@useinsider/guido 3.7.2 → 3.8.0-beta.4a5664c

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.
@@ -1,8 +1,8 @@
1
1
  import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAttributes as C } from "../../../../enums/extensions/recommendationBlock.js";
2
2
  import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
3
3
  import { useConfigStore as G } from "../../../../stores/config.js";
4
- import { defineStore as P } from "pinia";
5
- import { DEFAULT_MOBILE_CARDS_IN_ROW as D, DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
4
+ import { defineStore as F } from "pinia";
5
+ import { DEFAULT_MOBILE_CARDS_IN_ROW as P, DEFAULT_CARDS_IN_ROW as D } from "../constants/layout.js";
6
6
  import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
7
7
  import { getDefaultProducts as S } from "../templates/utils.js";
8
8
  import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
@@ -13,7 +13,7 @@ const h = y();
13
13
  let m = null, u = null, d = null;
14
14
  function k() {
15
15
  return {
16
- cardsInRow: F,
16
+ cardsInRow: D,
17
17
  currencySettings: {
18
18
  name: "USD",
19
19
  value: "USD",
@@ -27,7 +27,7 @@ function k() {
27
27
  productIds: [],
28
28
  id: 1,
29
29
  language: "en_US",
30
- mobileCardsInRow: D,
30
+ mobileCardsInRow: P,
31
31
  mobileLayoutEnabled: !1,
32
32
  orientation: "grid",
33
33
  recommendedProducts: [],
@@ -60,7 +60,7 @@ const L = () => ({
60
60
  blockStates: {},
61
61
  currentRecommendationId: null,
62
62
  configVersion: 0
63
- }), K = P("guidoRecommendationExtension", {
63
+ }), K = F("guidoRecommendationExtension", {
64
64
  state: () => L(),
65
65
  getters: {
66
66
  // ====================================================================
@@ -133,7 +133,7 @@ const L = () => ({
133
133
  value: e.text
134
134
  })),
135
135
  getFilterList() {
136
- return Object.values(this.filterList).map((t) => {
136
+ return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
137
137
  let e;
138
138
  return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : C.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
139
139
  text: t.displayName,
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-82128f7d]{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-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-f6a8cb4c]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-f6a8cb4c]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-f6a8cb4c]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-f6a8cb4c]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-f6a8cb4c]{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-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-82128f7d]{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-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-f6a8cb4c]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-f6a8cb4c]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-f6a8cb4c]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-f6a8cb4c]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-f6a8cb4c]{object-fit:cover;transform:scale(1)}[data-v-18e1220a] .guido__verion-history-view-option-selection-desktop svg,[data-v-18e1220a] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-18e1220a] .in-segments-wrapper__button_selected,[data-v-18e1220a] .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-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.65.0" } }, s = {
1
+ const o = { stripo: { version: "2.66.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -1,40 +1,52 @@
1
- import { useHttp as a } from "../composables/useHttp.js";
2
- import { QUERY_PARAMS as d, URLS as h } from "../enums/extensions/recommendationBlock.js";
3
- const y = () => {
4
- const { get: r } = a(), { get: s } = a({ headers: {} }), m = "6KcLM9TwheVB1mgK";
1
+ import { useHttp as d } from "../composables/useHttp.js";
2
+ import { QUERY_PARAMS as l, URLS as u } from "../enums/extensions/recommendationBlock.js";
3
+ const R = (o) => o.reduce(
4
+ (a, t, s) => (a[s] = {
5
+ attributeName: t.attributeName,
6
+ attributeJs: t.attributeJs,
7
+ attributeType: t.attributeType,
8
+ type: t.type,
9
+ displayName: t.displayName,
10
+ isFilterable: t.isFilterable
11
+ }, a),
12
+ {}
13
+ ), f = () => {
14
+ const { get: o } = d(), { get: a } = d({ headers: {} }), t = "6KcLM9TwheVB1mgK";
5
15
  return {
6
16
  fetchRecommendationCreateData: async () => {
7
17
  try {
8
- return (await r("/newsletter/recommendations/create-data")).data;
18
+ return (await o("/newsletter/recommendations/create-data")).data;
9
19
  } catch (e) {
10
20
  throw console.error("fetchUserModalState error:", e), e;
11
21
  }
12
22
  },
13
23
  fetchRecommendationFilters: async () => {
14
24
  try {
15
- const { data: e } = await r("/stripo/email-recommendation-attributes");
16
- return e;
25
+ const { data: e } = await o(
26
+ u.PRODUCT_ATTRIBUTES_PATH
27
+ ), n = Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
28
+ return R(n);
17
29
  } catch (e) {
18
30
  throw console.error("fetchRecommendationFilters error:", e), e;
19
31
  }
20
32
  },
21
- fetchRecommendationProducts: async (e, i) => {
22
- var n;
33
+ fetchRecommendationProducts: async (e, n) => {
34
+ var i;
23
35
  try {
24
- const t = new URLSearchParams(Object.entries(i));
25
- t.set(d.CLIENT_ID, m);
26
- const c = decodeURIComponent(t.toString());
27
- console.debug("🏁 Recommendation API Query:", c);
28
- const o = await s(
29
- `${h.RECOMMENDATION_API_URL}/v2/${e}?${c}`
36
+ const r = new URLSearchParams(Object.entries(n));
37
+ r.set(l.CLIENT_ID, t);
38
+ const m = decodeURIComponent(r.toString());
39
+ console.debug("🏁 Recommendation API Query:", m);
40
+ const c = await a(
41
+ `${u.RECOMMENDATION_API_URL}/v2/${e}?${m}`
30
42
  );
31
- return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
32
- } catch (t) {
33
- throw console.error("fetchRecommendationProducts error:", t), t;
43
+ return ((i = c == null ? void 0 : c.data) == null ? void 0 : i.data) ?? [];
44
+ } catch (r) {
45
+ throw console.error("fetchRecommendationProducts error:", r), r;
34
46
  }
35
47
  }
36
48
  };
37
49
  };
38
50
  export {
39
- y as useRecommendationApi
51
+ f as useRecommendationApi
40
52
  };
@@ -2,6 +2,7 @@ import type { TextValueObject } from '@@/Types/generic';
2
2
  import type { RecommendationFeedItem } from '@@/Types/recommendation';
3
3
  export declare const URLS: {
4
4
  RECOMMENDATION_API_URL: string;
5
+ PRODUCT_ATTRIBUTES_PATH: string;
5
6
  };
6
7
  export declare const QUERY_PARAMS: {
7
8
  CLIENT_ID: string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Browser translate extensions wrap text in nested `<font dir="auto">` tags that
3
+ * pile up and eventually exceed Chrome's DOM-depth limit. Unwrap only those
4
+ * (keep inner content); leave other `<font>` untouched. Pure string ops, no DOM.
5
+ */
6
+ export declare function stripFontTags(html: string): string;
@@ -0,0 +1,13 @@
1
+ const n = /<font(?=[\s>])[^>]*\sdir=["']?auto["']?[^>]*>([\s\S]*?)<\/font>/gi;
2
+ function o(e) {
3
+ if (!e || !/<font/i.test(e))
4
+ return e;
5
+ let r, t = e;
6
+ do
7
+ r = t, t = t.replace(n, "$1");
8
+ while (t !== r);
9
+ return t;
10
+ }
11
+ export {
12
+ o as stripFontTags
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.7.2",
3
+ "version": "3.8.0-beta.4a5664c",
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",
@@ -27,6 +27,8 @@
27
27
  "test": "vitest run --coverage",
28
28
  "test:watch": "vitest",
29
29
  "test:visual-update": "npx playwright test --update-snapshots --reporter html",
30
+ "test:e2e:coverage": "E2E_COVERAGE=true playwright test",
31
+ "coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
30
32
  "prepare": "husky",
31
33
  "preinstall": "rm -rf ./node_modules/.vite"
32
34
  },
@@ -74,10 +76,12 @@
74
76
  "happy-dom": "15.11.7",
75
77
  "husky": "9.1.7",
76
78
  "msw": "2.10.3",
79
+ "nyc": "17.1.0",
77
80
  "sass": "1.69.7",
78
81
  "typescript": "5.5.4",
79
82
  "typescript-eslint": "8.26.0",
80
83
  "vite-plugin-dts": "4.5.4",
84
+ "vite-plugin-istanbul": "7.0.0",
81
85
  "vitest": "2.1.9",
82
86
  "vue-tsc": "2.2.10"
83
87
  },
@@ -90,9 +94,17 @@
90
94
  "msw": {
91
95
  "workerDirectory": "public"
92
96
  },
97
+ "nyc": {
98
+ "report-dir": "coverage/e2e",
99
+ "reporter": [
100
+ "lcov",
101
+ "text-summary"
102
+ ],
103
+ "all": false
104
+ },
93
105
  "guido": {
94
106
  "stripo": {
95
- "version": "2.65.0"
107
+ "version": "2.66.0"
96
108
  }
97
109
  }
98
110
  }