@useinsider/guido 3.1.1-beta.d3c42de → 3.1.1-beta.d5a8f39

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 (29) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +7 -9
  3. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  4. package/dist/components/organisms/header/RightSlot.vue2.js +13 -16
  5. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +2 -2
  6. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  7. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +2 -2
  8. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +5 -5
  9. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +33 -41
  10. package/dist/composables/useHtmlCompiler.js +16 -18
  11. package/dist/composables/useSave.js +17 -23
  12. package/dist/composables/useStripo.js +32 -32
  13. package/dist/extensions/Blocks/CouponBlock/template.js +13 -24
  14. package/dist/guido.css +1 -1
  15. package/dist/services/recommendationApi.js +13 -11
  16. package/dist/src/@types/config/schemas.d.ts +0 -4
  17. package/dist/src/@types/generic.d.ts +0 -1
  18. package/dist/src/composables/useConfig.d.ts +0 -2
  19. package/dist/src/enums/onboarding.d.ts +1 -0
  20. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +0 -2
  21. package/dist/src/stores/config.d.ts +0 -18
  22. package/dist/src/stores/onboarding.d.ts +4 -0
  23. package/dist/stores/onboarding.js +4 -0
  24. package/dist/utils/tooltipUtils.js +4 -5
  25. package/package.json +2 -2
  26. package/dist/composables/validators/useLiquidValidator.js +0 -36
  27. package/dist/config/compiler/liquidCompilerRules.js +0 -15
  28. package/dist/src/composables/validators/useLiquidValidator.d.ts +0 -3
  29. 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
- }), x = k("type", [
196
+ }), U = k("type", [
199
197
  M,
200
198
  N,
201
199
  D,
202
200
  v
203
- ]), U = o({
201
+ ]), x = o({
204
202
  /** Custom compiler rules to apply */
205
- customRules: e(c(x), []),
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(U, {}),
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
- x as CompilerRuleSchema,
245
- U as CompilerSchema,
242
+ U as CompilerRuleSchema,
243
+ x as CompilerSchema,
246
244
  O as CustomBlockTypeSchema,
247
245
  v as CustomRuleSchema,
248
246
  g as DefaultBlockTypeSchema,
@@ -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
  };
@@ -5,11 +5,11 @@ import { InOnboard as b } from "@useinsider/design-system-vue";
5
5
  const O = /* @__PURE__ */ p({
6
6
  __name: "AMPOnboarding",
7
7
  setup(l) {
8
- const i = g(), o = u(), r = e(() => `${window.innerWidth / 2 - 110}px`), a = e(() => [
8
+ const i = g(), o = u(), r = e(() => `${window.innerWidth / 2 - 130}px`), a = e(() => [
9
9
  {
10
10
  classes: "guido-amp-onboarding",
11
11
  left: r.value,
12
- top: "70px",
12
+ top: "68px",
13
13
  position: "Top Center",
14
14
  title: i("email-editor.onboarding-amp-title"),
15
15
  description: i("email-editor.onboarding-amp-description"),
@@ -13,7 +13,7 @@ var l = function() {
13
13
  p,
14
14
  !1,
15
15
  null,
16
- "29b9af29"
16
+ "1cddafa8"
17
17
  );
18
18
  const S = _.exports;
19
19
  export {
@@ -6,7 +6,7 @@ import { InOnboard as f } from "@useinsider/design-system-vue";
6
6
  const S = /* @__PURE__ */ l({
7
7
  __name: "GenericOnboarding",
8
8
  setup(B) {
9
- const e = x(), o = k(), r = i(() => `${window.innerWidth / 2 - 160}px`), c = () => {
9
+ const e = x(), o = k(), r = i(() => `${window.innerWidth / 2 - 118}px`), c = () => {
10
10
  const t = document.querySelector("ui-editor");
11
11
  t != null && t.shadowRoot && m.forEach((n) => {
12
12
  var d;
@@ -52,7 +52,7 @@ const S = /* @__PURE__ */ l({
52
52
  {
53
53
  classes: "guido-onboarding-preview",
54
54
  left: r.value,
55
- top: "90px",
55
+ top: "68px",
56
56
  position: "Top Center",
57
57
  title: e("email-editor.onboarding-preview-title"),
58
58
  description: e("email-editor.onboarding-preview-description"),
@@ -1,19 +1,19 @@
1
- import l from "./TextBlockOnboarding.vue2.js";
1
+ import c from "./TextBlockOnboarding.vue2.js";
2
2
  /* empty css */
3
3
  import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var g = function() {
5
5
  var e, n, r, i, a, s;
6
- var t = this, c = t._self._c, o = t._self._setupProxy;
7
- return o.isVisible ? c(o.InOnboard, { key: "guido__text-block-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__text-block-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : n.bottom, "left-position": (r = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : r.left, "pages-config": o.onboardingStore.onboardings.textBlockOnboarding.config, "pointer-position": (i = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : i.position, "right-position": (a = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : a.right, "top-position": (s = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: o.handleBack, close: function(u) {
6
+ var t = this, l = t._self._c, o = t._self._setupProxy;
7
+ return o.isVisible ? l(o.InOnboard, { key: "guido__text-block-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__text-block-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : n.bottom, "left-position": (r = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : r.left, "pages-config": o.onboardingStore.onboardings.textBlockOnboarding.config, "pointer-position": (i = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : i.position, "right-position": (a = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : a.right, "top-position": (s = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: o.handleBack, close: function(u) {
8
8
  return o.onboardingStore.close("textBlockOnboarding");
9
9
  }, nextButtonClick: o.handleNext } }) : t._e();
10
10
  }, b = [], p = /* @__PURE__ */ d(
11
- l,
11
+ c,
12
12
  g,
13
13
  b,
14
14
  !1,
15
15
  null,
16
- "d073b1dc"
16
+ "b200491a"
17
17
  );
18
18
  const f = p.exports;
19
19
  export {
@@ -1,74 +1,66 @@
1
- import { defineComponent as u, computed as a, watch as b } from "vue";
2
- import { useTranslations as m } from "../../../composables/useTranslations.js";
3
- import { useOnboardingStore as k } from "../../../stores/onboarding.js";
4
- import { InOnboard as B } from "@useinsider/design-system-vue";
5
- const y = /* @__PURE__ */ u({
1
+ import { defineComponent as g, computed as r, watch as u } from "vue";
2
+ import { useTranslations as x } from "../../../composables/useTranslations.js";
3
+ import { RIBBON_SELECTOR as b } from "../../../enums/onboarding.js";
4
+ import { useOnboardingStore as p } from "../../../stores/onboarding.js";
5
+ import { InOnboard as k } from "@useinsider/design-system-vue";
6
+ const h = /* @__PURE__ */ g({
6
7
  __name: "TextBlockOnboarding",
7
- setup(h) {
8
- const i = m(), o = k(), e = a(() => {
9
- const n = window.innerHeight - 128, r = Math.max(90, n * 0.15), s = Math.max(490, n * 0.71), d = 200, g = 40;
10
- return {
11
- settings: {
12
- top: `${r}px`,
13
- position: r + d + g > n ? "Right Bottom" : "Right Top"
14
- },
15
- dynamic: {
16
- top: `${s}px`,
17
- position: s + d + g > n ? "Right Bottom" : "Right Top"
18
- }
19
- };
20
- }), c = a(() => [
8
+ setup(m) {
9
+ const n = x(), o = p(), c = r(() => {
10
+ const t = document.querySelector(b);
11
+ return (t == null ? void 0 : t.offsetHeight) ?? 0;
12
+ }), i = (t) => `${t + c.value}px`, a = r(() => [
21
13
  {
22
14
  classes: "guido-text-block-onboarding-settings",
23
15
  right: "426px",
24
- top: e.value.settings.top,
25
- position: e.value.settings.position,
26
- title: i("email-editor.onboarding-text-block-title"),
27
- description: i("email-editor.onboarding-text-block-description"),
16
+ top: i(90),
17
+ position: "Right Top",
18
+ title: n("email-editor.onboarding-text-block-title"),
19
+ description: n("email-editor.onboarding-text-block-description"),
28
20
  imageSource: "",
29
21
  backButtonClick: () => {
30
22
  },
31
23
  nextButtonType: "text",
32
- nextButtonText: i("products.next"),
24
+ nextButtonText: n("products.next"),
33
25
  nextButtonClick: () => {
34
26
  o.next("textBlockOnboarding");
35
27
  }
36
28
  },
37
29
  {
38
30
  classes: "guido-text-block-onboarding-dynamic",
39
- right: "426px",
40
- top: e.value.dynamic.top,
41
- position: e.value.dynamic.position,
42
- title: i("email-editor.onboarding-dynamic-content-title"),
43
- description: i("email-editor.onboarding-dynamic-content-description"),
31
+ right: "409px",
32
+ top: i(607),
33
+ position: "Right Top",
34
+ title: n("email-editor.onboarding-dynamic-content-title"),
35
+ description: n("email-editor.onboarding-dynamic-content-description"),
44
36
  imageSource: "",
45
37
  backButtonType: "text",
46
- backButtonText: i("ds-steps.back"),
38
+ backButtonText: n("ds-steps.back"),
47
39
  backButtonClick: () => {
48
40
  o.previous("textBlockOnboarding");
49
41
  },
50
42
  nextButtonType: "text",
51
- nextButtonText: i("action-builder.ok"),
43
+ nextButtonText: n("action-builder.ok"),
52
44
  nextButtonClick: () => {
53
45
  o.close("textBlockOnboarding");
54
46
  }
55
47
  }
56
- ]), l = a(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), p = () => {
57
- var t, n;
58
- (n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
59
- }, x = () => {
60
- var t, n;
61
- (n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
48
+ ]), s = r(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), d = () => {
49
+ var t, e;
50
+ (e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
51
+ }, l = () => {
52
+ var t, e;
53
+ (e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
62
54
  };
63
- return b(
55
+ return u(
64
56
  () => o.isActive("textBlockOnboarding"),
65
57
  (t) => {
66
- t && o.setConfig("textBlockOnboarding", c.value);
58
+ t && o.setConfig("textBlockOnboarding", a.value);
67
59
  },
68
60
  { immediate: !0 }
69
- ), { __sfc: !0, trans: i, onboardingStore: o, dynamicPosition: e, onboardingCardsConfig: c, isVisible: l, handleNext: p, handleBack: x, InOnboard: B };
61
+ ), { __sfc: !0, trans: n, onboardingStore: o, ribbonOffset: c, getTopPosition: i, onboardingCardsConfig: a, isVisible: s, handleNext: d, handleBack: l, InOnboard: k };
70
62
  }
71
63
  });
72
64
  export {
73
- y as default
65
+ h as default
74
66
  };
@@ -1,30 +1,28 @@
1
- import { defaultHtmlCompilerRules as c } from "../config/compiler/htmlCompilerRules.js";
2
- import { itemsCompilerRules as f } from "../config/compiler/itemsCompilerRules.js";
3
- import { liquidCompilerRules as R } from "../config/compiler/liquidCompilerRules.js";
4
- import { outlookCompilerRules as C } from "../config/compiler/outlookCompilerRules.js";
5
- import { recommendationCompilerRules as d } from "../config/compiler/recommendationCompilerRules.js";
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 v } from "./useConfig.js";
10
- const w = () => {
8
+ import { useConfig as b } from "./useConfig.js";
9
+ const q = () => {
11
10
  var l, m, r;
12
- const { compiler: e, isFeatureEnabled: t, partner: i } = v(), s = ((l = e.value) == null ? void 0 : l.customRules) || [], u = [
13
- ...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] : c,
14
- ...d,
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
- ...b,
19
- ...t("liquidSyntax") ? R : [],
20
- ...s.map((o, a) => ({
18
+ ...i.map((o, c) => ({
21
19
  ...o,
22
- priority: o.priority + 1e3 + a
20
+ priority: o.priority + 1e3 + c
23
21
  // Ensure additional rules run after default rules
24
22
  }))
25
- ], p = H(u), n = (r = i.value) == null ? void 0 : r.fallbackFont;
26
- return { compileHtml: (o) => p.compile(o, void 0, n) };
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
- w as useHtmlCompiler
27
+ q as useHtmlCompiler
30
28
  };
@@ -1,29 +1,23 @@
1
- import { useActionsApi as S } from "./useActionsApi.js";
2
- import { useConfig as V } from "./useConfig.js";
3
- import { useSaveStart as x, useSaveComplete as y } from "./useGuidoActions.js";
4
- import { useSyncModuleExtractor as w } from "./useSyncModuleExtractor.js";
5
- import { useStripoApi as b } from "../services/stripoApi.js";
6
- import { useTemplatePreparation as q } from "../utils/templatePreparation.js";
7
- import { useHtmlValidator as H } from "./useHtmlValidator.js";
8
- import { useLiquidValidator as L } from "./validators/useLiquidValidator.js";
9
- const F = () => {
10
- const o = x(), s = y(), { validateHtml: r } = H(), { validateLiquidSyntax: n } = L(), { callbacks: a, isFeatureEnabled: l } = V(), { extractSyncModuleData: d } = w(), { setSyncModuleUnsubscriptionPages: u } = b(), { editorSave: c } = S();
11
- return { save: async (m = !1) => {
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: p } = q(), t = await p();
15
- if (l("liquidSyntax")) {
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
- if ((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t))
21
- return;
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
- F as useSave
22
+ k as useSave
29
23
  };
@@ -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,40 +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
- c as COUPON_PLACEHOLDER_DEFAULT,
37
- s as COUPON_PLACEHOLDER_LIQUID,
38
- u as default,
39
- d as getDefaultTemplate
27
+ l as default,
28
+ s as getDefaultTemplate
40
29
  };
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-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
+ .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-1cddafa8] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-b200491a] .vueperslides__bullets{pointer-events:none!important}[data-v-b200491a] .vueperslides__parallax-wrapper{height:110px!important}
@@ -1,34 +1,36 @@
1
1
  import { useHttp as c } from "../composables/useHttp.js";
2
- import { URLS as m } from "../enums/extensions/recommendationBlock.js";
2
+ import { URLS as i } from "../enums/extensions/recommendationBlock.js";
3
3
  const f = () => {
4
- const { get: o } = c();
4
+ const { get: r } = c(), a = "6KcLM9TwheVB1mgK";
5
5
  return {
6
6
  fetchRecommendationCreateData: async () => {
7
7
  try {
8
- return (await o("/newsletter/recommendations/create-data")).data;
8
+ return (await r("/newsletter/recommendations/create-data")).data;
9
9
  } catch (e) {
10
10
  throw console.error("fetchUserModalState error:", e), e;
11
11
  }
12
12
  },
13
13
  fetchRecommendationFilters: async () => {
14
14
  try {
15
- const { data: e } = await o("/stripo/email-recommendation-attributes");
15
+ const { data: e } = await r("/stripo/email-recommendation-attributes");
16
16
  return e;
17
17
  } catch (e) {
18
18
  throw console.error("fetchRecommendationFilters error:", e), e;
19
19
  }
20
20
  },
21
- fetchRecommendationProducts: async (e, a) => {
21
+ fetchRecommendationProducts: async (e, s) => {
22
22
  var n;
23
23
  try {
24
- const t = decodeURIComponent(new URLSearchParams(Object.entries(a)).toString());
24
+ const t = decodeURIComponent(new URLSearchParams(Object.entries(s)).toString());
25
25
  console.debug("🏁 Recommendation API Query:", t);
26
- const { get: s } = c({
27
- headers: {}
28
- }), r = await s(
29
- `${m.RECOMMENDATION_API_URL}/v2/${e}?${t}`
26
+ const { get: m } = c({
27
+ headers: {
28
+ "X-CLIENT-ID": a
29
+ }
30
+ }), o = await m(
31
+ `${i.RECOMMENDATION_API_URL}/v2/${e}?${t}`
30
32
  );
31
- return ((n = r == null ? void 0 : r.data) == null ? void 0 : n.data) ?? [];
33
+ return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
32
34
  } catch (t) {
33
35
  throw console.error("fetchRecommendationProducts error:", t), t;
34
36
  }
@@ -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<{
@@ -44,7 +44,6 @@ export interface TooltipOptions {
44
44
  x: number;
45
45
  y: number;
46
46
  };
47
- preventXss?: boolean;
48
47
  }
49
48
  export type TextValueObject = {
50
49
  text: string;
@@ -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,3 +3,4 @@ export declare const UI_EDITOR_SELECTOR = "ui-editor";
3
3
  export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
4
4
  export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
5
5
  export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
6
+ export declare const DYNAMIC_CONTENT_BUTTON_SELECTOR = "#guido__btn-add-dynamic-content";
@@ -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")[];
@@ -1392,6 +1392,10 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoO
1392
1392
  close(type: OnboardingType): Promise<void>;
1393
1393
  next(type: OnboardingType): void;
1394
1394
  previous(type: OnboardingType): void;
1395
+ updateCardPosition(type: OnboardingType, cardIndex: number, position: {
1396
+ top: string;
1397
+ position: string;
1398
+ }): void;
1395
1399
  setConfig(type: OnboardingType, config: OnboardingCardConfig[]): void;
1396
1400
  onDiscoverNowClicked(): Promise<void>;
1397
1401
  onRemindMeLater(): void;
@@ -71,6 +71,10 @@ const t = () => ({
71
71
  previous(n) {
72
72
  this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
73
73
  },
74
+ updateCardPosition(n, i, o) {
75
+ const s = this.onboardings[n].config[i];
76
+ s && (s.top = o.top, s.position = o.position);
77
+ },
74
78
  setConfig(n, i) {
75
79
  this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
76
80
  },
@@ -1,11 +1,10 @@
1
- const e = (s, t = {}) => ({
2
- id: s,
1
+ const o = (i, t = {}) => ({
2
+ id: i,
3
3
  dynamicPosition: t.dynamicPosition ?? !1,
4
4
  staticPosition: t.staticPosition ?? "bottom center",
5
5
  iconStatus: t.iconStatus ?? !1,
6
- offset: t.offset,
7
- preventXss: t.preventXss
6
+ offset: t.offset
8
7
  });
9
8
  export {
10
- e as getTooltipOptions
9
+ o as getTooltipOptions
11
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.1.1-beta.d3c42de",
3
+ "version": "3.1.1-beta.d5a8f39",
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",
@@ -33,7 +33,7 @@
33
33
  "license": "ISC",
34
34
  "dependencies": {
35
35
  "@stripoinc/ui-editor-extensions": "3.5.0",
36
- "@useinsider/design-system-vue": "0.14.28",
36
+ "@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
37
37
  "@vueuse/core": "11.3.0",
38
38
  "lodash-es": "4.17.21",
39
39
  "pinia": "2.3.1",
@@ -1,36 +0,0 @@
1
- import { ToasterTypeOptions as i } from "../../enums/toaster.js";
2
- import { base64EncodeWithSpecialChars as d } from "../../utils/base64.js";
3
- import { useHttp as u } from "../useHttp.js";
4
- import { useToaster as m } from "../useToaster.js";
5
- import { useTranslations as p } from "../useTranslations.js";
6
- const x = () => {
7
- const { post: o } = u(), { showToaster: a } = m(), r = p();
8
- return { validateLiquidSyntax: async (n) => {
9
- var s;
10
- const e = await o("/newsletter/contents/validate-syntax", [{
11
- identifier: "default",
12
- syntax: "liquid",
13
- contents: {
14
- subject: null,
15
- preheader: null,
16
- html: d(n),
17
- ampHtml: null
18
- }
19
- }]);
20
- if (!Array.isArray(e.data)) {
21
- const l = e.data;
22
- return a({
23
- type: i.Alert,
24
- message: l.message ?? r("journey-builder.liquid-validation-failed")
25
- }), !1;
26
- }
27
- const [t] = e.data;
28
- return t != null && t.success ? !0 : (a({
29
- type: i.Alert,
30
- message: ((s = t == null ? void 0 : t.errors) == null ? void 0 : s.html) ?? r("journey-builder.liquid-validation-failed")
31
- }), !1);
32
- } };
33
- };
34
- export {
35
- x as useLiquidValidator
36
- };
@@ -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
- };
@@ -1,3 +0,0 @@
1
- export declare const useLiquidValidator: () => {
2
- validateLiquidSyntax: (compiledHtml: string) => Promise<boolean>;
3
- };
@@ -1,2 +0,0 @@
1
- import type { CompilerRule } from '@@/Types/html-compiler';
2
- export declare const liquidCompilerRules: CompilerRule[];