@useinsider/guido 3.6.0-beta.32a6a93 → 3.6.0-beta.3555230
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/README.md +0 -14
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +72 -75
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +6 -6
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +9 -9
- package/dist/composables/useHtmlCompiler.js +40 -22
- package/dist/guido.css +1 -1
- package/dist/src/components/Guido.vue.d.ts +0 -1
- package/dist/src/composables/useHtmlCompiler.d.ts +1 -0
- package/dist/utils/templatePreparation.js +53 -53
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -246,20 +246,6 @@ guidoRef.value?.dynamicContent.close();
|
|
|
246
246
|
|
|
247
247
|
// Silent save (no UI feedback)
|
|
248
248
|
guidoRef.value?.saveSilent();
|
|
249
|
-
|
|
250
|
-
// Control the editor's full-screen loader for flows Guido can't see.
|
|
251
|
-
// Guido shows the loader automatically for manual saves; use setLoading()
|
|
252
|
-
// when your app keeps the editor mounted after a save and needs to drive it:
|
|
253
|
-
|
|
254
|
-
// • Release the loader when a save is blocked/rejected and you stay in the
|
|
255
|
-
// editor (e.g. a post-save domain-allowlist error you surface in place),
|
|
256
|
-
// so the editor isn't left stuck on the spinner:
|
|
257
|
-
guidoRef.value?.setLoading(false);
|
|
258
|
-
|
|
259
|
-
// • Raise the loader to cover a host-initiated navigation (e.g. a
|
|
260
|
-
// save-and-leave flow) so the editor doesn't flash before your route
|
|
261
|
-
// changes — release it again if that save turns out to be blocked:
|
|
262
|
-
guidoRef.value?.setLoading(true);
|
|
263
249
|
```
|
|
264
250
|
|
|
265
251
|
---
|
|
@@ -1,72 +1,70 @@
|
|
|
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
|
|
9
|
-
import { ModuleFolderDefaults as
|
|
1
|
+
import { defineComponent as Q, defineAsyncComponent as N, ref as I, computed as W, watch as X, onMounted as Y, onUnmounted as Z } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ee } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as te } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as ne } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as re } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as se } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as x } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
10
10
|
import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useStripoApi as
|
|
11
|
+
import { useRecommendationExtensionStore as ae } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import ie from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import me from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import le from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import ue from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import pe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import fe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as ve } from "../services/stripoApi.js";
|
|
20
20
|
import { useConfigStore as ye } from "../stores/config.js";
|
|
21
|
-
import { useDynamicContentStore as
|
|
22
|
-
import { useEditorStore as
|
|
23
|
-
import { usePreviewStore as
|
|
21
|
+
import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as H } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as he } from "../stores/preview.js";
|
|
24
24
|
import { useTemplateStore as be } from "../stores/template.js";
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
const
|
|
25
|
+
import { useUnsubscribeStore as ge } from "../stores/unsubscribe.js";
|
|
26
|
+
const Ke = /* @__PURE__ */ Q({
|
|
27
27
|
__name: "Guido",
|
|
28
28
|
props: {
|
|
29
29
|
config: null
|
|
30
30
|
},
|
|
31
31
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
32
|
+
setup($, { expose: z, emit: n }) {
|
|
33
|
+
const g = $, q = N(
|
|
34
34
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
35
|
-
),
|
|
35
|
+
), K = N(
|
|
36
36
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
37
|
-
), E =
|
|
38
|
-
i.init(
|
|
39
|
-
const
|
|
37
|
+
), E = I(), u = I(), p = Se(), w = ge(), i = ye();
|
|
38
|
+
i.init(g.config);
|
|
39
|
+
const f = H(), V = he(), m = W(() => f.hasChanges), { isTestPartner: j } = ne(), D = () => {
|
|
40
40
|
var e;
|
|
41
41
|
return (e = E.value) == null ? void 0 : e.handleSave(!0);
|
|
42
|
-
}, C = (e) => {
|
|
43
|
-
m.loadingStatus = e;
|
|
44
42
|
}, {
|
|
45
43
|
templateId: v,
|
|
46
|
-
userId:
|
|
47
|
-
partnerName:
|
|
44
|
+
userId: C,
|
|
45
|
+
partnerName: T,
|
|
48
46
|
username: k,
|
|
49
47
|
template: o,
|
|
50
48
|
editor: s
|
|
51
|
-
} = i,
|
|
52
|
-
|
|
53
|
-
const
|
|
49
|
+
} = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) || G.SAVED_MODULES, U = (s == null ? void 0 : s.defaultModulesFolderName) || G.DEFAULT_MODULES;
|
|
50
|
+
ee(), te();
|
|
51
|
+
const S = {
|
|
54
52
|
emailId: v,
|
|
55
|
-
userId:
|
|
53
|
+
userId: C,
|
|
56
54
|
username: k,
|
|
57
|
-
partnerName:
|
|
58
|
-
savedModulesFolderName:
|
|
59
|
-
defaultModulesFolderName:
|
|
60
|
-
},
|
|
61
|
-
preselectedDynamicContentList:
|
|
55
|
+
partnerName: T,
|
|
56
|
+
savedModulesFolderName: L,
|
|
57
|
+
defaultModulesFolderName: U
|
|
58
|
+
}, _ = {
|
|
59
|
+
preselectedDynamicContentList: y,
|
|
62
60
|
onReady: () => {
|
|
63
61
|
console.debug("guido:ready"), n("ready");
|
|
64
62
|
}
|
|
65
|
-
}, { initPlugin:
|
|
63
|
+
}, { initPlugin: M } = re(S, _), { getDefaultTemplate: O } = ve(), { cloneTimersOnSave: P, hasTimerBlocks: R } = se(), J = W(() => {
|
|
66
64
|
var e;
|
|
67
65
|
return !((e = i.ui) != null && e.showHeader);
|
|
68
66
|
});
|
|
69
|
-
|
|
67
|
+
oe({
|
|
70
68
|
onBack: () => {
|
|
71
69
|
console.debug("guido:back"), n("back");
|
|
72
70
|
},
|
|
@@ -74,67 +72,66 @@ const Ve = /* @__PURE__ */ X({
|
|
|
74
72
|
console.debug("guido:save:start"), n("save:start");
|
|
75
73
|
},
|
|
76
74
|
onSaveComplete: (e) => {
|
|
77
|
-
const t = { ...e, metadata:
|
|
75
|
+
const t = { ...e, metadata: S };
|
|
78
76
|
console.debug("guido:save:complete", t), n("save:complete", t);
|
|
79
77
|
},
|
|
80
78
|
onTestEmailClick: () => {
|
|
81
79
|
console.debug("guido:test-email:click"), n("test-email:click");
|
|
82
80
|
}
|
|
83
81
|
});
|
|
84
|
-
const
|
|
85
|
-
console.debug("dynamic-content:close", e),
|
|
86
|
-
},
|
|
82
|
+
const A = (e) => {
|
|
83
|
+
console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
84
|
+
}, B = () => {
|
|
87
85
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
88
86
|
};
|
|
89
|
-
|
|
90
|
-
n("on-change",
|
|
87
|
+
X(() => m.value, () => {
|
|
88
|
+
n("on-change", m.value);
|
|
91
89
|
});
|
|
92
90
|
const h = (e) => {
|
|
93
|
-
const t = e, { attribute:
|
|
94
|
-
console.debug("dynamic-content:open", t.detail), n("dynamic-content:open",
|
|
91
|
+
const t = e, { attribute: l, position: a } = t.detail;
|
|
92
|
+
console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
|
|
95
93
|
};
|
|
96
|
-
let
|
|
97
|
-
const
|
|
94
|
+
let c = null;
|
|
95
|
+
const b = () => {
|
|
98
96
|
var t;
|
|
99
97
|
const e = document.querySelector(ce);
|
|
100
|
-
(t =
|
|
98
|
+
(t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
101
99
|
};
|
|
102
|
-
return
|
|
103
|
-
var t,
|
|
104
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
105
|
-
const e = (t =
|
|
106
|
-
e && (
|
|
100
|
+
return Y(async () => {
|
|
101
|
+
var t, l;
|
|
102
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ae().$reset(), H().$reset(), f.templateId = v, be().$reset(), b();
|
|
103
|
+
const e = (t = u.value) == null ? void 0 : t.parentElement;
|
|
104
|
+
e && (c = new ResizeObserver(b), c.observe(e));
|
|
107
105
|
try {
|
|
108
106
|
w.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
109
|
-
const
|
|
107
|
+
const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
|
|
110
108
|
let r = {
|
|
111
|
-
html:
|
|
109
|
+
html: d && await x(d, a),
|
|
112
110
|
css: F
|
|
113
111
|
};
|
|
114
|
-
r.html || (r = await
|
|
115
|
-
} catch (
|
|
116
|
-
console.error("Failed to initialize Stripo editor:",
|
|
112
|
+
r.html || (r = await O(), r.html = await x(r.html, a)), R(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
|
|
113
|
+
} catch (a) {
|
|
114
|
+
console.error("Failed to initialize Stripo editor:", a);
|
|
117
115
|
}
|
|
118
116
|
document.addEventListener("dynamic-content:open", h);
|
|
119
|
-
}),
|
|
120
|
-
|
|
117
|
+
}), Z(() => {
|
|
118
|
+
c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", h);
|
|
121
119
|
try {
|
|
122
120
|
window.UIEditor.removeEditor();
|
|
123
121
|
} catch {
|
|
124
122
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
125
123
|
}
|
|
126
124
|
i.reset();
|
|
127
|
-
}),
|
|
125
|
+
}), z({
|
|
128
126
|
dynamicContent: {
|
|
129
|
-
insert:
|
|
130
|
-
close:
|
|
127
|
+
insert: A,
|
|
128
|
+
close: B
|
|
131
129
|
},
|
|
132
|
-
hasChanges:
|
|
133
|
-
saveSilent: D
|
|
134
|
-
|
|
135
|
-
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: b, configStore: i, editorStore: m, previewStore: j, hasChanges: d, isTestPartner: J, saveSilent: D, setLoading: C, templateId: v, userId: T, partnerName: L, username: k, templateConfig: o, editorConfig: s, html: l, css: F, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: n, metadata: y, options: M, initPlugin: O, getDefaultTemplate: P, cloneTimersOnSave: R, hasTimerBlocks: A, noHeader: Q, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: h, ribbonObserver: a, updateRibbonOffset: g, AutoSaveController: me, Toaster: de, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ve };
|
|
130
|
+
hasChanges: m,
|
|
131
|
+
saveSilent: D
|
|
132
|
+
}), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: E, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: w, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: j, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: S, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: R, noHeader: J, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: h, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: ie, Toaster: me, FilterSelectionDrawer: de, HeaderWrapper: le, LoadingWrapper: ue, SaveAsTemplateDrawer: pe, UnsubscribeWrapper: fe };
|
|
136
133
|
}
|
|
137
134
|
});
|
|
138
135
|
export {
|
|
139
|
-
|
|
136
|
+
Ke as default
|
|
140
137
|
};
|
|
@@ -17,7 +17,7 @@ import K from "./MigrationConfirmModal.vue.js";
|
|
|
17
17
|
const ut = /* @__PURE__ */ O({
|
|
18
18
|
__name: "EditorActions",
|
|
19
19
|
setup(N, { expose: x }) {
|
|
20
|
-
const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations:
|
|
20
|
+
const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations: S } = J(y), s = L(), i = n(!1), r = n(!1), g = n(), H = B(), T = () => {
|
|
21
21
|
if (e.isVersionHistoryOpen) {
|
|
22
22
|
p();
|
|
23
23
|
return;
|
|
@@ -33,13 +33,13 @@ const ut = /* @__PURE__ */ O({
|
|
|
33
33
|
return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
34
34
|
}
|
|
35
35
|
), V = async (t) => {
|
|
36
|
-
r.value = !0,
|
|
36
|
+
r.value = !0, e.loadingStatus = !0;
|
|
37
37
|
const o = await u(t);
|
|
38
|
-
return r.value = !1,
|
|
38
|
+
return r.value = !1, (t || !o) && (e.loadingStatus = !1), o;
|
|
39
39
|
}, E = (t) => {
|
|
40
40
|
var o;
|
|
41
|
-
if (!t &&
|
|
42
|
-
(o =
|
|
41
|
+
if (!t && S.value) {
|
|
42
|
+
(o = g.value) == null || o.open();
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
return V(t);
|
|
@@ -58,7 +58,7 @@ const ut = /* @__PURE__ */ O({
|
|
|
58
58
|
};
|
|
59
59
|
return x({
|
|
60
60
|
handleSave: E
|
|
61
|
-
}), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations:
|
|
61
|
+
}), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations: S, trans: s, isExporting: i, isSaving: r, migrationModalRef: g, testEmailClick: H, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
export {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as l, computed as
|
|
1
|
+
import { defineComponent as l, computed as d, ref as p } from "vue";
|
|
2
2
|
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useBack as B } from "../../../composables/useGuidoActions.js";
|
|
4
4
|
import { usePreviewMode as b } from "../../../composables/usePreviewMode.js";
|
|
5
5
|
import { useTranslations as v } from "../../../composables/useTranslations.js";
|
|
6
6
|
import { useVersionHistoryApi as _ } from "../../../composables/useVersionHistoryApi.js";
|
|
7
7
|
import { useEditorStore as V } from "../../../stores/editor.js";
|
|
8
|
-
import { InButtonV2 as
|
|
9
|
-
import { useDebounceFn as
|
|
8
|
+
import { InButtonV2 as g } from "@useinsider/design-system-vue";
|
|
9
|
+
import { useDebounceFn as w } from "../../../node_modules/@vueuse/shared/index.js";
|
|
10
10
|
const D = /* @__PURE__ */ l({
|
|
11
11
|
__name: "LeftSlot",
|
|
12
|
-
setup(
|
|
13
|
-
const e = V(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), f =
|
|
12
|
+
setup(y) {
|
|
13
|
+
const e = V(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), f = d(() => {
|
|
14
14
|
var u, m;
|
|
15
15
|
return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (m = (u = t.value) == null ? void 0 : u.ui) != null && m.backButtonLabel ? t.value.ui.backButtonLabel : o("email-editor.back-to-design");
|
|
16
|
-
}), r =
|
|
16
|
+
}), r = p(!1), c = () => {
|
|
17
17
|
if (e.isVersionHistoryOpen) {
|
|
18
18
|
n();
|
|
19
19
|
return;
|
|
@@ -22,13 +22,13 @@ const D = /* @__PURE__ */ l({
|
|
|
22
22
|
s();
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
i();
|
|
26
|
-
}, a =
|
|
25
|
+
e.loadingStatus = !0, i();
|
|
26
|
+
}, a = w(() => {
|
|
27
27
|
c(), r.value = !1;
|
|
28
28
|
}, 500);
|
|
29
29
|
return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel: f, isBackButtonDisabled: r, executeBackAction: c, debouncedBackAction: a, handleBackClick: () => {
|
|
30
30
|
r.value = !0, a();
|
|
31
|
-
}, InButtonV2:
|
|
31
|
+
}, InButtonV2: g };
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
@@ -1,30 +1,48 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import { liquidCompilerRules as
|
|
4
|
-
import { outlookCompilerRules as
|
|
5
|
-
import { recommendationCompilerRules as
|
|
6
|
-
import { socialCompilerRules as
|
|
7
|
-
import { unsubscribeCompilerRules as
|
|
8
|
-
import { createHtmlCompiler as
|
|
9
|
-
import { useConfig as
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { defaultHtmlCompilerRules as R } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as g } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { liquidCompilerRules as C } from "../config/compiler/liquidCompilerRules.js";
|
|
4
|
+
import { outlookCompilerRules as b } from "../config/compiler/outlookCompilerRules.js";
|
|
5
|
+
import { recommendationCompilerRules as v } from "../config/compiler/recommendationCompilerRules.js";
|
|
6
|
+
import { socialCompilerRules as H } from "../config/compiler/socialCompilerRules.js";
|
|
7
|
+
import { unsubscribeCompilerRules as x } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
8
|
+
import { createHtmlCompiler as s } from "../utils/htmlCompiler.js";
|
|
9
|
+
import { useConfig as k } from "./useConfig.js";
|
|
10
|
+
const y = /* @__PURE__ */ new Set([
|
|
11
|
+
// URL/tag encoding fixes — keep merge-tag and placeholder integrity intact.
|
|
12
|
+
"fix-url-encoding-start",
|
|
13
|
+
"fix-url-encoding-end",
|
|
14
|
+
"fix-tags-start",
|
|
15
|
+
"fix-tags-end",
|
|
16
|
+
// Image domain corrections — plain string replacement.
|
|
17
|
+
"replace-old-image-domain",
|
|
18
|
+
"replace-old-v2-image-domain",
|
|
19
|
+
// Unsubscribe domain — the actual fix: injects the real unsubscribe href in
|
|
20
|
+
// place of the `{{ins-*-unsubscribe-link}}` placeholders, plus related
|
|
21
|
+
// unsubscribe-only cleanups. All pure regex/text, no AMP-forbidden output.
|
|
22
|
+
"add-unsubscribe-link-values",
|
|
23
|
+
"remove-data-ogsb-button-styles",
|
|
24
|
+
"format-comment-braces",
|
|
25
|
+
"add-universal-link-flags",
|
|
26
|
+
// Coupon placeholder replacement (only present when liquidSyntax is enabled).
|
|
27
|
+
"liquid-coupon-code"
|
|
28
|
+
]), M = () => {
|
|
29
|
+
var m, t, r;
|
|
30
|
+
const { compiler: e, isFeatureEnabled: a, partner: n } = k(), u = ((m = e.value) == null ? void 0 : m.customRules) || [], l = [
|
|
31
|
+
...!!((t = e.value) != null && t.ignoreDefaultRules) ? [] : R,
|
|
32
|
+
...v,
|
|
33
|
+
...x,
|
|
15
34
|
...g,
|
|
16
|
-
...f,
|
|
17
|
-
...C,
|
|
18
35
|
...b,
|
|
19
|
-
...
|
|
20
|
-
...
|
|
36
|
+
...H,
|
|
37
|
+
...a("liquidSyntax") ? C : [],
|
|
38
|
+
...u.map((o, f) => ({
|
|
21
39
|
...o,
|
|
22
|
-
priority: o.priority + 1e3 +
|
|
40
|
+
priority: o.priority + 1e3 + f
|
|
23
41
|
// Ensure additional rules run after default rules
|
|
24
42
|
}))
|
|
25
|
-
], p =
|
|
26
|
-
return { compileHtml: (o) => p.compile(o, void 0,
|
|
43
|
+
], p = s(l), c = l.filter((o) => y.has(o.id)), d = s(c), i = (r = n.value) == null ? void 0 : r.fallbackFont;
|
|
44
|
+
return { compileHtml: (o) => p.compile(o, void 0, i), compileAmpHtml: (o) => d.compile(o, void 0, i) };
|
|
27
45
|
};
|
|
28
46
|
export {
|
|
29
|
-
|
|
47
|
+
M as useHtmlCompiler
|
|
30
48
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-cd76c125] .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-4e2a4adb]{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-b293a2b0]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-b293a2b0]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-b293a2b0]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-df672485]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-df672485]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-df672485]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-df672485]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-df672485]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .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-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{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}
|
|
@@ -12,7 +12,6 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
12
12
|
};
|
|
13
13
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
14
14
|
saveSilent: () => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
15
|
-
setLoading: (value: boolean) => void;
|
|
16
15
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
17
16
|
"dynamic-content:open": (detail: {
|
|
18
17
|
text: string;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { DEFAULT_CURRENCY as
|
|
1
|
+
import { useActionsApi as D } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as P } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { DEFAULT_CURRENCY as p, DEFAULT_NODE_CONFIG as i } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
4
4
|
import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
5
|
import { DATA_ATTRIBUTES as S } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
-
import { parsePageList as
|
|
7
|
-
import { useDynamicContentStore as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
9
|
-
function
|
|
10
|
-
const t = new DOMParser().parseFromString(
|
|
11
|
-
return t.forEach((
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
}),
|
|
6
|
+
import { parsePageList as w } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
7
|
+
import { useDynamicContentStore as E } from "../stores/dynamic-content.js";
|
|
8
|
+
import { useUnsubscribeStore as H } from "../stores/unsubscribe.js";
|
|
9
|
+
function U(s, r) {
|
|
10
|
+
const t = new DOMParser().parseFromString(s, "text/html").querySelectorAll(`[${S.PAGE_LIST}]`), o = [];
|
|
11
|
+
return t.forEach((a) => {
|
|
12
|
+
const n = a.getAttribute(S.PAGE_LIST);
|
|
13
|
+
n && o.push(...w(n));
|
|
14
|
+
}), r.filter((a) => o.includes(a));
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
17
|
-
const m = new DOMParser().parseFromString(
|
|
16
|
+
async function F(s) {
|
|
17
|
+
const m = new DOMParser().parseFromString(s, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
18
18
|
if (m.length === 0)
|
|
19
19
|
return;
|
|
20
20
|
const l = b();
|
|
21
21
|
m.forEach((t) => {
|
|
22
|
-
var g, f,
|
|
23
|
-
const
|
|
24
|
-
if (!Number.isFinite(
|
|
22
|
+
var u, g, f, d, c;
|
|
23
|
+
const o = t.getAttribute("recommendation-id"), a = o ? Number(o) : NaN;
|
|
24
|
+
if (!Number.isFinite(a))
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
26
|
+
const n = t.getAttribute("esd-ext-config");
|
|
27
|
+
if (!n)
|
|
28
28
|
return;
|
|
29
29
|
let e;
|
|
30
30
|
try {
|
|
31
|
-
e = JSON.parse(
|
|
31
|
+
e = JSON.parse(n);
|
|
32
32
|
} catch {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
36
36
|
return;
|
|
37
|
-
const
|
|
38
|
-
strategy: e.strategy ??
|
|
39
|
-
language: e.language ??
|
|
40
|
-
size: e.size ??
|
|
37
|
+
const y = {
|
|
38
|
+
strategy: e.strategy ?? i.strategy,
|
|
39
|
+
language: e.language ?? i.language,
|
|
40
|
+
size: e.size ?? i.size,
|
|
41
41
|
// Spread the default arrays so each block gets a fresh reference
|
|
42
42
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
43
|
-
productIds: e.productIds ?? [...
|
|
44
|
-
filters: e.filters ?? [...
|
|
45
|
-
shuffleProducts: e.shuffleProducts ??
|
|
46
|
-
currencyCode: ((
|
|
47
|
-
currencyAlignment: ((
|
|
48
|
-
currencyDecimalCount: ((
|
|
49
|
-
currencyDecimalSeparator: ((
|
|
50
|
-
currencyThousandSeparator: ((
|
|
43
|
+
productIds: e.productIds ?? [...i.productIds],
|
|
44
|
+
filters: e.filters ?? [...i.filters],
|
|
45
|
+
shuffleProducts: e.shuffleProducts ?? i.shuffleProducts,
|
|
46
|
+
currencyCode: ((u = e.currency) == null ? void 0 : u.code) ?? p.code,
|
|
47
|
+
currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? p.alignment,
|
|
48
|
+
currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? p.decimalCount,
|
|
49
|
+
currencyDecimalSeparator: ((d = e.currency) == null ? void 0 : d.decimalSeparator) ?? p.decimalSeparator,
|
|
50
|
+
currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? p.thousandSeparator
|
|
51
51
|
};
|
|
52
|
-
l.seedBlockUrlConfig(
|
|
52
|
+
l.seedBlockUrlConfig(a, y);
|
|
53
53
|
});
|
|
54
54
|
try {
|
|
55
55
|
await l.fetchRecommendationCreateData();
|
|
@@ -60,42 +60,42 @@ async function U(i) {
|
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
const
|
|
64
|
-
const
|
|
63
|
+
const O = () => {
|
|
64
|
+
const s = E(), r = H(), { getCompiledEmail: m, getTemplateData: l } = D(), { compileHtml: t, compileAmpHtml: o } = P();
|
|
65
65
|
return {
|
|
66
66
|
prepareTemplateDetails: async () => {
|
|
67
|
-
const { html:
|
|
67
|
+
const { html: n, ampHtml: e = "", ampErrors: y = [] } = await m({
|
|
68
68
|
minimize: !0,
|
|
69
69
|
resetDataSavedFlag: !1
|
|
70
|
-
}), { html:
|
|
71
|
-
|
|
72
|
-
const { compiledHtml:
|
|
70
|
+
}), { html: u, css: g, syncModulesIds: f = [] } = await l();
|
|
71
|
+
r.selectedUnsubscribePages.length && await r.fetchTemplates(), await F(u);
|
|
72
|
+
const { compiledHtml: d, stats: c, appliedRules: h } = t(n), A = e && o(e).compiledHtml, C = s.getSelectedDynamicContentList, T = b();
|
|
73
73
|
return console.debug("HTML Compilation Stats:", {
|
|
74
|
-
originalSize:
|
|
75
|
-
compiledSize:
|
|
76
|
-
reduction: `${
|
|
77
|
-
appliedRules:
|
|
78
|
-
executionTime: `${
|
|
74
|
+
originalSize: c.originalSize,
|
|
75
|
+
compiledSize: c.compiledSize,
|
|
76
|
+
reduction: `${c.reductionPercentage.toFixed(2)}%`,
|
|
77
|
+
appliedRules: h,
|
|
78
|
+
executionTime: `${c.executionTime.toFixed(2)}ms`
|
|
79
79
|
}), {
|
|
80
|
-
dynamicContentList:
|
|
81
|
-
compiledHtml:
|
|
82
|
-
rawHtml:
|
|
80
|
+
dynamicContentList: C,
|
|
81
|
+
compiledHtml: d,
|
|
82
|
+
rawHtml: u,
|
|
83
83
|
css: g,
|
|
84
|
-
ampHtml:
|
|
85
|
-
ampErrors:
|
|
84
|
+
ampHtml: A,
|
|
85
|
+
ampErrors: y,
|
|
86
86
|
modules: f.map(Number),
|
|
87
87
|
recommendation: {
|
|
88
|
-
campaignUrls:
|
|
88
|
+
campaignUrls: T.recommendationCampaignUrls,
|
|
89
89
|
configs: {}
|
|
90
90
|
},
|
|
91
91
|
unsubscribe: {
|
|
92
|
-
status:
|
|
93
|
-
config:
|
|
92
|
+
status: r.unsubscribePagesStatus,
|
|
93
|
+
config: U(d, r.selectedUnsubscribePages)
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
export {
|
|
100
|
-
|
|
100
|
+
O as useTemplatePreparation
|
|
101
101
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.3555230",
|
|
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",
|