@useinsider/guido 3.1.1-beta.a80cc5e → 3.1.1-beta.b085e4a
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 +61 -69
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +20 -12
- package/dist/composables/useHtmlCompiler.js +20 -20
- package/dist/composables/usePreviewMode.js +16 -20
- package/dist/composables/useSave.js +13 -15
- package/dist/config/compiler/recommendationCompilerRules.js +158 -44
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +59 -58
- package/dist/config/migrator/checkboxMigrator.js +3 -5
- package/dist/config/migrator/radioButtonMigrator.js +12 -14
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +11 -27
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +172 -185
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +93 -95
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +73 -75
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +5 -7
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +29 -30
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +1 -3
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +50 -57
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +17 -16
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -20
- package/dist/src/@types/config/types.d.ts +1 -3
- package/dist/src/composables/useConfig.d.ts +0 -8
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +3 -20
- package/dist/src/stores/config.d.ts +0 -72
- package/dist/src/stores/preview.d.ts +0 -3
- package/dist/src/utils/htmlCompiler.d.ts +1 -2
- package/dist/stores/preview.js +3 -4
- package/dist/utils/htmlCompiler.js +41 -48
- package/dist/utils/templatePreparation.js +20 -20
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as b } from "../../enums/defaults.js";
|
|
2
|
-
import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, minLength as d, custom as S, boolean as a, array as c, literal as
|
|
2
|
+
import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, minLength as d, custom as S, boolean as a, array as c, literal as r, variant as k } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const m = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -26,11 +26,6 @@ const m = {
|
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
27
|
variationId: e(t())
|
|
28
28
|
}), y = o({
|
|
29
|
-
/** Fallback font name (e.g., "Georgia") */
|
|
30
|
-
name: t(),
|
|
31
|
-
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
32
|
-
family: t()
|
|
33
|
-
}), f = o({
|
|
34
29
|
/** Partner/organization name (required) */
|
|
35
30
|
name: u(
|
|
36
31
|
t(),
|
|
@@ -51,10 +46,8 @@ const m = {
|
|
|
51
46
|
m.PROMOTIONAL
|
|
52
47
|
),
|
|
53
48
|
/** Display name for the current user */
|
|
54
|
-
username: e(t(), "Guido User")
|
|
55
|
-
|
|
56
|
-
fallbackFont: e(y)
|
|
57
|
-
}), A = o({
|
|
49
|
+
username: e(t(), "Guido User")
|
|
50
|
+
}), f = o({
|
|
58
51
|
/** Display text for the dynamic content */
|
|
59
52
|
text: t(),
|
|
60
53
|
/** Template variable value (e.g., {{username}}) */
|
|
@@ -68,14 +61,14 @@ const m = {
|
|
|
68
61
|
value: t()
|
|
69
62
|
})
|
|
70
63
|
)
|
|
71
|
-
}),
|
|
64
|
+
}), A = o({
|
|
72
65
|
/** Initial HTML content */
|
|
73
66
|
html: e(t(), ""),
|
|
74
67
|
/** Initial CSS content */
|
|
75
68
|
css: e(t(), ""),
|
|
76
69
|
/** Preselected dynamic content items */
|
|
77
70
|
preselectedDynamicContent: e(
|
|
78
|
-
c(
|
|
71
|
+
c(f),
|
|
79
72
|
[]
|
|
80
73
|
),
|
|
81
74
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
@@ -84,12 +77,12 @@ const m = {
|
|
|
84
77
|
selectedUnsubscribePages: e(c(p()), []),
|
|
85
78
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
86
79
|
forceRecreate: e(a(), !1)
|
|
87
|
-
}),
|
|
80
|
+
}), R = o({
|
|
88
81
|
/** Sender display name */
|
|
89
82
|
senderName: e(t(), ""),
|
|
90
83
|
/** Email subject line */
|
|
91
84
|
subject: e(t(), "")
|
|
92
|
-
}),
|
|
85
|
+
}), C = o({
|
|
93
86
|
/** Locale for the editor UI */
|
|
94
87
|
locale: e(t(), "en"),
|
|
95
88
|
/** Path to translations object */
|
|
@@ -97,17 +90,17 @@ const m = {
|
|
|
97
90
|
/** Migration date for template compatibility */
|
|
98
91
|
migrationDate: e(p(), 1759696858),
|
|
99
92
|
/** Email header settings */
|
|
100
|
-
emailHeader: e(
|
|
93
|
+
emailHeader: e(R, { senderName: "", subject: "" }),
|
|
101
94
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
102
95
|
savedModulesFolderName: e(t(), b.SAVED_MODULES),
|
|
103
96
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
104
97
|
defaultModulesFolderName: e(t(), b.DEFAULT_MODULES)
|
|
105
|
-
}),
|
|
98
|
+
}), T = o({
|
|
106
99
|
/** Whether to show the header bar */
|
|
107
100
|
showHeader: e(a(), !0),
|
|
108
101
|
/** Custom label for back button (if shown) */
|
|
109
102
|
backButtonLabel: e(t())
|
|
110
|
-
}),
|
|
103
|
+
}), I = o({
|
|
111
104
|
/** Enable dynamic content insertion */
|
|
112
105
|
dynamicContent: e(a(), !0),
|
|
113
106
|
/** Enable save as template functionality */
|
|
@@ -122,7 +115,7 @@ const m = {
|
|
|
122
115
|
unsubscribe: e(a(), !0),
|
|
123
116
|
/** Disable modules panel in the editor */
|
|
124
117
|
modulesDisabled: e(a(), !1)
|
|
125
|
-
}),
|
|
118
|
+
}), E = n([
|
|
126
119
|
"amp-accordion",
|
|
127
120
|
"amp-carousel",
|
|
128
121
|
"amp-form-controls",
|
|
@@ -136,7 +129,7 @@ const m = {
|
|
|
136
129
|
"text-block",
|
|
137
130
|
"timer-block",
|
|
138
131
|
"video-block"
|
|
139
|
-
]),
|
|
132
|
+
]), g = n([
|
|
140
133
|
"dynamic-content",
|
|
141
134
|
"checkbox-block",
|
|
142
135
|
"radio-button-block",
|
|
@@ -144,66 +137,66 @@ const m = {
|
|
|
144
137
|
"unsubscribe-block",
|
|
145
138
|
"coupon-block",
|
|
146
139
|
"items-block"
|
|
147
|
-
]),
|
|
140
|
+
]), O = o({
|
|
148
141
|
/** Default blocks to exclude from the editor */
|
|
149
142
|
excludeDefaults: e(
|
|
150
|
-
c(
|
|
143
|
+
c(E),
|
|
151
144
|
[]
|
|
152
145
|
),
|
|
153
146
|
/** Custom blocks to include in the editor */
|
|
154
147
|
includeCustoms: e(
|
|
155
|
-
c(
|
|
148
|
+
c(g),
|
|
156
149
|
[]
|
|
157
150
|
)
|
|
158
|
-
}),
|
|
151
|
+
}), l = o({
|
|
159
152
|
/** Unique identifier for the rule */
|
|
160
153
|
id: t(),
|
|
161
154
|
/** Human-readable description */
|
|
162
155
|
description: e(t()),
|
|
163
156
|
/** Priority for rule ordering (lower = earlier) */
|
|
164
157
|
priority: p()
|
|
165
|
-
}),
|
|
166
|
-
...
|
|
167
|
-
type:
|
|
158
|
+
}), L = o({
|
|
159
|
+
...l.entries,
|
|
160
|
+
type: r("replace"),
|
|
168
161
|
/** String to search for */
|
|
169
162
|
search: t(),
|
|
170
163
|
/** Replacement string */
|
|
171
164
|
replacement: t(),
|
|
172
165
|
/** Replace all occurrences (default: false) */
|
|
173
166
|
replaceAll: e(a())
|
|
174
|
-
}),
|
|
175
|
-
...
|
|
176
|
-
type:
|
|
167
|
+
}), M = o({
|
|
168
|
+
...l.entries,
|
|
169
|
+
type: r("regex"),
|
|
177
170
|
/** Regex pattern string */
|
|
178
171
|
pattern: t(),
|
|
179
172
|
/** Replacement string (supports $1, $2, etc.) */
|
|
180
173
|
replacement: t(),
|
|
181
174
|
/** Regex flags (e.g., 'gi') */
|
|
182
175
|
flags: e(t())
|
|
183
|
-
}),
|
|
184
|
-
...
|
|
185
|
-
type:
|
|
176
|
+
}), N = o({
|
|
177
|
+
...l.entries,
|
|
178
|
+
type: r("remove"),
|
|
186
179
|
/** Strings or patterns to remove */
|
|
187
180
|
targets: c(t())
|
|
188
|
-
}),
|
|
189
|
-
...
|
|
190
|
-
type:
|
|
181
|
+
}), D = o({
|
|
182
|
+
...l.entries,
|
|
183
|
+
type: r("custom"),
|
|
191
184
|
/** Custom processor function */
|
|
192
185
|
processor: S(
|
|
193
186
|
(i) => typeof i == "function",
|
|
194
187
|
"processor must be a function"
|
|
195
188
|
)
|
|
196
|
-
}),
|
|
189
|
+
}), v = k("type", [
|
|
190
|
+
L,
|
|
197
191
|
M,
|
|
198
192
|
N,
|
|
199
|
-
D
|
|
200
|
-
|
|
201
|
-
]), x = o({
|
|
193
|
+
D
|
|
194
|
+
]), U = o({
|
|
202
195
|
/** Custom compiler rules to apply */
|
|
203
|
-
customRules: e(c(
|
|
196
|
+
customRules: e(c(v), []),
|
|
204
197
|
/** Skip default compiler rules */
|
|
205
198
|
ignoreDefaultRules: e(a(), !1)
|
|
206
|
-
}),
|
|
199
|
+
}), x = o({
|
|
207
200
|
/**
|
|
208
201
|
* External validation handler called before save completes.
|
|
209
202
|
* Return false to cancel the save operation.
|
|
@@ -214,49 +207,48 @@ const m = {
|
|
|
214
207
|
"externalValidation must be a function"
|
|
215
208
|
)
|
|
216
209
|
)
|
|
217
|
-
}),
|
|
210
|
+
}), F = o({
|
|
218
211
|
// Required sections
|
|
219
212
|
/** Identity configuration (required) */
|
|
220
213
|
identity: h,
|
|
221
214
|
/** Partner configuration (required) */
|
|
222
|
-
partner:
|
|
215
|
+
partner: y,
|
|
223
216
|
// Optional sections (with defaults)
|
|
224
217
|
/** Template content and presets */
|
|
225
|
-
template: e(
|
|
218
|
+
template: e(A, {}),
|
|
226
219
|
/** Editor settings */
|
|
227
|
-
editor: e(
|
|
220
|
+
editor: e(C, {}),
|
|
228
221
|
/** UI configuration */
|
|
229
|
-
ui: e(
|
|
222
|
+
ui: e(T, {}),
|
|
230
223
|
/** Feature toggles */
|
|
231
|
-
features: e(
|
|
224
|
+
features: e(I, {}),
|
|
232
225
|
/** Block configuration */
|
|
233
|
-
blocks: e(
|
|
226
|
+
blocks: e(O, {}),
|
|
234
227
|
/** Compiler configuration */
|
|
235
|
-
compiler: e(
|
|
228
|
+
compiler: e(U, {}),
|
|
236
229
|
/** Callbacks and event handlers */
|
|
237
|
-
callbacks: e(
|
|
230
|
+
callbacks: e(x, {})
|
|
238
231
|
});
|
|
239
232
|
export {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
H as GuidoConfigSchema,
|
|
233
|
+
O as BlocksSchema,
|
|
234
|
+
x as CallbacksSchema,
|
|
235
|
+
v as CompilerRuleSchema,
|
|
236
|
+
U as CompilerSchema,
|
|
237
|
+
g as CustomBlockTypeSchema,
|
|
238
|
+
D as CustomRuleSchema,
|
|
239
|
+
E as DefaultBlockTypeSchema,
|
|
240
|
+
f as DynamicContentSchema,
|
|
241
|
+
C as EditorSchema,
|
|
242
|
+
R as EmailHeaderSchema,
|
|
243
|
+
I as FeaturesSchema,
|
|
244
|
+
F as GuidoConfigSchema,
|
|
253
245
|
h as IdentitySchema,
|
|
254
246
|
m as MessageType,
|
|
255
|
-
|
|
247
|
+
y as PartnerSchema,
|
|
256
248
|
s as ProductType,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
249
|
+
M as RegexRuleSchema,
|
|
250
|
+
N as RemoveRuleSchema,
|
|
251
|
+
L as ReplaceRuleSchema,
|
|
252
|
+
A as TemplateSchema,
|
|
253
|
+
T as UISchema
|
|
262
254
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import s from "./EmailSizeIndicator.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return
|
|
7
|
-
}, a = [], n = /* @__PURE__ */
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var o = function() {
|
|
5
|
+
var e = this, i = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return t.previewStore.previewHtml ? i("div", { staticClass: "d-f a-i-c j-c-c" }, [i(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), i(t.InTooltipV2, { attrs: { id: "email-size-tooltip", "icon-status": "", "static-position": "bottom center", "dynamic-position": !1, text: t.trans("email-editor.preview-design-size-tooltip") } })], 1) : e._e();
|
|
7
|
+
}, a = [], n = /* @__PURE__ */ r(
|
|
8
8
|
s,
|
|
9
|
-
|
|
9
|
+
o,
|
|
10
10
|
a,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"079d2bf7"
|
|
14
14
|
);
|
|
15
15
|
const m = n.exports;
|
|
16
16
|
export {
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { usePreviewStore as
|
|
4
|
-
import { InTooltipV2 as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
|
|
2
|
+
import { useTranslations as p } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { usePreviewStore as _ } from "../../../../stores/preview.js";
|
|
4
|
+
import { InTooltipV2 as v, InProgress as f } from "@useinsider/design-system-vue";
|
|
5
|
+
const S = /* @__PURE__ */ c({
|
|
6
6
|
__name: "EmailSizeIndicator",
|
|
7
|
-
setup(
|
|
8
|
-
const
|
|
9
|
-
type:
|
|
10
|
-
value:
|
|
11
|
-
})),
|
|
12
|
-
|
|
7
|
+
setup(w) {
|
|
8
|
+
const t = _(), o = 102, e = n(0), s = n({
|
|
9
|
+
type: "success",
|
|
10
|
+
value: 0
|
|
11
|
+
}), a = l(() => `~${e.value} KB`), r = () => {
|
|
12
|
+
const m = new Blob([t.previewHtml]).size;
|
|
13
|
+
e.value = Math.round(m / 1024), s.value = {
|
|
14
|
+
type: e.value < o ? "success" : "warning",
|
|
15
|
+
value: Math.min(e.value, o)
|
|
16
|
+
};
|
|
17
|
+
}, i = p();
|
|
18
|
+
return u(() => t.previewHtml, () => {
|
|
19
|
+
r();
|
|
20
|
+
}, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltipV2: v };
|
|
13
21
|
}
|
|
14
22
|
});
|
|
15
23
|
export {
|
|
16
|
-
|
|
24
|
+
S as default
|
|
17
25
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import { outlookCompilerRules as
|
|
4
|
-
import { recommendationCompilerRules as
|
|
5
|
-
import { socialCompilerRules as
|
|
6
|
-
import { unsubscribeCompilerRules as
|
|
7
|
-
import { createHtmlCompiler as
|
|
8
|
-
import { useConfig as
|
|
9
|
-
const
|
|
10
|
-
var
|
|
11
|
-
const { compiler: e
|
|
12
|
-
...!!((
|
|
1
|
+
import { defaultHtmlCompilerRules as p } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as u } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { outlookCompilerRules as c } from "../config/compiler/outlookCompilerRules.js";
|
|
4
|
+
import { recommendationCompilerRules as n } from "../config/compiler/recommendationCompilerRules.js";
|
|
5
|
+
import { socialCompilerRules as f } from "../config/compiler/socialCompilerRules.js";
|
|
6
|
+
import { unsubscribeCompilerRules as R } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
7
|
+
import { createHtmlCompiler as a } from "../utils/htmlCompiler.js";
|
|
8
|
+
import { useConfig as C } from "./useConfig.js";
|
|
9
|
+
const B = () => {
|
|
10
|
+
var m, l;
|
|
11
|
+
const { compiler: e } = C(), r = ((m = e.value) == null ? void 0 : m.customRules) || [], t = [
|
|
12
|
+
...!!((l = e.value) != null && l.ignoreDefaultRules) ? [] : p,
|
|
13
|
+
...n,
|
|
13
14
|
...R,
|
|
14
|
-
...
|
|
15
|
-
...
|
|
15
|
+
...u,
|
|
16
|
+
...c,
|
|
16
17
|
...f,
|
|
17
|
-
...
|
|
18
|
-
...i.map((o, c) => ({
|
|
18
|
+
...r.map((o, s) => ({
|
|
19
19
|
...o,
|
|
20
|
-
priority: o.priority + 1e3 +
|
|
20
|
+
priority: o.priority + 1e3 + s
|
|
21
21
|
// Ensure additional rules run after default rules
|
|
22
22
|
}))
|
|
23
|
-
],
|
|
24
|
-
return { compileHtml: (o) =>
|
|
23
|
+
], i = a(t);
|
|
24
|
+
return { compileHtml: (o) => i.compile(o) };
|
|
25
25
|
};
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
B as useHtmlCompiler
|
|
28
28
|
};
|
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
import { useEditorStore as
|
|
2
|
-
import { usePreviewStore as
|
|
3
|
-
import { useActionsApi as
|
|
4
|
-
import { useCodeEditorApi as
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
t.isPreviewModeOpen = !1, e.$reset();
|
|
1
|
+
import { useEditorStore as n } from "../stores/editor.js";
|
|
2
|
+
import { usePreviewStore as l } from "../stores/preview.js";
|
|
3
|
+
import { useActionsApi as m } from "./useActionsApi.js";
|
|
4
|
+
import { useCodeEditorApi as p } from "./useCodeEditorApi.js";
|
|
5
|
+
const E = () => {
|
|
6
|
+
const o = n(), e = l(), { closeCodeEditor: a } = p(), { getPreviewData: s } = m(), r = () => {
|
|
7
|
+
o.isPreviewModeOpen = !1, e.$reset();
|
|
9
8
|
};
|
|
10
9
|
return {
|
|
11
10
|
closePreviewMode: r,
|
|
12
11
|
openPreviewMode: () => {
|
|
13
|
-
|
|
12
|
+
o.isCodeEditorOpen && a(), o.isPreviewModeOpen = !0;
|
|
14
13
|
},
|
|
15
14
|
loadPreviewData: async () => {
|
|
16
|
-
if (!(
|
|
17
|
-
|
|
15
|
+
if (!(o.loadingStatus || e.isLoaded)) {
|
|
16
|
+
o.loadingStatus = !0;
|
|
18
17
|
try {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
e.templateHtml = o.html || "", e.ampHtml = o.ampHtml || "", e.ampErrors = o.ampErrors || [], e.setEmailFormat(o.ampHtml ? "AMP" : "html"), e.emailSizeKB = m(l.html).estimatedSizeKB, e.isLoaded = !0;
|
|
24
|
-
} catch (o) {
|
|
25
|
-
console.error("Failed to load preview data:", o), r();
|
|
18
|
+
const { html: t, ampHtml: i, ampErrors: d } = await s();
|
|
19
|
+
e.templateHtml = t || "", e.ampHtml = i || "", e.ampErrors = d || [], e.setEmailFormat(i ? "AMP" : "html"), e.isLoaded = !0;
|
|
20
|
+
} catch (t) {
|
|
21
|
+
console.error("Failed to load preview data:", t), r();
|
|
26
22
|
} finally {
|
|
27
|
-
|
|
23
|
+
o.loadingStatus = !1;
|
|
28
24
|
}
|
|
29
25
|
}
|
|
30
26
|
}
|
|
31
27
|
};
|
|
32
28
|
};
|
|
33
29
|
export {
|
|
34
|
-
|
|
30
|
+
E as usePreviewMode
|
|
35
31
|
};
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
return { save: async (c = !1) => {
|
|
1
|
+
import { useConfig as d } from "./useConfig.js";
|
|
2
|
+
import { useSaveStart as p, useSaveComplete as f } from "./useGuidoActions.js";
|
|
3
|
+
import { useSyncModuleExtractor as v } from "./useSyncModuleExtractor.js";
|
|
4
|
+
import { useStripoApi as S } from "../services/stripoApi.js";
|
|
5
|
+
import { useTemplatePreparation as x } from "../utils/templatePreparation.js";
|
|
6
|
+
import { useHtmlValidator as V } from "./useHtmlValidator.js";
|
|
7
|
+
const g = () => {
|
|
8
|
+
const o = p(), s = f(), { validateHtml: i } = V(), { callbacks: a } = d(), { extractSyncModuleData: r } = v(), { setSyncModuleUnsubscriptionPages: n } = S();
|
|
9
|
+
return { save: async (l = !1) => {
|
|
11
10
|
var e;
|
|
12
11
|
o();
|
|
13
|
-
const { prepareTemplateDetails:
|
|
12
|
+
const { prepareTemplateDetails: c } = x(), t = await c();
|
|
14
13
|
if (!await i(t.compiledHtml, t.dynamicContentList, !0) || (e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t))
|
|
15
14
|
return;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return await n(u), t.modules = p, c || s(t), t;
|
|
15
|
+
const { unsubscribePayload: m, stripoModules: u } = r(t.rawHtml);
|
|
16
|
+
return await n(m), t.modules = u, l || s(t), t;
|
|
19
17
|
} };
|
|
20
18
|
};
|
|
21
19
|
export {
|
|
22
|
-
|
|
20
|
+
g as useSave
|
|
23
21
|
};
|