@useinsider/guido 3.26.0-beta.8251afd → 3.26.0-beta.a188943

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 (69) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +46 -45
  3. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +5 -6
  4. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +19 -18
  5. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
  6. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +15 -15
  7. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
  8. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +28 -27
  9. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +3 -3
  10. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +42 -27
  11. package/dist/composables/useCustomInterfaceAppearance.js +50 -50
  12. package/dist/composables/useFullStoryBridge.js +10 -9
  13. package/dist/composables/useSave.js +17 -19
  14. package/dist/composables/useSaveValidation.js +249 -142
  15. package/dist/composables/useTranslations.js +9 -14
  16. package/dist/enums/save-validation.js +1 -1
  17. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +14 -14
  18. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -40
  19. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +15 -15
  20. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +17 -15
  21. package/dist/extensions/Blocks/common-control.js +25 -25
  22. package/dist/extensions/DynamicContent/dynamic-content.js +15 -17
  23. package/dist/guido.css +1 -1
  24. package/dist/node_modules/valibot/dist/index.js +122 -184
  25. package/dist/package.json.js +1 -1
  26. package/dist/src/composables/useSaveValidation.d.ts +2 -2
  27. package/dist/src/enums/save-validation.d.ts +14 -3
  28. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +2 -0
  29. package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
  30. package/dist/src/stores/onboarding.d.ts +1 -0
  31. package/dist/src/utils/editorShadowRoot.d.ts +1 -0
  32. package/dist/stores/onboarding.js +4 -1
  33. package/dist/utils/editorShadowRoot.js +8 -0
  34. package/package.json +11 -3
  35. package/dist/@types/email-be/html-validation.js +0 -24
  36. package/dist/enums/email-be.js +0 -27
  37. package/dist/services/emailBe/errors/ApiError.js +0 -50
  38. package/dist/services/emailBe/errors/handleApiError.js +0 -31
  39. package/dist/services/emailBe/errors/toApiError.js +0 -71
  40. package/dist/services/emailBe/html/HtmlValidationService.js +0 -35
  41. package/dist/services/emailBe/html/index.js +0 -6
  42. package/dist/services/emailBe/http/HttpManager.js +0 -68
  43. package/dist/services/emailBe/http/RetryStack.js +0 -23
  44. package/dist/services/emailBe/http/client.js +0 -61
  45. package/dist/services/emailBe/http/index.js +0 -10
  46. package/dist/services/emailBe/http/transportErrors.js +0 -20
  47. package/dist/src/@types/email-be/html-validation.d.ts +0 -35
  48. package/dist/src/enums/email-be.d.ts +0 -26
  49. package/dist/src/extensions/Blocks/_Boilerplate/block.d.ts +0 -11
  50. package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +0 -7
  51. package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +0 -10
  52. package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +0 -16
  53. package/dist/src/extensions/Blocks/_Boilerplate/control.d.ts +0 -17
  54. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +0 -15
  55. package/dist/src/extensions/Blocks/_Boilerplate/extension.d.ts +0 -2
  56. package/dist/src/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -4
  57. package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
  58. package/dist/src/extensions/Blocks/_Boilerplate/template.d.ts +0 -6
  59. package/dist/src/services/emailBe/errors/ApiError.d.ts +0 -40
  60. package/dist/src/services/emailBe/errors/handleApiError.d.ts +0 -11
  61. package/dist/src/services/emailBe/errors/toApiError.d.ts +0 -2
  62. package/dist/src/services/emailBe/html/HtmlValidationService.d.ts +0 -8
  63. package/dist/src/services/emailBe/html/index.d.ts +0 -2
  64. package/dist/src/services/emailBe/http/HttpManager.d.ts +0 -13
  65. package/dist/src/services/emailBe/http/RetryStack.d.ts +0 -6
  66. package/dist/src/services/emailBe/http/client.d.ts +0 -3
  67. package/dist/src/services/emailBe/http/index.d.ts +0 -2
  68. package/dist/src/services/emailBe/http/transportErrors.d.ts +0 -15
  69. package/dist/src/services/emailBe/http/types.d.ts +0 -46
@@ -1,46 +1,61 @@
1
- import { defineComponent as d, computed as g, watch as l } from "vue";
2
- import { useRibbonOffset as b } from "../../../composables/useRibbonOffset.js";
3
- import { useTranslations as p } from "../../../composables/useTranslations.js";
4
- import { ACADEMY_LINKS as u } from "../../../enums/academy.js";
5
- import { useOnboardingStore as y } from "../../../stores/onboarding.js";
6
- import { InOnboard as f } from "@useinsider/design-system-vue";
7
- const A = /* @__PURE__ */ d({
1
+ import { defineComponent as E, computed as _, onMounted as L, onBeforeUnmount as O } from "vue";
2
+ import { useRibbonOffset as S } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as C } from "../../../composables/useTranslations.js";
4
+ import { ACADEMY_LINKS as h } from "../../../enums/academy.js";
5
+ import { useOnboardingStore as k } from "../../../stores/onboarding.js";
6
+ import { findEditorShadowRoot as v } from "../../../utils/editorShadowRoot.js";
7
+ import { InOnboard as B } from "@useinsider/design-system-vue";
8
+ const F = /* @__PURE__ */ E({
8
9
  __name: "RecommendationLegacyStrategyOnboarding",
9
- setup(O) {
10
- const n = "recommendationLegacyStrategyOnboarding", o = p(), t = y(), { getTopPosition: i } = b(), r = `<a href="${u.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${o("action-builder.visit-academy")}</a>`, a = () => [
10
+ setup(T) {
11
+ const a = "recommendationLegacyStrategyOnboarding", l = "#guido__btn-update-legacy-strategy", i = C(), t = k(), { getTopPosition: m } = S(), u = `<a href="${h.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${i("action-builder.visit-academy")}</a>`, g = () => [
11
12
  {
12
13
  classes: "guido-recommendation-legacy-strategy-onboarding",
13
14
  right: "40px",
14
- top: i(485),
15
+ top: m(500),
15
16
  position: "Top Right",
16
- title: o("email-editor.onboarding-recommendation-strategy-legacy-title"),
17
- description: o("email-editor.onboarding-recommendation-strategy-legacy-description", {
18
- academyLink: r
17
+ title: i("email-editor.onboarding-recommendation-strategy-legacy-title"),
18
+ description: i("email-editor.onboarding-recommendation-strategy-legacy-description", {
19
+ academyLink: u
19
20
  }),
20
21
  imageSource: "",
21
22
  backButtonClick: () => {
22
23
  },
23
24
  nextButtonType: "text",
24
- nextButtonText: o("action-builder.ok"),
25
+ nextButtonText: i("action-builder.ok"),
25
26
  nextButtonClick: () => {
26
- t.close(n);
27
+ t.close(a);
27
28
  }
28
29
  }
29
- ], s = g(
30
+ ], y = _(
30
31
  () => t.onboardings.recommendationLegacyStrategyOnboarding.config.length > 0 && t.onboardings.recommendationLegacyStrategyOnboarding.isActive
31
- ), m = () => {
32
- var e, c;
33
- (c = (e = t.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : e.nextButtonClick) == null || c.call(e);
32
+ ), b = () => {
33
+ var n, o;
34
+ (o = (n = t.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : n.nextButtonClick) == null || o.call(n);
34
35
  };
35
- return l(
36
- () => t.isActive(n),
37
- (e) => {
38
- e && t.setConfig(n, a());
39
- },
40
- { immediate: !0 }
41
- ), { __sfc: !0, ONBOARDING_TYPE: n, trans: o, onboardingStore: t, getTopPosition: i, academyLink: r, buildOnboardingCards: a, isVisible: s, handleNext: m, InOnboard: f };
36
+ let e = null;
37
+ const s = ({ target: n }) => {
38
+ n instanceof Element && n.closest("ue-control-panel") && t.closeForSession(a);
39
+ };
40
+ let r = null;
41
+ const d = (n) => {
42
+ var o;
43
+ return !!((o = n.querySelector(l)) != null && o.getClientRects().length);
44
+ }, c = ({ target: n }) => {
45
+ const o = n instanceof Element ? n.closest("ue-control-panel") : null;
46
+ !o || r !== null || (r = requestAnimationFrame(() => {
47
+ r = null, d(o) || t.closeForSession(a);
48
+ }));
49
+ }, p = () => {
50
+ e == null || e.removeEventListener("scroll", s, !0), e == null || e.removeEventListener("click", c, !0), e == null || e.removeEventListener("keyup", c, !0), e = null, r !== null && (cancelAnimationFrame(r), r = null);
51
+ }, f = () => {
52
+ e = v(), e == null || e.addEventListener("scroll", s, !0), e == null || e.addEventListener("click", c, !0), e == null || e.addEventListener("keyup", c, !0);
53
+ };
54
+ return L(() => {
55
+ t.setConfig(a, g()), f();
56
+ }), O(p), { __sfc: !0, ONBOARDING_TYPE: a, UPDATE_BUTTON_SELECTOR: l, trans: i, onboardingStore: t, getTopPosition: m, academyLink: u, buildOnboardingCards: g, isVisible: y, handleNext: b, editorRoot: e, handlePanelScroll: s, pendingCheck: r, isUpdateButtonVisible: d, handlePanelInteraction: c, stopWatchingPanel: p, startWatchingPanel: f, InOnboard: B };
42
57
  }
43
58
  });
44
59
  export {
45
- A as default
60
+ F as default
46
61
  };
@@ -1,44 +1,46 @@
1
- import p from "../static/assets/icons/filled-arrow-rising.svg.js";
2
- import s from "../static/assets/icons/line-change.svg.js";
3
- import f from "../static/assets/icons/line-delete.svg.js";
4
- import a from "../static/assets/icons/line-info.svg.js";
5
- import c from "../static/assets/icons/line-plus.svg.js";
6
- import l from "../static/styles/base.css.js";
7
- import C from "../static/styles/components/accessibility.css.js";
8
- import d from "../static/styles/components/alert-message.css.js";
9
- import u from "../static/styles/components/amp-block.css.js";
10
- import h from "../static/styles/components/base-input.css.js";
11
- import I from "../static/styles/components/button-group.css.js";
12
- import g from "../static/styles/components/button.css.js";
13
- import w from "../static/styles/components/combobox.css.js";
14
- import y from "../static/styles/components/counter.css.js";
15
- import A from "../static/styles/components/dropdown-menu.css.js";
16
- import $ from "../static/styles/components/loader.css.js";
17
- import b from "../static/styles/components/narrow-panel.css.js";
18
- import B from "../static/styles/components/popup.css.js";
19
- import D from "../static/styles/components/recommendation-strategy.css.js";
20
- import R from "../static/styles/components/skeleton.css.js";
21
- import P from "../static/styles/components/switcher.css.js";
22
- import T from "../static/styles/components/tabs.css.js";
23
- import x from "../static/styles/components/tools.css.js";
24
- import M from "../static/styles/components/version-history.css.js";
25
- import O from "../static/styles/components/wide-panel.css.js";
26
- import V from "../static/styles/variables.css.js";
1
+ import S from "../static/assets/icons/filled-arrow-rising.svg.js";
2
+ import p from "../static/assets/icons/line-change.svg.js";
3
+ import s from "../static/assets/icons/line-delete.svg.js";
4
+ import f from "../static/assets/icons/line-info.svg.js";
5
+ import a from "../static/assets/icons/line-plus.svg.js";
6
+ import c from "../static/styles/base.css.js";
7
+ import l from "../static/styles/components/accessibility.css.js";
8
+ import C from "../static/styles/components/alert-message.css.js";
9
+ import d from "../static/styles/components/amp-block.css.js";
10
+ import u from "../static/styles/components/base-input.css.js";
11
+ import h from "../static/styles/components/button-group.css.js";
12
+ import I from "../static/styles/components/button.css.js";
13
+ import g from "../static/styles/components/combobox.css.js";
14
+ import w from "../static/styles/components/counter.css.js";
15
+ import y from "../static/styles/components/dropdown-menu.css.js";
16
+ import A from "../static/styles/components/loader.css.js";
17
+ import $ from "../static/styles/components/narrow-panel.css.js";
18
+ import b from "../static/styles/components/popup.css.js";
19
+ import B from "../static/styles/components/recommendation-strategy.css.js";
20
+ import D from "../static/styles/components/skeleton.css.js";
21
+ import R from "../static/styles/components/switcher.css.js";
22
+ import P from "../static/styles/components/tabs.css.js";
23
+ import T from "../static/styles/components/tools.css.js";
24
+ import x from "../static/styles/components/version-history.css.js";
25
+ import E from "../static/styles/components/wide-panel.css.js";
26
+ import M from "../static/styles/variables.css.js";
27
+ import { findEditorShadowRoot as O } from "../utils/editorShadowRoot.js";
27
28
  function o(i, r) {
28
29
  return `--guido-icon-${i}: url("data:image/svg+xml,${encodeURIComponent(r.trim())}");`;
29
30
  }
30
- const W = `:host {
31
- ${o("line-change", s)}
32
- ${o("line-delete", f)}
33
- ${o("filled-arrow-rising", p)}
34
- ${o("line-info", a)}
35
- ${o("line-plus", c)}
36
- }`, _ = [
37
- V,
31
+ const V = `:host {
32
+ ${o("line-change", p)}
33
+ ${o("line-delete", s)}
34
+ ${o("filled-arrow-rising", S)}
35
+ ${o("line-info", f)}
36
+ ${o("line-plus", a)}
37
+ }`, W = [
38
+ M,
38
39
  // Must be on top
39
- W,
40
- l,
40
+ V,
41
+ c,
41
42
  // Must be on top
43
+ C,
42
44
  d,
43
45
  u,
44
46
  h,
@@ -49,34 +51,32 @@ const W = `:host {
49
51
  A,
50
52
  $,
51
53
  b,
52
- B,
54
+ D,
53
55
  R,
54
56
  P,
55
57
  T,
56
58
  x,
57
- M,
58
- O,
59
- D,
60
- C
59
+ E,
60
+ B,
61
+ l
61
62
  ].join(`
62
63
 
63
- `), k = 3e4;
64
+ `), _ = 3e4;
64
65
  let e = null;
65
- function q() {
66
- return e || (e = new CSSStyleSheet(), e.replaceSync(_)), e;
66
+ function k() {
67
+ return e || (e = new CSSStyleSheet(), e.replaceSync(W)), e;
67
68
  }
68
- const fo = () => ({ importCss: () => {
69
- const r = q(), S = Date.now() + k, m = () => {
70
- var n;
71
- const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
69
+ const ao = () => ({ importCss: () => {
70
+ const r = k(), n = Date.now() + _, m = () => {
71
+ const t = O();
72
72
  if (t) {
73
73
  t.adoptedStyleSheets.includes(r) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, r]);
74
74
  return;
75
75
  }
76
- Date.now() < S && requestAnimationFrame(m);
76
+ Date.now() < n && requestAnimationFrame(m);
77
77
  };
78
78
  m();
79
79
  } });
80
80
  export {
81
- fo as useCustomInterfaceAppearance
81
+ ao as useCustomInterfaceAppearance
82
82
  };
@@ -1,15 +1,16 @@
1
+ import { findEditorShadowRoot as i } from "../utils/editorShadowRoot.js";
1
2
  import { FULLSTORY_BRIDGE_SCRIPT_URL as s } from "../utils/fullStoryScripts.js";
2
- const l = () => ({ injectFullStory: () => {
3
- var c;
4
- const n = window;
5
- if (typeof n._fs_org != "string" || !n._fs_org)
3
+ const d = () => ({ injectFullStory: () => {
4
+ var n;
5
+ const e = window;
6
+ if (typeof e._fs_org != "string" || !e._fs_org)
6
7
  return;
7
- const e = document.querySelector("ui-editor"), o = (c = e == null ? void 0 : e.shadowRoot) == null ? void 0 : c.querySelector("iframe"), r = o == null ? void 0 : o.contentDocument;
8
- if (!r || r.querySelector('script[data-fullstory-bridge="true"]'))
8
+ const o = (n = i()) == null ? void 0 : n.querySelector("iframe"), t = o == null ? void 0 : o.contentDocument;
9
+ if (!t || t.querySelector('script[data-fullstory-bridge="true"]'))
9
10
  return;
10
- const t = r.createElement("script");
11
- t.src = s, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", r.head.appendChild(t);
11
+ const r = t.createElement("script");
12
+ r.src = s, r.async = !0, r.crossOrigin = "anonymous", r.dataset.fullstoryBridge = "true", t.head.appendChild(r);
12
13
  } });
13
14
  export {
14
- l as useFullStoryBridge
15
+ d as useFullStoryBridge
15
16
  };
@@ -16,40 +16,40 @@ import { useHtmlValidator as tt } from "./useHtmlValidator.js";
16
16
  import { useToaster as et } from "./useToaster.js";
17
17
  import { useCouponBlockValidator as ot } from "./validators/useCouponBlockValidator.js";
18
18
  import { useHtmlDocumentCountValidator as it } from "./validators/useHtmlDocumentCountValidator.js";
19
- import { useLiquidValidator as rt } from "./validators/useLiquidValidator.js";
20
- import { useSyncModuleBlockValidator as st } from "./validators/useSyncModuleBlockValidator.js";
19
+ import { useLiquidValidator as st } from "./validators/useLiquidValidator.js";
20
+ import { useSyncModuleBlockValidator as rt } from "./validators/useSyncModuleBlockValidator.js";
21
21
  import { useUnsubscribeBlockValidator as at } from "./validators/useUnsubscribeBlockValidator.js";
22
22
  const Pt = () => {
23
- const n = I(), S = N(), { validateHtml: y } = tt(), { validateLiquidSyntax: b } = rt(), { validateCouponBlockTags: H } = ot(), {
23
+ const n = I(), S = N(), { validateHtml: y } = tt(), { validateLiquidSyntax: b } = st(), { validateCouponBlockTags: H } = ot(), {
24
24
  validateUnsubscribeBlockUniqueness: E,
25
25
  validateUnsubscribeBlockHasTemplate: g,
26
26
  validateNoInsiderUnsubscribeCode: V
27
- } = at(), { validateSyncModuleBlocks: l } = st(), { validateSingleHtmlDocument: c } = it(), { callbacks: a, isFeatureEnabled: u } = D(), { extractSyncModuleData: x } = G(), { setSyncModuleUnsubscriptionPages: k } = K(), { editorSave: C, getTemplateData: m } = O(), { showToaster: h } = et(), { getBlockedDomains: B, resolveToast: T } = $(), { prepareTemplateDetails: p } = Z(), { collectSaveValidationErrors: L } = j(), { isEnabled: P } = z(), U = Y(), A = X(), w = Q(), { runExclusive: d } = F(), f = async (t, e, i) => {
27
+ } = at(), { validateSyncModuleBlocks: l } = rt(), { validateSingleHtmlDocument: c } = it(), { callbacks: a, isFeatureEnabled: u } = D(), { extractSyncModuleData: x } = G(), { setSyncModuleUnsubscriptionPages: k } = K(), { editorSave: C, getTemplateData: m } = O(), { showToaster: h } = et(), { getBlockedDomains: B, resolveToast: T } = $(), { prepareTemplateDetails: p } = Z(), { collectSaveValidationErrors: L } = j(), { isEnabled: P } = z(), U = Y(), A = X(), w = Q(), { runExclusive: d } = F(), f = async (t, e, i) => {
28
28
  if (!u("allowlistEnabled"))
29
29
  return !1;
30
30
  const o = await B(t, e);
31
31
  if (!o.length)
32
32
  return !1;
33
33
  if (!i) {
34
- const r = await T(o);
35
- r != null && r.message && h({
34
+ const s = await T(o);
35
+ s != null && s.message && h({
36
36
  type: J.Warning,
37
- message: r.message,
38
- actionButton: r.actionButton
37
+ message: s.message,
38
+ actionButton: s.actionButton
39
39
  });
40
40
  }
41
41
  return !0;
42
42
  }, M = async (t, e) => !H(t.compiledHtml) || u("blockUnsubscribeLinks") && !V(t.rawHtml, e) || !E(t.compiledHtml) || !g(t.compiledHtml) ? !1 : u("liquidSyntax") ? b(t.compiledHtml) : y(t.compiledHtml, t.dynamicContentList, !0), v = async (t, e) => {
43
43
  if (!await C())
44
44
  return;
45
- const { unsubscribePayload: o, stripoModules: r } = x(t.rawHtml);
46
- if (await k(o), t.modules = r, !e.suppress) {
47
- const s = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
48
- S({ ...t, ...s, silent: e.silent });
45
+ const { unsubscribePayload: o, stripoModules: s } = x(t.rawHtml);
46
+ if (await k(o), t.modules = s, !e.suppress) {
47
+ const r = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
48
+ S({ ...t, ...r, silent: e.silent });
49
49
  }
50
50
  return t;
51
51
  }, W = async (t, e) => {
52
- var r;
52
+ var s;
53
53
  n();
54
54
  const i = await m();
55
55
  if (!c(i.html, e))
@@ -57,20 +57,18 @@ const Pt = () => {
57
57
  const o = await p(i);
58
58
  if (l(o.rawHtml, e)) {
59
59
  if (P.value && !e) {
60
- const s = await L(
60
+ const r = await L(
61
61
  o.compiledHtml,
62
62
  o.dynamicContentList,
63
63
  o.rawHtml
64
64
  );
65
- if (!s)
66
- return;
67
- if (s.length) {
68
- U.open(s, "save");
65
+ if (r.length) {
66
+ U.open(r, "save");
69
67
  return;
70
68
  }
71
69
  } else if (!await M(o, e))
72
70
  return;
73
- if (!((r = a.value) != null && r.externalValidation && !await a.value.externalValidation(o)) && !await f(o.compiledHtml, o.css, e))
71
+ if (!((s = a.value) != null && s.externalValidation && !await a.value.externalValidation(o)) && !await f(o.compiledHtml, o.css, e))
74
72
  return v(o, { silent: e, suppress: t });
75
73
  }
76
74
  }, R = async () => {