@useinsider/guido 3.11.0-beta.1fde696 → 3.11.0-beta.30fc3cf
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 +40 -49
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +8 -8
- package/dist/composables/useStripo.js +59 -62
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -36
- package/dist/src/composables/useConfig.d.ts +0 -18
- package/dist/src/stores/config.d.ts +0 -162
- package/dist/src/utils/genericUtil.d.ts +0 -7
- package/dist/utils/genericUtil.js +19 -26
- package/package.json +1 -1
- package/dist/composables/useModuleDynamicContentRepair.js +0 -36
- package/dist/src/composables/useModuleDynamicContentRepair.d.ts +0 -18
- package/dist/src/utils/dynamicContentConverter.d.ts +0 -31
- package/dist/utils/dynamicContentConverter.js +0 -33
|
@@ -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 s, 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 y, variant as g, union as f, unknown as n } 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
|
+
}, R = 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
|
+
}), C = 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
|
+
}), A = 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 = y({
|
|
72
72
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
73
|
-
id: e(
|
|
73
|
+
id: e(s()),
|
|
74
74
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
75
|
-
decimalCount: e(f([t(),
|
|
75
|
+
decimalCount: e(f([t(), s()])),
|
|
76
76
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
77
|
-
productIds: e(c(
|
|
77
|
+
productIds: e(c(n())),
|
|
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(n())),
|
|
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(n()),
|
|
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(n())),
|
|
94
94
|
/** Number of product cards per row */
|
|
95
|
-
cardsInRow: e(
|
|
95
|
+
cardsInRow: e(s()),
|
|
96
96
|
/** Mobile-only padding (right) */
|
|
97
|
-
mobileRightPadding: e(
|
|
97
|
+
mobileRightPadding: e(s()),
|
|
98
98
|
/** Mobile-only padding (left) */
|
|
99
|
-
mobileLeftPadding: e(
|
|
99
|
+
mobileLeftPadding: e(s()),
|
|
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(), s()])),
|
|
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
|
+
}), L = 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,34 +124,25 @@ const d = {
|
|
|
124
124
|
k(t(), I),
|
|
125
125
|
{}
|
|
126
126
|
)
|
|
127
|
-
}),
|
|
127
|
+
}), P = 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(
|
|
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),
|
|
134
|
+
c(A),
|
|
144
135
|
[]
|
|
145
136
|
),
|
|
146
137
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
147
138
|
customFieldAttributes: e(c(t()), []),
|
|
148
139
|
/** Selected unsubscribe page IDs */
|
|
149
|
-
selectedUnsubscribePages: e(c(
|
|
140
|
+
selectedUnsubscribePages: e(c(s()), []),
|
|
150
141
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
151
142
|
forceRecreate: e(o(), !1),
|
|
152
143
|
/** Migration-only inputs (legacy block configs) */
|
|
153
|
-
migration: e(
|
|
154
|
-
}),
|
|
144
|
+
migration: e(L, {})
|
|
145
|
+
}), v = a({
|
|
155
146
|
/** Sender display name */
|
|
156
147
|
senderName: e(t(), ""),
|
|
157
148
|
/** Email subject line */
|
|
@@ -162,9 +153,9 @@ const d = {
|
|
|
162
153
|
/** Path to translations object */
|
|
163
154
|
translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
|
|
164
155
|
/** Migration date for template compatibility */
|
|
165
|
-
migrationDate: e(
|
|
156
|
+
migrationDate: e(s(), 1759696858),
|
|
166
157
|
/** Email header settings */
|
|
167
|
-
emailHeader: e(
|
|
158
|
+
emailHeader: e(v, { senderName: "", subject: "" }),
|
|
168
159
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
169
160
|
savedModulesFolderName: e(t(), S.SAVED_MODULES),
|
|
170
161
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
@@ -193,7 +184,7 @@ const d = {
|
|
|
193
184
|
liquidSyntax: e(o(), !1),
|
|
194
185
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
195
186
|
autosave: e(o(), !1)
|
|
196
|
-
}),
|
|
187
|
+
}), N = l([
|
|
197
188
|
"amp-accordion",
|
|
198
189
|
"amp-carousel",
|
|
199
190
|
"amp-form-controls",
|
|
@@ -207,7 +198,7 @@ const d = {
|
|
|
207
198
|
"text-block",
|
|
208
199
|
"timer-block",
|
|
209
200
|
"video-block"
|
|
210
|
-
]),
|
|
201
|
+
]), D = l([
|
|
211
202
|
"dynamic-content",
|
|
212
203
|
"checkbox-block",
|
|
213
204
|
"radio-button-block",
|
|
@@ -218,12 +209,12 @@ const d = {
|
|
|
218
209
|
]), x = a({
|
|
219
210
|
/** Default blocks to exclude from the editor */
|
|
220
211
|
excludeDefaults: e(
|
|
221
|
-
c(
|
|
212
|
+
c(N),
|
|
222
213
|
[]
|
|
223
214
|
),
|
|
224
215
|
/** Custom blocks to include in the editor */
|
|
225
216
|
includeCustoms: e(
|
|
226
|
-
c(
|
|
217
|
+
c(D),
|
|
227
218
|
[]
|
|
228
219
|
)
|
|
229
220
|
}), m = a({
|
|
@@ -232,7 +223,7 @@ const d = {
|
|
|
232
223
|
/** Human-readable description */
|
|
233
224
|
description: e(t()),
|
|
234
225
|
/** Priority for rule ordering (lower = earlier) */
|
|
235
|
-
priority:
|
|
226
|
+
priority: s()
|
|
236
227
|
}), F = a({
|
|
237
228
|
...m.entries,
|
|
238
229
|
type: i("replace"),
|
|
@@ -264,7 +255,7 @@ const d = {
|
|
|
264
255
|
(u) => typeof u == "function",
|
|
265
256
|
"processor must be a function"
|
|
266
257
|
)
|
|
267
|
-
}), H =
|
|
258
|
+
}), H = g("type", [
|
|
268
259
|
F,
|
|
269
260
|
U,
|
|
270
261
|
B,
|
|
@@ -288,12 +279,12 @@ const d = {
|
|
|
288
279
|
}), V = a({
|
|
289
280
|
// Required sections
|
|
290
281
|
/** Identity configuration (required) */
|
|
291
|
-
identity:
|
|
282
|
+
identity: R,
|
|
292
283
|
/** Partner configuration (required) */
|
|
293
|
-
partner:
|
|
284
|
+
partner: C,
|
|
294
285
|
// Optional sections (with defaults)
|
|
295
286
|
/** Template content and presets */
|
|
296
|
-
template: e(
|
|
287
|
+
template: e(P, {}),
|
|
297
288
|
/** Editor settings */
|
|
298
289
|
editor: e(E, {}),
|
|
299
290
|
/** UI configuration */
|
|
@@ -312,24 +303,24 @@ export {
|
|
|
312
303
|
q as CallbacksSchema,
|
|
313
304
|
H as CompilerRuleSchema,
|
|
314
305
|
j as CompilerSchema,
|
|
315
|
-
|
|
306
|
+
D as CustomBlockTypeSchema,
|
|
316
307
|
w as CustomRuleSchema,
|
|
317
|
-
|
|
318
|
-
|
|
308
|
+
N as DefaultBlockTypeSchema,
|
|
309
|
+
A as DynamicContentSchema,
|
|
319
310
|
E as EditorSchema,
|
|
320
|
-
|
|
311
|
+
v as EmailHeaderSchema,
|
|
321
312
|
T as FallbackFontSchema,
|
|
322
313
|
O as FeaturesSchema,
|
|
323
314
|
V as GuidoConfigSchema,
|
|
324
|
-
|
|
315
|
+
R as IdentitySchema,
|
|
325
316
|
I as LegacyRecommendationConfigSchema,
|
|
326
317
|
d as MessageType,
|
|
327
|
-
|
|
318
|
+
C as PartnerSchema,
|
|
328
319
|
r as ProductType,
|
|
329
320
|
U as RegexRuleSchema,
|
|
330
321
|
B as RemoveRuleSchema,
|
|
331
322
|
F as ReplaceRuleSchema,
|
|
332
|
-
|
|
333
|
-
|
|
323
|
+
L as TemplateMigrationSchema,
|
|
324
|
+
P as TemplateSchema,
|
|
334
325
|
M as UISchema
|
|
335
326
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as h, ref as b, computed as f, watch as v } from "vue";
|
|
2
2
|
import U from "../../wrappers/WpDrawer.vue.js";
|
|
3
3
|
import { useToaster as w } from "../../../composables/useToaster.js";
|
|
4
4
|
import { useTranslations as N } from "../../../composables/useTranslations.js";
|
|
@@ -7,7 +7,7 @@ import { ToasterTypeOptions as I } from "../../../enums/toaster.js";
|
|
|
7
7
|
import { PAGE_TYPES as l, getTypeTranslations as R, UNSUBSCRIBE_PAGES_LINK as P } from "../../../enums/unsubscribe.js";
|
|
8
8
|
import { useUnsubscribeStore as G } from "../../../stores/unsubscribe.js";
|
|
9
9
|
import { InSegments as L } from "@useinsider/design-system-vue";
|
|
10
|
-
const W = /* @__PURE__ */
|
|
10
|
+
const W = /* @__PURE__ */ h({
|
|
11
11
|
__name: "UnsubscribeTypeSelection",
|
|
12
12
|
setup(k) {
|
|
13
13
|
const t = N(), { showToaster: d } = w(), e = G(), n = b(!1), o = b(!0), r = b(l.GLOBAL_UNSUBSCRIBE), y = t(
|
|
@@ -54,12 +54,12 @@ const W = /* @__PURE__ */ _({
|
|
|
54
54
|
skeletonSizing: { width: 78, height: 40 }
|
|
55
55
|
}
|
|
56
56
|
})), g = (s) => {
|
|
57
|
-
e.typeSelectionDrawerStatus && (e.typeSelectionDrawerStatus = !1,
|
|
57
|
+
e.typeSelectionDrawerStatus && (e.typeSelectionDrawerStatus = !1, new CustomEvent("unsubscribe:cancel", {
|
|
58
58
|
detail: { blockId: e.pendingBlockId }
|
|
59
|
-
})
|
|
59
|
+
}), s && setTimeout(() => {
|
|
60
60
|
s();
|
|
61
61
|
}, 500));
|
|
62
|
-
},
|
|
62
|
+
}, B = (s) => {
|
|
63
63
|
r.value = s;
|
|
64
64
|
}, m = () => {
|
|
65
65
|
const s = e.hasTemplatesByCollectionType, a = [];
|
|
@@ -67,7 +67,7 @@ const W = /* @__PURE__ */ _({
|
|
|
67
67
|
p || a.push(Number(i));
|
|
68
68
|
}), a.length === 0)
|
|
69
69
|
return !0;
|
|
70
|
-
const
|
|
70
|
+
const _ = R(), c = a.map((i) => _[i]);
|
|
71
71
|
let u = "";
|
|
72
72
|
if (a.length === 1)
|
|
73
73
|
u = t("unsubscription-preference.create-page-to-continue", {
|
|
@@ -96,7 +96,7 @@ const W = /* @__PURE__ */ _({
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}), !1;
|
|
99
|
-
},
|
|
99
|
+
}, E = async () => {
|
|
100
100
|
if (n.value = !0, await e.fetchTemplates(!0), e.setCollection(r.value), !m()) {
|
|
101
101
|
n.value = !1, g();
|
|
102
102
|
return;
|
|
@@ -105,7 +105,7 @@ const W = /* @__PURE__ */ _({
|
|
|
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: y, segmentList: T, hasNoSelectableType: S, footerButtonGroupOptions: C, closeModal: g, changeCollection:
|
|
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: B, validateTemplates: m, selectCollection: E, WpDrawer: U, InSegments: L };
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
export {
|
|
@@ -1,45 +1,44 @@
|
|
|
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
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
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;
|
|
1
|
+
import { useActionsApi as U } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as R } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as x } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as O } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as q } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useStripoEventHandler as H } from "./useStripoEventHandler.js";
|
|
7
|
+
import { useStripoNotifications as N } from "./useStripoNotifications.js";
|
|
8
|
+
import { useToaster as z } from "./useToaster.js";
|
|
9
|
+
import { localePatch as L } from "../config/i18n/index.js";
|
|
10
|
+
import { en as h } from "../config/i18n/en/index.js";
|
|
11
|
+
import { ToasterTypeOptions as $ } from "../enums/toaster.js";
|
|
12
|
+
import { useStripoApi as G } from "../services/stripoApi.js";
|
|
13
|
+
import J from "../static/styles/customEditorStyle.css.js";
|
|
14
|
+
import { useEditorStore as E } from "../stores/editor.js";
|
|
15
|
+
import { dynamicContentToMergeTags as X } from "../utils/genericUtil.js";
|
|
16
|
+
import j from "../package.json.js";
|
|
17
|
+
const fo = (C, l) => {
|
|
18
|
+
const { features: c, template: w, isFeatureEnabled: u } = x(), { handleError: m, showToaster: b } = z(), { getToken: T, getCustomFonts: k, getSyncModulesStatus: B } = G(), { handleEvent: F } = H(), { getStripoBlocksConfig: v } = R(), { getStripoNotifications: V } = N(), _ = async (s, i = [], r = !1) => {
|
|
19
|
+
var g, S, y;
|
|
20
|
+
const o = E(), { html: p, css: a } = s, { baseBlocks: t, extensions: d } = await v(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, M = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, P = ((y = w.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
22
21
|
await window.UIEditor.initEditor(
|
|
23
22
|
document.querySelector("#guido-editor"),
|
|
24
23
|
{
|
|
25
|
-
metadata:
|
|
26
|
-
html:
|
|
24
|
+
metadata: C,
|
|
25
|
+
html: p,
|
|
27
26
|
css: a,
|
|
28
|
-
forceRecreate:
|
|
27
|
+
forceRecreate: P,
|
|
29
28
|
locale: "en",
|
|
30
29
|
undoButtonSelector: "#guido__undo-button",
|
|
31
30
|
redoButtonSelector: "#guido__redo-button",
|
|
32
31
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
33
32
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
34
33
|
codeEditorButtonSelector: "#guido__code-button",
|
|
35
|
-
customAppearanceMergetags: !
|
|
34
|
+
customAppearanceMergetags: !u("liquidSyntax"),
|
|
36
35
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
37
36
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
38
|
-
customViewStyles:
|
|
39
|
-
conditionsEnabled:
|
|
40
|
-
customConditionsEnabled:
|
|
37
|
+
customViewStyles: J,
|
|
38
|
+
conditionsEnabled: f,
|
|
39
|
+
customConditionsEnabled: f,
|
|
41
40
|
enableXSSSecurity: !0,
|
|
42
|
-
modulesDisabled:
|
|
41
|
+
modulesDisabled: M,
|
|
43
42
|
syncModulesEnabled: r,
|
|
44
43
|
messageSettingsEnabled: !0,
|
|
45
44
|
displayGmailAnnotations: !0,
|
|
@@ -57,45 +56,43 @@ const ye = (b, l) => {
|
|
|
57
56
|
},
|
|
58
57
|
mergeTags: [
|
|
59
58
|
{
|
|
60
|
-
entries:
|
|
59
|
+
entries: X(
|
|
61
60
|
l.preselectedDynamicContentList,
|
|
62
|
-
(
|
|
63
|
-
m("liquidSyntax")
|
|
61
|
+
u("liquidSyntax")
|
|
64
62
|
)
|
|
65
63
|
}
|
|
66
64
|
],
|
|
67
|
-
async onTokenRefreshRequest(
|
|
65
|
+
async onTokenRefreshRequest(e) {
|
|
68
66
|
try {
|
|
69
|
-
const n = await
|
|
70
|
-
|
|
67
|
+
const n = await T();
|
|
68
|
+
e(n);
|
|
71
69
|
} catch (n) {
|
|
72
|
-
|
|
70
|
+
m(n, "Failed to refresh token");
|
|
73
71
|
}
|
|
74
72
|
},
|
|
75
73
|
onTemplateLoaded() {
|
|
76
74
|
try {
|
|
77
|
-
const { importCss:
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
const { importCss: e } = O(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: D } = U(), { injectFullStory: I } = q();
|
|
76
|
+
e(), n(), I(), D(), l.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
|
|
77
|
+
o.hasChanges = !1;
|
|
80
78
|
}, 1e3);
|
|
81
|
-
} catch (
|
|
82
|
-
|
|
79
|
+
} catch (e) {
|
|
80
|
+
m(e, "Failed to load custom interface appearance");
|
|
83
81
|
}
|
|
84
82
|
},
|
|
85
|
-
onCodeEditorVisibilityChanged(
|
|
86
|
-
|
|
83
|
+
onCodeEditorVisibilityChanged(e) {
|
|
84
|
+
o.isCodeEditorOpen = e;
|
|
87
85
|
},
|
|
88
|
-
onEditorVisualModeChanged(
|
|
89
|
-
|
|
86
|
+
onEditorVisualModeChanged(e) {
|
|
87
|
+
o.editorVisualMode = e.toLowerCase();
|
|
90
88
|
},
|
|
91
|
-
onVersionHistoryVisibilityChanged(
|
|
92
|
-
|
|
89
|
+
onVersionHistoryVisibilityChanged(e) {
|
|
90
|
+
o.isVersionHistoryOpen = e;
|
|
93
91
|
},
|
|
94
92
|
onDataChanged() {
|
|
95
|
-
|
|
93
|
+
o.hasChanges = !0;
|
|
96
94
|
},
|
|
97
95
|
onEvent: F,
|
|
98
|
-
onModuleAdd: M,
|
|
99
96
|
notifications: V(),
|
|
100
97
|
ignoreClickOutsideSelectors: [
|
|
101
98
|
"#guido-dynamic-content-modal",
|
|
@@ -103,16 +100,16 @@ const ye = (b, l) => {
|
|
|
103
100
|
".in-drawer__container"
|
|
104
101
|
],
|
|
105
102
|
extensions: d,
|
|
106
|
-
localePatch:
|
|
103
|
+
localePatch: L
|
|
107
104
|
}
|
|
108
105
|
);
|
|
109
|
-
},
|
|
106
|
+
}, A = (s) => new Promise((i, r) => {
|
|
110
107
|
var d;
|
|
111
108
|
if (document.getElementById("UiEditorScript")) {
|
|
112
109
|
Promise.resolve(s()).then(i, r);
|
|
113
110
|
return;
|
|
114
111
|
}
|
|
115
|
-
const
|
|
112
|
+
const o = j.guido, a = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
|
|
116
113
|
t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
|
|
117
114
|
Promise.resolve(s()).then(i, r);
|
|
118
115
|
}, t.onerror = () => {
|
|
@@ -120,21 +117,21 @@ const ye = (b, l) => {
|
|
|
120
117
|
}, document.body.appendChild(t);
|
|
121
118
|
});
|
|
122
119
|
return { initPlugin: async (s) => {
|
|
123
|
-
const i =
|
|
120
|
+
const i = E();
|
|
124
121
|
try {
|
|
125
|
-
await
|
|
126
|
-
const [r,
|
|
127
|
-
|
|
122
|
+
await A(async () => {
|
|
123
|
+
const [r, o] = await Promise.all([
|
|
124
|
+
k(),
|
|
128
125
|
B()
|
|
129
126
|
]);
|
|
130
|
-
i.syncModulesEnabled =
|
|
127
|
+
i.syncModulesEnabled = o, await _(s, r, o);
|
|
131
128
|
});
|
|
132
129
|
} catch {
|
|
133
|
-
i.loadingStatus = !1,
|
|
134
|
-
type:
|
|
135
|
-
message:
|
|
130
|
+
i.loadingStatus = !1, b({
|
|
131
|
+
type: $.Error,
|
|
132
|
+
message: h["An error has occurred. Please report the error code to support."],
|
|
136
133
|
actionButton: {
|
|
137
|
-
text:
|
|
134
|
+
text: h["Reload page"],
|
|
138
135
|
onClick: () => window.location.reload()
|
|
139
136
|
}
|
|
140
137
|
});
|
|
@@ -142,5 +139,5 @@ const ye = (b, l) => {
|
|
|
142
139
|
} };
|
|
143
140
|
};
|
|
144
141
|
export {
|
|
145
|
-
|
|
142
|
+
fo as useStripo
|
|
146
143
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.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}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.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}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-8b32eb16] .guido__verion-history-view-option-selection-desktop svg,[data-v-8b32eb16] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-8b32eb16] .in-segments-wrapper__button_selected,[data-v-8b32eb16] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-06afaecb]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-06afaecb]{min-height:504px}.iframe-wrapper[data-v-cbafc185]{width:258px}.iframe-scaled[data-v-cbafc185]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -227,24 +227,6 @@ export declare const TemplateSchema: v.ObjectSchema<{
|
|
|
227
227
|
readonly value: v.StringSchema<undefined>;
|
|
228
228
|
}, undefined>, undefined>;
|
|
229
229
|
}, undefined>, undefined>, readonly []>;
|
|
230
|
-
/**
|
|
231
|
-
* Full set of dynamic-content items the account offers (label + token).
|
|
232
|
-
* Used as the label→token map that repairs label-form placeholders
|
|
233
|
-
* (e.g. `{{ Phone Number }}`) in dropped saved modules.
|
|
234
|
-
*/
|
|
235
|
-
readonly availableDynamicContent: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
236
|
-
/** Display text for the dynamic content */
|
|
237
|
-
readonly text: v.StringSchema<undefined>;
|
|
238
|
-
/** Template variable value (e.g., {{username}}) */
|
|
239
|
-
readonly value: v.StringSchema<undefined>;
|
|
240
|
-
/** Fallback value if variable is empty */
|
|
241
|
-
readonly fallback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
242
|
-
/** Optional formatting options */
|
|
243
|
-
readonly format: v.OptionalSchema<v.ObjectSchema<{
|
|
244
|
-
readonly key: v.StringSchema<undefined>;
|
|
245
|
-
readonly value: v.StringSchema<undefined>;
|
|
246
|
-
}, undefined>, undefined>;
|
|
247
|
-
}, undefined>, undefined>, readonly []>;
|
|
248
230
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
249
231
|
readonly customFieldAttributes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
250
232
|
/** Selected unsubscribe page IDs */
|
|
@@ -640,24 +622,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
640
622
|
readonly value: v.StringSchema<undefined>;
|
|
641
623
|
}, undefined>, undefined>;
|
|
642
624
|
}, undefined>, undefined>, readonly []>;
|
|
643
|
-
/**
|
|
644
|
-
* Full set of dynamic-content items the account offers (label + token).
|
|
645
|
-
* Used as the label→token map that repairs label-form placeholders
|
|
646
|
-
* (e.g. `{{ Phone Number }}`) in dropped saved modules.
|
|
647
|
-
*/
|
|
648
|
-
readonly availableDynamicContent: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
649
|
-
/** Display text for the dynamic content */
|
|
650
|
-
readonly text: v.StringSchema<undefined>;
|
|
651
|
-
/** Template variable value (e.g., {{username}}) */
|
|
652
|
-
readonly value: v.StringSchema<undefined>;
|
|
653
|
-
/** Fallback value if variable is empty */
|
|
654
|
-
readonly fallback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
655
|
-
/** Optional formatting options */
|
|
656
|
-
readonly format: v.OptionalSchema<v.ObjectSchema<{
|
|
657
|
-
readonly key: v.StringSchema<undefined>;
|
|
658
|
-
readonly value: v.StringSchema<undefined>;
|
|
659
|
-
}, undefined>, undefined>;
|
|
660
|
-
}, undefined>, undefined>, readonly []>;
|
|
661
625
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
662
626
|
readonly customFieldAttributes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
|
|
663
627
|
/** Selected unsubscribe page IDs */
|
|
@@ -34,15 +34,6 @@ export declare const useConfig: () => {
|
|
|
34
34
|
value: string;
|
|
35
35
|
} | undefined;
|
|
36
36
|
}[];
|
|
37
|
-
availableDynamicContent: {
|
|
38
|
-
text: string;
|
|
39
|
-
value: string;
|
|
40
|
-
fallback?: string | undefined;
|
|
41
|
-
format?: {
|
|
42
|
-
key: string;
|
|
43
|
-
value: string;
|
|
44
|
-
} | undefined;
|
|
45
|
-
}[];
|
|
46
37
|
customFieldAttributes: string[];
|
|
47
38
|
selectedUnsubscribePages: number[];
|
|
48
39
|
forceRecreate: boolean;
|
|
@@ -171,15 +162,6 @@ export declare const useConfig: () => {
|
|
|
171
162
|
value: string;
|
|
172
163
|
} | undefined;
|
|
173
164
|
}[];
|
|
174
|
-
availableDynamicContent: {
|
|
175
|
-
text: string;
|
|
176
|
-
value: string;
|
|
177
|
-
fallback?: string | undefined;
|
|
178
|
-
format?: {
|
|
179
|
-
key: string;
|
|
180
|
-
value: string;
|
|
181
|
-
} | undefined;
|
|
182
|
-
}[];
|
|
183
165
|
customFieldAttributes: string[];
|
|
184
166
|
selectedUnsubscribePages: number[];
|
|
185
167
|
forceRecreate: boolean;
|
|
@@ -39,15 +39,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
39
39
|
value: string;
|
|
40
40
|
} | undefined;
|
|
41
41
|
}[];
|
|
42
|
-
availableDynamicContent: {
|
|
43
|
-
text: string;
|
|
44
|
-
value: string;
|
|
45
|
-
fallback?: string | undefined;
|
|
46
|
-
format?: {
|
|
47
|
-
key: string;
|
|
48
|
-
value: string;
|
|
49
|
-
} | undefined;
|
|
50
|
-
}[];
|
|
51
42
|
customFieldAttributes: string[];
|
|
52
43
|
selectedUnsubscribePages: number[];
|
|
53
44
|
forceRecreate: boolean;
|
|
@@ -182,15 +173,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
182
173
|
value: string;
|
|
183
174
|
} | undefined;
|
|
184
175
|
}[];
|
|
185
|
-
availableDynamicContent: {
|
|
186
|
-
text: string;
|
|
187
|
-
value: string;
|
|
188
|
-
fallback?: string | undefined;
|
|
189
|
-
format?: {
|
|
190
|
-
key: string;
|
|
191
|
-
value: string;
|
|
192
|
-
} | undefined;
|
|
193
|
-
}[];
|
|
194
176
|
customFieldAttributes: string[];
|
|
195
177
|
selectedUnsubscribePages: number[];
|
|
196
178
|
forceRecreate: boolean;
|
|
@@ -325,15 +307,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
325
307
|
value: string;
|
|
326
308
|
} | undefined;
|
|
327
309
|
}[];
|
|
328
|
-
availableDynamicContent: {
|
|
329
|
-
text: string;
|
|
330
|
-
value: string;
|
|
331
|
-
fallback?: string | undefined;
|
|
332
|
-
format?: {
|
|
333
|
-
key: string;
|
|
334
|
-
value: string;
|
|
335
|
-
} | undefined;
|
|
336
|
-
}[];
|
|
337
310
|
customFieldAttributes: string[];
|
|
338
311
|
selectedUnsubscribePages: number[];
|
|
339
312
|
forceRecreate: boolean;
|
|
@@ -468,15 +441,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
468
441
|
value: string;
|
|
469
442
|
} | undefined;
|
|
470
443
|
}[];
|
|
471
|
-
availableDynamicContent: {
|
|
472
|
-
text: string;
|
|
473
|
-
value: string;
|
|
474
|
-
fallback?: string | undefined;
|
|
475
|
-
format?: {
|
|
476
|
-
key: string;
|
|
477
|
-
value: string;
|
|
478
|
-
} | undefined;
|
|
479
|
-
}[];
|
|
480
444
|
customFieldAttributes: string[];
|
|
481
445
|
selectedUnsubscribePages: number[];
|
|
482
446
|
forceRecreate: boolean;
|
|
@@ -611,15 +575,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
611
575
|
value: string;
|
|
612
576
|
} | undefined;
|
|
613
577
|
}[];
|
|
614
|
-
availableDynamicContent: {
|
|
615
|
-
text: string;
|
|
616
|
-
value: string;
|
|
617
|
-
fallback?: string | undefined;
|
|
618
|
-
format?: {
|
|
619
|
-
key: string;
|
|
620
|
-
value: string;
|
|
621
|
-
} | undefined;
|
|
622
|
-
}[];
|
|
623
578
|
customFieldAttributes: string[];
|
|
624
579
|
selectedUnsubscribePages: number[];
|
|
625
580
|
forceRecreate: boolean;
|
|
@@ -754,15 +709,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
754
709
|
value: string;
|
|
755
710
|
} | undefined;
|
|
756
711
|
}[];
|
|
757
|
-
availableDynamicContent: {
|
|
758
|
-
text: string;
|
|
759
|
-
value: string;
|
|
760
|
-
fallback?: string | undefined;
|
|
761
|
-
format?: {
|
|
762
|
-
key: string;
|
|
763
|
-
value: string;
|
|
764
|
-
} | undefined;
|
|
765
|
-
}[];
|
|
766
712
|
customFieldAttributes: string[];
|
|
767
713
|
selectedUnsubscribePages: number[];
|
|
768
714
|
forceRecreate: boolean;
|
|
@@ -897,15 +843,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
897
843
|
value: string;
|
|
898
844
|
} | undefined;
|
|
899
845
|
}[];
|
|
900
|
-
availableDynamicContent: {
|
|
901
|
-
text: string;
|
|
902
|
-
value: string;
|
|
903
|
-
fallback?: string | undefined;
|
|
904
|
-
format?: {
|
|
905
|
-
key: string;
|
|
906
|
-
value: string;
|
|
907
|
-
} | undefined;
|
|
908
|
-
}[];
|
|
909
846
|
customFieldAttributes: string[];
|
|
910
847
|
selectedUnsubscribePages: number[];
|
|
911
848
|
forceRecreate: boolean;
|
|
@@ -1040,15 +977,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1040
977
|
value: string;
|
|
1041
978
|
} | undefined;
|
|
1042
979
|
}[];
|
|
1043
|
-
availableDynamicContent: {
|
|
1044
|
-
text: string;
|
|
1045
|
-
value: string;
|
|
1046
|
-
fallback?: string | undefined;
|
|
1047
|
-
format?: {
|
|
1048
|
-
key: string;
|
|
1049
|
-
value: string;
|
|
1050
|
-
} | undefined;
|
|
1051
|
-
}[];
|
|
1052
980
|
customFieldAttributes: string[];
|
|
1053
981
|
selectedUnsubscribePages: number[];
|
|
1054
982
|
forceRecreate: boolean;
|
|
@@ -1183,15 +1111,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1183
1111
|
value: string;
|
|
1184
1112
|
} | undefined;
|
|
1185
1113
|
}[];
|
|
1186
|
-
availableDynamicContent: {
|
|
1187
|
-
text: string;
|
|
1188
|
-
value: string;
|
|
1189
|
-
fallback?: string | undefined;
|
|
1190
|
-
format?: {
|
|
1191
|
-
key: string;
|
|
1192
|
-
value: string;
|
|
1193
|
-
} | undefined;
|
|
1194
|
-
}[];
|
|
1195
1114
|
customFieldAttributes: string[];
|
|
1196
1115
|
selectedUnsubscribePages: number[];
|
|
1197
1116
|
forceRecreate: boolean;
|
|
@@ -1326,15 +1245,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1326
1245
|
value: string;
|
|
1327
1246
|
} | undefined;
|
|
1328
1247
|
}[];
|
|
1329
|
-
availableDynamicContent: {
|
|
1330
|
-
text: string;
|
|
1331
|
-
value: string;
|
|
1332
|
-
fallback?: string | undefined;
|
|
1333
|
-
format?: {
|
|
1334
|
-
key: string;
|
|
1335
|
-
value: string;
|
|
1336
|
-
} | undefined;
|
|
1337
|
-
}[];
|
|
1338
1248
|
customFieldAttributes: string[];
|
|
1339
1249
|
selectedUnsubscribePages: number[];
|
|
1340
1250
|
forceRecreate: boolean;
|
|
@@ -1469,15 +1379,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1469
1379
|
value: string;
|
|
1470
1380
|
} | undefined;
|
|
1471
1381
|
}[];
|
|
1472
|
-
availableDynamicContent: {
|
|
1473
|
-
text: string;
|
|
1474
|
-
value: string;
|
|
1475
|
-
fallback?: string | undefined;
|
|
1476
|
-
format?: {
|
|
1477
|
-
key: string;
|
|
1478
|
-
value: string;
|
|
1479
|
-
} | undefined;
|
|
1480
|
-
}[];
|
|
1481
1382
|
customFieldAttributes: string[];
|
|
1482
1383
|
selectedUnsubscribePages: number[];
|
|
1483
1384
|
forceRecreate: boolean;
|
|
@@ -1612,15 +1513,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1612
1513
|
value: string;
|
|
1613
1514
|
} | undefined;
|
|
1614
1515
|
}[];
|
|
1615
|
-
availableDynamicContent: {
|
|
1616
|
-
text: string;
|
|
1617
|
-
value: string;
|
|
1618
|
-
fallback?: string | undefined;
|
|
1619
|
-
format?: {
|
|
1620
|
-
key: string;
|
|
1621
|
-
value: string;
|
|
1622
|
-
} | undefined;
|
|
1623
|
-
}[];
|
|
1624
1516
|
customFieldAttributes: string[];
|
|
1625
1517
|
selectedUnsubscribePages: number[];
|
|
1626
1518
|
forceRecreate: boolean;
|
|
@@ -1755,15 +1647,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1755
1647
|
value: string;
|
|
1756
1648
|
} | undefined;
|
|
1757
1649
|
}[];
|
|
1758
|
-
availableDynamicContent: {
|
|
1759
|
-
text: string;
|
|
1760
|
-
value: string;
|
|
1761
|
-
fallback?: string | undefined;
|
|
1762
|
-
format?: {
|
|
1763
|
-
key: string;
|
|
1764
|
-
value: string;
|
|
1765
|
-
} | undefined;
|
|
1766
|
-
}[];
|
|
1767
1650
|
customFieldAttributes: string[];
|
|
1768
1651
|
selectedUnsubscribePages: number[];
|
|
1769
1652
|
forceRecreate: boolean;
|
|
@@ -1898,15 +1781,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1898
1781
|
value: string;
|
|
1899
1782
|
} | undefined;
|
|
1900
1783
|
}[];
|
|
1901
|
-
availableDynamicContent: {
|
|
1902
|
-
text: string;
|
|
1903
|
-
value: string;
|
|
1904
|
-
fallback?: string | undefined;
|
|
1905
|
-
format?: {
|
|
1906
|
-
key: string;
|
|
1907
|
-
value: string;
|
|
1908
|
-
} | undefined;
|
|
1909
|
-
}[];
|
|
1910
1784
|
customFieldAttributes: string[];
|
|
1911
1785
|
selectedUnsubscribePages: number[];
|
|
1912
1786
|
forceRecreate: boolean;
|
|
@@ -2041,15 +1915,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2041
1915
|
value: string;
|
|
2042
1916
|
} | undefined;
|
|
2043
1917
|
}[];
|
|
2044
|
-
availableDynamicContent: {
|
|
2045
|
-
text: string;
|
|
2046
|
-
value: string;
|
|
2047
|
-
fallback?: string | undefined;
|
|
2048
|
-
format?: {
|
|
2049
|
-
key: string;
|
|
2050
|
-
value: string;
|
|
2051
|
-
} | undefined;
|
|
2052
|
-
}[];
|
|
2053
1918
|
customFieldAttributes: string[];
|
|
2054
1919
|
selectedUnsubscribePages: number[];
|
|
2055
1920
|
forceRecreate: boolean;
|
|
@@ -2184,15 +2049,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2184
2049
|
value: string;
|
|
2185
2050
|
} | undefined;
|
|
2186
2051
|
}[];
|
|
2187
|
-
availableDynamicContent: {
|
|
2188
|
-
text: string;
|
|
2189
|
-
value: string;
|
|
2190
|
-
fallback?: string | undefined;
|
|
2191
|
-
format?: {
|
|
2192
|
-
key: string;
|
|
2193
|
-
value: string;
|
|
2194
|
-
} | undefined;
|
|
2195
|
-
}[];
|
|
2196
2052
|
customFieldAttributes: string[];
|
|
2197
2053
|
selectedUnsubscribePages: number[];
|
|
2198
2054
|
forceRecreate: boolean;
|
|
@@ -2327,15 +2183,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2327
2183
|
value: string;
|
|
2328
2184
|
} | undefined;
|
|
2329
2185
|
}[];
|
|
2330
|
-
availableDynamicContent: {
|
|
2331
|
-
text: string;
|
|
2332
|
-
value: string;
|
|
2333
|
-
fallback?: string | undefined;
|
|
2334
|
-
format?: {
|
|
2335
|
-
key: string;
|
|
2336
|
-
value: string;
|
|
2337
|
-
} | undefined;
|
|
2338
|
-
}[];
|
|
2339
2186
|
customFieldAttributes: string[];
|
|
2340
2187
|
selectedUnsubscribePages: number[];
|
|
2341
2188
|
forceRecreate: boolean;
|
|
@@ -2470,15 +2317,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2470
2317
|
value: string;
|
|
2471
2318
|
} | undefined;
|
|
2472
2319
|
}[];
|
|
2473
|
-
availableDynamicContent: {
|
|
2474
|
-
text: string;
|
|
2475
|
-
value: string;
|
|
2476
|
-
fallback?: string | undefined;
|
|
2477
|
-
format?: {
|
|
2478
|
-
key: string;
|
|
2479
|
-
value: string;
|
|
2480
|
-
} | undefined;
|
|
2481
|
-
}[];
|
|
2482
2320
|
customFieldAttributes: string[];
|
|
2483
2321
|
selectedUnsubscribePages: number[];
|
|
2484
2322
|
forceRecreate: boolean;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import type { DynamicContent, MergeTag } from '@@/Types/generic';
|
|
2
2
|
export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
|
|
3
3
|
export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
|
|
4
|
-
/**
|
|
5
|
-
* Builds the editor merge-tag entries from the template's preselected list plus
|
|
6
|
-
* the account's full available list, deduped by token value (preselected wins so
|
|
7
|
-
* its fallback/format is kept). Registering the full list lets every recognized
|
|
8
|
-
* token — including ones repaired on module drop — render as a chip.
|
|
9
|
-
*/
|
|
10
|
-
export declare const buildMergeTagEntries: (preselected: DynamicContent[], available: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
|
|
11
4
|
export declare const getCsrfToken: () => string;
|
|
12
5
|
/**
|
|
13
6
|
* URL Parameter utilities
|
|
@@ -1,54 +1,47 @@
|
|
|
1
|
-
const
|
|
2
|
-
const a =
|
|
3
|
-
text:
|
|
1
|
+
const s = (e) => {
|
|
2
|
+
const a = e.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [n] = a, c = {
|
|
3
|
+
text: e.label,
|
|
4
4
|
value: n || ""
|
|
5
5
|
};
|
|
6
6
|
if (a.length >= 2) {
|
|
7
|
-
const [, l,
|
|
7
|
+
const [, l, r] = a;
|
|
8
8
|
if (l.startsWith("default:")) {
|
|
9
|
-
let
|
|
10
|
-
|
|
9
|
+
let t = l.slice(8).trim();
|
|
10
|
+
t.startsWith('"') && t.endsWith('"') && (t = t.slice(1, -1)), c.fallback = t;
|
|
11
11
|
} else {
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const t = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
|
|
13
|
+
t ? c.format = t : r || (c.fallback = l), r && (c.fallback = r);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
return
|
|
17
|
-
},
|
|
16
|
+
return c;
|
|
17
|
+
}, u = (e, f = !1) => e.map((a) => {
|
|
18
18
|
if (a.format)
|
|
19
19
|
return {
|
|
20
20
|
label: `${a.text} | ${a.format.key}=${a.format.value}`,
|
|
21
21
|
value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
|
|
22
22
|
};
|
|
23
|
-
if (
|
|
23
|
+
if (f) {
|
|
24
24
|
if (!a.fallback)
|
|
25
25
|
return {
|
|
26
26
|
label: a.text,
|
|
27
27
|
value: `{{ ${a.value} }}`
|
|
28
28
|
};
|
|
29
|
-
const
|
|
29
|
+
const c = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
|
|
30
30
|
return {
|
|
31
31
|
label: `${a.text} | ${a.fallback}`,
|
|
32
|
-
value: `{{ ${a.value} | default: ${
|
|
32
|
+
value: `{{ ${a.value} | default: ${c} }}`
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
36
|
label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
|
|
37
37
|
value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
|
|
38
38
|
};
|
|
39
|
-
}), o = (
|
|
40
|
-
|
|
41
|
-
return [
|
|
42
|
-
...s(t, a),
|
|
43
|
-
...s(e, a)
|
|
44
|
-
];
|
|
45
|
-
}, b = () => {
|
|
46
|
-
var t;
|
|
47
|
-
return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
|
|
39
|
+
}), o = () => {
|
|
40
|
+
var e;
|
|
41
|
+
return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
|
|
48
42
|
};
|
|
49
43
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
u as mergeTagToDynamicContent
|
|
44
|
+
u as dynamicContentToMergeTags,
|
|
45
|
+
o as getCsrfToken,
|
|
46
|
+
s as mergeTagToDynamicContent
|
|
54
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.11.0-beta.
|
|
3
|
+
"version": "3.11.0-beta.30fc3cf",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -1,36 +0,0 @@
|
|
|
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,18 +0,0 @@
|
|
|
1
|
-
import type { ModuleAddData, ModuleModifier } from '@@/Types/stripo';
|
|
2
|
-
/**
|
|
3
|
-
* Host-registered translation key for the "some attributes could not be
|
|
4
|
-
* converted" toaster. Guido resolves it against the host's `window.trans.en`;
|
|
5
|
-
* the copy is registered host-side.
|
|
6
|
-
*/
|
|
7
|
-
export declare const UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY = "dynamic-content.unresolved-attributes-on-drop";
|
|
8
|
-
/**
|
|
9
|
-
* Repairs label-form dynamic-content tokens in saved modules as they are dropped
|
|
10
|
-
* or copied into the editor. Saved modules serialize merge-tag chips by their
|
|
11
|
-
* display label (`{{ Phone Number }}`); this maps them back to their canonical
|
|
12
|
-
* token (`{{phone_number}}`) using the account's dynamic-content list.
|
|
13
|
-
*
|
|
14
|
-
* Wired into Stripo via the `onModuleAdd` init callback (see `useStripo`).
|
|
15
|
-
*/
|
|
16
|
-
export declare const useModuleDynamicContentRepair: () => {
|
|
17
|
-
handleModuleAdd: (data: ModuleAddData, modifier: ModuleModifier) => void;
|
|
18
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
-
export interface DynamicContentConversionResult {
|
|
3
|
-
html: string;
|
|
4
|
-
/** Distinct label-form tokens that had no match in the lookup (left unchanged). */
|
|
5
|
-
unresolved: string[];
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Builds a label→item lookup from one or more dynamic-content lists, keyed by
|
|
9
|
-
* normalized label (trimmed, lowercased). When lists overlap, a later list wins
|
|
10
|
-
* for a shared key.
|
|
11
|
-
*/
|
|
12
|
-
export declare const buildDynamicContentLookup: (...lists: DynamicContent[][]) => Map<string, DynamicContent>;
|
|
13
|
-
/**
|
|
14
|
-
* Rewrites label-form dynamic-content tokens in a dropped module's HTML into
|
|
15
|
-
* their canonical `{{token}}` form, using `lookup` (label→item).
|
|
16
|
-
*
|
|
17
|
-
* Legacy saved modules can serialize merge-tag chips by their display label —
|
|
18
|
-
* both multi-word (`{{ Phone Number }}`) and single-word (`{{Email}}`) — which
|
|
19
|
-
* the backend can't resolve (its attribute match is case-sensitive). Every tag's
|
|
20
|
-
* name is looked up case-insensitively and a match is rewritten to its canonical
|
|
21
|
-
* token — but a name that is ALREADY a clean identifier is only rewritten when
|
|
22
|
-
* the match is the same attribute in a different case (e.g. `{{Email}}` →
|
|
23
|
-
* `{{email}}`); if the matched value differs by more than case, the name merely
|
|
24
|
-
* coincides with an unrelated display label, so it is left as-is rather than
|
|
25
|
-
* silently corrupted into a different attribute. A name with no match is left as
|
|
26
|
-
* well, and reported in `unresolved` ONLY when it is not already a clean
|
|
27
|
-
* identifier — a clean identifier is treated as a valid token we simply weren't
|
|
28
|
-
* given, so it never triggers a false warning. Allowed system tokens and `data-*`
|
|
29
|
-
* attribute values (backend-resolved product tags) are never touched.
|
|
30
|
-
*/
|
|
31
|
-
export declare const convertModuleDynamicContent: (html: string, lookup: Map<string, DynamicContent>, liquidSyntax: boolean) => DynamicContentConversionResult;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DATA_ATTRIBUTE_REGEX as _, DYNAMIC_CONTENT_TAG_REGEX as D, ALLOWED_DYNAMIC_SYSTEM_TOKENS as m, VALID_DYNAMIC_VARIABLE_REGEX as A } from "../enums/html-validator.js";
|
|
2
|
-
import { dynamicContentToMergeTags as M } from "./genericUtil.js";
|
|
3
|
-
const T = "guidoDataMask", p = "EndDataMask", f = /guidoDataMask(\d+)EndDataMask/g, u = (r) => r.trim().toLowerCase(), S = (...r) => {
|
|
4
|
-
const a = /* @__PURE__ */ new Map();
|
|
5
|
-
return r.forEach((d) => {
|
|
6
|
-
d.forEach((s) => {
|
|
7
|
-
const n = u(s.text);
|
|
8
|
-
n && a.set(n, s);
|
|
9
|
-
});
|
|
10
|
-
}), a;
|
|
11
|
-
}, L = (r, a, d) => {
|
|
12
|
-
const s = /* @__PURE__ */ new Set(), n = [];
|
|
13
|
-
return { html: r.replace(_, (t) => (n.push(t), `${T}${n.length - 1}${p}`)).replace(D, (t) => {
|
|
14
|
-
const o = t.slice(2, -2), c = o.indexOf("|"), l = c === -1 ? o : o.slice(0, c), e = l.trim();
|
|
15
|
-
if (e === "" || m.includes(e))
|
|
16
|
-
return t;
|
|
17
|
-
const i = a.get(u(e));
|
|
18
|
-
if (i) {
|
|
19
|
-
if (A.test(e) && u(i.value) !== u(e))
|
|
20
|
-
return t;
|
|
21
|
-
if (c !== -1) {
|
|
22
|
-
const E = o.slice(c);
|
|
23
|
-
return `{{${l.replace(e, () => i.value)}${E}}}`;
|
|
24
|
-
}
|
|
25
|
-
return M([i], d)[0].value;
|
|
26
|
-
}
|
|
27
|
-
return A.test(e) || s.add(e), t;
|
|
28
|
-
}).replace(f, (t, o) => n[Number(o)]), unresolved: [...s] };
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
S as buildDynamicContentLookup,
|
|
32
|
-
L as convertModuleDynamicContent
|
|
33
|
-
};
|