@useinsider/guido 3.1.1-beta.e00a22b → 3.1.1-beta.e4b695a
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 -1
- package/dist/@types/config/schemas.js +7 -9
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +35 -45
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -16
- package/dist/composables/useHtmlCompiler.js +16 -18
- package/dist/composables/useSave.js +17 -23
- package/dist/composables/useStripo.js +41 -44
- package/dist/enums/extensions/recommendationBlock.js +14 -11
- package/dist/extensions/Blocks/CouponBlock/template.js +13 -24
- package/dist/extensions/DynamicContent/dynamic-content.js +12 -17
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +12 -14
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +0 -2
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/utils/genericUtil.js +20 -42
- package/package.json +1 -2
- package/dist/composables/validators/useLiquidValidator.js +0 -42
- package/dist/config/compiler/liquidCompilerRules.js +0 -15
- package/dist/src/composables/validators/useLiquidValidator.d.ts +0 -3
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +0 -2
package/README.md
CHANGED
|
@@ -143,7 +143,6 @@ const config: GuidoConfigInput = {
|
|
|
143
143
|
displayConditions?: boolean, // Default: true
|
|
144
144
|
unsubscribe?: boolean, // Default: true
|
|
145
145
|
modulesDisabled?: boolean, // Default: false - Disable modules panel
|
|
146
|
-
liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
|
|
147
146
|
},
|
|
148
147
|
|
|
149
148
|
// Optional: Callbacks
|
|
@@ -121,9 +121,7 @@ const m = {
|
|
|
121
121
|
/** Enable unsubscribe block */
|
|
122
122
|
unsubscribe: e(a(), !0),
|
|
123
123
|
/** Disable modules panel in the editor */
|
|
124
|
-
modulesDisabled: e(a(), !1)
|
|
125
|
-
/** Enable Liquid template syntax */
|
|
126
|
-
liquidSyntax: e(a(), !1)
|
|
124
|
+
modulesDisabled: e(a(), !1)
|
|
127
125
|
}), g = n([
|
|
128
126
|
"amp-accordion",
|
|
129
127
|
"amp-carousel",
|
|
@@ -195,14 +193,14 @@ const m = {
|
|
|
195
193
|
(i) => typeof i == "function",
|
|
196
194
|
"processor must be a function"
|
|
197
195
|
)
|
|
198
|
-
}),
|
|
196
|
+
}), U = k("type", [
|
|
199
197
|
M,
|
|
200
198
|
N,
|
|
201
199
|
D,
|
|
202
200
|
v
|
|
203
|
-
]),
|
|
201
|
+
]), x = o({
|
|
204
202
|
/** Custom compiler rules to apply */
|
|
205
|
-
customRules: e(c(
|
|
203
|
+
customRules: e(c(U), []),
|
|
206
204
|
/** Skip default compiler rules */
|
|
207
205
|
ignoreDefaultRules: e(a(), !1)
|
|
208
206
|
}), B = o({
|
|
@@ -234,15 +232,15 @@ const m = {
|
|
|
234
232
|
/** Block configuration */
|
|
235
233
|
blocks: e(L, {}),
|
|
236
234
|
/** Compiler configuration */
|
|
237
|
-
compiler: e(
|
|
235
|
+
compiler: e(x, {}),
|
|
238
236
|
/** Callbacks and event handlers */
|
|
239
237
|
callbacks: e(B, {})
|
|
240
238
|
});
|
|
241
239
|
export {
|
|
242
240
|
L as BlocksSchema,
|
|
243
241
|
B as CallbacksSchema,
|
|
244
|
-
|
|
245
|
-
|
|
242
|
+
U as CompilerRuleSchema,
|
|
243
|
+
x as CompilerSchema,
|
|
246
244
|
O as CustomBlockTypeSchema,
|
|
247
245
|
v as CustomRuleSchema,
|
|
248
246
|
g as DefaultBlockTypeSchema,
|
|
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
|
4
4
|
var u = function() {
|
|
5
5
|
var s, i, n, a;
|
|
6
6
|
var o = this, e = o._self._c, t = o._self._setupProxy;
|
|
7
|
-
return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.
|
|
7
|
+
return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.testEmailClick } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
|
|
8
8
|
return t.handleSave(!1);
|
|
9
9
|
} } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
|
|
10
10
|
return t.executeSave(!1);
|
|
@@ -15,7 +15,7 @@ var u = function() {
|
|
|
15
15
|
p,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"acff76a8"
|
|
19
19
|
);
|
|
20
20
|
const v = c.exports;
|
|
21
21
|
export {
|
|
@@ -1,61 +1,51 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
import { storeToRefs as J } from "pinia";
|
|
16
|
-
import K from "./MigrationConfirmModal.vue.js";
|
|
17
|
-
const ct = /* @__PURE__ */ O({
|
|
1
|
+
import { defineComponent as E, ref as n, computed as g } from "vue";
|
|
2
|
+
import { useConfig as w } from "../../../composables/useConfig.js";
|
|
3
|
+
import { useExport as C } from "../../../composables/useExport.js";
|
|
4
|
+
import { useTestEmailClick as M } from "../../../composables/useGuidoActions.js";
|
|
5
|
+
import { useSave as O } from "../../../composables/useSave.js";
|
|
6
|
+
import { useTranslations as A } from "../../../composables/useTranslations.js";
|
|
7
|
+
import { useVersionHistoryApi as k } from "../../../composables/useVersionHistoryApi.js";
|
|
8
|
+
import { useEditorStore as B } from "../../../stores/editor.js";
|
|
9
|
+
import { useTemplateStore as R } from "../../../stores/template.js";
|
|
10
|
+
import { getTooltipOptions as b } from "../../../utils/tooltipUtils.js";
|
|
11
|
+
import { InButtonV2 as D } from "@useinsider/design-system-vue";
|
|
12
|
+
import { storeToRefs as I } from "pinia";
|
|
13
|
+
import P from "./MigrationConfirmModal.vue.js";
|
|
14
|
+
const Z = /* @__PURE__ */ E({
|
|
18
15
|
__name: "EditorActions",
|
|
19
|
-
setup(
|
|
20
|
-
const { config: a
|
|
16
|
+
setup(j, { expose: H }) {
|
|
17
|
+
const { config: a } = w(), { exportHtml: m } = C(), { save: p } = O(), { openVersionHistory: l, closeVersionHistory: u } = k(), e = B(), c = R(), { hasMigrations: f } = I(c), r = A(), s = n(!1), i = n(!1), v = n(), S = M(), V = () => {
|
|
21
18
|
if (e.isVersionHistoryOpen) {
|
|
22
19
|
u();
|
|
23
20
|
return;
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
22
|
+
l();
|
|
23
|
+
}, T = async () => {
|
|
24
|
+
s.value = !0, await m(), s.value = !1;
|
|
28
25
|
}, _ = () => {
|
|
29
26
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
30
|
-
},
|
|
27
|
+
}, h = g(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), x = g(
|
|
31
28
|
() => {
|
|
32
|
-
var
|
|
33
|
-
return ((
|
|
29
|
+
var o, t;
|
|
30
|
+
return ((t = (o = a.value) == null ? void 0 : o.features) == null ? void 0 : t.versionHistory) && !e.isPreviewModeOpen;
|
|
34
31
|
}
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
-
},
|
|
40
|
-
var
|
|
41
|
-
if (!
|
|
42
|
-
(
|
|
32
|
+
), d = async (o) => {
|
|
33
|
+
i.value = !0, e.loadingStatus = !0;
|
|
34
|
+
const t = await p(o);
|
|
35
|
+
return i.value = !1, (o || !t) && (e.loadingStatus = !1), t;
|
|
36
|
+
}, y = (o) => {
|
|
37
|
+
var t;
|
|
38
|
+
if (!o && f.value) {
|
|
39
|
+
(t = v.value) == null || t.open();
|
|
43
40
|
return;
|
|
44
41
|
}
|
|
45
|
-
return
|
|
46
|
-
}, M = async () => {
|
|
47
|
-
if (m("liquidSyntax")) {
|
|
48
|
-
const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
|
|
49
|
-
if (!await v(o))
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
g();
|
|
42
|
+
return d(o);
|
|
53
43
|
};
|
|
54
|
-
return
|
|
55
|
-
handleSave:
|
|
56
|
-
}), { __sfc: !0, config: a,
|
|
44
|
+
return H({
|
|
45
|
+
handleSave: y
|
|
46
|
+
}), { __sfc: !0, config: a, exportHtml: m, save: p, openVersionHistory: l, closeVersionHistory: u, editorStore: e, templateStore: c, hasMigrations: f, trans: r, isExporting: s, isSaving: i, migrationModalRef: v, testEmailClick: S, handleVersionHistory: V, handleExport: T, handleSaveAs: _, versionHistoryTooltipText: h, isVersionHistoryButtonVisible: x, executeSave: d, handleSave: y, getTooltipOptions: b, InButtonV2: D, MigrationConfirmModal: P };
|
|
57
47
|
}
|
|
58
48
|
});
|
|
59
49
|
export {
|
|
60
|
-
|
|
50
|
+
Z as default
|
|
61
51
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return
|
|
6
|
-
},
|
|
7
|
-
i,
|
|
1
|
+
import o from "./RightSlot.vue2.js";
|
|
2
|
+
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var n = function() {
|
|
4
|
+
var r = this, t = r._self._c, e = r._self._setupProxy;
|
|
5
|
+
return t("div", { staticClass: "d-f" }, [e.editorStore.isVersionHistoryOpen ? t(e.RestoreButton) : t(e.EditorActions, { ref: "editorActionsRef" })], 1);
|
|
6
|
+
}, i = [], _ = /* @__PURE__ */ s(
|
|
8
7
|
o,
|
|
9
|
-
|
|
8
|
+
n,
|
|
9
|
+
i,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const l = _.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
l as default
|
|
17
17
|
};
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import _ from "./EditorActions.vue.js";
|
|
7
|
-
import S from "./version-history/RestoreButton.vue.js";
|
|
8
|
-
const x = /* @__PURE__ */ a({
|
|
1
|
+
import { defineComponent as i, ref as s } from "vue";
|
|
2
|
+
import { useEditorStore as m } from "../../../stores/editor.js";
|
|
3
|
+
import f from "./EditorActions.vue.js";
|
|
4
|
+
import a from "./version-history/RestoreButton.vue.js";
|
|
5
|
+
const l = /* @__PURE__ */ i({
|
|
9
6
|
__name: "RightSlot",
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
handleSave: (
|
|
14
|
-
var
|
|
15
|
-
return (
|
|
7
|
+
setup(p, { expose: e }) {
|
|
8
|
+
const r = m(), o = s(null);
|
|
9
|
+
return e({
|
|
10
|
+
handleSave: (n) => {
|
|
11
|
+
var t;
|
|
12
|
+
return (t = o.value) == null ? void 0 : t.handleSave(n);
|
|
16
13
|
}
|
|
17
|
-
}), { __sfc: !0,
|
|
14
|
+
}), { __sfc: !0, editorStore: r, editorActionsRef: o, EditorActions: f, RestoreButton: a };
|
|
18
15
|
}
|
|
19
16
|
});
|
|
20
17
|
export {
|
|
21
|
-
|
|
18
|
+
l as default
|
|
22
19
|
};
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { socialCompilerRules as b } from "../config/compiler/socialCompilerRules.js";
|
|
1
|
+
import { defaultHtmlCompilerRules as n } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as a } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { outlookCompilerRules as f } from "../config/compiler/outlookCompilerRules.js";
|
|
4
|
+
import { recommendationCompilerRules as R } from "../config/compiler/recommendationCompilerRules.js";
|
|
5
|
+
import { socialCompilerRules as C } from "../config/compiler/socialCompilerRules.js";
|
|
7
6
|
import { unsubscribeCompilerRules as g } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
8
7
|
import { createHtmlCompiler as H } from "../utils/htmlCompiler.js";
|
|
9
|
-
import { useConfig as
|
|
10
|
-
const
|
|
8
|
+
import { useConfig as b } from "./useConfig.js";
|
|
9
|
+
const q = () => {
|
|
11
10
|
var l, m, r;
|
|
12
|
-
const { compiler: e,
|
|
13
|
-
...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] :
|
|
14
|
-
...
|
|
11
|
+
const { compiler: e, partner: t } = b(), i = ((l = e.value) == null ? void 0 : l.customRules) || [], s = [
|
|
12
|
+
...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] : n,
|
|
13
|
+
...R,
|
|
15
14
|
...g,
|
|
15
|
+
...a,
|
|
16
16
|
...f,
|
|
17
17
|
...C,
|
|
18
|
-
...
|
|
19
|
-
...t("liquidSyntax") ? R : [],
|
|
20
|
-
...s.map((o, a) => ({
|
|
18
|
+
...i.map((o, c) => ({
|
|
21
19
|
...o,
|
|
22
|
-
priority: o.priority + 1e3 +
|
|
20
|
+
priority: o.priority + 1e3 + c
|
|
23
21
|
// Ensure additional rules run after default rules
|
|
24
22
|
}))
|
|
25
|
-
], p = H(
|
|
26
|
-
return { compileHtml: (o) => p.compile(o, void 0,
|
|
23
|
+
], p = H(s), u = (r = t.value) == null ? void 0 : r.fallbackFont;
|
|
24
|
+
return { compileHtml: (o) => p.compile(o, void 0, u) };
|
|
27
25
|
};
|
|
28
26
|
export {
|
|
29
|
-
|
|
27
|
+
q as useHtmlCompiler
|
|
30
28
|
};
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useSaveStart as
|
|
4
|
-
import { useSyncModuleExtractor as
|
|
5
|
-
import { useStripoApi as
|
|
6
|
-
import { useTemplatePreparation as
|
|
7
|
-
import { useHtmlValidator as
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var i;
|
|
1
|
+
import { useActionsApi as d } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as f } from "./useConfig.js";
|
|
3
|
+
import { useSaveStart as v, useSaveComplete as S } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as x } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { useStripoApi as V } from "../services/stripoApi.js";
|
|
6
|
+
import { useTemplatePreparation as y } from "../utils/templatePreparation.js";
|
|
7
|
+
import { useHtmlValidator as w } from "./useHtmlValidator.js";
|
|
8
|
+
const k = () => {
|
|
9
|
+
const o = v(), s = S(), { validateHtml: i } = w(), { callbacks: a } = f(), { extractSyncModuleData: r } = x(), { setSyncModuleUnsubscriptionPages: n } = V(), { editorSave: l } = d();
|
|
10
|
+
return { save: async (c = !1) => {
|
|
11
|
+
var e;
|
|
13
12
|
o();
|
|
14
|
-
const { prepareTemplateDetails:
|
|
15
|
-
if (
|
|
16
|
-
if (!await n(t.compiledHtml))
|
|
17
|
-
return;
|
|
18
|
-
} else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
|
|
13
|
+
const { prepareTemplateDetails: m } = y(), t = await m();
|
|
14
|
+
if (!await i(t.compiledHtml, t.dynamicContentList, !0) || (e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t))
|
|
19
15
|
return;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
c();
|
|
23
|
-
const { unsubscribePayload: f, stripoModules: v } = d(t.rawHtml);
|
|
24
|
-
return await u(f), t.modules = v, m || s(t), t;
|
|
16
|
+
l();
|
|
17
|
+
const { unsubscribePayload: u, stripoModules: p } = r(t.rawHtml);
|
|
18
|
+
return await n(u), t.modules = p, c || s(t), t;
|
|
25
19
|
} };
|
|
26
20
|
};
|
|
27
21
|
export {
|
|
28
|
-
|
|
22
|
+
k as useSave
|
|
29
23
|
};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useStripoEventHandler as
|
|
6
|
-
import { useToaster as
|
|
7
|
-
import { localePatch as
|
|
8
|
-
import { displayConditions as
|
|
9
|
-
import { useStripoApi as
|
|
10
|
-
import
|
|
11
|
-
import { useEditorStore as
|
|
12
|
-
import { dynamicContentToMergeTags as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
const { features: l, template:
|
|
16
|
-
var g, y
|
|
17
|
-
const e =
|
|
1
|
+
import { useActionsApi as A } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as F } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as D } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as I } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useStripoEventHandler as P } from "./useStripoEventHandler.js";
|
|
6
|
+
import { useToaster as U } from "./useToaster.js";
|
|
7
|
+
import { localePatch as R } from "../config/i18n/index.js";
|
|
8
|
+
import { displayConditions as H } from "../enums/displayConditions.js";
|
|
9
|
+
import { useStripoApi as O } from "../services/stripoApi.js";
|
|
10
|
+
import q from "../static/styles/customEditorStyle.css.js";
|
|
11
|
+
import { useEditorStore as S } from "../stores/editor.js";
|
|
12
|
+
import { dynamicContentToMergeTags as x } from "../utils/genericUtil.js";
|
|
13
|
+
import L from "../package.json.js";
|
|
14
|
+
const oe = (C, c) => {
|
|
15
|
+
const { features: l, template: E } = D(), { handleError: u } = U(), { getToken: h, getCustomFonts: w, getSyncModulesStatus: b } = O(), { handleEvent: k } = P(), { getStripoBlocksConfig: T } = F(), V = async (i, n = [], r = !1) => {
|
|
16
|
+
var f, g, y;
|
|
17
|
+
const e = S(), { html: m, css: a } = i, { baseBlocks: o, extensions: d } = await T(), p = ((f = l.value) == null ? void 0 : f.displayConditions) ?? !0, B = ((g = l.value) == null ? void 0 : g.modulesDisabled) ?? !1, v = ((y = E.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
18
18
|
window.UIEditor.initEditor(
|
|
19
19
|
document.querySelector("#guido-editor"),
|
|
20
20
|
{
|
|
21
|
-
metadata:
|
|
22
|
-
html:
|
|
21
|
+
metadata: C,
|
|
22
|
+
html: m,
|
|
23
23
|
css: a,
|
|
24
|
-
forceRecreate:
|
|
24
|
+
forceRecreate: v,
|
|
25
25
|
locale: "en",
|
|
26
26
|
undoButtonSelector: "#guido__undo-button",
|
|
27
27
|
redoButtonSelector: "#guido__redo-button",
|
|
28
28
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
29
29
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
30
30
|
codeEditorButtonSelector: "#guido__code-button",
|
|
31
|
-
customAppearanceMergetags: !
|
|
31
|
+
customAppearanceMergetags: !0,
|
|
32
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
|
-
customViewStyles:
|
|
35
|
-
conditionsEnabled:
|
|
36
|
-
customConditionsEnabled:
|
|
37
|
-
conditionCategories:
|
|
34
|
+
customViewStyles: q,
|
|
35
|
+
conditionsEnabled: p,
|
|
36
|
+
customConditionsEnabled: p,
|
|
37
|
+
conditionCategories: H,
|
|
38
38
|
enableXSSSecurity: !0,
|
|
39
|
-
modulesDisabled:
|
|
39
|
+
modulesDisabled: B,
|
|
40
40
|
syncModulesEnabled: r,
|
|
41
41
|
messageSettingsEnabled: !0,
|
|
42
42
|
displayGmailAnnotations: !0,
|
|
@@ -52,28 +52,25 @@ const ie = (E, c) => {
|
|
|
52
52
|
},
|
|
53
53
|
mergeTags: [
|
|
54
54
|
{
|
|
55
|
-
entries:
|
|
56
|
-
c.preselectedDynamicContentList,
|
|
57
|
-
u("liquidSyntax")
|
|
58
|
-
)
|
|
55
|
+
entries: x(c.preselectedDynamicContentList)
|
|
59
56
|
}
|
|
60
57
|
],
|
|
61
58
|
async onTokenRefreshRequest(t) {
|
|
62
59
|
try {
|
|
63
|
-
const s = await
|
|
60
|
+
const s = await h();
|
|
64
61
|
t(s);
|
|
65
62
|
} catch (s) {
|
|
66
|
-
|
|
63
|
+
u(s, "Failed to refresh token");
|
|
67
64
|
}
|
|
68
65
|
},
|
|
69
66
|
onTemplateLoaded() {
|
|
70
67
|
try {
|
|
71
|
-
const { importCss: t } =
|
|
72
|
-
t(), s(),
|
|
68
|
+
const { importCss: t } = I(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: M } = A();
|
|
69
|
+
t(), s(), M(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
73
70
|
e.hasChanges = !1;
|
|
74
71
|
}, 1e3);
|
|
75
72
|
} catch (t) {
|
|
76
|
-
|
|
73
|
+
u(t, "Failed to load custom interface appearance");
|
|
77
74
|
}
|
|
78
75
|
},
|
|
79
76
|
onCodeEditorVisibilityChanged(t) {
|
|
@@ -88,23 +85,23 @@ const ie = (E, c) => {
|
|
|
88
85
|
onDataChanged() {
|
|
89
86
|
e.hasChanges = !0;
|
|
90
87
|
},
|
|
91
|
-
onEvent:
|
|
88
|
+
onEvent: k,
|
|
92
89
|
ignoreClickOutsideSelectors: [
|
|
93
90
|
"#guido-dynamic-content-modal",
|
|
94
91
|
".in-on-board-wrapper",
|
|
95
92
|
".in-drawer__container"
|
|
96
93
|
],
|
|
97
94
|
extensions: d,
|
|
98
|
-
localePatch:
|
|
95
|
+
localePatch: R
|
|
99
96
|
}
|
|
100
97
|
);
|
|
101
|
-
},
|
|
98
|
+
}, _ = (i) => new Promise((n, r) => {
|
|
102
99
|
var d;
|
|
103
100
|
if (document.getElementById("UiEditorScript")) {
|
|
104
101
|
i(), n();
|
|
105
102
|
return;
|
|
106
103
|
}
|
|
107
|
-
const e =
|
|
104
|
+
const e = L.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
|
|
108
105
|
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
109
106
|
i(), n();
|
|
110
107
|
}, o.onerror = () => {
|
|
@@ -112,15 +109,15 @@ const ie = (E, c) => {
|
|
|
112
109
|
}, document.body.appendChild(o);
|
|
113
110
|
});
|
|
114
111
|
return { initPlugin: async (i) => {
|
|
115
|
-
await
|
|
116
|
-
const n =
|
|
112
|
+
await _(async () => {
|
|
113
|
+
const n = S(), [r, e] = await Promise.all([
|
|
117
114
|
w(),
|
|
118
|
-
|
|
115
|
+
b()
|
|
119
116
|
]);
|
|
120
|
-
n.syncModulesEnabled = e, await
|
|
117
|
+
n.syncModulesEnabled = e, await V(i, r, e);
|
|
121
118
|
});
|
|
122
119
|
} };
|
|
123
120
|
};
|
|
124
121
|
export {
|
|
125
|
-
|
|
122
|
+
oe as useStripo
|
|
126
123
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const s = {
|
|
2
2
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
|
|
3
|
-
}, i =
|
|
3
|
+
}, i = {
|
|
4
|
+
CLIENT_ID: "clientId"
|
|
5
|
+
}, u = [
|
|
4
6
|
{ id: 11, key: "similarViewed", name: "Viewed Together", path: "viewed-together" },
|
|
5
7
|
{ id: 12, key: "similarBought", name: "Purchased Together", path: "purchased-together" },
|
|
6
8
|
{ id: 13, key: "userBased", name: "User Based", path: "user-based" },
|
|
@@ -11,13 +13,13 @@ const s = {
|
|
|
11
13
|
{ id: 46, key: "mostValuableOfPartner", name: "Most Valuable Products", path: "most-valuable" },
|
|
12
14
|
{ id: 61, key: "mostPopular", name: "Most Popular Items", path: "most-popular" },
|
|
13
15
|
{ id: 62, key: "mostPurchased", name: "Top Sellers", path: "top-sellers" }
|
|
14
|
-
],
|
|
16
|
+
], l = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], c = [
|
|
15
17
|
{ text: "before the amount", value: "0" },
|
|
16
18
|
{ text: "after the amount", value: "1" }
|
|
17
|
-
],
|
|
19
|
+
], d = [
|
|
18
20
|
{ text: "dot(.)", value: "." },
|
|
19
21
|
{ text: "comma(,)", value: "," }
|
|
20
|
-
],
|
|
22
|
+
], p = [
|
|
21
23
|
{ text: "0", value: "0" },
|
|
22
24
|
{ text: "1", value: "1" },
|
|
23
25
|
{ text: "2", value: "2" },
|
|
@@ -46,7 +48,7 @@ const s = {
|
|
|
46
48
|
], n = [
|
|
47
49
|
{ text: "true", value: "==" },
|
|
48
50
|
{ text: "false", value: "!=" }
|
|
49
|
-
],
|
|
51
|
+
], m = (t) => {
|
|
50
52
|
if (!t)
|
|
51
53
|
return e;
|
|
52
54
|
switch (t) {
|
|
@@ -65,13 +67,14 @@ const s = {
|
|
|
65
67
|
}
|
|
66
68
|
};
|
|
67
69
|
export {
|
|
68
|
-
|
|
69
|
-
i as
|
|
70
|
+
l as PriceAttributes,
|
|
71
|
+
i as QUERY_PARAMS,
|
|
72
|
+
u as RecommendationFeedSourceMaps,
|
|
70
73
|
s as URLS,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
p as currencyDecimalCounts,
|
|
75
|
+
c as currencyLocationMaps,
|
|
76
|
+
d as currencyOperators,
|
|
77
|
+
m as getOperatorOptions,
|
|
75
78
|
a as operatorOptionsForArrayOfStrings,
|
|
76
79
|
n as operatorOptionsForBooleans,
|
|
77
80
|
o as operatorOptionsForDates,
|
|
@@ -1,40 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function l() {
|
|
6
|
-
const { isFeatureEnabled: o } = n();
|
|
7
|
-
return o("liquidSyntax") ? s : c;
|
|
8
|
-
}
|
|
9
|
-
function i(o) {
|
|
10
|
-
return `
|
|
11
|
-
<${e.BLOCK_TEXT}
|
|
1
|
+
import { BlockType as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { COUPON_BLOCK_ID as e } from "./block.js";
|
|
3
|
+
const t = `
|
|
4
|
+
<${o.BLOCK_TEXT}
|
|
12
5
|
class="coupon-block ins-coupon-code coupon-block-v2 es-p10"
|
|
13
6
|
align="center"
|
|
14
|
-
esd-extension-block-id="${
|
|
7
|
+
esd-extension-block-id="${e}">
|
|
15
8
|
<p
|
|
16
9
|
path="1"
|
|
17
10
|
contenteditable="false"
|
|
18
11
|
style="font-size: 16px; color: #333333;">
|
|
19
|
-
<strong path="1,0"
|
|
12
|
+
<strong path="1,0">{@COUPON_CODE}</strong>
|
|
20
13
|
</p>
|
|
21
|
-
</${
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const u = `
|
|
14
|
+
</${o.BLOCK_TEXT}>
|
|
15
|
+
`, l = `
|
|
25
16
|
<td
|
|
26
17
|
class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"
|
|
27
|
-
esd-extension-block-id="${
|
|
18
|
+
esd-extension-block-id="${e}"
|
|
28
19
|
>
|
|
29
20
|
<p class="ins-title" contenteditable="false">{@COUPON_CODE}</p>
|
|
30
21
|
</td>
|
|
31
22
|
`;
|
|
32
|
-
function
|
|
33
|
-
return
|
|
23
|
+
function s() {
|
|
24
|
+
return t;
|
|
34
25
|
}
|
|
35
26
|
export {
|
|
36
|
-
|
|
37
|
-
s as
|
|
38
|
-
u as default,
|
|
39
|
-
d as getDefaultTemplate
|
|
27
|
+
l as default,
|
|
28
|
+
s as getDefaultTemplate
|
|
40
29
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
2
|
var g = (o, s, t) => s in o ? c(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
3
|
var r = (o, s, t) => g(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class w extends y {
|
|
4
|
+
import { mergeTagToDynamicContent as d, dynamicContentToMergeTags as m } from "../../utils/genericUtil.js";
|
|
5
|
+
import { UIElement as u, UIElementType as a, UEAttr as h, UIElementTagRegistry as T } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { ExternalMergeTagsLibrary as y } from "./dynamic-content-modal.js";
|
|
7
|
+
const l = "external-dynamic-content-ui-element", C = "button-add-dynamic-content";
|
|
8
|
+
class p extends T {
|
|
10
9
|
registerUiElements(s) {
|
|
11
10
|
s[a.MERGETAGS] = l;
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
|
-
class
|
|
13
|
+
class b extends u {
|
|
15
14
|
constructor() {
|
|
16
15
|
super(...arguments);
|
|
17
16
|
r(this, "mergeTagsButton", null);
|
|
@@ -44,7 +43,7 @@ class f extends h {
|
|
|
44
43
|
onAttributeUpdated(t, e) {
|
|
45
44
|
if (t !== "mergeTag" || !(e != null && e.value))
|
|
46
45
|
return;
|
|
47
|
-
const n =
|
|
46
|
+
const n = d(e), i = this._getLastClickedPosition();
|
|
48
47
|
this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(n, i);
|
|
49
48
|
}
|
|
50
49
|
openMergeTagLibrary() {
|
|
@@ -56,14 +55,10 @@ class f extends h {
|
|
|
56
55
|
* Dispatches event with dynamic content data and position
|
|
57
56
|
*/
|
|
58
57
|
_openDynamicContentLibrary(t, e) {
|
|
59
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
58
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new y()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
60
59
|
t,
|
|
61
60
|
(n) => {
|
|
62
|
-
|
|
63
|
-
const { isFeatureEnabled: i } = d();
|
|
64
|
-
this.api.triggerValueChange(u([n], i("liquidSyntax"))[0]);
|
|
65
|
-
} else
|
|
66
|
-
this.api.triggerValueChange(null);
|
|
61
|
+
n.text && n.value ? this.api.triggerValueChange(m([n])[0]) : this.api.triggerValueChange(null);
|
|
67
62
|
},
|
|
68
63
|
e
|
|
69
64
|
);
|
|
@@ -147,7 +142,7 @@ class f extends h {
|
|
|
147
142
|
<${a.BUTTON}
|
|
148
143
|
id="guido__btn-add-dynamic-content"
|
|
149
144
|
class="btn btn-primary"
|
|
150
|
-
${
|
|
145
|
+
${h.BUTTON.name}="${C}">
|
|
151
146
|
<${a.ICON} src="plus" class="icon icon-button color-primary">
|
|
152
147
|
</${a.ICON}>
|
|
153
148
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -156,6 +151,6 @@ class f extends h {
|
|
|
156
151
|
}
|
|
157
152
|
}
|
|
158
153
|
export {
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
p as DynamicContentTagRegistry,
|
|
155
|
+
b as DynamicContentUiElementExtension
|
|
161
156
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-3b53a736],.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}.editor-actions[data-v-
|
|
1
|
+
.gap-16[data-v-3b53a736],.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}.editor-actions[data-v-acff76a8]{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-a26d7792]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-a26d7792]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-a26d7792]{height:calc(100vh - 75px)}[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-29b9af29] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-d073b1dc] .vueperslides__bullets{pointer-events:none!important}[data-v-d073b1dc] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { URLS as
|
|
3
|
-
const
|
|
4
|
-
const { get: r } =
|
|
1
|
+
import { useHttp as a } from "../composables/useHttp.js";
|
|
2
|
+
import { QUERY_PARAMS as d, URLS as h } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const y = () => {
|
|
4
|
+
const { get: r } = a(), { get: s } = a({ headers: {} }), m = "6KcLM9TwheVB1mgK";
|
|
5
5
|
return {
|
|
6
6
|
fetchRecommendationCreateData: async () => {
|
|
7
7
|
try {
|
|
@@ -18,17 +18,15 @@ const f = () => {
|
|
|
18
18
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
fetchRecommendationProducts: async (e,
|
|
21
|
+
fetchRecommendationProducts: async (e, i) => {
|
|
22
22
|
var n;
|
|
23
23
|
try {
|
|
24
|
-
const t =
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
}), o = await m(
|
|
31
|
-
`${i.RECOMMENDATION_API_URL}/v2/${e}?${t}`
|
|
24
|
+
const t = new URLSearchParams(Object.entries(i));
|
|
25
|
+
t.set(d.CLIENT_ID, m);
|
|
26
|
+
const c = decodeURIComponent(t.toString());
|
|
27
|
+
console.debug("🏁 Recommendation API Query:", c);
|
|
28
|
+
const o = await s(
|
|
29
|
+
`${h.RECOMMENDATION_API_URL}/v2/${e}?${c}`
|
|
32
30
|
);
|
|
33
31
|
return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
|
|
34
32
|
} catch (t) {
|
|
@@ -38,5 +36,5 @@ const f = () => {
|
|
|
38
36
|
};
|
|
39
37
|
};
|
|
40
38
|
export {
|
|
41
|
-
|
|
39
|
+
y as useRecommendationApi
|
|
42
40
|
};
|
|
@@ -176,8 +176,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
176
176
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
177
177
|
/** Disable modules panel in the editor */
|
|
178
178
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
179
|
-
/** Enable Liquid template syntax */
|
|
180
|
-
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
181
179
|
}, undefined>;
|
|
182
180
|
/**
|
|
183
181
|
* Default block types available in Stripo
|
|
@@ -499,8 +497,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
499
497
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
500
498
|
/** Disable modules panel in the editor */
|
|
501
499
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
502
|
-
/** Enable Liquid template syntax */
|
|
503
|
-
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
504
500
|
}, undefined>, {}>;
|
|
505
501
|
/** Block configuration */
|
|
506
502
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -61,7 +61,6 @@ export declare const useConfig: () => {
|
|
|
61
61
|
displayConditions: boolean;
|
|
62
62
|
unsubscribe: boolean;
|
|
63
63
|
modulesDisabled: boolean;
|
|
64
|
-
liquidSyntax: boolean;
|
|
65
64
|
};
|
|
66
65
|
blocks: {
|
|
67
66
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -158,7 +157,6 @@ export declare const useConfig: () => {
|
|
|
158
157
|
displayConditions: boolean;
|
|
159
158
|
unsubscribe: boolean;
|
|
160
159
|
modulesDisabled: boolean;
|
|
161
|
-
liquidSyntax: boolean;
|
|
162
160
|
} | null>;
|
|
163
161
|
blocks: import("vue").ComputedRef<{
|
|
164
162
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -3,6 +3,9 @@ import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
5
|
};
|
|
6
|
+
export declare const QUERY_PARAMS: {
|
|
7
|
+
CLIENT_ID: string;
|
|
8
|
+
};
|
|
6
9
|
export declare const RecommendationFeedSourceMaps: RecommendationFeedItem[];
|
|
7
10
|
export declare const PriceAttributes: string[];
|
|
8
11
|
export declare const currencyLocationMaps: TextValueObject[];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export declare const COUPON_PLACEHOLDER_DEFAULT = "{@COUPON_CODE}";
|
|
2
|
-
export declare const COUPON_PLACEHOLDER_LIQUID = "{{ins_coupon_code}}";
|
|
3
1
|
declare const migrationTemplate = "\n <td\n class=\"coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block\"\n esd-extension-block-id=\"coupon-block\"\n >\n <p class=\"ins-title\" contenteditable=\"false\">{@COUPON_CODE}</p>\n </td>\n";
|
|
4
2
|
export declare function getDefaultTemplate(): string;
|
|
5
3
|
export default migrationTemplate;
|
|
@@ -66,7 +66,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
66
66
|
displayConditions: boolean;
|
|
67
67
|
unsubscribe: boolean;
|
|
68
68
|
modulesDisabled: boolean;
|
|
69
|
-
liquidSyntax: boolean;
|
|
70
69
|
};
|
|
71
70
|
blocks: {
|
|
72
71
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -169,7 +168,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
169
168
|
displayConditions: boolean;
|
|
170
169
|
unsubscribe: boolean;
|
|
171
170
|
modulesDisabled: boolean;
|
|
172
|
-
liquidSyntax: boolean;
|
|
173
171
|
};
|
|
174
172
|
blocks: {
|
|
175
173
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -272,7 +270,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
272
270
|
displayConditions: boolean;
|
|
273
271
|
unsubscribe: boolean;
|
|
274
272
|
modulesDisabled: boolean;
|
|
275
|
-
liquidSyntax: boolean;
|
|
276
273
|
};
|
|
277
274
|
blocks: {
|
|
278
275
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -375,7 +372,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
375
372
|
displayConditions: boolean;
|
|
376
373
|
unsubscribe: boolean;
|
|
377
374
|
modulesDisabled: boolean;
|
|
378
|
-
liquidSyntax: boolean;
|
|
379
375
|
};
|
|
380
376
|
blocks: {
|
|
381
377
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -478,7 +474,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
478
474
|
displayConditions: boolean;
|
|
479
475
|
unsubscribe: boolean;
|
|
480
476
|
modulesDisabled: boolean;
|
|
481
|
-
liquidSyntax: boolean;
|
|
482
477
|
};
|
|
483
478
|
blocks: {
|
|
484
479
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -581,7 +576,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
581
576
|
displayConditions: boolean;
|
|
582
577
|
unsubscribe: boolean;
|
|
583
578
|
modulesDisabled: boolean;
|
|
584
|
-
liquidSyntax: boolean;
|
|
585
579
|
};
|
|
586
580
|
blocks: {
|
|
587
581
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -684,7 +678,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
684
678
|
displayConditions: boolean;
|
|
685
679
|
unsubscribe: boolean;
|
|
686
680
|
modulesDisabled: boolean;
|
|
687
|
-
liquidSyntax: boolean;
|
|
688
681
|
};
|
|
689
682
|
blocks: {
|
|
690
683
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -787,7 +780,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
787
780
|
displayConditions: boolean;
|
|
788
781
|
unsubscribe: boolean;
|
|
789
782
|
modulesDisabled: boolean;
|
|
790
|
-
liquidSyntax: boolean;
|
|
791
783
|
};
|
|
792
784
|
blocks: {
|
|
793
785
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -890,7 +882,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
890
882
|
displayConditions: boolean;
|
|
891
883
|
unsubscribe: boolean;
|
|
892
884
|
modulesDisabled: boolean;
|
|
893
|
-
liquidSyntax: boolean;
|
|
894
885
|
};
|
|
895
886
|
blocks: {
|
|
896
887
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -993,7 +984,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
993
984
|
displayConditions: boolean;
|
|
994
985
|
unsubscribe: boolean;
|
|
995
986
|
modulesDisabled: boolean;
|
|
996
|
-
liquidSyntax: boolean;
|
|
997
987
|
};
|
|
998
988
|
blocks: {
|
|
999
989
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1096,7 +1086,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1096
1086
|
displayConditions: boolean;
|
|
1097
1087
|
unsubscribe: boolean;
|
|
1098
1088
|
modulesDisabled: boolean;
|
|
1099
|
-
liquidSyntax: boolean;
|
|
1100
1089
|
};
|
|
1101
1090
|
blocks: {
|
|
1102
1091
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1199,7 +1188,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1199
1188
|
displayConditions: boolean;
|
|
1200
1189
|
unsubscribe: boolean;
|
|
1201
1190
|
modulesDisabled: boolean;
|
|
1202
|
-
liquidSyntax: boolean;
|
|
1203
1191
|
};
|
|
1204
1192
|
blocks: {
|
|
1205
1193
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1302,7 +1290,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1302
1290
|
displayConditions: boolean;
|
|
1303
1291
|
unsubscribe: boolean;
|
|
1304
1292
|
modulesDisabled: boolean;
|
|
1305
|
-
liquidSyntax: boolean;
|
|
1306
1293
|
};
|
|
1307
1294
|
blocks: {
|
|
1308
1295
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1405,7 +1392,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1405
1392
|
displayConditions: boolean;
|
|
1406
1393
|
unsubscribe: boolean;
|
|
1407
1394
|
modulesDisabled: boolean;
|
|
1408
|
-
liquidSyntax: boolean;
|
|
1409
1395
|
};
|
|
1410
1396
|
blocks: {
|
|
1411
1397
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1508,7 +1494,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1508
1494
|
displayConditions: boolean;
|
|
1509
1495
|
unsubscribe: boolean;
|
|
1510
1496
|
modulesDisabled: boolean;
|
|
1511
|
-
liquidSyntax: boolean;
|
|
1512
1497
|
};
|
|
1513
1498
|
blocks: {
|
|
1514
1499
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1611,7 +1596,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1611
1596
|
displayConditions: boolean;
|
|
1612
1597
|
unsubscribe: boolean;
|
|
1613
1598
|
modulesDisabled: boolean;
|
|
1614
|
-
liquidSyntax: boolean;
|
|
1615
1599
|
};
|
|
1616
1600
|
blocks: {
|
|
1617
1601
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1714,7 +1698,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1714
1698
|
displayConditions: boolean;
|
|
1715
1699
|
unsubscribe: boolean;
|
|
1716
1700
|
modulesDisabled: boolean;
|
|
1717
|
-
liquidSyntax: boolean;
|
|
1718
1701
|
};
|
|
1719
1702
|
blocks: {
|
|
1720
1703
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1817,7 +1800,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1817
1800
|
displayConditions: boolean;
|
|
1818
1801
|
unsubscribe: boolean;
|
|
1819
1802
|
modulesDisabled: boolean;
|
|
1820
|
-
liquidSyntax: boolean;
|
|
1821
1803
|
};
|
|
1822
1804
|
blocks: {
|
|
1823
1805
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DynamicContent, MergeTag } from '@@/Types/generic';
|
|
2
2
|
export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
|
|
3
|
-
export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[]
|
|
3
|
+
export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[]) => MergeTag[];
|
|
4
4
|
export declare const getCsrfToken: () => string;
|
|
5
5
|
/**
|
|
6
6
|
* URL Parameter utilities
|
|
@@ -1,47 +1,25 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
text:
|
|
4
|
-
value:
|
|
1
|
+
const f = (t) => {
|
|
2
|
+
const n = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [r] = n, e = {
|
|
3
|
+
text: t.label,
|
|
4
|
+
value: r || ""
|
|
5
5
|
};
|
|
6
|
-
if (
|
|
7
|
-
const [, l,
|
|
8
|
-
|
|
9
|
-
let t = l.slice(8).trim();
|
|
10
|
-
t.startsWith('"') && t.endsWith('"') && (t = t.slice(1, -1)), c.fallback = t;
|
|
11
|
-
} else {
|
|
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
|
-
}
|
|
6
|
+
if (n.length >= 2) {
|
|
7
|
+
const [, l, o] = n, c = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
|
|
8
|
+
c ? e.format = c : o || (e.fallback = l), o && (e.fallback = o);
|
|
15
9
|
}
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
label: a.text,
|
|
27
|
-
value: `{{ ${a.value} }}`
|
|
28
|
-
};
|
|
29
|
-
const c = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
|
|
30
|
-
return {
|
|
31
|
-
label: `${a.text} | ${a.fallback}`,
|
|
32
|
-
value: `{{ ${a.value} | default: ${c} }}`
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
|
|
37
|
-
value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
|
|
38
|
-
};
|
|
39
|
-
}), o = () => {
|
|
40
|
-
var e;
|
|
41
|
-
return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
|
|
10
|
+
return e;
|
|
11
|
+
}, s = (t) => t.map((a) => a.format ? {
|
|
12
|
+
label: `${a.text} | ${a.format.key}=${a.format.value}`,
|
|
13
|
+
value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
|
|
14
|
+
} : {
|
|
15
|
+
label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
|
|
16
|
+
value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
|
|
17
|
+
}), u = () => {
|
|
18
|
+
var t;
|
|
19
|
+
return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
|
|
42
20
|
};
|
|
43
21
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
22
|
+
s as dynamicContentToMergeTags,
|
|
23
|
+
u as getCsrfToken,
|
|
24
|
+
f as mergeTagToDynamicContent
|
|
47
25
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.1.1-beta.
|
|
3
|
+
"version": "3.1.1-beta.e4b695a",
|
|
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",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@stripoinc/ui-editor-extensions": "3.5.0",
|
|
36
36
|
"@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
|
|
37
|
-
"@useinsider/guido": "3.1.1-beta.22d798c",
|
|
38
37
|
"@vueuse/core": "11.3.0",
|
|
39
38
|
"lodash-es": "4.17.21",
|
|
40
39
|
"pinia": "2.3.1",
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ToasterTypeOptions as a } from "../../enums/toaster.js";
|
|
2
|
-
import { base64EncodeWithSpecialChars as u } from "../../utils/base64.js";
|
|
3
|
-
import { useHttp as d } from "../useHttp.js";
|
|
4
|
-
import { useToaster as c } from "../useToaster.js";
|
|
5
|
-
import { useTranslations as p } from "../useTranslations.js";
|
|
6
|
-
const v = () => {
|
|
7
|
-
const { post: i } = d(), { showToaster: e } = c(), s = p();
|
|
8
|
-
return { validateLiquidSyntax: async (o) => {
|
|
9
|
-
try {
|
|
10
|
-
const t = await i("/newsletter/contents/validate-syntax", [{
|
|
11
|
-
identifier: "default",
|
|
12
|
-
syntax: "liquid",
|
|
13
|
-
contents: {
|
|
14
|
-
subject: null,
|
|
15
|
-
preheader: null,
|
|
16
|
-
html: u(o),
|
|
17
|
-
ampHtml: null
|
|
18
|
-
}
|
|
19
|
-
}]);
|
|
20
|
-
if (!Array.isArray(t.data)) {
|
|
21
|
-
const l = t.data;
|
|
22
|
-
return e({
|
|
23
|
-
type: a.Warning,
|
|
24
|
-
message: l.message ?? s("journey-builder.liquid-validation-failed")
|
|
25
|
-
}), !1;
|
|
26
|
-
}
|
|
27
|
-
const [r] = t.data, n = Object.values((r == null ? void 0 : r.errors) ?? {});
|
|
28
|
-
return n.length ? (e({
|
|
29
|
-
type: a.Warning,
|
|
30
|
-
message: n[0].replace(/^line \d+:\s*/, "")
|
|
31
|
-
}), !1) : !0;
|
|
32
|
-
} catch {
|
|
33
|
-
return e({
|
|
34
|
-
type: a.Alert,
|
|
35
|
-
message: s("journey-builder.liquid-validation-failed")
|
|
36
|
-
}), !1;
|
|
37
|
-
}
|
|
38
|
-
} };
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
v as useLiquidValidator
|
|
42
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { COUPON_PLACEHOLDER_LIQUID as e, COUPON_PLACEHOLDER_DEFAULT as i } from "../../extensions/Blocks/CouponBlock/template.js";
|
|
2
|
-
const o = [
|
|
3
|
-
{
|
|
4
|
-
id: "liquid-coupon-code",
|
|
5
|
-
description: "Replace legacy coupon placeholder with liquid syntax",
|
|
6
|
-
type: "replace",
|
|
7
|
-
search: i,
|
|
8
|
-
replacement: e,
|
|
9
|
-
replaceAll: !0,
|
|
10
|
-
priority: 50
|
|
11
|
-
}
|
|
12
|
-
];
|
|
13
|
-
export {
|
|
14
|
-
o as liquidCompilerRules
|
|
15
|
-
};
|