@useinsider/guido 3.18.2-beta.6cafced → 3.18.2-beta.6dbea61

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 (41) hide show
  1. package/dist/components/Guido.vue.js +3 -3
  2. package/dist/components/Guido.vue2.js +30 -30
  3. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
  4. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -70
  5. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
  6. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
  7. package/dist/composables/useCustomInterfaceAppearance.js +46 -56
  8. package/dist/composables/useHtmlValidator.js +79 -84
  9. package/dist/composables/useRecommendation.js +35 -40
  10. package/dist/composables/useStripo.js +30 -30
  11. package/dist/enums/extensions/recommendationBlock.js +31 -38
  12. package/dist/extensions/Blocks/Recommendation/block.js +39 -43
  13. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
  14. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +44 -55
  15. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
  16. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  17. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -190
  18. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +16 -26
  19. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
  20. package/dist/guido.css +1 -1
  21. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +28 -29
  22. package/dist/package.json.js +1 -1
  23. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  24. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
  25. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  26. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -7
  27. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
  28. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -7
  29. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -87
  30. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
  31. package/dist/src/stores/onboarding.d.ts +0 -377
  32. package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
  33. package/dist/stores/onboarding.js +36 -41
  34. package/dist/utils/templatePreparation.js +54 -55
  35. package/package.json +3 -3
  36. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
  37. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
  38. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +0 -24
  39. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
  40. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +0 -14
  41. package/dist/static/styles/components/skeleton.css.js +0 -23
@@ -1,31 +1,31 @@
1
- import { useActionsApi as R } from "../composables/useActionsApi.js";
2
- import { useConfig as k } from "../composables/useConfig.js";
3
- import { useHtmlCompiler as N } from "../composables/useHtmlCompiler.js";
4
- import { RRS_CONFIG_VERSION as U, DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as I } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
- import { mapLegacyStrategy as x } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
- import { DATA_ATTRIBUTES as T } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
- import { parsePageList as L } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
- import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
10
- import { useEditorStore as _ } from "../stores/editor.js";
11
- import { useUnsubscribeStore as O } from "../stores/unsubscribe.js";
1
+ import { useActionsApi as k } from "../composables/useActionsApi.js";
2
+ import { useConfig as U } from "../composables/useConfig.js";
3
+ import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
4
+ import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
+ import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
+ import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
+ import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
+ import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
10
+ import { useEditorStore as z } from "../stores/editor.js";
11
+ import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
12
12
  import { assignTrackingIds as v } from "./linkTrackingIds.js";
13
- function B(l) {
14
- const s = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${T.PAGE_LIST}]`), t = [];
15
- return s.forEach((c) => {
16
- const r = c.getAttribute(T.PAGE_LIST);
17
- r && t.push(...L(r));
13
+ function O(m) {
14
+ const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
+ return i.forEach((s) => {
16
+ const o = s.getAttribute(A.PAGE_LIST);
17
+ o && t.push(...R(o));
18
18
  }), [...new Set(t)];
19
19
  }
20
- async function G(l) {
21
- const n = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
20
+ async function M(m) {
21
+ const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
22
  if (n.length === 0)
23
23
  return;
24
- const s = I();
24
+ const i = C();
25
25
  n.forEach((t) => {
26
- var d, g, f, i, y, S;
27
- const c = t.getAttribute("recommendation-id"), r = c ? Number(c) : NaN;
28
- if (!Number.isFinite(r))
26
+ var r, l, g, f, c;
27
+ const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
28
+ if (!Number.isFinite(o))
29
29
  return;
30
30
  const p = t.getAttribute("esd-ext-config");
31
31
  if (!p)
@@ -38,11 +38,11 @@ async function G(l) {
38
38
  }
39
39
  if (!e || typeof e != "object" || Array.isArray(e))
40
40
  return;
41
- const A = !!e.strategyId || (e.configVersion ?? 0) >= U, o = {
41
+ const h = {
42
42
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
43
43
  // already-saved blocks that never re-run the migrator don't emit a
44
44
  // strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
45
- strategy: x(e.strategy) || (A ? "" : a.strategy),
45
+ strategy: L(e.strategy) || a.strategy,
46
46
  strategyId: e.strategyId ?? a.strategyId,
47
47
  language: e.language ?? a.language,
48
48
  size: e.size ?? a.size,
@@ -51,17 +51,16 @@ async function G(l) {
51
51
  productIds: e.productIds ?? [...a.productIds],
52
52
  filters: e.filters ?? [...a.filters],
53
53
  shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
54
- currencyCode: ((d = e.currency) == null ? void 0 : d.code) ?? m.code,
55
- currencySymbol: ((g = e.currency) == null ? void 0 : g.symbol) ?? m.symbol,
56
- currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? m.alignment,
57
- currencyDecimalCount: ((i = e.currency) == null ? void 0 : i.decimalCount) ?? m.decimalCount,
58
- currencyDecimalSeparator: ((y = e.currency) == null ? void 0 : y.decimalSeparator) ?? m.decimalSeparator,
59
- currencyThousandSeparator: ((S = e.currency) == null ? void 0 : S.thousandSeparator) ?? m.thousandSeparator
54
+ currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
55
+ currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
56
+ currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
57
+ currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
58
+ currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
60
59
  };
61
- s.seedBlockUrlConfig(r, o);
60
+ i.seedBlockUrlConfig(o, h);
62
61
  });
63
62
  try {
64
- await s.fetchRecommendationCreateData();
63
+ await i.fetchRecommendationCreateData();
65
64
  } catch (t) {
66
65
  console.warn(
67
66
  "Recommendation reference data pre-load failed; validator will skip the availability check.",
@@ -69,51 +68,51 @@ async function G(l) {
69
68
  );
70
69
  }
71
70
  }
72
- const ee = () => {
73
- const l = z(), u = _(), n = O(), { getCompiledEmail: s, getTemplateData: t, updateHtmlAndCss: c } = R(), { compileHtml: r, compileAmpHtml: p } = N(), { isFeatureEnabled: e } = k();
71
+ const Z = () => {
72
+ const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
74
73
  return {
75
74
  prepareTemplateDetails: async () => {
76
- let { html: o, css: d, syncModulesIds: g = [] } = await t();
75
+ let { html: r, css: l, syncModulesIds: g = [] } = await t();
77
76
  if (e("linkTrackingIds"))
78
77
  try {
79
- const { html: b, changed: P, nextSeq: H } = v(o, u.trackIdSessionFloor);
80
- u.trackIdSessionFloor = H, P && (o = b, await c(b, d));
81
- } catch (b) {
82
- console.error("Tracking-id step failed, saving anyway:", b);
78
+ const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
79
+ u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
80
+ } catch (S) {
81
+ console.error("Tracking-id step failed, saving anyway:", S);
83
82
  }
84
- const { html: f, ampHtml: i = "", ampErrors: y = [] } = await s({
83
+ const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
85
84
  minimize: !0,
86
85
  resetDataSavedFlag: !1
87
86
  });
88
- n.selectedUnsubscribePages.length && await n.fetchTemplates(), await G(o);
89
- const { compiledHtml: S, stats: h, appliedRules: w } = r(f), D = i && p(i).compiledHtml, E = l.getSelectedDynamicContentList, F = I(), C = B(o);
87
+ n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
88
+ const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
90
89
  return console.debug("HTML Compilation Stats:", {
91
- originalSize: h.originalSize,
92
- compiledSize: h.compiledSize,
93
- reduction: `${h.reductionPercentage.toFixed(2)}%`,
90
+ originalSize: y.originalSize,
91
+ compiledSize: y.compiledSize,
92
+ reduction: `${y.reductionPercentage.toFixed(2)}%`,
94
93
  appliedRules: w,
95
- executionTime: `${h.executionTime.toFixed(2)}ms`
94
+ executionTime: `${y.executionTime.toFixed(2)}ms`
96
95
  }), {
97
96
  dynamicContentList: E,
98
- compiledHtml: S,
99
- rawHtml: o,
100
- css: d,
97
+ compiledHtml: I,
98
+ rawHtml: r,
99
+ css: l,
101
100
  ampHtml: D,
102
- ampErrors: y,
101
+ ampErrors: T,
103
102
  modules: g.map(Number),
104
103
  recommendation: {
105
- campaignUrls: F.recommendationCampaignUrls,
104
+ campaignUrls: P.recommendationCampaignUrls,
106
105
  configs: {}
107
106
  },
108
107
  unsubscribe: {
109
- status: C.length > 0,
110
- config: C
108
+ status: b.length > 0,
109
+ config: b
111
110
  }
112
111
  };
113
112
  }
114
113
  };
115
114
  };
116
115
  export {
117
- B as getHtmlReferencedUnsubscribePages,
118
- ee as useTemplatePreparation
116
+ O as getHtmlReferencedUnsubscribePages,
117
+ Z as useTemplatePreparation
119
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.18.2-beta.6cafced",
3
+ "version": "3.18.2-beta.6dbea61",
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",
@@ -47,7 +47,7 @@
47
47
  "author": "",
48
48
  "license": "ISC",
49
49
  "dependencies": {
50
- "@stripoinc/ui-editor-extensions": "3.10.0",
50
+ "@stripoinc/ui-editor-extensions": "3.9.0",
51
51
  "@useinsider/design-system-organisms": "0.0.3-beta.d816f06",
52
52
  "@useinsider/design-system-vue": "1.5.0",
53
53
  "@vueuse/core": "11.3.0",
@@ -118,7 +118,7 @@
118
118
  },
119
119
  "guido": {
120
120
  "stripo": {
121
- "version": "2.76.0"
121
+ "version": "2.73.0"
122
122
  }
123
123
  }
124
124
  }
@@ -1,21 +0,0 @@
1
- import d from "./RecommendationStrategyOnboarding.vue2.js";
2
- /* empty css */
3
- import g from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var m = function() {
5
- var e, n, r, i, a;
6
- var t = this, s = t._self._c, o = t._self._setupProxy;
7
- return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.right, "top-position": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.top }, on: { close: function(p) {
8
- return o.onboardingStore.close(o.ONBOARDING_TYPE);
9
- }, nextButtonClick: o.handleNext } }) : t._e();
10
- }, c = [], _ = /* @__PURE__ */ g(
11
- d,
12
- m,
13
- c,
14
- !1,
15
- null,
16
- "ec2027ff"
17
- );
18
- const S = _.exports;
19
- export {
20
- S as default
21
- };
@@ -1,47 +0,0 @@
1
- import { defineComponent as g, computed as p, watch as b } from "vue";
2
- import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
3
- import { useTranslations as l } from "../../../composables/useTranslations.js";
4
- import { ACADEMY_LINKS as f } from "../../../enums/academy.js";
5
- import { useRecommendationExtensionStore as O } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
6
- import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
7
- import { InOnboard as y } from "@useinsider/design-system-vue";
8
- const h = /* @__PURE__ */ g({
9
- __name: "RecommendationStrategyOnboarding",
10
- setup(C) {
11
- const n = "recommendationStrategyOnboarding", e = l(), t = _(), i = O(), { getTopPosition: r } = u(), a = `<a href="${f.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${e("action-builder.visit-academy")}</a>`, m = () => [
12
- {
13
- classes: "guido-recommendation-strategy-onboarding",
14
- // Sits in the gap left of the settings panel and points at the strategy section, which
15
- // starts 208px down: the panel header and its tab row are fixed chrome above it.
16
- right: "426px",
17
- top: r(208),
18
- position: "Right Top",
19
- title: e("email-editor.onboarding-recommendation-strategy-title"),
20
- description: e("email-editor.onboarding-recommendation-strategy-description", {
21
- academyLink: a
22
- }),
23
- imageSource: "",
24
- backButtonClick: () => {
25
- },
26
- nextButtonType: "text",
27
- nextButtonText: e("action-builder.ok"),
28
- nextButtonClick: () => {
29
- t.close(n);
30
- }
31
- }
32
- ], c = p(() => i.strategyPanelOpen && t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
33
- var o, s;
34
- (s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
35
- };
36
- return b(
37
- () => t.isActive(n),
38
- (o) => {
39
- o && t.setConfig(n, m());
40
- },
41
- { immediate: !0 }
42
- ), { __sfc: !0, ONBOARDING_TYPE: n, trans: e, onboardingStore: t, recommendationStore: i, getTopPosition: r, academyLink: a, buildOnboardingCards: m, isVisible: c, handleNext: d, InOnboard: y };
43
- }
44
- });
45
- export {
46
- h as default
47
- };
@@ -1,24 +0,0 @@
1
- import { useRecommendationExtensionStore as s } from "../store/recommendation.js";
2
- import { commitBlockChangeOutsidePanel as d } from "./nodeConfigWriter.js";
3
- async function u(e, n) {
4
- const t = s(), o = t.blockStates[e];
5
- if (!o)
6
- return !1;
7
- const { strategyId: a, strategy: c, size: i } = o.recommendationConfigs;
8
- if (t.currentRecommendationId === e)
9
- try {
10
- await t.fetchRecommendationProducts();
11
- } catch (m) {
12
- console.error("[recommendation] product refetch after a strategy change failed", m);
13
- }
14
- const r = d(
15
- e,
16
- { strategyId: a, strategy: c, size: i },
17
- o.recommendationProducts,
18
- n
19
- );
20
- return r || console.error("[recommendation] strategy change did not reach a node", { blockId: e }), r;
21
- }
22
- export {
23
- u as commitStrategyChange
24
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
- export default _default;
@@ -1,14 +0,0 @@
1
- /**
2
- * Writes a strategy change and its products straight to the document, without the settings panel.
3
- *
4
- * Every entry point is host-rendered UI outside `ui-editor`, and none of them can rely on the
5
- * panel control: opening the strategy page deselects the block, so by the time the user comes back
6
- * and presses Assign the control — and with it the subscription that does the node write, the
7
- * product fetch and the repaint — is gone. The assignment then reaches Pinia and nothing else
8
- * (SD-149916).
9
- *
10
- * Call AFTER the store change (`assignStrategy` / `removeStrategy`).
11
- * @param description - labels the undo entry
12
- * @returns whether the write reached a node
13
- */
14
- export declare function commitStrategyChange(blockId: number, description: string): Promise<boolean>;
@@ -1,23 +0,0 @@
1
- const e = `/*
2
- * Mirrors the design system's InSkeleton 1:1 (gradient stops, 200% size, 1.6s linear).
3
- * The Stripo panel lives in the editor's shadow root and is built from raw HTML strings,
4
- * so the Vue component cannot be used there. Hex values are literal in the DS too.
5
- *
6
- * Base only: each panel sizes its own \`.guido-skeleton--*\` modifier to the footprint of
7
- * the element it stands in for.
8
- */
9
- .guido-skeleton {
10
- display: none;
11
- border-radius: 4px;
12
- background: linear-gradient(90deg, #f0f0f0 39.5%, #e1e1e1 66.02%, #f0f0f0 89.42%);
13
- background-size: 200% 100%;
14
- animation: guido-skeleton-shine 1.6s linear infinite;
15
- }
16
-
17
- @keyframes guido-skeleton-shine {
18
- to { background-position-x: -200%; }
19
- }
20
- `;
21
- export {
22
- e as default
23
- };