@useinsider/guido 3.1.1-beta.513425d → 3.1.1-beta.58e1771
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 +7 -9
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +17 -16
- 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 +17 -19
- package/dist/composables/useSave.js +16 -17
- package/dist/composables/useStripo.js +32 -32
- package/dist/extensions/Blocks/CouponBlock/template.js +13 -22
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +95 -93
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +75 -73
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/stores/config.d.ts +0 -18
- package/package.json +1 -1
- package/dist/composables/validators/useLiquidValidator.js +0 -28
- package/dist/config/compiler/liquidCompilerRules.js +0 -14
- package/dist/src/composables/validators/useLiquidValidator.d.ts +0 -3
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +0 -2
|
@@ -114,9 +114,7 @@ const m = {
|
|
|
114
114
|
/** Enable unsubscribe block */
|
|
115
115
|
unsubscribe: e(a(), !0),
|
|
116
116
|
/** Disable modules panel in the editor */
|
|
117
|
-
modulesDisabled: e(a(), !1)
|
|
118
|
-
/** Enable Liquid template syntax */
|
|
119
|
-
liquidSyntax: e(a(), !1)
|
|
117
|
+
modulesDisabled: e(a(), !1)
|
|
120
118
|
}), E = n([
|
|
121
119
|
"amp-accordion",
|
|
122
120
|
"amp-carousel",
|
|
@@ -193,12 +191,12 @@ const m = {
|
|
|
193
191
|
M,
|
|
194
192
|
N,
|
|
195
193
|
D
|
|
196
|
-
]),
|
|
194
|
+
]), U = o({
|
|
197
195
|
/** Custom compiler rules to apply */
|
|
198
196
|
customRules: e(c(v), []),
|
|
199
197
|
/** Skip default compiler rules */
|
|
200
198
|
ignoreDefaultRules: e(a(), !1)
|
|
201
|
-
}),
|
|
199
|
+
}), x = o({
|
|
202
200
|
/**
|
|
203
201
|
* External validation handler called before save completes.
|
|
204
202
|
* Return false to cancel the save operation.
|
|
@@ -227,15 +225,15 @@ const m = {
|
|
|
227
225
|
/** Block configuration */
|
|
228
226
|
blocks: e(O, {}),
|
|
229
227
|
/** Compiler configuration */
|
|
230
|
-
compiler: e(
|
|
228
|
+
compiler: e(U, {}),
|
|
231
229
|
/** Callbacks and event handlers */
|
|
232
|
-
callbacks: e(
|
|
230
|
+
callbacks: e(x, {})
|
|
233
231
|
});
|
|
234
232
|
export {
|
|
235
233
|
O as BlocksSchema,
|
|
236
|
-
|
|
234
|
+
x as CallbacksSchema,
|
|
237
235
|
v as CompilerRuleSchema,
|
|
238
|
-
|
|
236
|
+
U as CompilerSchema,
|
|
239
237
|
g as CustomBlockTypeSchema,
|
|
240
238
|
D as CustomRuleSchema,
|
|
241
239
|
E as DefaultBlockTypeSchema,
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as u, ref as a, computed as p, watch as _ } from "vue";
|
|
2
|
+
import { useActionsApi as f } from "../../../../composables/useActionsApi.js";
|
|
3
|
+
import { useTranslations as v } from "../../../../composables/useTranslations.js";
|
|
4
|
+
import { usePreviewStore as d } from "../../../../stores/preview.js";
|
|
5
|
+
import { InTooltipV2 as h, InProgress as g } from "@useinsider/design-system-vue";
|
|
6
|
+
const B = /* @__PURE__ */ u({
|
|
6
7
|
__name: "EmailSizeIndicator",
|
|
7
8
|
setup(w) {
|
|
8
|
-
const
|
|
9
|
+
const o = d(), { getCompiledEmail: s } = f(), t = 102, e = a(0), r = a({
|
|
9
10
|
type: "success",
|
|
10
11
|
value: 0
|
|
11
|
-
}),
|
|
12
|
-
const
|
|
13
|
-
e.value = Math.round(
|
|
14
|
-
type: e.value <
|
|
15
|
-
value: Math.min(e.value,
|
|
12
|
+
}), i = p(() => `~${e.value} KB`), n = async () => {
|
|
13
|
+
const { html: c } = await s({ minimize: !0, resetDataSavedFlag: !1 }), l = new TextEncoder().encode(c).byteLength;
|
|
14
|
+
e.value = Math.round(l / 1024), r.value = {
|
|
15
|
+
type: e.value < t ? "success" : "warning",
|
|
16
|
+
value: Math.min(e.value, t)
|
|
16
17
|
};
|
|
17
|
-
},
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
}, { immediate: !0 }), { __sfc: !0, previewStore:
|
|
18
|
+
}, m = v();
|
|
19
|
+
return _(() => o.previewHtml, () => {
|
|
20
|
+
n();
|
|
21
|
+
}, { immediate: !0 }), { __sfc: !0, previewStore: o, getCompiledEmail: s, MAX_EMAIL_SIZE_IN_KB: t, htmlKB: e, progress: r, htmlSize: i, calculateProgress: n, trans: m, InProgress: g, InTooltipV2: h };
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
+
B as default
|
|
25
26
|
};
|
|
@@ -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
1
|
import { defaultHtmlCompilerRules as p } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const F = () => {
|
|
2
|
+
import { itemsCompilerRules as u } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { outlookCompilerRules as c } from "../config/compiler/outlookCompilerRules.js";
|
|
4
|
+
import { recommendationCompilerRules as n } from "../config/compiler/recommendationCompilerRules.js";
|
|
5
|
+
import { socialCompilerRules as f } from "../config/compiler/socialCompilerRules.js";
|
|
6
|
+
import { unsubscribeCompilerRules as R } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
7
|
+
import { createHtmlCompiler as a } from "../utils/htmlCompiler.js";
|
|
8
|
+
import { useConfig as C } from "./useConfig.js";
|
|
9
|
+
const B = () => {
|
|
11
10
|
var m, l;
|
|
12
|
-
const { compiler: e
|
|
11
|
+
const { compiler: e } = C(), r = ((m = e.value) == null ? void 0 : m.customRules) || [], t = [
|
|
13
12
|
...!!((l = e.value) != null && l.ignoreDefaultRules) ? [] : p,
|
|
14
|
-
...f,
|
|
15
|
-
...C,
|
|
16
13
|
...n,
|
|
17
|
-
...a,
|
|
18
14
|
...R,
|
|
19
|
-
...
|
|
20
|
-
...
|
|
15
|
+
...u,
|
|
16
|
+
...c,
|
|
17
|
+
...f,
|
|
18
|
+
...r.map((o, s) => ({
|
|
21
19
|
...o,
|
|
22
|
-
priority: o.priority + 1e3 +
|
|
20
|
+
priority: o.priority + 1e3 + s
|
|
23
21
|
// Ensure additional rules run after default rules
|
|
24
22
|
}))
|
|
25
|
-
],
|
|
26
|
-
return { compileHtml: (o) =>
|
|
23
|
+
], i = a(t);
|
|
24
|
+
return { compileHtml: (o) => i.compile(o) };
|
|
27
25
|
};
|
|
28
26
|
export {
|
|
29
|
-
|
|
27
|
+
B as useHtmlCompiler
|
|
30
28
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useSaveStart as
|
|
3
|
-
import { useSyncModuleExtractor as
|
|
4
|
-
import { useStripoApi as
|
|
5
|
-
import { useTemplatePreparation as
|
|
6
|
-
import { useHtmlValidator as
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (!await s(t.compiledHtml, t.dynamicContentList, !0) || n("liquidSyntax") && !await r(t.compiledHtml) || (i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t))
|
|
1
|
+
import { useConfig as d } from "./useConfig.js";
|
|
2
|
+
import { useSaveStart as p, useSaveComplete as f } from "./useGuidoActions.js";
|
|
3
|
+
import { useSyncModuleExtractor as v } from "./useSyncModuleExtractor.js";
|
|
4
|
+
import { useStripoApi as S } from "../services/stripoApi.js";
|
|
5
|
+
import { useTemplatePreparation as x } from "../utils/templatePreparation.js";
|
|
6
|
+
import { useHtmlValidator as V } from "./useHtmlValidator.js";
|
|
7
|
+
const g = () => {
|
|
8
|
+
const o = p(), s = f(), { validateHtml: i } = V(), { callbacks: a } = d(), { extractSyncModuleData: r } = v(), { setSyncModuleUnsubscriptionPages: n } = S();
|
|
9
|
+
return { save: async (l = !1) => {
|
|
10
|
+
var e;
|
|
11
|
+
o();
|
|
12
|
+
const { prepareTemplateDetails: c } = x(), t = await c();
|
|
13
|
+
if (!await i(t.compiledHtml, t.dynamicContentList, !0) || (e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t))
|
|
15
14
|
return;
|
|
16
|
-
const { unsubscribePayload: m, stripoModules:
|
|
17
|
-
return await
|
|
15
|
+
const { unsubscribePayload: m, stripoModules: u } = r(t.rawHtml);
|
|
16
|
+
return await n(m), t.modules = u, l || s(t), t;
|
|
18
17
|
} };
|
|
19
18
|
};
|
|
20
19
|
export {
|
|
21
|
-
|
|
20
|
+
g as useSave
|
|
22
21
|
};
|
|
@@ -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
|
|
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
11
|
import { useEditorStore as S } from "../stores/editor.js";
|
|
12
|
-
import { dynamicContentToMergeTags as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
const { features: l, template: E
|
|
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
16
|
var f, g, y;
|
|
17
|
-
const e = S(), { html: m, css: a } = i, { baseBlocks: o, extensions: d } = await
|
|
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
21
|
metadata: C,
|
|
22
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:
|
|
34
|
+
customViewStyles: q,
|
|
35
35
|
conditionsEnabled: p,
|
|
36
36
|
customConditionsEnabled: p,
|
|
37
|
-
conditionCategories:
|
|
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,12 +52,12 @@ const ie = (C, c) => {
|
|
|
52
52
|
},
|
|
53
53
|
mergeTags: [
|
|
54
54
|
{
|
|
55
|
-
entries:
|
|
55
|
+
entries: x(c.preselectedDynamicContentList)
|
|
56
56
|
}
|
|
57
57
|
],
|
|
58
58
|
async onTokenRefreshRequest(t) {
|
|
59
59
|
try {
|
|
60
|
-
const s = await
|
|
60
|
+
const s = await h();
|
|
61
61
|
t(s);
|
|
62
62
|
} catch (s) {
|
|
63
63
|
u(s, "Failed to refresh token");
|
|
@@ -65,8 +65,8 @@ const ie = (C, c) => {
|
|
|
65
65
|
},
|
|
66
66
|
onTemplateLoaded() {
|
|
67
67
|
try {
|
|
68
|
-
const { importCss: t } =
|
|
69
|
-
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(() => {
|
|
70
70
|
e.hasChanges = !1;
|
|
71
71
|
}, 1e3);
|
|
72
72
|
} catch (t) {
|
|
@@ -85,23 +85,23 @@ const ie = (C, c) => {
|
|
|
85
85
|
onDataChanged() {
|
|
86
86
|
e.hasChanges = !0;
|
|
87
87
|
},
|
|
88
|
-
onEvent:
|
|
88
|
+
onEvent: k,
|
|
89
89
|
ignoreClickOutsideSelectors: [
|
|
90
90
|
"#guido-dynamic-content-modal",
|
|
91
91
|
".in-on-board-wrapper",
|
|
92
92
|
".in-drawer__container"
|
|
93
93
|
],
|
|
94
94
|
extensions: d,
|
|
95
|
-
localePatch:
|
|
95
|
+
localePatch: R
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
|
-
},
|
|
98
|
+
}, _ = (i) => new Promise((n, r) => {
|
|
99
99
|
var d;
|
|
100
100
|
if (document.getElementById("UiEditorScript")) {
|
|
101
101
|
i(), n();
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
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");
|
|
105
105
|
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
106
106
|
i(), n();
|
|
107
107
|
}, o.onerror = () => {
|
|
@@ -109,15 +109,15 @@ const ie = (C, c) => {
|
|
|
109
109
|
}, document.body.appendChild(o);
|
|
110
110
|
});
|
|
111
111
|
return { initPlugin: async (i) => {
|
|
112
|
-
await
|
|
112
|
+
await _(async () => {
|
|
113
113
|
const n = S(), [r, e] = await Promise.all([
|
|
114
114
|
w(),
|
|
115
|
-
|
|
115
|
+
b()
|
|
116
116
|
]);
|
|
117
|
-
n.syncModulesEnabled = e, await
|
|
117
|
+
n.syncModulesEnabled = e, await V(i, r, e);
|
|
118
118
|
});
|
|
119
119
|
} };
|
|
120
120
|
};
|
|
121
121
|
export {
|
|
122
|
-
|
|
122
|
+
oe as useStripo
|
|
123
123
|
};
|
|
@@ -1,38 +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
|
-
|
|
27
|
+
l as default,
|
|
28
|
+
s as getDefaultTemplate
|
|
38
29
|
};
|
|
@@ -169,7 +169,7 @@ class q extends b {
|
|
|
169
169
|
if (e && e.includes(a))
|
|
170
170
|
return t;
|
|
171
171
|
}
|
|
172
|
-
return "querySelector" in t ? t.querySelector(`.${a}`) : null;
|
|
172
|
+
return "querySelector" in t ? t.querySelector(`.${a}`) ?? null : null;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* Migrate configuration from legacy format
|
|
@@ -1,26 +1,42 @@
|
|
|
1
|
-
const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container",
|
|
1
|
+
const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", n = ".ins-recommendation-mobile-container", t = ".ins-recommendation-mobile-row", r = {
|
|
2
2
|
CURRENCY: "currency",
|
|
3
3
|
SYMBOL: "currency-symbol",
|
|
4
4
|
ALIGNMENT: "currency-alignment",
|
|
5
5
|
THOUSAND_SEPARATOR: "currency-thousand-separator",
|
|
6
6
|
DECIMAL_SEPARATOR: "currency-decimal-separator",
|
|
7
7
|
DECIMAL_COUNT: "currency-decimal-count"
|
|
8
|
-
},
|
|
8
|
+
}, R = "productImage", _ = "productName", e = "productPrice", O = "productOldPrice", s = "productOmnibusPrice", i = "productOmnibusDiscount", E = "productButton", A = "customAttr:", C = "data-custom-attributes", u = "product-attr", m = /* @__PURE__ */ new Set([
|
|
9
|
+
"name",
|
|
10
|
+
// productName
|
|
11
|
+
"price",
|
|
12
|
+
// productPrice
|
|
13
|
+
"original_price",
|
|
14
|
+
// productOldPrice
|
|
15
|
+
"image_url",
|
|
16
|
+
// productImage
|
|
17
|
+
"url",
|
|
18
|
+
// productButton
|
|
19
|
+
"omnibus_price",
|
|
20
|
+
// productOmnibusPrice
|
|
21
|
+
"omnibus_discount"
|
|
22
|
+
// productOmnibusDiscount
|
|
23
|
+
]);
|
|
9
24
|
export {
|
|
10
25
|
A as ATTR_CUSTOM_PREFIX,
|
|
11
|
-
|
|
26
|
+
C as ATTR_DATA_CUSTOM_ATTRIBUTES,
|
|
12
27
|
u as ATTR_PRODUCT_ATTR,
|
|
13
28
|
E as ATTR_PRODUCT_BUTTON,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
29
|
+
R as ATTR_PRODUCT_IMAGE,
|
|
30
|
+
_ as ATTR_PRODUCT_NAME,
|
|
31
|
+
O as ATTR_PRODUCT_OLD_PRICE,
|
|
32
|
+
i as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
|
|
18
33
|
s as ATTR_PRODUCT_OMNIBUS_PRICE,
|
|
19
|
-
|
|
34
|
+
e as ATTR_PRODUCT_PRICE,
|
|
20
35
|
T as BLOCK_ROOT_SELECTOR,
|
|
36
|
+
m as BUILT_IN_DEFAULT_ATTRIBUTES,
|
|
21
37
|
c as CONTAINER_SELECTOR,
|
|
22
|
-
|
|
38
|
+
r as CURRENCY_ATTR,
|
|
23
39
|
o as DESKTOP_CONTAINER_SELECTOR,
|
|
24
|
-
|
|
25
|
-
|
|
40
|
+
n as MOBILE_CONTAINER_SELECTOR,
|
|
41
|
+
t as MOBILE_ROW_SELECTOR
|
|
26
42
|
};
|