@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.
Files changed (37) hide show
  1. package/dist/@types/config/schemas.js +7 -9
  2. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +1 -1
  3. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +17 -16
  4. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  5. package/dist/components/organisms/header/RightSlot.vue2.js +13 -16
  6. package/dist/composables/useHtmlCompiler.js +17 -19
  7. package/dist/composables/useSave.js +16 -17
  8. package/dist/composables/useStripo.js +32 -32
  9. package/dist/extensions/Blocks/CouponBlock/template.js +13 -22
  10. package/dist/extensions/Blocks/Recommendation/block.js +1 -1
  11. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
  12. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
  13. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +95 -93
  14. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +75 -73
  15. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
  16. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
  17. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
  18. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
  19. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
  20. package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
  21. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
  22. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
  23. package/dist/guido.css +1 -1
  24. package/dist/src/@types/config/schemas.d.ts +0 -4
  25. package/dist/src/composables/useConfig.d.ts +0 -2
  26. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  27. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
  28. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
  29. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  30. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  31. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
  32. package/dist/src/stores/config.d.ts +0 -18
  33. package/package.json +1 -1
  34. package/dist/composables/validators/useLiquidValidator.js +0 -28
  35. package/dist/config/compiler/liquidCompilerRules.js +0 -14
  36. package/dist/src/composables/validators/useLiquidValidator.d.ts +0 -3
  37. 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
- ]), x = o({
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
- }), U = o({
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(x, {}),
228
+ compiler: e(U, {}),
231
229
  /** Callbacks and event handlers */
232
- callbacks: e(U, {})
230
+ callbacks: e(x, {})
233
231
  });
234
232
  export {
235
233
  O as BlocksSchema,
236
- U as CallbacksSchema,
234
+ x as CallbacksSchema,
237
235
  v as CompilerRuleSchema,
238
- x as CompilerSchema,
236
+ U as CompilerSchema,
239
237
  g as CustomBlockTypeSchema,
240
238
  D as CustomRuleSchema,
241
239
  E as DefaultBlockTypeSchema,
@@ -10,7 +10,7 @@ var o = function() {
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "079d2bf7"
13
+ "870ebbaf"
14
14
  );
15
15
  const m = n.exports;
16
16
  export {
@@ -1,25 +1,26 @@
1
- import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
2
- import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
- import { usePreviewStore as _ } from "../../../../stores/preview.js";
4
- import { InTooltipV2 as v, InProgress as f } from "@useinsider/design-system-vue";
5
- const S = /* @__PURE__ */ c({
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 t = _(), o = 102, e = n(0), s = n({
9
+ const o = d(), { getCompiledEmail: s } = f(), t = 102, e = a(0), r = a({
9
10
  type: "success",
10
11
  value: 0
11
- }), a = l(() => `~${e.value} KB`), r = () => {
12
- const m = new Blob([t.previewHtml]).size;
13
- e.value = Math.round(m / 1024), s.value = {
14
- type: e.value < o ? "success" : "warning",
15
- value: Math.min(e.value, o)
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
- }, i = p();
18
- return u(() => t.previewHtml, () => {
19
- r();
20
- }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltipV2: v };
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
- S as default
25
+ B as default
25
26
  };
@@ -1,17 +1,17 @@
1
- import i from "./RightSlot.vue2.js";
2
- import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var o = function() {
4
- var s = this, e = s._self._c, t = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f a-i-c" }, [t.isLiquidEnabled && !t.editorStore.isVersionHistoryOpen ? e(t.InChips, { staticClass: "mr-3", attrs: { id: "guido__liquid-tag-chip", styles: "stroke", type: "default", value: "liquid-tags", "close-button": !1, "disabled-status": t.editorStore.loadingStatus, interactive: !1, text: t.trans("email-editor.liquid-tags-enabled") } }) : s._e(), t.editorStore.isVersionHistoryOpen ? e(t.RestoreButton) : e(t.EditorActions, { ref: "editorActionsRef" })], 1);
6
- }, a = [], n = /* @__PURE__ */ r(
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
- a,
8
+ n,
9
+ i,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const u = n.exports;
14
+ const l = _.exports;
15
15
  export {
16
- u as default
16
+ l as default
17
17
  };
@@ -1,22 +1,19 @@
1
- import { defineComponent as a, ref as f, computed as p } from "vue";
2
- import { useConfig as u } from "../../../composables/useConfig.js";
3
- import { useTranslations as d } from "../../../composables/useTranslations.js";
4
- import { useEditorStore as c } from "../../../stores/editor.js";
5
- import { InChips as l } from "@useinsider/design-system-vue";
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(h, { expose: r }) {
11
- const { isFeatureEnabled: o } = u(), n = d(), i = c(), t = f(null), s = p(() => o("liquidSyntax"));
12
- return r({
13
- handleSave: (m) => {
14
- var e;
15
- return (e = t.value) == null ? void 0 : e.handleSave(m);
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, isFeatureEnabled: o, trans: n, editorStore: i, editorActionsRef: t, isLiquidEnabled: s, InChips: l, EditorActions: _, RestoreButton: S };
14
+ }), { __sfc: !0, editorStore: r, editorActionsRef: o, EditorActions: f, RestoreButton: a };
18
15
  }
19
16
  });
20
17
  export {
21
- x as default
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 n } from "../config/compiler/itemsCompilerRules.js";
3
- import { liquidCompilerRules as c } from "../config/compiler/liquidCompilerRules.js";
4
- import { outlookCompilerRules as a } from "../config/compiler/outlookCompilerRules.js";
5
- import { recommendationCompilerRules as f } from "../config/compiler/recommendationCompilerRules.js";
6
- import { socialCompilerRules as R } from "../config/compiler/socialCompilerRules.js";
7
- import { unsubscribeCompilerRules as C } from "../config/compiler/unsubscribeCompilerRules.js";
8
- import { createHtmlCompiler as d } from "../utils/htmlCompiler.js";
9
- import { useConfig as g } from "./useConfig.js";
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, isFeatureEnabled: r } = g(), i = ((m = e.value) == null ? void 0 : m.customRules) || [], t = [
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
- ...r("liquidSyntax") ? c : [],
20
- ...i.map((o, u) => ({
15
+ ...u,
16
+ ...c,
17
+ ...f,
18
+ ...r.map((o, s) => ({
21
19
  ...o,
22
- priority: o.priority + 1e3 + u
20
+ priority: o.priority + 1e3 + s
23
21
  // Ensure additional rules run after default rules
24
22
  }))
25
- ], s = d(t);
26
- return { compileHtml: (o) => s.compile(o) };
23
+ ], i = a(t);
24
+ return { compileHtml: (o) => i.compile(o) };
27
25
  };
28
26
  export {
29
- F as useHtmlCompiler
27
+ B as useHtmlCompiler
30
28
  };
@@ -1,22 +1,21 @@
1
- import { useConfig as v } from "./useConfig.js";
2
- import { useSaveStart as S, useSaveComplete as V } from "./useGuidoActions.js";
3
- import { useSyncModuleExtractor as x } from "./useSyncModuleExtractor.js";
4
- import { useStripoApi as y } from "../services/stripoApi.js";
5
- import { useTemplatePreparation as w } from "../utils/templatePreparation.js";
6
- import { useHtmlValidator as b } from "./useHtmlValidator.js";
7
- import { useLiquidValidator as q } from "./validators/useLiquidValidator.js";
8
- const k = () => {
9
- const e = S(), o = V(), { validateHtml: s } = b(), { validateLiquidSyntax: r } = q(), { callbacks: a, isFeatureEnabled: n } = v(), { extractSyncModuleData: l } = x(), { setSyncModuleUnsubscriptionPages: d } = y();
10
- return { save: async (u = !1) => {
11
- var i;
12
- e();
13
- const { prepareTemplateDetails: c } = w(), t = await c();
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: p } = l(t.rawHtml);
17
- return await d(m), t.modules = p, u || o(t), t;
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
- k as useSave
20
+ g as useSave
22
21
  };
@@ -1,42 +1,42 @@
1
- import { useActionsApi as F } from "./useActionsApi.js";
2
- import { useBlocksConfig as D } from "./useBlocksConfig.js";
3
- import { useConfig as I } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as P } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as U } from "./useStripoEventHandler.js";
6
- import { useToaster as R } from "./useToaster.js";
7
- import { localePatch as H } from "../config/i18n/index.js";
8
- import { displayConditions as q } from "../enums/displayConditions.js";
9
- import { useStripoApi as x } from "../services/stripoApi.js";
10
- import O from "../static/styles/customEditorStyle.css.js";
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 L } from "../utils/genericUtil.js";
13
- import $ from "../package.json.js";
14
- const ie = (C, c) => {
15
- const { features: l, template: E, isFeatureEnabled: h } = I(), { handleError: u } = R(), { getToken: b, getCustomFonts: w, getSyncModulesStatus: k } = x(), { handleEvent: T } = U(), { getStripoBlocksConfig: V } = D(), _ = async (i, n = [], r = !1) => {
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 V(), p = ((f = l.value) == null ? void 0 : f.displayConditions) ?? !0, v = ((g = l.value) == null ? void 0 : g.modulesDisabled) ?? !1, M = ((y = E.value) == null ? void 0 : y.forceRecreate) ?? !1;
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: M,
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: !h("liquidSyntax"),
31
+ customAppearanceMergetags: !0,
32
32
  customAppearanceMergetagsBorderColor: "#f1f3fe",
33
33
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
34
- customViewStyles: O,
34
+ customViewStyles: q,
35
35
  conditionsEnabled: p,
36
36
  customConditionsEnabled: p,
37
- conditionCategories: q,
37
+ conditionCategories: H,
38
38
  enableXSSSecurity: !0,
39
- modulesDisabled: v,
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: L(c.preselectedDynamicContentList)
55
+ entries: x(c.preselectedDynamicContentList)
56
56
  }
57
57
  ],
58
58
  async onTokenRefreshRequest(t) {
59
59
  try {
60
- const s = await b();
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 } = P(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: A } = F();
69
- t(), s(), A(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
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: T,
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: H
95
+ localePatch: R
96
96
  }
97
97
  );
98
- }, B = (i) => new Promise((n, r) => {
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 = $.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");
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 B(async () => {
112
+ await _(async () => {
113
113
  const n = S(), [r, e] = await Promise.all([
114
114
  w(),
115
- k()
115
+ b()
116
116
  ]);
117
- n.syncModulesEnabled = e, await _(i, r, e);
117
+ n.syncModulesEnabled = e, await V(i, r, e);
118
118
  });
119
119
  } };
120
120
  };
121
121
  export {
122
- ie as useStripo
122
+ oe as useStripo
123
123
  };
@@ -1,38 +1,29 @@
1
- import { useConfig as n } from "../../../composables/useConfig.js";
2
- import { BlockType as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
- import { COUPON_BLOCK_ID as t } from "./block.js";
4
- const c = "{@COUPON_CODE}", s = "{{ins_coupon_code}}";
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="${t}">
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">${o}</strong>
12
+ <strong path="1,0">{@COUPON_CODE}</strong>
20
13
  </p>
21
- </${e.BLOCK_TEXT}>
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="${t}"
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 d() {
33
- return i(l());
23
+ function s() {
24
+ return t;
34
25
  }
35
26
  export {
36
- u as default,
37
- d as getDefaultTemplate
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", t = ".ins-recommendation-mobile-container", n = ".ins-recommendation-mobile-row", R = {
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
- }, r = "productImage", O = "productName", _ = "productPrice", e = "productOldPrice", s = "productOmnibusPrice", C = "productOmnibusDiscount", E = "productButton", A = "customAttr:", i = "data-custom-attributes", u = "product-attr";
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
- i as ATTR_DATA_CUSTOM_ATTRIBUTES,
26
+ C as ATTR_DATA_CUSTOM_ATTRIBUTES,
12
27
  u as ATTR_PRODUCT_ATTR,
13
28
  E as ATTR_PRODUCT_BUTTON,
14
- r as ATTR_PRODUCT_IMAGE,
15
- O as ATTR_PRODUCT_NAME,
16
- e as ATTR_PRODUCT_OLD_PRICE,
17
- C as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
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
- _ as ATTR_PRODUCT_PRICE,
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
- R as CURRENCY_ATTR,
38
+ r as CURRENCY_ATTR,
23
39
  o as DESKTOP_CONTAINER_SELECTOR,
24
- t as MOBILE_CONTAINER_SELECTOR,
25
- n as MOBILE_ROW_SELECTOR
40
+ n as MOBILE_CONTAINER_SELECTOR,
41
+ t as MOBILE_ROW_SELECTOR
26
42
  };