@useinsider/guido 3.19.0-beta.ab4fcb3 → 3.19.0-beta.b539426

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 (36) hide show
  1. package/dist/components/Guido.vue.js +6 -6
  2. package/dist/components/Guido.vue2.js +27 -26
  3. package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
  4. package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
  5. package/dist/components/wrappers/WpModal.vue.js +1 -1
  6. package/dist/components/wrappers/WpModal.vue2.js +4 -3
  7. package/dist/composables/useAuthError.js +52 -0
  8. package/dist/composables/useAutoSave.js +11 -11
  9. package/dist/composables/useHttp.js +64 -54
  10. package/dist/composables/useLegacyStrategyConversion.js +23 -19
  11. package/dist/composables/useStripo.js +24 -20
  12. package/dist/composables/useToaster.js +17 -15
  13. package/dist/composables/validators/useLiquidValidator.js +15 -15
  14. package/dist/config/migrator/recommendationMigrator.js +28 -21
  15. package/dist/config/migrator/recommendationPartnerMigrator.js +36 -30
  16. package/dist/enums/extensions/recommendationBlock.js +30 -29
  17. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +105 -96
  18. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +29 -29
  19. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +72 -70
  20. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +69 -60
  21. package/dist/guido.css +1 -1
  22. package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
  23. package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
  24. package/dist/src/composables/useAuthError.d.ts +12 -0
  25. package/dist/src/composables/useGuidoActions.d.ts +2 -0
  26. package/dist/src/composables/useHttp.d.ts +2 -0
  27. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
  28. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +2 -0
  29. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +4 -0
  30. package/dist/src/mock/cortexChatStore.d.ts +12 -0
  31. package/dist/src/stores/onboarding.d.ts +4 -0
  32. package/dist/src/stores/recommendation.d.ts +5 -0
  33. package/dist/src/utils/dateUtil.d.ts +10 -0
  34. package/dist/src/utils/genericUtil.d.ts +3 -0
  35. package/dist/stores/onboarding.js +4 -0
  36. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
- import { useToaster as D } from "../../../../composables/useToaster.js";
1
+ import { useToaster as _ } from "../../../../composables/useToaster.js";
2
2
  import { useTranslations as L } from "../../../../composables/useTranslations.js";
3
- import { getRecommendationFeedSourceMaps as F, strategyEditPath as U, URLS as E, getOperatorOptions as N, PriceAttributes as M } from "../../../../enums/extensions/recommendationBlock.js";
4
- import { ToasterTypeOptions as A } from "../../../../enums/toaster.js";
5
- import { useRecommendationApi as T } from "../../../../services/recommendationApi.js";
6
- import { useConfigStore as k } from "../../../../stores/config.js";
7
- import { defineStore as B } from "pinia";
3
+ import { getRecommendationFeedSourceMaps as F, strategyEditPath as U, strategyCreatePath as N, getOperatorOptions as M, PriceAttributes as E } from "../../../../enums/extensions/recommendationBlock.js";
4
+ import { ToasterTypeOptions as B } from "../../../../enums/toaster.js";
5
+ import { useRecommendationApi as z } from "../../../../services/recommendationApi.js";
6
+ import { useConfigStore as R } from "../../../../stores/config.js";
7
+ import { defineStore as A } from "pinia";
8
8
  import "../constants/selectors.js";
9
- import { DEFAULT_MOBILE_CARDS_IN_ROW as O, DEFAULT_CARDS_IN_ROW as z } from "../constants/layout.js";
10
- import { CURRENT_CONFIG_VERSION as C, DEFAULT_NODE_CONFIG as x, EXCLUDED_ALGORITHM_IDS as V } from "../constants/defaultConfig.js";
9
+ import { DEFAULT_MOBILE_CARDS_IN_ROW as O, DEFAULT_CARDS_IN_ROW as x } from "../constants/layout.js";
10
+ import { CURRENT_CONFIG_VERSION as C, DEFAULT_NODE_CONFIG as T, EXCLUDED_ALGORITHM_IDS as V } from "../constants/defaultConfig.js";
11
11
  import { getDefaultProducts as w } from "../templates/utils.js";
12
12
  import { generateCompleteFilterQuery as P } from "../utils/filterUtil.js";
13
13
  import { isLegacyStrategyConfig as j } from "../utils/legacyStrategyMigration.js";
@@ -15,13 +15,13 @@ import { getPartnerRecommendationParams as $ } from "../utils/partnerCustomizati
15
15
  import { sanitizeProductIds as q } from "../utils/productIds.js";
16
16
  import { isFilterValid as K } from "../validation/filterSchema.js";
17
17
  import { getInvalidFields as H, isConfigValid as J } from "../validation/requiredFields.js";
18
- const m = T();
19
- let S = null, p = null, y = null, I = "", R = null, b = 0;
18
+ const m = z();
19
+ let S = null, p = null, y = null, I = "", k = null, b = 0;
20
20
  const g = /* @__PURE__ */ new Map();
21
21
  let l = null;
22
- function _() {
22
+ function D() {
23
23
  return {
24
- cardsInRow: z,
24
+ cardsInRow: x,
25
25
  currencySettings: {
26
26
  name: "USD",
27
27
  value: "USD",
@@ -45,7 +45,7 @@ function _() {
45
45
  // that default is what reached buildCampaignUrl and baked a most-popular feed URL
46
46
  // for a block the user never configured (SD-149916). Legacy blocks still get their real
47
47
  // algorithm from the node-config sync or the save-time seed.
48
- strategy: k().isFeatureEnabled("reusableRecommendationStrategy") ? "" : "mostPopular",
48
+ strategy: R().isFeatureEnabled("reusableRecommendationStrategy") ? "" : "mostPopular",
49
49
  strategyId: "",
50
50
  nodeConfigVersion: C,
51
51
  textTrimming: !0,
@@ -58,7 +58,7 @@ function _() {
58
58
  }
59
59
  function G() {
60
60
  return {
61
- recommendationConfigs: _(),
61
+ recommendationConfigs: D(),
62
62
  recommendationProducts: [],
63
63
  filterStatus: !1,
64
64
  filterSelectionDrawerStatus: !1,
@@ -87,7 +87,7 @@ const Q = () => ({
87
87
  currentRecommendationId: null,
88
88
  strategyPanelOpen: !1,
89
89
  configVersion: 0
90
- }), ft = B("guidoRecommendationExtension", {
90
+ }), ft = A("guidoRecommendationExtension", {
91
91
  state: () => Q(),
92
92
  getters: {
93
93
  // ====================================================================
@@ -98,7 +98,7 @@ const Q = () => ({
98
98
  * This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
99
99
  */
100
100
  recommendationConfigs(t) {
101
- return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : _();
101
+ return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : D();
102
102
  },
103
103
  /**
104
104
  * Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
@@ -119,7 +119,7 @@ const Q = () => ({
119
119
  return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].removeStrategyModalStatus : !1;
120
120
  },
121
121
  isLegacyStrategyBlock() {
122
- return k().isFeatureEnabled("reusableRecommendationStrategy") && j(this.recommendationConfigs);
122
+ return R().isFeatureEnabled("reusableRecommendationStrategy") && j(this.recommendationConfigs);
123
123
  },
124
124
  legacyConversionLoading(t) {
125
125
  return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].legacyConversionLoading ?? !1 : !1;
@@ -181,7 +181,7 @@ const Q = () => ({
181
181
  getFilterList() {
182
182
  return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
183
183
  let e;
184
- return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : M.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
184
+ return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : E.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
185
185
  text: t.displayName,
186
186
  value: e,
187
187
  type: t.attributeType
@@ -234,7 +234,7 @@ const Q = () => ({
234
234
  const r = this.blockStates[t];
235
235
  if (r) {
236
236
  const o = structuredClone(r);
237
- o.recommendationConfigs.id = e, o.recommendationConfigs.strategyId && k().isFeatureEnabled("reusableRecommendationStrategy") && (o.isInitialized = !1, o.syncedConfigFingerprint = null), this.blockStates = {
237
+ o.recommendationConfigs.id = e, o.recommendationConfigs.strategyId && R().isFeatureEnabled("reusableRecommendationStrategy") && (o.isInitialized = !1, o.syncedConfigFingerprint = null), this.blockStates = {
238
238
  ...this.blockStates,
239
239
  [e]: o
240
240
  };
@@ -314,7 +314,7 @@ const Q = () => ({
314
314
  * Creates a filter with the first available attribute and operator pre-selected.
315
315
  */
316
316
  createDefaultFilter(t, e) {
317
- const [r] = this.getFilterList, [n] = N(r == null ? void 0 : r.type);
317
+ const [r] = this.getFilterList, [n] = M(r == null ? void 0 : r.type);
318
318
  return {
319
319
  type: "standardFilter",
320
320
  attribute: (r == null ? void 0 : r.value) ?? "",
@@ -380,9 +380,9 @@ const Q = () => ({
380
380
  this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].removeStrategyModalStatus = !1);
381
381
  },
382
382
  async fetchStrategies() {
383
- for (; R; )
383
+ for (; k; )
384
384
  try {
385
- await R;
385
+ await k;
386
386
  } catch {
387
387
  }
388
388
  if (this.strategiesFetched)
@@ -398,11 +398,11 @@ const Q = () => ({
398
398
  this.strategiesLoading = !1, t === b && (this.strategiesSettled = !0);
399
399
  }
400
400
  })();
401
- R = e;
401
+ k = e;
402
402
  try {
403
403
  await e;
404
404
  } finally {
405
- R = null;
405
+ k = null;
406
406
  }
407
407
  },
408
408
  /**
@@ -434,8 +434,8 @@ const Q = () => ({
434
434
  _armStrategyPageReturn(t) {
435
435
  const e = window.open(t, "_blank");
436
436
  if (!e)
437
- return D().showToaster({
438
- type: A.Error,
437
+ return _().showToaster({
438
+ type: B.Error,
439
439
  message: L()("discovery-strategy.error-description")
440
440
  }), !1;
441
441
  e.opener = null, l == null || l();
@@ -471,7 +471,7 @@ const Q = () => ({
471
471
  * new strategy is offered; the user picks it themselves.
472
472
  */
473
473
  openStrategyCreation() {
474
- return this._armStrategyPageReturn(E.RECOMMENDATION_STRATEGY_CREATE_PATH);
474
+ return this._armStrategyPageReturn(N());
475
475
  },
476
476
  /**
477
477
  * Opens the strategy's edit page. Every return refreshes the list so the block reflects the
@@ -533,7 +533,7 @@ const Q = () => ({
533
533
  this.patchCurrentBlockConfig({
534
534
  strategyId: "",
535
535
  strategy: "",
536
- size: x.size,
536
+ size: T.size,
537
537
  nodeConfigVersion: C
538
538
  });
539
539
  },
@@ -686,7 +686,7 @@ const Q = () => ({
686
686
  },
687
687
  async _doFetchProducts() {
688
688
  var h;
689
- const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = k();
689
+ const t = this.currentRecommendationId, e = this.blockStates[t], { recommendationConfigs: r } = e, n = R();
690
690
  if (r.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy")) {
691
691
  await this._doFetchStrategyProducts(t);
692
692
  return;
@@ -1,10 +1,10 @@
1
- import { extractWrapperTags as C } from "../../../../utils/preserveTextStyles.js";
1
+ import { extractWrapperTags as A } from "../../../../utils/preserveTextStyles.js";
2
2
  import { RecommendationBlockId as c } from "../constants/blockIds.js";
3
- import { DESKTOP_CONTAINER_SELECTOR as S, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_PRICE as p, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_OMNIBUS_PRICE as A, ATTR_PRODUCT_OMNIBUS_DISCOUNT as R, ATTR_PRODUCT_BUTTON as P, ATTR_PRODUCT_IMAGE as q, ATTR_PRODUCT_ATTR as x } from "../constants/selectors.js";
4
- import { CSS_CLASS_TEXT_TRIM as v } from "../controls/shared/textTrimCssRules.js";
5
- import { toCustomCompositionKey as B } from "../templates/utils.js";
6
- import { resolveRowCompositionKey as U } from "./compositionKeys.js";
7
- import { hasQuerySelectorAll as _, hasGetAttribute as l, hasGetStyle as I, hasGetComputedStyle as N } from "./tagName.js";
3
+ import { DESKTOP_CONTAINER_SELECTOR as b, ATTR_PRODUCT_NAME as k, ATTR_PRODUCT_PRICE as y, ATTR_PRODUCT_OLD_PRICE as p, ATTR_PRODUCT_OMNIBUS_PRICE as R, ATTR_PRODUCT_OMNIBUS_DISCOUNT as _, ATTR_PRODUCT_BUTTON as x, ATTR_PRODUCT_IMAGE as q, ATTR_PRODUCT_ATTR as v } from "../constants/selectors.js";
4
+ import { CSS_CLASS_TEXT_TRIM as B } from "../controls/shared/textTrimCssRules.js";
5
+ import { toCustomCompositionKey as U } from "../templates/utils.js";
6
+ import { resolveRowVisibilityKeys as N, isMergedInlinePriceRow as C } from "./compositionKeys.js";
7
+ import { hasQuerySelectorAll as I, hasGetAttribute as l, hasGetStyle as O, hasGetComputedStyle as M } from "./tagName.js";
8
8
  const s = [
9
9
  "font-size",
10
10
  "font-family",
@@ -14,14 +14,14 @@ const s = [
14
14
  "text-align",
15
15
  "line-height",
16
16
  "text-decoration"
17
- ], M = [
17
+ ], D = [
18
18
  "background",
19
19
  "background-color",
20
20
  "border-width",
21
21
  "border-color",
22
22
  "border-style",
23
23
  "border-radius"
24
- ], D = [
24
+ ], w = [
25
25
  ...s,
26
26
  "background",
27
27
  "background-color",
@@ -40,47 +40,47 @@ const s = [
40
40
  "border-radius",
41
41
  "margin"
42
42
  ], g = /* @__PURE__ */ new Set(["transparent", "rgba(0, 0, 0, 0)"]), L = [
43
- { attrKey: E, blockId: c.NAME, kind: "text" },
44
- { attrKey: p, blockId: c.PRICE, kind: "text" },
45
- { attrKey: y, blockId: c.OLD_PRICE, kind: "text" },
46
- { attrKey: A, blockId: c.OMNIBUS_PRICE, kind: "text" },
47
- { attrKey: R, blockId: c.OMNIBUS_DISCOUNT, kind: "text" },
48
- { attrKey: P, blockId: c.BUTTON, kind: "button" },
43
+ { attrKey: k, blockId: c.NAME, kind: "text" },
44
+ { attrKey: y, blockId: c.PRICE, kind: "text" },
45
+ { attrKey: p, blockId: c.OLD_PRICE, kind: "text" },
46
+ { attrKey: R, blockId: c.OMNIBUS_PRICE, kind: "text" },
47
+ { attrKey: _, blockId: c.OMNIBUS_DISCOUNT, kind: "text" },
48
+ { attrKey: x, blockId: c.BUTTON, kind: "button" },
49
49
  { attrKey: q, blockId: c.IMAGE, kind: "image" }
50
50
  ];
51
- function O(t) {
51
+ function h(t) {
52
52
  return t && "getInnerHTML" in t && typeof t.getInnerHTML == "function" ? t.getInnerHTML().trim() : "";
53
53
  }
54
- function w(t) {
54
+ function K(t) {
55
55
  return t && "getInnerText" in t && typeof t.getInnerText == "function" ? t.getInnerText().trim() : "";
56
56
  }
57
57
  function a(t, e, r) {
58
- !e || !I(e) || r.forEach((n) => {
58
+ !e || !O(e) || r.forEach((n) => {
59
59
  const o = e.getStyle(n);
60
60
  o && o !== "inherit" && o !== "initial" && (t[n] = o);
61
61
  });
62
62
  }
63
- function h(t) {
63
+ function E(t) {
64
64
  return Object.entries(t).map(([e, r]) => `${e}: ${r};`).join(" ");
65
65
  }
66
- function k(t) {
67
- if (!t || !I(t))
66
+ function P(t) {
67
+ if (!t || !O(t))
68
68
  return;
69
69
  const e = t.getStyle("background-color") || t.getStyle("background");
70
70
  return e && !g.has(e) ? e : void 0;
71
71
  }
72
- function b(t, e) {
72
+ function S(t, e) {
73
73
  const r = {};
74
- return a(r, t, e), h(r);
74
+ return a(r, t, e), E(r);
75
75
  }
76
- function K(t) {
76
+ function $(t) {
77
77
  const e = t.querySelector("p"), r = {};
78
78
  a(r, t, s), a(r, e, s), a(r, t.querySelector("strong"), s), a(r, t.querySelector("em"), s), a(r, t.querySelector("s"), s);
79
- const n = h(r), { openTags: o, closeTags: i } = C(O(e));
79
+ const n = E(r), { openTags: o, closeTags: i } = A(h(e));
80
80
  return !n && !o ? null : { pStyle: n || void 0, openTags: o, closeTags: i };
81
81
  }
82
- function $(t) {
83
- const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = b(e, M), o = b(r, D), i = e && "getAttribute" in e ? e.getAttribute("class") ?? "" : "", u = /\bes-fw\b/.test(i), { openTags: T, closeTags: d } = C(O(r)), m = w(r);
82
+ function H(t) {
83
+ const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = S(e, D), o = S(r, w), i = e && "getAttribute" in e ? e.getAttribute("class") ?? "" : "", u = /\bes-fw\b/.test(i), { openTags: T, closeTags: d } = A(h(r)), m = K(r);
84
84
  return !n && !o && !u && !T && !m ? null : {
85
85
  buttonBorderStyle: n || void 0,
86
86
  buttonAnchorStyle: o || void 0,
@@ -90,44 +90,44 @@ function $(t) {
90
90
  closeTags: d
91
91
  };
92
92
  }
93
- function H(t) {
94
- const e = b(t.querySelector("img"), G);
93
+ function F(t) {
94
+ const e = S(t.querySelector("img"), G);
95
95
  return e ? { imgStyle: e } : null;
96
96
  }
97
- function F(t, e) {
98
- return e === "button" ? $(t) : e === "image" ? H(t) : K(t);
97
+ function j(t, e) {
98
+ return e === "button" ? H(t) : e === "image" ? F(t) : $(t);
99
99
  }
100
100
  function f(t, e) {
101
101
  if (!t || !("querySelector" in t))
102
102
  return;
103
- const r = t.querySelector(S) ?? t;
103
+ const r = t.querySelector(b) ?? t;
104
104
  if (L.forEach(({ attrKey: i, blockId: u, kind: T }) => {
105
105
  const d = r.querySelector(`[esd-extension-block-id="${u}"]`);
106
106
  d && e(d, i, T);
107
- }), !_(r))
107
+ }), !I(r))
108
108
  return;
109
109
  const n = /* @__PURE__ */ new Set();
110
110
  r.querySelectorAll(
111
111
  `[esd-extension-block-id="${c.CUSTOM_ATTRIBUTE}"]`
112
112
  ).forEach((i) => {
113
- const u = l(i) ? i.getAttribute(x) : null;
114
- !u || n.has(u) || (n.add(u), e(i, B(u), "text"));
113
+ const u = l(i) ? i.getAttribute(v) : null;
114
+ !u || n.has(u) || (n.add(u), e(i, U(u), "text"));
115
115
  });
116
116
  }
117
- function j(t) {
117
+ function V(t) {
118
118
  const e = {};
119
119
  return f(t, (r, n, o) => {
120
120
  if (!("querySelector" in r))
121
121
  return;
122
- const i = F(r, o);
122
+ const i = j(r, o);
123
123
  i && (e[n] = i);
124
124
  }), e;
125
125
  }
126
126
  function X(t) {
127
127
  if (!t || !("querySelector" in t))
128
128
  return;
129
- const e = t.querySelector(S) ?? t, r = e.querySelector(".product-card-segment") ?? e.querySelector(".product-card-wrapper");
130
- return k(r);
129
+ const e = t.querySelector(b) ?? t, r = e.querySelector(".product-card-segment") ?? e.querySelector(".product-card-wrapper");
130
+ return P(r);
131
131
  }
132
132
  function z(t) {
133
133
  if (!t)
@@ -135,10 +135,10 @@ function z(t) {
135
135
  const e = l(t) ? t.getAttribute("bgcolor") : null;
136
136
  if (e && !g.has(e))
137
137
  return e;
138
- const r = k(t);
138
+ const r = P(t);
139
139
  if (r)
140
140
  return r;
141
- const n = N(t) ? t.getComputedStyle("background-color") : void 0;
141
+ const n = M(t) ? t.getComputedStyle("background-color") : void 0;
142
142
  return n && !g.has(n) ? n : void 0;
143
143
  }
144
144
  function Q(t) {
@@ -150,7 +150,7 @@ function Q(t) {
150
150
  i && (e[n] = i);
151
151
  }), e;
152
152
  }
153
- function V(t) {
153
+ function W(t) {
154
154
  const e = {};
155
155
  return f(t, (r, n, o) => {
156
156
  if (o === "image")
@@ -159,68 +159,70 @@ function V(t) {
159
159
  i && (e[n] = i);
160
160
  }), e;
161
161
  }
162
- const W = /^es-[pm]\d+[trbl]?$/;
163
- function Y(t) {
162
+ const Y = /^es-[pm]\d+[trbl]?$/;
163
+ function J(t) {
164
164
  const e = l(t) ? t.getAttribute("class") : null;
165
165
  if (!e)
166
166
  return;
167
- const r = e.split(/\s+/).filter((n) => W.test(n) || n === v);
167
+ const r = e.split(/\s+/).filter((n) => Y.test(n) || n === B);
168
168
  return r.length ? r.join(" ") : void 0;
169
169
  }
170
- function J(t) {
170
+ function Z(t) {
171
171
  if (!t || !("querySelector" in t))
172
172
  return !1;
173
- const e = t.querySelector(S) ?? t, r = (n) => !!(n && "querySelector" in n && n.querySelector(".product-price") && n.querySelector(".product-old-price"));
174
- return r(e.querySelector(`[data-attribute-type="${p}"]`)) || r(e.querySelector(`[data-attribute-type="${y}"]`));
173
+ const e = t.querySelector(b) ?? t;
174
+ return C(e.querySelector(`[data-attribute-type="${y}"]`)) || C(e.querySelector(`[data-attribute-type="${p}"]`));
175
175
  }
176
- function Z(t) {
177
- const e = {}, r = J(t);
176
+ function tt(t) {
177
+ const e = {}, r = Z(t);
178
178
  return f(t, (n, o, i) => {
179
- if (i === "image" || r && (o === p || o === y))
179
+ if (i === "image" || r && (o === y || o === p))
180
180
  return;
181
- const u = Y(n);
181
+ const u = J(n);
182
182
  u && (e[o] = u);
183
183
  }), e;
184
184
  }
185
- function tt(t) {
185
+ function et(t) {
186
186
  const e = {};
187
187
  return f(t, (r, n) => {
188
- if (n !== A && n !== R || !l(r))
188
+ if (n !== R && n !== _ || !l(r))
189
189
  return;
190
190
  const o = r.getAttribute("data-text-before"), i = r.getAttribute("data-text-after");
191
191
  (o != null || i != null) && (e[n] = { before: o ?? void 0, after: i ?? void 0 });
192
192
  }), e;
193
193
  }
194
- function et(t) {
194
+ function rt(t) {
195
195
  const e = {};
196
196
  if (!t || !("querySelector" in t))
197
197
  return e;
198
- const r = t.querySelector(S) ?? t;
199
- return _(r) && r.querySelectorAll(".recommendation-attribute-row").forEach((n) => {
198
+ const r = t.querySelector(b) ?? t;
199
+ return I(r) && r.querySelectorAll(".recommendation-attribute-row").forEach((n) => {
200
200
  if (!l(n))
201
201
  return;
202
- const o = U(n), i = n.getAttribute("data-visibility");
203
- o && i != null && (e[o] = i !== "0");
202
+ const o = n.getAttribute("data-visibility");
203
+ o != null && N(n).forEach((i) => {
204
+ e[i] = o !== "0";
205
+ });
204
206
  }), e;
205
207
  }
206
- function at(t) {
208
+ function lt(t) {
207
209
  return {
208
- styleTemplates: j(t),
210
+ styleTemplates: V(t),
209
211
  cardBackgroundColor: X(t),
210
212
  cellBackgroundColors: Q(t),
211
- cellAlignments: V(t),
212
- cellClasses: Z(t),
213
- omnibusTexts: tt(t),
214
- visibility: et(t)
213
+ cellAlignments: W(t),
214
+ cellClasses: tt(t),
215
+ omnibusTexts: et(t),
216
+ visibility: rt(t)
215
217
  };
216
218
  }
217
219
  export {
218
- j as captureAttributeStyleTemplates,
220
+ V as captureAttributeStyleTemplates,
219
221
  X as captureCardBackgroundColor,
220
- V as captureCellAlignments,
222
+ W as captureCellAlignments,
221
223
  Q as captureCellBackgroundColors,
222
- Z as captureCellClasses,
223
- tt as captureOmnibusTexts,
224
- at as captureStyles,
225
- et as captureVisibility
224
+ tt as captureCellClasses,
225
+ et as captureOmnibusTexts,
226
+ lt as captureStyles,
227
+ rt as captureVisibility
226
228
  };
@@ -1,89 +1,98 @@
1
- import { ATTR_CUSTOM_PREFIX as s, ATTR_PRODUCT_ATTR as i, PRODUCT_ATTRIBUTE_PREFIX as f, ATTR_DATA_ATTRIBUTE_TYPE as l, SELECTOR_ATTRIBUTE_ROW as R } from "../constants/selectors.js";
2
- function d(t) {
3
- return !t.startsWith(f);
1
+ import { ATTR_CUSTOM_PREFIX as o, ATTR_PRODUCT_PRICE as g, ATTR_PRODUCT_OLD_PRICE as d, PRODUCT_ATTRIBUTE_PREFIX as a, ATTR_DATA_ATTRIBUTE_TYPE as f, ATTR_PRODUCT_ATTR as c, SELECTOR_ATTRIBUTE_ROW as y } from "../constants/selectors.js";
2
+ function q(t) {
3
+ return !t.startsWith(a);
4
4
  }
5
- function y(t) {
6
- return t.startsWith(f) ? t.substring(f.length) : t;
7
- }
8
- function T(t) {
9
- return t.startsWith(s) ? t.substring(s.length) : t;
5
+ function $(t) {
6
+ return t.startsWith(a) ? t.substring(a.length) : t;
10
7
  }
11
8
  function A(t) {
12
- return `${s}${t}`;
9
+ return t.startsWith(o) ? t.substring(o.length) : t;
10
+ }
11
+ function T(t) {
12
+ return `${o}${t}`;
13
13
  }
14
- function P(t) {
15
- return t.type === "defaultAttribute" ? t.attributeName : `${f}${t.attributeName}`;
14
+ function C(t) {
15
+ return t.type === "defaultAttribute" ? t.attributeName : `${a}${t.attributeName}`;
16
16
  }
17
- function _(t, r) {
17
+ function h(t, r) {
18
18
  const n = Object.values(r).filter((e) => e.attributeName === t);
19
19
  return n.find((e) => e.type === "defaultAttribute") ?? n[0];
20
20
  }
21
- function a(t, r) {
21
+ function l(t, r) {
22
22
  return t && "getAttribute" in t ? t.getAttribute(r) : null;
23
23
  }
24
- function m(t, r, n = {}) {
25
- const e = `${s}${t}`, u = r == null ? void 0 : r.querySelector(
26
- `${R}[${l}="${e}"]`
27
- ), c = a(u, i) ?? a(u == null ? void 0 : u.querySelector(`[${i}]`), i);
28
- if (c)
29
- return c;
30
- const o = _(t, n);
31
- return o ? P(o) : t;
24
+ function S(t, r, n = {}) {
25
+ const e = `${o}${t}`, u = r == null ? void 0 : r.querySelector(
26
+ `${y}[${f}="${e}"]`
27
+ ), i = l(u, c) ?? l(u == null ? void 0 : u.querySelector(`[${c}]`), c);
28
+ if (i)
29
+ return i;
30
+ const s = h(t, n);
31
+ return s ? C(s) : t;
32
32
  }
33
- function g(t, r, n = {}) {
34
- return t.startsWith(f) ? t : m(t, r, n);
33
+ function P(t, r, n = {}) {
34
+ return t.startsWith(a) ? t : S(t, r, n);
35
35
  }
36
- function C(t, r, n = {}) {
36
+ function O(t, r, n = {}) {
37
37
  return t.map((e) => {
38
- if (!e.startsWith(s))
38
+ if (!e.startsWith(o))
39
39
  return e;
40
- const u = T(e);
41
- return A(g(u, r, n));
40
+ const u = A(e);
41
+ return T(P(u, r, n));
42
42
  });
43
43
  }
44
- function E(t, r, n = {}) {
45
- return t.map((e) => g(e, r, n));
44
+ function p(t, r, n = {}) {
45
+ return t.map((e) => P(e, r, n));
46
46
  }
47
- function S(t) {
48
- const r = a(t, l);
49
- if (!(r != null && r.startsWith(s)))
47
+ function b(t) {
48
+ const r = l(t, f);
49
+ if (!(r != null && r.startsWith(o)))
50
50
  return r;
51
- const n = "querySelector" in t ? t.querySelector(`[${i}]`) : void 0, e = a(n, i);
52
- return e ? A(e) : r;
51
+ const n = "querySelector" in t ? t.querySelector(`[${c}]`) : void 0, e = l(n, c);
52
+ return e ? T(e) : r;
53
+ }
54
+ function m(t) {
55
+ return !!(t && "querySelector" in t && t.querySelector(".product-price") && t.querySelector(".product-old-price"));
56
+ }
57
+ function D(t) {
58
+ const r = b(t);
59
+ return r ? m(t) ? [g, d] : [r] : [];
53
60
  }
54
- function $(t, r, n) {
55
- const e = a(t, i), u = a(t.querySelector(`[${i}]`), i), c = e ?? u;
56
- return c === null ? n : c === r;
61
+ function R(t, r, n) {
62
+ const e = l(t, c), u = l(t.querySelector(`[${c}]`), c), i = e ?? u;
63
+ return i === null ? n : i === r;
57
64
  }
58
- function W(t, r) {
59
- const n = (h) => t.querySelector(
60
- `${R}[${l}="${h}"]`
65
+ function I(t, r) {
66
+ const n = (_) => t.querySelector(
67
+ `${y}[${f}="${_}"]`
61
68
  );
62
- if (!r.startsWith(s))
69
+ if (!r.startsWith(o))
63
70
  return n(r) ?? null;
64
- const e = T(r), u = n(r);
65
- if (u && $(u, e, !0))
71
+ const e = A(r), u = n(r);
72
+ if (u && R(u, e, !0))
66
73
  return u;
67
- const c = A(y(e)), o = c === r ? void 0 : n(c);
68
- return o && $(o, e, !1) ? o : null;
74
+ const i = T($(e)), s = i === r ? void 0 : n(i);
75
+ return s && R(s, e, !1) ? s : null;
69
76
  }
70
- function q(t, r) {
71
- const n = T(r), e = A(y(n));
77
+ function U(t, r) {
78
+ const n = A(r), e = T($(n));
72
79
  return e === r ? t : t.replace(
73
- `${l}="${e}"`,
74
- `${l}="${r}"`
80
+ `${f}="${e}"`,
81
+ `${f}="${r}"`
75
82
  );
76
83
  }
77
84
  export {
78
- y as bareAttributeName,
79
- T as compositionKeyToProductAttr,
80
- P as filterToProductAttrValue,
81
- W as findAttributeRow,
82
- _ as findFilterByBareName,
83
- d as isDefaultProductAttr,
84
- C as normalizeCompositionKeys,
85
- E as normalizeCustomAttrValues,
86
- A as productAttrToCompositionKey,
87
- S as resolveRowCompositionKey,
88
- q as rewriteLegacyRowKeyHtml
85
+ $ as bareAttributeName,
86
+ A as compositionKeyToProductAttr,
87
+ C as filterToProductAttrValue,
88
+ I as findAttributeRow,
89
+ h as findFilterByBareName,
90
+ q as isDefaultProductAttr,
91
+ m as isMergedInlinePriceRow,
92
+ O as normalizeCompositionKeys,
93
+ p as normalizeCustomAttrValues,
94
+ T as productAttrToCompositionKey,
95
+ b as resolveRowCompositionKey,
96
+ D as resolveRowVisibilityKeys,
97
+ U as rewriteLegacyRowKeyHtml
89
98
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.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-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__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-c61cc8ea]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-55f67f37]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-55f67f37]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-55f67f37]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{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-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.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-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__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-c61cc8ea]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-926b01f5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-926b01f5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-926b01f5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{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-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
@@ -0,0 +1,2 @@
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;