@useinsider/guido 3.13.1-beta.88c2f20 → 3.13.1-beta.88e4a0d
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 +17 -24
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +72 -78
- package/dist/composables/useActionsApi.js +18 -24
- package/dist/composables/useEmailTemplateApplier.js +24 -26
- package/dist/composables/useTimerClone.js +1 -1
- package/dist/config/migrator/index.js +10 -11
- package/dist/guido.css +1 -1
- package/dist/library.js +9 -14
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +12 -12
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -14
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/config/migrator/index.d.ts +1 -6
- package/dist/src/library.d.ts +0 -2
- package/dist/src/stores/config.d.ts +0 -36
- package/dist/src/stores/editor.d.ts +0 -25
- package/dist/static/styles/components/wide-panel.css.js +7 -0
- package/dist/static/styles/customEditorStyle.css.js +8 -0
- package/dist/stores/editor.js +1 -4
- package/dist/utils/templatePreparation.js +59 -70
- package/package.json +3 -3
- package/dist/config/migrator/trackIdMigrator.js +0 -11
- package/dist/src/config/migrator/trackIdMigrator.d.ts +0 -6
- package/dist/src/utils/linkTrackingIds.d.ts +0 -25
- package/dist/utils/linkTrackingIds.js +0 -44
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
2
|
-
import { object as a, number as n, optional as e, string as t, picklist as r, pipe as p, minLength as b, custom as
|
|
1
|
+
import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as r, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as f, unknown as s, lazy as T } 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
|
+
}, A = a({
|
|
16
16
|
/** Unique identifier for the template being edited */
|
|
17
17
|
templateId: p(
|
|
18
18
|
t(),
|
|
@@ -25,7 +25,7 @@ const d = {
|
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
27
|
variationId: e(t())
|
|
28
|
-
}),
|
|
28
|
+
}), I = a({
|
|
29
29
|
/** Fallback font name (e.g., "Georgia") */
|
|
30
30
|
name: t(),
|
|
31
31
|
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
@@ -53,7 +53,7 @@ const d = {
|
|
|
53
53
|
/** Display name for the current user */
|
|
54
54
|
username: e(t(), "Guido User"),
|
|
55
55
|
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
56
|
-
fallbackFont: e(
|
|
56
|
+
fallbackFont: e(I)
|
|
57
57
|
}), v = a({
|
|
58
58
|
/** Display text for the dynamic content */
|
|
59
59
|
text: t(),
|
|
@@ -76,14 +76,14 @@ const d = {
|
|
|
76
76
|
children: e(c(S)),
|
|
77
77
|
// eslint-disable-next-line camelcase -- backend field name
|
|
78
78
|
select_items: e(c(S))
|
|
79
|
-
})), E =
|
|
79
|
+
})), E = k(
|
|
80
80
|
t(),
|
|
81
81
|
C(c(S), [])
|
|
82
82
|
), P = g({
|
|
83
83
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
84
84
|
id: e(n()),
|
|
85
85
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
86
|
-
decimalCount: e(
|
|
86
|
+
decimalCount: e(f([t(), n()])),
|
|
87
87
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
88
88
|
productIds: e(c(s())),
|
|
89
89
|
/** Whether the block requested live products at send time */
|
|
@@ -117,7 +117,7 @@ const d = {
|
|
|
117
117
|
/** Block type marker used by some legacy variants */
|
|
118
118
|
blockType: e(t()),
|
|
119
119
|
/** Size variant marker (legacy data may use string or number) */
|
|
120
|
-
size: e(
|
|
120
|
+
size: e(f([t(), n()])),
|
|
121
121
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
122
122
|
verticalResponsiveness: e(o()),
|
|
123
123
|
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
@@ -132,7 +132,7 @@ const d = {
|
|
|
132
132
|
* strategy, currency, locale, and layout data.
|
|
133
133
|
*/
|
|
134
134
|
recommendationConfigs: e(
|
|
135
|
-
|
|
135
|
+
k(t(), P),
|
|
136
136
|
{}
|
|
137
137
|
)
|
|
138
138
|
}), M = a({
|
|
@@ -158,11 +158,6 @@ const d = {
|
|
|
158
158
|
selectedUnsubscribePages: e(c(n()), []),
|
|
159
159
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
160
160
|
forceRecreate: e(o(), !1),
|
|
161
|
-
/**
|
|
162
|
-
* Consumer-persisted tracking-id high-water mark (SD-141414). Used as the id floor
|
|
163
|
-
* during migration so a rolled-back document never re-mints retired tracking ids.
|
|
164
|
-
*/
|
|
165
|
-
trackIdCounter: e(n(), 0),
|
|
166
161
|
/** Migration-only inputs (legacy block configs) */
|
|
167
162
|
migration: e(D, {})
|
|
168
163
|
}), N = a({
|
|
@@ -180,9 +175,9 @@ const d = {
|
|
|
180
175
|
/** Email header settings */
|
|
181
176
|
emailHeader: e(N, { senderName: "", subject: "" }),
|
|
182
177
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
183
|
-
savedModulesFolderName: e(t(),
|
|
178
|
+
savedModulesFolderName: e(t(), y.SAVED_MODULES),
|
|
184
179
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
185
|
-
defaultModulesFolderName: e(t(),
|
|
180
|
+
defaultModulesFolderName: e(t(), y.DEFAULT_MODULES)
|
|
186
181
|
}), x = a({
|
|
187
182
|
/** Whether to show the header bar */
|
|
188
183
|
showHeader: e(o(), !0),
|
|
@@ -208,9 +203,7 @@ const d = {
|
|
|
208
203
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
209
204
|
autosave: e(o(), !1),
|
|
210
205
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
211
|
-
allowlistEnabled: e(o(), !1)
|
|
212
|
-
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
213
|
-
linkTrackingIds: e(o(), !1)
|
|
206
|
+
allowlistEnabled: e(o(), !1)
|
|
214
207
|
}), U = r([
|
|
215
208
|
"amp-accordion",
|
|
216
209
|
"amp-carousel",
|
|
@@ -278,7 +271,7 @@ const d = {
|
|
|
278
271
|
...m.entries,
|
|
279
272
|
type: i("custom"),
|
|
280
273
|
/** Custom processor function */
|
|
281
|
-
processor:
|
|
274
|
+
processor: h(
|
|
282
275
|
(u) => typeof u == "function",
|
|
283
276
|
"processor must be a function"
|
|
284
277
|
)
|
|
@@ -298,7 +291,7 @@ const d = {
|
|
|
298
291
|
* Return false to cancel the save operation.
|
|
299
292
|
*/
|
|
300
293
|
externalValidation: e(
|
|
301
|
-
|
|
294
|
+
h(
|
|
302
295
|
(u) => typeof u == "function",
|
|
303
296
|
"externalValidation must be a function"
|
|
304
297
|
)
|
|
@@ -306,7 +299,7 @@ const d = {
|
|
|
306
299
|
}), K = a({
|
|
307
300
|
// Required sections
|
|
308
301
|
/** Identity configuration (required) */
|
|
309
|
-
identity:
|
|
302
|
+
identity: A,
|
|
310
303
|
/** Partner configuration (required) */
|
|
311
304
|
partner: L,
|
|
312
305
|
// Optional sections (with defaults)
|
|
@@ -338,10 +331,10 @@ export {
|
|
|
338
331
|
v as DynamicContentSchema,
|
|
339
332
|
O as EditorSchema,
|
|
340
333
|
N as EmailHeaderSchema,
|
|
341
|
-
|
|
334
|
+
I as FallbackFontSchema,
|
|
342
335
|
F as FeaturesSchema,
|
|
343
336
|
K as GuidoConfigSchema,
|
|
344
|
-
|
|
337
|
+
A as IdentitySchema,
|
|
345
338
|
P as LegacyRecommendationConfigSchema,
|
|
346
339
|
d as MessageType,
|
|
347
340
|
L as PartnerSchema,
|
|
@@ -1,50 +1,49 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
4
|
-
import { useGuidoStateBridge as
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import { useStripo as
|
|
7
|
-
import { useTimerClone as
|
|
8
|
-
import { migrate as
|
|
1
|
+
import { defineComponent as q, defineAsyncComponent as M, ref as U, computed as _, watch as B, onMounted as K, onUnmounted as V } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as j } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as Q } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as X } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as Y } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as Z } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as I } from "../config/migrator/index.js";
|
|
9
9
|
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useStripoApi as
|
|
20
|
-
import { useConfigStore as
|
|
21
|
-
import { useDynamicContentStore as
|
|
22
|
-
import { useEditorStore as
|
|
23
|
-
import { usePreviewStore as
|
|
24
|
-
import { useTemplateStore as
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
|
|
27
|
-
const ze = /* @__PURE__ */ j({
|
|
10
|
+
import { RIBBON_SELECTOR as ee } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as te } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import oe from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import ne from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import se from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import ie from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ce from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as de } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as me } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as ue } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as pe } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
|
|
26
|
+
const xe = /* @__PURE__ */ q({
|
|
28
27
|
__name: "Guido",
|
|
29
28
|
props: {
|
|
30
29
|
config: null,
|
|
31
30
|
ready: { type: Boolean, default: !0 }
|
|
32
31
|
},
|
|
33
32
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
33
|
+
setup(P, { expose: A, emit: n }) {
|
|
34
|
+
const i = P, W = M(
|
|
36
35
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
),
|
|
36
|
+
), x = M(
|
|
38
37
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
),
|
|
40
|
-
|
|
41
|
-
const
|
|
38
|
+
), g = U(), l = U(), u = le(), S = fe(), o = me();
|
|
39
|
+
i.ready && o.init(i.config);
|
|
40
|
+
const d = O(), G = ue(), m = _(() => d.hasChanges), { isTestPartner: H } = X(), h = () => {
|
|
42
41
|
var t;
|
|
43
|
-
return (t =
|
|
42
|
+
return (t = g.value) == null ? void 0 : t.handleSave(!0);
|
|
44
43
|
}, b = (t) => {
|
|
45
|
-
|
|
44
|
+
d.loadingStatus = t;
|
|
46
45
|
};
|
|
47
|
-
|
|
46
|
+
j(), Q();
|
|
48
47
|
const p = () => {
|
|
49
48
|
var t, e;
|
|
50
49
|
return {
|
|
@@ -55,101 +54,96 @@ const ze = /* @__PURE__ */ j({
|
|
|
55
54
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
56
55
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
57
56
|
};
|
|
58
|
-
}, { initPlugin: E, preloadRuntime: w } =
|
|
57
|
+
}, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(), $ = _(() => {
|
|
59
58
|
var t;
|
|
60
59
|
return !((t = o.ui) != null && t.showHeader);
|
|
61
60
|
});
|
|
62
|
-
|
|
61
|
+
J({
|
|
63
62
|
onBack: () => {
|
|
64
|
-
console.debug("guido:back"),
|
|
63
|
+
console.debug("guido:back"), n("back");
|
|
65
64
|
},
|
|
66
65
|
onSaveStart: () => {
|
|
67
|
-
console.debug("guido:save:start"),
|
|
66
|
+
console.debug("guido:save:start"), n("save:start");
|
|
68
67
|
},
|
|
69
68
|
onSaveComplete: (t) => {
|
|
70
69
|
const e = { ...t, metadata: p() };
|
|
71
|
-
console.debug("guido:save:complete", e),
|
|
70
|
+
console.debug("guido:save:complete", e), n("save:complete", e);
|
|
72
71
|
},
|
|
73
72
|
onTestEmailClick: () => {
|
|
74
|
-
console.debug("guido:test-email:click"),
|
|
73
|
+
console.debug("guido:test-email:click"), n("test-email:click");
|
|
75
74
|
}
|
|
76
75
|
});
|
|
77
|
-
const
|
|
76
|
+
const L = (t) => {
|
|
78
77
|
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
79
|
-
},
|
|
78
|
+
}, R = () => {
|
|
80
79
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
81
80
|
};
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
B(() => m.value, () => {
|
|
82
|
+
n("on-change", m.value);
|
|
84
83
|
});
|
|
85
84
|
const f = (t) => {
|
|
86
|
-
const e = t, { attribute: s, position:
|
|
87
|
-
console.debug("dynamic-content:open", e.detail),
|
|
85
|
+
const e = t, { attribute: s, position: c } = e.detail;
|
|
86
|
+
console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s, c);
|
|
88
87
|
};
|
|
89
|
-
let
|
|
88
|
+
let a = null;
|
|
90
89
|
const y = () => {
|
|
91
90
|
var e;
|
|
92
|
-
const t = document.querySelector(
|
|
91
|
+
const t = document.querySelector(ee);
|
|
93
92
|
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
94
93
|
}, v = async () => {
|
|
95
94
|
var t;
|
|
96
95
|
try {
|
|
97
|
-
o.initialized || o.init(
|
|
98
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "",
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
o.initialized || o.init(i.config), d.templateId = o.templateId;
|
|
97
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", c = (e == null ? void 0 : e.css) || "", k = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
98
|
+
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
99
|
+
const F = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {};
|
|
100
|
+
let r = {
|
|
101
|
+
html: s && await I(s, F),
|
|
102
|
+
css: c
|
|
103
103
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
};
|
|
108
|
-
n.html || (n = await k(), n.html = await _(n.html, L, M));
|
|
109
|
-
const K = A(n.html);
|
|
110
|
-
D(n.html) && (n.html = await C(n.html)), c.trackIdSessionFloor = Math.max(K, A(n.html));
|
|
111
|
-
const V = {
|
|
112
|
-
preselectedDynamicContentList: F,
|
|
104
|
+
r.html || (r = await C(), r.html = await I(r.html, F)), T(r.html) && (r.html = await D(r.html));
|
|
105
|
+
const z = {
|
|
106
|
+
preselectedDynamicContentList: k,
|
|
113
107
|
onReady: () => {
|
|
114
|
-
console.debug("guido:ready"),
|
|
108
|
+
console.debug("guido:ready"), n("ready");
|
|
115
109
|
}
|
|
116
110
|
};
|
|
117
|
-
await E(
|
|
111
|
+
await E(r, p(), z), u.selectedDynamicContentList = k;
|
|
118
112
|
} catch (e) {
|
|
119
113
|
console.error("Failed to initialize Stripo editor:", e);
|
|
120
114
|
}
|
|
121
115
|
};
|
|
122
|
-
return
|
|
116
|
+
return K(async () => {
|
|
123
117
|
var e;
|
|
124
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
118
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), O().$reset(), pe().$reset(), y();
|
|
125
119
|
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
126
|
-
if (t && (
|
|
120
|
+
if (t && (a = new ResizeObserver(y), a.observe(t)), w(), i.ready)
|
|
127
121
|
await v();
|
|
128
122
|
else {
|
|
129
|
-
const s =
|
|
130
|
-
|
|
123
|
+
const s = B(() => i.ready, (c) => {
|
|
124
|
+
c && (s(), v());
|
|
131
125
|
});
|
|
132
126
|
}
|
|
133
127
|
document.addEventListener("dynamic-content:open", f);
|
|
134
|
-
}),
|
|
135
|
-
|
|
128
|
+
}), V(() => {
|
|
129
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f);
|
|
136
130
|
try {
|
|
137
131
|
window.UIEditor.removeEditor();
|
|
138
132
|
} catch {
|
|
139
133
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
140
134
|
}
|
|
141
135
|
o.reset();
|
|
142
|
-
}),
|
|
136
|
+
}), A({
|
|
143
137
|
dynamicContent: {
|
|
144
|
-
insert:
|
|
145
|
-
close:
|
|
138
|
+
insert: L,
|
|
139
|
+
close: R
|
|
146
140
|
},
|
|
147
141
|
hasChanges: m,
|
|
148
142
|
saveSilent: h,
|
|
149
143
|
setLoading: b
|
|
150
|
-
}), { __sfc: !0, PreviewContainer:
|
|
144
|
+
}), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: d, previewStore: G, hasChanges: m, isTestPartner: H, saveSilent: h, setLoading: b, emit: n, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: $, insertDynamicContent: L, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: oe, Toaster: ne, FilterSelectionDrawer: re, HeaderWrapper: se, LoadingWrapper: ie, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ce };
|
|
151
145
|
}
|
|
152
146
|
});
|
|
153
147
|
export {
|
|
154
|
-
|
|
148
|
+
xe as default
|
|
155
149
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { filterAmpErrors as
|
|
1
|
+
import { filterAmpErrors as w } from "../utils/ampErrorFilter.js";
|
|
2
2
|
import { useToaster as A } from "./useToaster.js";
|
|
3
|
-
const
|
|
4
|
-
const { handleError: n } = A(),
|
|
3
|
+
const D = () => {
|
|
4
|
+
const { handleError: n } = A(), s = (t = {}) => new Promise((e, a) => {
|
|
5
5
|
const o = { ...{
|
|
6
6
|
minimize: !0,
|
|
7
7
|
utmEntity: {
|
|
@@ -21,28 +21,28 @@ const p = 1e4, D = () => {
|
|
|
21
21
|
forceAmp: !1,
|
|
22
22
|
resetDataSavedFlag: !1,
|
|
23
23
|
disableLineHeightsReplace: !0
|
|
24
|
-
}, ...t },
|
|
25
|
-
callback: (r, d, c, u
|
|
24
|
+
}, ...t }, l = {
|
|
25
|
+
callback: (r, p, d, c, u) => {
|
|
26
26
|
r ? a(r) : e({
|
|
27
|
-
html:
|
|
28
|
-
ampHtml:
|
|
29
|
-
ampErrors:
|
|
30
|
-
displayConditions:
|
|
27
|
+
html: p,
|
|
28
|
+
ampHtml: d,
|
|
29
|
+
ampErrors: w(c ?? []),
|
|
30
|
+
displayConditions: u
|
|
31
31
|
});
|
|
32
32
|
},
|
|
33
33
|
...o
|
|
34
34
|
};
|
|
35
|
-
window.StripoEditorApi.actionsApi.compileEmail(
|
|
35
|
+
window.StripoEditorApi.actionsApi.compileEmail(l);
|
|
36
36
|
});
|
|
37
37
|
return {
|
|
38
|
-
getCompiledEmail:
|
|
38
|
+
getCompiledEmail: s,
|
|
39
39
|
getTemplateData: () => new Promise((t) => {
|
|
40
|
-
const e = ({ html: a, css: i, width: o, height:
|
|
40
|
+
const e = ({ html: a, css: i, width: o, height: m, utmParams: l, syncModulesIds: r }) => t({
|
|
41
41
|
html: a,
|
|
42
42
|
css: i,
|
|
43
43
|
width: o,
|
|
44
|
-
height:
|
|
45
|
-
utmParams:
|
|
44
|
+
height: m,
|
|
45
|
+
utmParams: l,
|
|
46
46
|
syncModulesIds: r
|
|
47
47
|
});
|
|
48
48
|
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
@@ -57,7 +57,7 @@ const p = 1e4, D = () => {
|
|
|
57
57
|
displayConditions: a,
|
|
58
58
|
ampHtml: i = "",
|
|
59
59
|
ampErrors: o = []
|
|
60
|
-
} = await
|
|
60
|
+
} = await s({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
61
61
|
return {
|
|
62
62
|
html: e,
|
|
63
63
|
ampHtml: i,
|
|
@@ -87,15 +87,9 @@ const p = 1e4, D = () => {
|
|
|
87
87
|
n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
|
|
88
88
|
}
|
|
89
89
|
}),
|
|
90
|
-
updateHtmlAndCss: (t, e) =>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
p
|
|
94
|
-
);
|
|
95
|
-
window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e, () => {
|
|
96
|
-
clearTimeout(o), a();
|
|
97
|
-
});
|
|
98
|
-
}),
|
|
90
|
+
updateHtmlAndCss: (t, e) => {
|
|
91
|
+
window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
|
|
92
|
+
},
|
|
99
93
|
editorSave: () => new Promise((t) => {
|
|
100
94
|
window.StripoEditorApi.actionsApi.save((e) => {
|
|
101
95
|
if (e) {
|
|
@@ -1,45 +1,43 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import { ref as
|
|
6
|
-
const E = 250, s =
|
|
7
|
-
const { updateHtmlAndCss: l } =
|
|
1
|
+
import { useActionsApi as T } from "./useActionsApi.js";
|
|
2
|
+
import { useToaster as f } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as y } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as n } from "../enums/toaster.js";
|
|
5
|
+
import { ref as v } from "vue";
|
|
6
|
+
const E = 250, s = v({}), o = {}, j = () => {
|
|
7
|
+
const { updateHtmlAndCss: l } = T(), { showToaster: p } = f(), i = y(), u = (e) => {
|
|
8
8
|
s.value[e] === void 0 && (s.value = { ...s.value, [e]: "pending" });
|
|
9
|
-
}, c = (e, t) => {
|
|
10
|
-
s.value = { ...s.value, [e]: "failed" }, r({
|
|
11
|
-
type: i.Error,
|
|
12
|
-
message: t instanceof Error ? t.message : "Failed to apply template"
|
|
13
|
-
});
|
|
14
|
-
}, m = (e, t, p) => {
|
|
9
|
+
}, c = (e, t, r) => {
|
|
15
10
|
s.value = { ...s.value, [e]: "applying" };
|
|
16
11
|
try {
|
|
17
|
-
l(t,
|
|
18
|
-
type:
|
|
19
|
-
message:
|
|
12
|
+
l(t, r), s.value = { ...s.value, [e]: "applied" }, p({
|
|
13
|
+
type: n.Success,
|
|
14
|
+
message: i("newsletter.ai-template-applied")
|
|
20
15
|
});
|
|
21
16
|
} catch (a) {
|
|
22
|
-
|
|
17
|
+
s.value = { ...s.value, [e]: "failed" }, p({
|
|
18
|
+
type: n.Error,
|
|
19
|
+
message: a instanceof Error ? a.message : "Failed to apply template"
|
|
20
|
+
});
|
|
23
21
|
}
|
|
24
|
-
},
|
|
22
|
+
}, m = (e) => {
|
|
25
23
|
const t = o[e];
|
|
26
24
|
t && (clearTimeout(t), delete o[e]);
|
|
27
25
|
};
|
|
28
|
-
return { applyStatus: s, markPending:
|
|
29
|
-
t.html && (
|
|
26
|
+
return { applyStatus: s, markPending: u, applyTemplate: (e, t) => {
|
|
27
|
+
t.html && (m(e), c(e, t.html, t.css ?? ""));
|
|
30
28
|
}, applyTemplateDebounced: (e, t) => {
|
|
31
29
|
if (!t.html)
|
|
32
30
|
return;
|
|
33
|
-
|
|
34
|
-
const { html:
|
|
31
|
+
m(e);
|
|
32
|
+
const { html: r } = t, a = t.css ?? "";
|
|
35
33
|
o[e] = setTimeout(() => {
|
|
36
|
-
delete o[e],
|
|
34
|
+
delete o[e], c(e, r, a);
|
|
37
35
|
}, E);
|
|
38
36
|
} };
|
|
39
|
-
},
|
|
37
|
+
}, k = () => {
|
|
40
38
|
Object.values(o).forEach(clearTimeout), Object.keys(o).forEach((l) => delete o[l]), s.value = {};
|
|
41
39
|
};
|
|
42
40
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
k as resetEmailTemplateApplier,
|
|
42
|
+
j as useEmailTemplateApplier
|
|
45
43
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import { migrateCouponBlock as
|
|
1
|
+
import { migrateCheckbox as t } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as i } from "./couponBlockMigrator.js";
|
|
3
3
|
import { migrateItemsBlock as e } from "./itemsBlockMigrator.js";
|
|
4
|
-
import { migrateRadioButton as
|
|
5
|
-
import { migrateRecommendation as
|
|
6
|
-
import { migrateSocialIcons as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return r = i(r), r = c(r), r = await p(r), r = a(r), r = g(r, t), r = e(r), r = n(r), m.linkTrackingIds && (r = f(r, m.trackIdFloor)), r;
|
|
4
|
+
import { migrateRadioButton as a } from "./radioButtonMigrator.js";
|
|
5
|
+
import { migrateRecommendation as c } from "./recommendationMigrator.js";
|
|
6
|
+
import { migrateSocialIcons as g } from "./socialIconMigrator.js";
|
|
7
|
+
import { migrateUnsubscribe as n } from "./unsubscribeMigrator.js";
|
|
8
|
+
const k = async (o, r = {}) => {
|
|
9
|
+
let m = o;
|
|
10
|
+
return m = t(m), m = a(m), m = await n(m), m = i(m), m = c(m, r), m = e(m), m = g(m), m;
|
|
12
11
|
};
|
|
13
12
|
export {
|
|
14
|
-
|
|
13
|
+
k as migrate
|
|
15
14
|
};
|
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-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{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-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[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-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{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-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-5079a1c8]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-5079a1c8]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-5079a1c8]{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-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{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-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}
|
package/dist/library.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { default as a } from "./components/Guido.vue.js";
|
|
2
|
-
import { MessageType as
|
|
2
|
+
import { MessageType as f, ProductType as t } from "./@types/config/schemas.js";
|
|
3
3
|
import "./@types/config/defaults.js";
|
|
4
|
-
import { getValidationErrors as
|
|
5
|
-
import { TRACK_ID_ATTRIBUTE as m, TRACK_SEQ_ATTRIBUTE as l, assignTrackingIds as x, readTrackSeq as A } from "./utils/linkTrackingIds.js";
|
|
4
|
+
import { getValidationErrors as s, isValidConfig as d, parseConfig as g, parseConfigSafe as n, validateConfig as l } from "./@types/config/validator.js";
|
|
6
5
|
export {
|
|
7
6
|
a as Guido,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
d as parseConfig,
|
|
16
|
-
g as parseConfigSafe,
|
|
17
|
-
A as readTrackSeq,
|
|
18
|
-
n as validateConfig
|
|
7
|
+
f as MessageType,
|
|
8
|
+
t as ProductType,
|
|
9
|
+
s as getValidationErrors,
|
|
10
|
+
d as isValidConfig,
|
|
11
|
+
g as parseConfig,
|
|
12
|
+
n as parseConfigSafe,
|
|
13
|
+
l as validateConfig
|
|
19
14
|
};
|