@useinsider/guido 3.11.0-beta.e62ab49 → 3.11.0-beta.f2b79f2
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 +49 -40
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/HeaderWrapper.vue.js +3 -3
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +2 -0
- package/dist/components/organisms/header/version-history/VersionHistory.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +2 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +9 -9
- package/dist/composables/useModuleDynamicContentRepair.js +36 -0
- package/dist/composables/useStripo.js +62 -59
- package/dist/config/compiler/outlookCompilerRules.js +8 -33
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +36 -0
- package/dist/src/composables/useConfig.d.ts +18 -0
- package/dist/src/composables/useModuleDynamicContentRepair.d.ts +18 -0
- package/dist/src/stores/config.d.ts +162 -0
- package/dist/src/utils/dynamicContentConverter.d.ts +27 -0
- package/dist/src/utils/genericUtil.d.ts +7 -0
- package/dist/utils/dynamicContentConverter.js +31 -0
- package/dist/utils/genericUtil.js +26 -19
- package/package.json +10 -1
- package/dist/src/composables/useHtmlValidator.test.d.ts +0 -1
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
|
|
2
|
-
import { object as a, number as
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, literal as i, looseObject as g, variant as R, union as f, unknown as s } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const d = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -12,7 +12,7 @@ const d = {
|
|
|
12
12
|
ARCHITECT: 49,
|
|
13
13
|
/** Unsubscribe page builder */
|
|
14
14
|
UNSUBSCRIBE_PAGES: 97
|
|
15
|
-
},
|
|
15
|
+
}, C = a({
|
|
16
16
|
/** Unique identifier for the template being edited */
|
|
17
17
|
templateId: p(
|
|
18
18
|
t(),
|
|
@@ -30,7 +30,7 @@ const d = {
|
|
|
30
30
|
name: t(),
|
|
31
31
|
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
32
32
|
family: t()
|
|
33
|
-
}),
|
|
33
|
+
}), A = a({
|
|
34
34
|
/** Partner/organization name (required) */
|
|
35
35
|
name: p(
|
|
36
36
|
t(),
|
|
@@ -54,7 +54,7 @@ const d = {
|
|
|
54
54
|
username: e(t(), "Guido User"),
|
|
55
55
|
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
56
56
|
fallbackFont: e(T)
|
|
57
|
-
}),
|
|
57
|
+
}), y = a({
|
|
58
58
|
/** Display text for the dynamic content */
|
|
59
59
|
text: t(),
|
|
60
60
|
/** Template variable value (e.g., {{username}}) */
|
|
@@ -68,35 +68,35 @@ const d = {
|
|
|
68
68
|
value: t()
|
|
69
69
|
})
|
|
70
70
|
)
|
|
71
|
-
}), I =
|
|
71
|
+
}), I = g({
|
|
72
72
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
73
|
-
id: e(
|
|
73
|
+
id: e(n()),
|
|
74
74
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
75
|
-
decimalCount: e(f([t(),
|
|
75
|
+
decimalCount: e(f([t(), n()])),
|
|
76
76
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
77
|
-
productIds: e(c(
|
|
77
|
+
productIds: e(c(s())),
|
|
78
78
|
/** Whether the block requested live products at send time */
|
|
79
79
|
sendProductRequestFlag: e(o()),
|
|
80
80
|
/** Whether to randomize product order */
|
|
81
81
|
shuffleProducts: e(o()),
|
|
82
82
|
/** Filter rules driving product selection */
|
|
83
|
-
filters: e(c(
|
|
83
|
+
filters: e(c(s())),
|
|
84
84
|
/** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
|
|
85
85
|
currency: e(t()),
|
|
86
86
|
/** Currency display settings (separators, alignment, decimals) */
|
|
87
|
-
currencySettings: e(
|
|
87
|
+
currencySettings: e(s()),
|
|
88
88
|
/** Locale (e.g. 'nl_NL') */
|
|
89
89
|
language: e(t()),
|
|
90
90
|
/** Recommendation strategy key (e.g. 'newArrivals') */
|
|
91
91
|
strategy: e(t()),
|
|
92
92
|
/** Snapshot of products as rendered by the legacy block */
|
|
93
|
-
recommendedProducts: e(c(
|
|
93
|
+
recommendedProducts: e(c(s())),
|
|
94
94
|
/** Number of product cards per row */
|
|
95
|
-
cardsInRow: e(
|
|
95
|
+
cardsInRow: e(n()),
|
|
96
96
|
/** Mobile-only padding (right) */
|
|
97
|
-
mobileRightPadding: e(
|
|
97
|
+
mobileRightPadding: e(n()),
|
|
98
98
|
/** Mobile-only padding (left) */
|
|
99
|
-
mobileLeftPadding: e(
|
|
99
|
+
mobileLeftPadding: e(n()),
|
|
100
100
|
/** Disable responsive scaling */
|
|
101
101
|
unresponsive: e(o()),
|
|
102
102
|
/** Layout orientation ('vertical' | 'horizontal') */
|
|
@@ -106,14 +106,14 @@ const d = {
|
|
|
106
106
|
/** Block type marker used by some legacy variants */
|
|
107
107
|
blockType: e(t()),
|
|
108
108
|
/** Size variant marker (legacy data may use string or number) */
|
|
109
|
-
size: e(f([t(),
|
|
109
|
+
size: e(f([t(), n()])),
|
|
110
110
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
111
111
|
verticalResponsiveness: e(o()),
|
|
112
112
|
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
113
113
|
isPriceMovedToNextLine: e(o()),
|
|
114
114
|
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
115
115
|
isPriceDeletedForZeroSale: e(o())
|
|
116
|
-
}),
|
|
116
|
+
}), v = a({
|
|
117
117
|
/**
|
|
118
118
|
* Legacy recommendation block configs keyed by block ID.
|
|
119
119
|
* Pass this when loading a template authored with the v1
|
|
@@ -124,25 +124,34 @@ const d = {
|
|
|
124
124
|
k(t(), I),
|
|
125
125
|
{}
|
|
126
126
|
)
|
|
127
|
-
}),
|
|
127
|
+
}), L = a({
|
|
128
128
|
/** Initial HTML content */
|
|
129
129
|
html: e(t(), ""),
|
|
130
130
|
/** Initial CSS content */
|
|
131
131
|
css: e(t(), ""),
|
|
132
132
|
/** Preselected dynamic content items */
|
|
133
133
|
preselectedDynamicContent: e(
|
|
134
|
-
c(
|
|
134
|
+
c(y),
|
|
135
|
+
[]
|
|
136
|
+
),
|
|
137
|
+
/**
|
|
138
|
+
* Full set of dynamic-content items the account offers (label + token).
|
|
139
|
+
* Used as the label→token map that repairs label-form placeholders
|
|
140
|
+
* (e.g. `{{ Phone Number }}`) in dropped saved modules.
|
|
141
|
+
*/
|
|
142
|
+
availableDynamicContent: e(
|
|
143
|
+
c(y),
|
|
135
144
|
[]
|
|
136
145
|
),
|
|
137
146
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
138
147
|
customFieldAttributes: e(c(t()), []),
|
|
139
148
|
/** Selected unsubscribe page IDs */
|
|
140
|
-
selectedUnsubscribePages: e(c(
|
|
149
|
+
selectedUnsubscribePages: e(c(n()), []),
|
|
141
150
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
142
151
|
forceRecreate: e(o(), !1),
|
|
143
152
|
/** Migration-only inputs (legacy block configs) */
|
|
144
|
-
migration: e(
|
|
145
|
-
}),
|
|
153
|
+
migration: e(v, {})
|
|
154
|
+
}), P = a({
|
|
146
155
|
/** Sender display name */
|
|
147
156
|
senderName: e(t(), ""),
|
|
148
157
|
/** Email subject line */
|
|
@@ -153,9 +162,9 @@ const d = {
|
|
|
153
162
|
/** Path to translations object */
|
|
154
163
|
translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
|
|
155
164
|
/** Migration date for template compatibility */
|
|
156
|
-
migrationDate: e(
|
|
165
|
+
migrationDate: e(n(), 1759696858),
|
|
157
166
|
/** Email header settings */
|
|
158
|
-
emailHeader: e(
|
|
167
|
+
emailHeader: e(P, { senderName: "", subject: "" }),
|
|
159
168
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
160
169
|
savedModulesFolderName: e(t(), S.SAVED_MODULES),
|
|
161
170
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
@@ -184,7 +193,7 @@ const d = {
|
|
|
184
193
|
liquidSyntax: e(o(), !1),
|
|
185
194
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
186
195
|
autosave: e(o(), !1)
|
|
187
|
-
}),
|
|
196
|
+
}), D = l([
|
|
188
197
|
"amp-accordion",
|
|
189
198
|
"amp-carousel",
|
|
190
199
|
"amp-form-controls",
|
|
@@ -198,7 +207,7 @@ const d = {
|
|
|
198
207
|
"text-block",
|
|
199
208
|
"timer-block",
|
|
200
209
|
"video-block"
|
|
201
|
-
]),
|
|
210
|
+
]), N = l([
|
|
202
211
|
"dynamic-content",
|
|
203
212
|
"checkbox-block",
|
|
204
213
|
"radio-button-block",
|
|
@@ -209,12 +218,12 @@ const d = {
|
|
|
209
218
|
]), x = a({
|
|
210
219
|
/** Default blocks to exclude from the editor */
|
|
211
220
|
excludeDefaults: e(
|
|
212
|
-
c(
|
|
221
|
+
c(D),
|
|
213
222
|
[]
|
|
214
223
|
),
|
|
215
224
|
/** Custom blocks to include in the editor */
|
|
216
225
|
includeCustoms: e(
|
|
217
|
-
c(
|
|
226
|
+
c(N),
|
|
218
227
|
[]
|
|
219
228
|
)
|
|
220
229
|
}), m = a({
|
|
@@ -223,7 +232,7 @@ const d = {
|
|
|
223
232
|
/** Human-readable description */
|
|
224
233
|
description: e(t()),
|
|
225
234
|
/** Priority for rule ordering (lower = earlier) */
|
|
226
|
-
priority:
|
|
235
|
+
priority: n()
|
|
227
236
|
}), F = a({
|
|
228
237
|
...m.entries,
|
|
229
238
|
type: i("replace"),
|
|
@@ -255,7 +264,7 @@ const d = {
|
|
|
255
264
|
(u) => typeof u == "function",
|
|
256
265
|
"processor must be a function"
|
|
257
266
|
)
|
|
258
|
-
}), H =
|
|
267
|
+
}), H = R("type", [
|
|
259
268
|
F,
|
|
260
269
|
U,
|
|
261
270
|
B,
|
|
@@ -279,12 +288,12 @@ const d = {
|
|
|
279
288
|
}), V = a({
|
|
280
289
|
// Required sections
|
|
281
290
|
/** Identity configuration (required) */
|
|
282
|
-
identity:
|
|
291
|
+
identity: C,
|
|
283
292
|
/** Partner configuration (required) */
|
|
284
|
-
partner:
|
|
293
|
+
partner: A,
|
|
285
294
|
// Optional sections (with defaults)
|
|
286
295
|
/** Template content and presets */
|
|
287
|
-
template: e(
|
|
296
|
+
template: e(L, {}),
|
|
288
297
|
/** Editor settings */
|
|
289
298
|
editor: e(E, {}),
|
|
290
299
|
/** UI configuration */
|
|
@@ -303,24 +312,24 @@ export {
|
|
|
303
312
|
q as CallbacksSchema,
|
|
304
313
|
H as CompilerRuleSchema,
|
|
305
314
|
j as CompilerSchema,
|
|
306
|
-
|
|
315
|
+
N as CustomBlockTypeSchema,
|
|
307
316
|
w as CustomRuleSchema,
|
|
308
|
-
|
|
309
|
-
|
|
317
|
+
D as DefaultBlockTypeSchema,
|
|
318
|
+
y as DynamicContentSchema,
|
|
310
319
|
E as EditorSchema,
|
|
311
|
-
|
|
320
|
+
P as EmailHeaderSchema,
|
|
312
321
|
T as FallbackFontSchema,
|
|
313
322
|
O as FeaturesSchema,
|
|
314
323
|
V as GuidoConfigSchema,
|
|
315
|
-
|
|
324
|
+
C as IdentitySchema,
|
|
316
325
|
I as LegacyRecommendationConfigSchema,
|
|
317
326
|
d as MessageType,
|
|
318
|
-
|
|
327
|
+
A as PartnerSchema,
|
|
319
328
|
r as ProductType,
|
|
320
329
|
U as RegexRuleSchema,
|
|
321
330
|
B as RemoveRuleSchema,
|
|
322
331
|
F as ReplaceRuleSchema,
|
|
323
|
-
|
|
324
|
-
|
|
332
|
+
v as TemplateMigrationSchema,
|
|
333
|
+
L as TemplateSchema,
|
|
325
334
|
M as UISchema
|
|
326
335
|
};
|
|
@@ -8,6 +8,8 @@ const c = /* @__PURE__ */ n({
|
|
|
8
8
|
setup(l, { expose: r }) {
|
|
9
9
|
const e = m(null);
|
|
10
10
|
return r({
|
|
11
|
+
// Stryker disable next-line OptionalChaining: RightSlot is always rendered (no
|
|
12
|
+
// v-if), so rightSlotRef.value is never null and `?.` cannot short-circuit.
|
|
11
13
|
handleSave: (t) => {
|
|
12
14
|
var o;
|
|
13
15
|
return (o = e.value) == null ? void 0 : o.handleSave(t);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./UnsubscribePageSelection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import n from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var o = function() {
|
|
5
5
|
var r = this, e = r._self._c, t = r._self._setupProxy;
|
|
6
6
|
return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.handleClose, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
|
|
@@ -10,13 +10,13 @@ var o = function() {
|
|
|
10
10
|
return t.selectTemplate(s.id);
|
|
11
11
|
} } }, [e(t.InContainer, { staticClass: "template-container o-h", class: { selected: t.unsubscribeStore.getSelectedTemplateByActiveType === s.id }, attrs: { border: t.getBorderClass(s.id) } }, [e("div", { staticClass: "w-1 h-1 d-f j-c-c a-i-c" }, [e("img", { staticClass: "w-1 h-1 thumbnail o-h", attrs: { alt: s.name, src: s.thumbnail } })])]), e("div", { staticClass: "mt-1 f-s-1" }, [r._v(" " + r._s(s.name) + " ")])], 1);
|
|
12
12
|
}), 0)]);
|
|
13
|
-
}, i = [], c = /* @__PURE__ */
|
|
14
|
-
|
|
13
|
+
}, i = [], c = /* @__PURE__ */ n(
|
|
14
|
+
a,
|
|
15
15
|
o,
|
|
16
16
|
i,
|
|
17
17
|
!1,
|
|
18
18
|
null,
|
|
19
|
-
"
|
|
19
|
+
"91a26acd"
|
|
20
20
|
);
|
|
21
21
|
const _ = c.exports;
|
|
22
22
|
export {
|
|
@@ -29,9 +29,9 @@ const N = /* @__PURE__ */ y({
|
|
|
29
29
|
t();
|
|
30
30
|
}, 500);
|
|
31
31
|
}, m = () => {
|
|
32
|
-
n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
|
|
32
|
+
e.pageSelectionDrawerStatus && (n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
|
|
33
33
|
detail: { blockId: e.pendingBlockId }
|
|
34
|
-
}));
|
|
34
|
+
})));
|
|
35
35
|
}, b = () => {
|
|
36
36
|
if (e.isActiveTypeFirstInCollection) {
|
|
37
37
|
n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
|
|
@@ -2,15 +2,15 @@ import n from "./UnsubscribeTypeSelection.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var i = function() {
|
|
5
|
-
var
|
|
6
|
-
return s(
|
|
5
|
+
var t = this, s = t._self._c, e = t._self._setupProxy;
|
|
6
|
+
return s(e.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.unsubscribeStore.typeSelectionDrawerStatus, "title-text": e.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: e.closeModal, onCloseEvent: e.closeModal, primaryButtonEvent: e.selectCollection } }, [s(e.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: e.isSelecting, "segment-list": e.segmentList, selected: e.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": e.skeletonStatus }, on: { click: e.changeCollection } })], 1);
|
|
7
7
|
}, r = [], c = /* @__PURE__ */ o(
|
|
8
8
|
n,
|
|
9
9
|
i,
|
|
10
10
|
r,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"b9a93c6e"
|
|
14
14
|
);
|
|
15
15
|
const _ = c.exports;
|
|
16
16
|
export {
|
|
@@ -10,10 +10,10 @@ import { InSegments as L } from "@useinsider/design-system-vue";
|
|
|
10
10
|
const W = /* @__PURE__ */ _({
|
|
11
11
|
__name: "UnsubscribeTypeSelection",
|
|
12
12
|
setup(k) {
|
|
13
|
-
const t = N(), { showToaster: d } = w(), e = G(), n = b(!1), o = b(!0), r = b(l.GLOBAL_UNSUBSCRIBE),
|
|
13
|
+
const t = N(), { showToaster: d } = w(), e = G(), n = b(!1), o = b(!0), r = b(l.GLOBAL_UNSUBSCRIBE), y = t(
|
|
14
14
|
"unsubscription-preference.select-unsubscribe-page-description",
|
|
15
15
|
{ action: `<a href="${D.GLOBAL_UNSUBSCRIBE}" target="_blank">${t("ds-rules.visit-academy")}</a>` }
|
|
16
|
-
),
|
|
16
|
+
), T = f(() => [
|
|
17
17
|
{
|
|
18
18
|
description: t("unsubscription-preference.type-global-unsubscribe-description"),
|
|
19
19
|
icon: "line-contact-global-unsub-page",
|
|
@@ -31,7 +31,7 @@ const W = /* @__PURE__ */ _({
|
|
|
31
31
|
disable: e.isSubscriptionPreferencesCenterDisabled,
|
|
32
32
|
tooltipText: e.isSubscriptionPreferencesCenterDisabled ? t("unsubscription-preference.pref-center-added") : ""
|
|
33
33
|
}
|
|
34
|
-
]),
|
|
34
|
+
]), S = f(
|
|
35
35
|
() => e.isGlobalUnsubscribeDisabled && e.isSubscriptionPreferencesCenterDisabled
|
|
36
36
|
), C = f(() => ({
|
|
37
37
|
primaryButton: {
|
|
@@ -41,7 +41,7 @@ const W = /* @__PURE__ */ _({
|
|
|
41
41
|
n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
|
|
42
42
|
),
|
|
43
43
|
loadingStatus: n.value,
|
|
44
|
-
disabledStatus:
|
|
44
|
+
disabledStatus: S.value,
|
|
45
45
|
skeletonStatus: o.value,
|
|
46
46
|
skeletonSizing: { width: 168, height: 40 }
|
|
47
47
|
},
|
|
@@ -53,12 +53,12 @@ const W = /* @__PURE__ */ _({
|
|
|
53
53
|
skeletonStatus: o.value,
|
|
54
54
|
skeletonSizing: { width: 78, height: 40 }
|
|
55
55
|
}
|
|
56
|
-
})),
|
|
57
|
-
e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
|
|
56
|
+
})), g = (s) => {
|
|
57
|
+
e.typeSelectionDrawerStatus && (e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
|
|
58
58
|
detail: { blockId: e.pendingBlockId }
|
|
59
59
|
})), s && setTimeout(() => {
|
|
60
60
|
s();
|
|
61
|
-
}, 500);
|
|
61
|
+
}, 500));
|
|
62
62
|
}, E = (s) => {
|
|
63
63
|
r.value = s;
|
|
64
64
|
}, m = () => {
|
|
@@ -98,14 +98,14 @@ const W = /* @__PURE__ */ _({
|
|
|
98
98
|
}), !1;
|
|
99
99
|
}, B = async () => {
|
|
100
100
|
if (n.value = !0, await e.fetchTemplates(!0), e.setCollection(r.value), !m()) {
|
|
101
|
-
n.value = !1,
|
|
101
|
+
n.value = !1, g();
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
n.value = !1, e.typeSelectionDrawerStatus = !1, e.pageSelectionDrawerStatus = !0;
|
|
105
105
|
};
|
|
106
106
|
return v(() => e.typeSelectionDrawerStatus, (s) => {
|
|
107
107
|
s && (o.value = !0, r.value = l.GLOBAL_UNSUBSCRIBE, e.isGlobalUnsubscribeDisabled && (r.value = e.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), o.value = !1);
|
|
108
|
-
}), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: o, selectedCollection: r, descriptionText:
|
|
108
|
+
}), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: o, selectedCollection: r, descriptionText: y, segmentList: T, hasNoSelectableType: S, footerButtonGroupOptions: C, closeModal: g, changeCollection: E, validateTemplates: m, selectCollection: B, WpDrawer: U, InSegments: L };
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
export {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useConfig as D } from "./useConfig.js";
|
|
2
|
+
import { useToaster as T } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as g } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as C } from "../enums/toaster.js";
|
|
5
|
+
import { buildDynamicContentLookup as h, convertModuleDynamicContent as O } from "../utils/dynamicContentConverter.js";
|
|
6
|
+
const M = "dynamic-content.unresolved-attributes-on-drop", A = () => {
|
|
7
|
+
const { template: i, isFeatureEnabled: p } = D(), { showToaster: a } = T(), m = g();
|
|
8
|
+
return { handleModuleAdd: (n, e) => {
|
|
9
|
+
var s, c, l;
|
|
10
|
+
try {
|
|
11
|
+
if ((n == null ? void 0 : n.action) !== "ADD" && (n == null ? void 0 : n.action) !== "COPY")
|
|
12
|
+
return;
|
|
13
|
+
const o = h(((s = i.value) == null ? void 0 : s.availableDynamicContent) ?? []);
|
|
14
|
+
if (o.size === 0)
|
|
15
|
+
return;
|
|
16
|
+
const t = (c = e == null ? void 0 : e.getTargetNode) == null ? void 0 : c.call(e), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
|
|
17
|
+
if (!t || typeof r != "string")
|
|
18
|
+
return;
|
|
19
|
+
const { html: u, unresolved: y } = O(
|
|
20
|
+
r,
|
|
21
|
+
o,
|
|
22
|
+
p("liquidSyntax")
|
|
23
|
+
);
|
|
24
|
+
u !== r && e.modifyHtml(t).replaceWith(u), y.length > 0 && a({
|
|
25
|
+
type: C.Warning,
|
|
26
|
+
message: m(M)
|
|
27
|
+
});
|
|
28
|
+
} catch (o) {
|
|
29
|
+
console.error("Failed to repair dynamic content on module add:", o);
|
|
30
|
+
}
|
|
31
|
+
} };
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
M as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
|
|
35
|
+
A as useModuleDynamicContentRepair
|
|
36
|
+
};
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as O } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as q } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useModuleDynamicContentRepair as z } from "./useModuleDynamicContentRepair.js";
|
|
7
|
+
import { useStripoEventHandler as L } from "./useStripoEventHandler.js";
|
|
8
|
+
import { useStripoNotifications as $ } from "./useStripoNotifications.js";
|
|
9
|
+
import { useToaster as G } from "./useToaster.js";
|
|
10
|
+
import { localePatch as J } from "../config/i18n/index.js";
|
|
11
|
+
import { en as C } from "../config/i18n/en/index.js";
|
|
12
|
+
import { ToasterTypeOptions as X } from "../enums/toaster.js";
|
|
13
|
+
import { useStripoApi as j } from "../services/stripoApi.js";
|
|
14
|
+
import K from "../static/styles/customEditorStyle.css.js";
|
|
15
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
16
|
+
import { buildMergeTagEntries as Q } from "../utils/genericUtil.js";
|
|
17
|
+
import W from "../package.json.js";
|
|
18
|
+
const ye = (b, l) => {
|
|
19
|
+
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: v, getCustomFonts: T, getSyncModulesStatus: B } = j(), { handleEvent: F } = L(), { handleModuleAdd: M } = z(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), _ = async (s, i = [], r = !1) => {
|
|
20
|
+
var S, y, h, E;
|
|
21
|
+
const e = w(), { html: f, css: a } = s, { baseBlocks: t, extensions: d } = await A(), g = ((S = c.value) == null ? void 0 : S.displayConditions) ?? !0, P = ((y = c.value) == null ? void 0 : y.modulesDisabled) ?? !1, I = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
|
|
21
22
|
await window.UIEditor.initEditor(
|
|
22
23
|
document.querySelector("#guido-editor"),
|
|
23
24
|
{
|
|
24
|
-
metadata:
|
|
25
|
-
html:
|
|
25
|
+
metadata: b,
|
|
26
|
+
html: f,
|
|
26
27
|
css: a,
|
|
27
|
-
forceRecreate:
|
|
28
|
+
forceRecreate: I,
|
|
28
29
|
locale: "en",
|
|
29
30
|
undoButtonSelector: "#guido__undo-button",
|
|
30
31
|
redoButtonSelector: "#guido__redo-button",
|
|
31
32
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
32
33
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
33
34
|
codeEditorButtonSelector: "#guido__code-button",
|
|
34
|
-
customAppearanceMergetags: !
|
|
35
|
+
customAppearanceMergetags: !m("liquidSyntax"),
|
|
35
36
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
36
37
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
37
|
-
customViewStyles:
|
|
38
|
-
conditionsEnabled:
|
|
39
|
-
customConditionsEnabled:
|
|
38
|
+
customViewStyles: K,
|
|
39
|
+
conditionsEnabled: g,
|
|
40
|
+
customConditionsEnabled: g,
|
|
40
41
|
enableXSSSecurity: !0,
|
|
41
|
-
modulesDisabled:
|
|
42
|
+
modulesDisabled: P,
|
|
42
43
|
syncModulesEnabled: r,
|
|
43
44
|
messageSettingsEnabled: !0,
|
|
44
45
|
displayGmailAnnotations: !0,
|
|
@@ -56,43 +57,45 @@ const fo = (C, l) => {
|
|
|
56
57
|
},
|
|
57
58
|
mergeTags: [
|
|
58
59
|
{
|
|
59
|
-
entries:
|
|
60
|
+
entries: Q(
|
|
60
61
|
l.preselectedDynamicContentList,
|
|
61
|
-
u
|
|
62
|
+
((E = u.value) == null ? void 0 : E.availableDynamicContent) ?? [],
|
|
63
|
+
m("liquidSyntax")
|
|
62
64
|
)
|
|
63
65
|
}
|
|
64
66
|
],
|
|
65
|
-
async onTokenRefreshRequest(
|
|
67
|
+
async onTokenRefreshRequest(o) {
|
|
66
68
|
try {
|
|
67
|
-
const n = await
|
|
68
|
-
|
|
69
|
+
const n = await v();
|
|
70
|
+
o(n);
|
|
69
71
|
} catch (n) {
|
|
70
|
-
|
|
72
|
+
p(n, "Failed to refresh token");
|
|
71
73
|
}
|
|
72
74
|
},
|
|
73
75
|
onTemplateLoaded() {
|
|
74
76
|
try {
|
|
75
|
-
const { importCss:
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
const { importCss: o } = H(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: R } = x(), { injectFullStory: U } = N();
|
|
78
|
+
o(), n(), U(), R(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
79
|
+
e.hasChanges = !1;
|
|
78
80
|
}, 1e3);
|
|
79
|
-
} catch (
|
|
80
|
-
|
|
81
|
+
} catch (o) {
|
|
82
|
+
p(o, "Failed to load custom interface appearance");
|
|
81
83
|
}
|
|
82
84
|
},
|
|
83
|
-
onCodeEditorVisibilityChanged(
|
|
84
|
-
|
|
85
|
+
onCodeEditorVisibilityChanged(o) {
|
|
86
|
+
e.isCodeEditorOpen = o;
|
|
85
87
|
},
|
|
86
|
-
onEditorVisualModeChanged(
|
|
87
|
-
|
|
88
|
+
onEditorVisualModeChanged(o) {
|
|
89
|
+
e.editorVisualMode = o.toLowerCase();
|
|
88
90
|
},
|
|
89
|
-
onVersionHistoryVisibilityChanged(
|
|
90
|
-
|
|
91
|
+
onVersionHistoryVisibilityChanged(o) {
|
|
92
|
+
e.isVersionHistoryOpen = o;
|
|
91
93
|
},
|
|
92
94
|
onDataChanged() {
|
|
93
|
-
|
|
95
|
+
e.hasChanges = !0;
|
|
94
96
|
},
|
|
95
97
|
onEvent: F,
|
|
98
|
+
onModuleAdd: M,
|
|
96
99
|
notifications: V(),
|
|
97
100
|
ignoreClickOutsideSelectors: [
|
|
98
101
|
"#guido-dynamic-content-modal",
|
|
@@ -100,16 +103,16 @@ const fo = (C, l) => {
|
|
|
100
103
|
".in-drawer__container"
|
|
101
104
|
],
|
|
102
105
|
extensions: d,
|
|
103
|
-
localePatch:
|
|
106
|
+
localePatch: J
|
|
104
107
|
}
|
|
105
108
|
);
|
|
106
|
-
},
|
|
109
|
+
}, D = (s) => new Promise((i, r) => {
|
|
107
110
|
var d;
|
|
108
111
|
if (document.getElementById("UiEditorScript")) {
|
|
109
112
|
Promise.resolve(s()).then(i, r);
|
|
110
113
|
return;
|
|
111
114
|
}
|
|
112
|
-
const
|
|
115
|
+
const e = W.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
|
|
113
116
|
t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
|
|
114
117
|
Promise.resolve(s()).then(i, r);
|
|
115
118
|
}, t.onerror = () => {
|
|
@@ -117,21 +120,21 @@ const fo = (C, l) => {
|
|
|
117
120
|
}, document.body.appendChild(t);
|
|
118
121
|
});
|
|
119
122
|
return { initPlugin: async (s) => {
|
|
120
|
-
const i =
|
|
123
|
+
const i = w();
|
|
121
124
|
try {
|
|
122
|
-
await
|
|
123
|
-
const [r,
|
|
124
|
-
|
|
125
|
+
await D(async () => {
|
|
126
|
+
const [r, e] = await Promise.all([
|
|
127
|
+
T(),
|
|
125
128
|
B()
|
|
126
129
|
]);
|
|
127
|
-
i.syncModulesEnabled =
|
|
130
|
+
i.syncModulesEnabled = e, await _(s, r, e);
|
|
128
131
|
});
|
|
129
132
|
} catch {
|
|
130
|
-
i.loadingStatus = !1,
|
|
131
|
-
type:
|
|
132
|
-
message:
|
|
133
|
+
i.loadingStatus = !1, k({
|
|
134
|
+
type: X.Error,
|
|
135
|
+
message: C["An error has occurred. Please report the error code to support."],
|
|
133
136
|
actionButton: {
|
|
134
|
-
text:
|
|
137
|
+
text: C["Reload page"],
|
|
135
138
|
onClick: () => window.location.reload()
|
|
136
139
|
}
|
|
137
140
|
});
|
|
@@ -139,5 +142,5 @@ const fo = (C, l) => {
|
|
|
139
142
|
} };
|
|
140
143
|
};
|
|
141
144
|
export {
|
|
142
|
-
|
|
145
|
+
ye as useStripo
|
|
143
146
|
};
|