@useinsider/guido 3.24.0 → 3.25.0-beta.2954d1a
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.
- package/README.md +7 -1
- package/dist/@types/config/schemas.js +9 -7
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +79 -77
- package/dist/composables/useActionsApi.js +2 -2
- package/dist/composables/useEditorTrackingIds.js +49 -0
- package/dist/composables/useHtmlCompiler.js +2 -0
- package/dist/composables/useModuleRepair.js +14 -12
- package/dist/composables/useStripo.js +70 -70
- package/dist/config/compiler/htmlCompilerRules.js +14 -6
- package/dist/config/migrator/index.js +16 -15
- package/dist/config/migrator/itemsPriceFormatMigrator.js +20 -0
- package/dist/config/migrator/recommendation/inferLegacyConfig.js +133 -0
- package/dist/config/migrator/recommendationMigrator.js +78 -64
- package/dist/extensions/Blocks/Items/block.js +115 -77
- package/dist/extensions/Blocks/Items/constants/currency.js +59 -14
- package/dist/extensions/Blocks/Items/controls/blockBackground/index.js +11 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +34 -23
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +62 -51
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +18 -17
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -31
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +135 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +141 -120
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/extension.js +15 -13
- package/dist/extensions/Blocks/Items/items.css.js +19 -0
- package/dist/extensions/Blocks/Items/settingsPanel.js +35 -25
- package/dist/extensions/Blocks/Items/template.js +250 -212
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +185 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +10 -8
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +28 -24
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +23 -22
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +1 -0
- package/dist/extensions/Blocks/controlFactories.js +104 -104
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/services/templateLibraryApi.js +39 -36
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useEditorTrackingIds.d.ts +7 -0
- package/dist/src/composables/useStripo.d.ts +1 -1
- package/dist/src/config/migrator/index.d.ts +4 -1
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/inferLegacyConfig.d.ts +6 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +1 -1
- package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -5
- package/dist/src/extensions/Blocks/Items/block.d.ts +6 -9
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/controls/blockBackground/index.d.ts +15 -0
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +24 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +4 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +66 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +12 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +1 -1
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/utils/itemsCurrencyRepair.d.ts +5 -1
- package/dist/src/utils/linkTrackingIds.d.ts +19 -0
- package/dist/src/utils/trimHrefWhitespace.d.ts +5 -0
- package/dist/utils/itemsCurrencyRepair.js +29 -24
- package/dist/utils/linkTrackingIds.js +82 -48
- package/dist/utils/pairProductVariables.js +119 -99
- package/dist/utils/templatePreparation.js +30 -33
- package/dist/utils/trimHrefWhitespace.js +10 -0
- package/package.json +1 -1
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { TextAlignBuiltInControl as C, TextColorBuiltInControl as x, TextSizeBuiltInControl as T, TextStyleBuiltInControl as B, TextFontFamilyBuiltInControl as m,
|
|
1
|
+
import { ButtonBackgroundColorBuiltInControl as d, TextAlignBuiltInControl as C, TextColorBuiltInControl as x, TextSizeBuiltInControl as T, TextStyleBuiltInControl as B, TextFontFamilyBuiltInControl as m, TextPaddingsBuiltInControl as y, ImageSizeBuiltInControl as b, ImageMarginsBuiltInControl as I, ButtonAlignBuiltInControl as S, ButtonBorderBuiltInControl as A, ButtonBorderRadiusBuiltInControl as k, ButtonColorBuiltInControl as N, ButtonFontFamilyBuiltInControl as h, ButtonMarginsBuiltInControl as p, ButtonPaddingsBuiltInControl as $, ButtonTextBuiltInControl as q, ButtonTextSizeBuiltInControl as F, ButtonTextStyleAndFontColorBuiltInControl as v, ButtonFitToContainerBuiltInControl as R, TextLineSpacingBuiltInControl as M } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
const O = "buttonTextStyleForm", a = "backgroundColor", g = /* @__PURE__ */ new Set(["", "transparent", "rgba(0, 0, 0, 0)"]), _ = ["elementColor", a], E = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
3
|
-
function P(
|
|
3
|
+
function P(r, e, o) {
|
|
4
4
|
return class extends C {
|
|
5
5
|
getId() {
|
|
6
|
-
return
|
|
6
|
+
return r;
|
|
7
7
|
}
|
|
8
8
|
getTargetNodes(n) {
|
|
9
|
-
if (!e || !
|
|
9
|
+
if (!e || !o)
|
|
10
10
|
return [n];
|
|
11
|
-
const t = n.closest(
|
|
11
|
+
const t = n.closest(o);
|
|
12
12
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function H(
|
|
16
|
+
function H(r, e, o) {
|
|
17
17
|
return class extends x {
|
|
18
18
|
getId() {
|
|
19
|
-
return
|
|
19
|
+
return r;
|
|
20
20
|
}
|
|
21
21
|
getTargetNodes(n) {
|
|
22
|
-
if (!e || !
|
|
22
|
+
if (!e || !o)
|
|
23
23
|
return [n];
|
|
24
|
-
const t = n.closest(
|
|
24
|
+
const t = n.closest(o);
|
|
25
25
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function U(
|
|
29
|
+
function U(r, e, o) {
|
|
30
30
|
return class extends T {
|
|
31
31
|
getId() {
|
|
32
|
-
return
|
|
32
|
+
return r;
|
|
33
33
|
}
|
|
34
34
|
getTargetNodes(n) {
|
|
35
|
-
if (!e || !
|
|
35
|
+
if (!e || !o)
|
|
36
36
|
return [n];
|
|
37
|
-
const t = n.closest(
|
|
37
|
+
const t = n.closest(o);
|
|
38
38
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function Y(
|
|
42
|
+
function Y(r, e, o) {
|
|
43
43
|
return class extends B {
|
|
44
44
|
getId() {
|
|
45
|
-
return
|
|
45
|
+
return r;
|
|
46
46
|
}
|
|
47
47
|
getTargetNodes(n) {
|
|
48
|
-
if (!e || !
|
|
48
|
+
if (!e || !o)
|
|
49
49
|
return [n];
|
|
50
|
-
const t = n.closest(
|
|
50
|
+
const t = n.closest(o);
|
|
51
51
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function G(
|
|
55
|
+
function G(r, e, o) {
|
|
56
56
|
return class extends m {
|
|
57
57
|
getId() {
|
|
58
|
-
return
|
|
58
|
+
return r;
|
|
59
59
|
}
|
|
60
60
|
getTargetNodes(n) {
|
|
61
|
-
if (!e || !
|
|
61
|
+
if (!e || !o)
|
|
62
62
|
return [n];
|
|
63
|
-
const t = n.closest(
|
|
63
|
+
const t = n.closest(o);
|
|
64
64
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function V(
|
|
68
|
+
function V(r, e, o) {
|
|
69
69
|
return class extends d {
|
|
70
70
|
getId() {
|
|
71
|
-
return
|
|
71
|
+
return r;
|
|
72
72
|
}
|
|
73
73
|
getTargetNodes(n) {
|
|
74
|
-
if (!e || !
|
|
74
|
+
if (!e || !o)
|
|
75
75
|
return [n];
|
|
76
|
-
const t = n.closest(
|
|
76
|
+
const t = n.closest(o);
|
|
77
77
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
@@ -89,46 +89,46 @@ function V(o, e, r) {
|
|
|
89
89
|
const t = this.getTargetNodes(n);
|
|
90
90
|
if (!t.length)
|
|
91
91
|
return;
|
|
92
|
-
const
|
|
93
|
-
return t.forEach((
|
|
94
|
-
const
|
|
95
|
-
l ?
|
|
96
|
-
}),
|
|
92
|
+
const s = this.api.getValues()[a], l = !s || g.has(s), c = this.api.getDocumentModifier();
|
|
93
|
+
return t.forEach((i) => {
|
|
94
|
+
const u = c.modifyHtml(i);
|
|
95
|
+
l ? u.removeStyle("background-color") : u.setStyle("background-color", s);
|
|
96
|
+
}), c;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function K(
|
|
101
|
-
const e = _.find((n) => n in
|
|
100
|
+
function K(r) {
|
|
101
|
+
const e = _.find((n) => n in r);
|
|
102
102
|
if (!e)
|
|
103
103
|
return;
|
|
104
|
-
const
|
|
105
|
-
return typeof
|
|
104
|
+
const o = r[e];
|
|
105
|
+
return typeof o == "string" ? o : "";
|
|
106
106
|
}
|
|
107
|
-
function L(
|
|
108
|
-
return e.startsWith(".") && "hasClass" in
|
|
107
|
+
function L(r, e) {
|
|
108
|
+
return e.startsWith(".") && "hasClass" in r && r.hasClass(e.slice(1));
|
|
109
109
|
}
|
|
110
|
-
function z(
|
|
110
|
+
function z(r, e) {
|
|
111
111
|
if (!e)
|
|
112
|
-
return
|
|
112
|
+
return r;
|
|
113
113
|
try {
|
|
114
|
-
return L(
|
|
114
|
+
return L(r, e) ? r : r.closest(e) ?? void 0;
|
|
115
115
|
} catch {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
function w(
|
|
119
|
+
function w(r, e, o = "Block Background Color") {
|
|
120
120
|
return class extends d {
|
|
121
121
|
getId() {
|
|
122
|
-
return
|
|
122
|
+
return r;
|
|
123
123
|
}
|
|
124
124
|
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
125
125
|
getLabels() {
|
|
126
|
-
return { title: this.api.translate(
|
|
126
|
+
return { title: this.api.translate(o) };
|
|
127
127
|
}
|
|
128
128
|
/** Guard: redirect the borrowed button parent onto the block `<td>` so it never paints the Buy buttons. */
|
|
129
|
-
getTargetNodes(
|
|
130
|
-
const
|
|
131
|
-
return
|
|
129
|
+
getTargetNodes(n) {
|
|
130
|
+
const t = z(n, e);
|
|
131
|
+
return t ? [t] : [];
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
@@ -136,147 +136,147 @@ function w(o, e) {
|
|
|
136
136
|
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
137
137
|
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
138
138
|
*/
|
|
139
|
-
getAdditionalModifications(
|
|
140
|
-
const [
|
|
141
|
-
if (!
|
|
139
|
+
getAdditionalModifications(n) {
|
|
140
|
+
const [t] = this.getTargetNodes(n);
|
|
141
|
+
if (!t)
|
|
142
142
|
return;
|
|
143
|
-
const
|
|
144
|
-
if (
|
|
143
|
+
const s = K(this.api.getValues());
|
|
144
|
+
if (s === void 0)
|
|
145
145
|
return;
|
|
146
|
-
const
|
|
147
|
-
return
|
|
146
|
+
const l = !s || g.has(s), c = this.api.getDocumentModifier(), i = c.modifyHtml(t);
|
|
147
|
+
return l ? i.removeStyle("background-color").removeAttribute("bgcolor") : (i.setStyle("background-color", s), E.test(s) ? i.setAttribute("bgcolor", s) : i.removeAttribute("bgcolor")), c;
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
function W(
|
|
151
|
+
function W(r, e, o) {
|
|
152
152
|
return class extends y {
|
|
153
153
|
getId() {
|
|
154
|
-
return
|
|
154
|
+
return r;
|
|
155
155
|
}
|
|
156
156
|
getTargetNodes(n) {
|
|
157
|
-
if (!e || !
|
|
157
|
+
if (!e || !o)
|
|
158
158
|
return [n];
|
|
159
|
-
const t = n.closest(
|
|
159
|
+
const t = n.closest(o);
|
|
160
160
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
function X(
|
|
164
|
+
function X(r, e, o) {
|
|
165
165
|
return class extends M {
|
|
166
166
|
getId() {
|
|
167
|
-
return
|
|
167
|
+
return r;
|
|
168
168
|
}
|
|
169
169
|
getTargetNodes(n) {
|
|
170
170
|
return [n];
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
function j(
|
|
174
|
+
function j(r, e, o = ".ins-recommendation-product-container") {
|
|
175
175
|
return class extends S {
|
|
176
176
|
getId() {
|
|
177
|
-
return
|
|
177
|
+
return r;
|
|
178
178
|
}
|
|
179
179
|
getTargetNodes(n) {
|
|
180
|
-
const t = n.closest(
|
|
180
|
+
const t = n.closest(o);
|
|
181
181
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function J(
|
|
185
|
+
function J(r, e, o = ".ins-recommendation-product-container") {
|
|
186
186
|
return class extends N {
|
|
187
187
|
getId() {
|
|
188
|
-
return
|
|
188
|
+
return r;
|
|
189
189
|
}
|
|
190
190
|
getTargetNodes(n) {
|
|
191
|
-
const t = n.closest(
|
|
191
|
+
const t = n.closest(o);
|
|
192
192
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
function Q(
|
|
196
|
+
function Q(r, e, o = ".ins-recommendation-product-container") {
|
|
197
197
|
return class extends A {
|
|
198
198
|
getId() {
|
|
199
|
-
return
|
|
199
|
+
return r;
|
|
200
200
|
}
|
|
201
201
|
getTargetNodes(n) {
|
|
202
|
-
const t = n.closest(
|
|
202
|
+
const t = n.closest(o);
|
|
203
203
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
function Z(
|
|
207
|
+
function Z(r, e, o = ".ins-recommendation-product-container") {
|
|
208
208
|
return class extends k {
|
|
209
209
|
getId() {
|
|
210
|
-
return
|
|
210
|
+
return r;
|
|
211
211
|
}
|
|
212
212
|
getTargetNodes(n) {
|
|
213
|
-
const t = n.closest(
|
|
213
|
+
const t = n.closest(o);
|
|
214
214
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
215
215
|
}
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
|
-
function tt(
|
|
218
|
+
function tt(r, e, o = ".ins-recommendation-product-container") {
|
|
219
219
|
return class extends h {
|
|
220
220
|
getId() {
|
|
221
|
-
return
|
|
221
|
+
return r;
|
|
222
222
|
}
|
|
223
223
|
getTargetNodes(n) {
|
|
224
|
-
const t = n.closest(
|
|
224
|
+
const t = n.closest(o);
|
|
225
225
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
226
226
|
}
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
|
-
function et(
|
|
229
|
+
function et(r, e, o = ".ins-recommendation-product-container") {
|
|
230
230
|
return class extends p {
|
|
231
231
|
getId() {
|
|
232
|
-
return
|
|
232
|
+
return r;
|
|
233
233
|
}
|
|
234
234
|
getTargetNodes(n) {
|
|
235
|
-
const t = n.closest(
|
|
235
|
+
const t = n.closest(o);
|
|
236
236
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
function nt(
|
|
240
|
+
function nt(r, e, o = ".ins-recommendation-product-container") {
|
|
241
241
|
return class extends $ {
|
|
242
242
|
getId() {
|
|
243
|
-
return
|
|
243
|
+
return r;
|
|
244
244
|
}
|
|
245
245
|
getTargetNodes(n) {
|
|
246
|
-
const t = n.closest(
|
|
246
|
+
const t = n.closest(o);
|
|
247
247
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
|
-
function rt(
|
|
251
|
+
function rt(r, e, o = ".ins-recommendation-product-container") {
|
|
252
252
|
return class extends q {
|
|
253
253
|
getId() {
|
|
254
|
-
return
|
|
254
|
+
return r;
|
|
255
255
|
}
|
|
256
256
|
getTargetNodes(n) {
|
|
257
|
-
const t = n.closest(
|
|
257
|
+
const t = n.closest(o);
|
|
258
258
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
function ot(
|
|
262
|
+
function ot(r, e, o = ".ins-recommendation-product-container") {
|
|
263
263
|
return class extends F {
|
|
264
264
|
getId() {
|
|
265
|
-
return
|
|
265
|
+
return r;
|
|
266
266
|
}
|
|
267
267
|
getTargetNodes(n) {
|
|
268
|
-
const t = n.closest(
|
|
268
|
+
const t = n.closest(o);
|
|
269
269
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
function st(
|
|
273
|
+
function st(r, e, o) {
|
|
274
274
|
return class extends v {
|
|
275
275
|
getId() {
|
|
276
|
-
return
|
|
276
|
+
return r;
|
|
277
277
|
}
|
|
278
278
|
getTargetNodes(n) {
|
|
279
|
-
const t = n.closest(
|
|
279
|
+
const t = n.closest(o);
|
|
280
280
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
@@ -290,41 +290,41 @@ function st(o, e, r) {
|
|
|
290
290
|
* when this runs. Returned modifications are merged into the parent control's patch.
|
|
291
291
|
*/
|
|
292
292
|
getAdditionalModifications(n) {
|
|
293
|
-
const t = n.closest(
|
|
293
|
+
const t = n.closest(o);
|
|
294
294
|
if (!t)
|
|
295
295
|
return;
|
|
296
|
-
const
|
|
297
|
-
if (!
|
|
296
|
+
const s = t.querySelectorAll(`[esd-extension-block-id="${e}"] a.es-button`);
|
|
297
|
+
if (!s.length)
|
|
298
298
|
return;
|
|
299
299
|
const l = this.api.getValues()[O];
|
|
300
300
|
if (!l)
|
|
301
301
|
return;
|
|
302
|
-
const
|
|
303
|
-
return
|
|
304
|
-
|
|
305
|
-
}),
|
|
302
|
+
const c = l.bold ? "bold" : "normal", i = l.italic ? "italic" : "normal", u = this.api.getDocumentModifier();
|
|
303
|
+
return s.forEach((f) => {
|
|
304
|
+
u.modifyHtml(f).setStyle("font-weight", c).setStyle("font-style", i);
|
|
305
|
+
}), u;
|
|
306
306
|
}
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
|
-
function it(
|
|
309
|
+
function it(r, e, o) {
|
|
310
310
|
return class extends R {
|
|
311
311
|
getId() {
|
|
312
|
-
return
|
|
312
|
+
return r;
|
|
313
313
|
}
|
|
314
314
|
getTargetNodes(n) {
|
|
315
|
-
const t = n.closest(
|
|
315
|
+
const t = n.closest(o);
|
|
316
316
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
-
function lt(
|
|
320
|
+
function lt(r, e, o) {
|
|
321
321
|
return class extends b {
|
|
322
322
|
getId() {
|
|
323
|
-
return
|
|
323
|
+
return r;
|
|
324
324
|
}
|
|
325
325
|
getTargetNodes(n) {
|
|
326
326
|
try {
|
|
327
|
-
const t = n.closest(
|
|
327
|
+
const t = n.closest(o);
|
|
328
328
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
329
329
|
} catch {
|
|
330
330
|
return [];
|
|
@@ -332,14 +332,14 @@ function lt(o, e, r) {
|
|
|
332
332
|
}
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
function ct(
|
|
335
|
+
function ct(r, e, o) {
|
|
336
336
|
return class extends I {
|
|
337
337
|
getId() {
|
|
338
|
-
return
|
|
338
|
+
return r;
|
|
339
339
|
}
|
|
340
340
|
getTargetNodes(n) {
|
|
341
341
|
try {
|
|
342
|
-
const t = n.closest(
|
|
342
|
+
const t = n.closest(o);
|
|
343
343
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
|
|
344
344
|
} catch {
|
|
345
345
|
return [];
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
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-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-
|
|
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-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-98b59f91]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-98b59f91]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-98b59f91]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{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}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[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}
|
package/dist/package.json.js
CHANGED
|
@@ -1,60 +1,63 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as A } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as S } from "../composables/useConfig.js";
|
|
3
|
-
import { useHttp as
|
|
3
|
+
import { useHttp as E } from "../composables/useHttp.js";
|
|
4
4
|
import { useToaster as x } from "../composables/useToaster.js";
|
|
5
|
-
import { useTranslations as
|
|
6
|
-
import { useHtmlDocumentCountValidator as
|
|
5
|
+
import { useTranslations as P } from "../composables/useTranslations.js";
|
|
6
|
+
import { useHtmlDocumentCountValidator as L } from "../composables/validators/useHtmlDocumentCountValidator.js";
|
|
7
7
|
import { useLiquidValidator as N } from "../composables/validators/useLiquidValidator.js";
|
|
8
8
|
import { EditorType as H } from "../enums/defaults.js";
|
|
9
|
-
import { ToasterTypeOptions as
|
|
9
|
+
import { ToasterTypeOptions as T } from "../enums/toaster.js";
|
|
10
10
|
import { useRecommendationExtensionStore as D } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
11
|
-
import { useSaveAsTemplateStore as
|
|
11
|
+
import { useSaveAsTemplateStore as q } from "../stores/save-as-template.js";
|
|
12
12
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
13
|
-
import { isPlainObject as
|
|
13
|
+
import { isPlainObject as w } from "../utils/genericUtil.js";
|
|
14
14
|
import { useTemplatePreparation as F } from "../utils/templatePreparation.js";
|
|
15
15
|
const Z = () => {
|
|
16
|
-
const { get:
|
|
16
|
+
const { get: l, post: c } = E(), { handleError: o, showToaster: i } = x(), { config: p, isFeatureEnabled: u } = S(), { validateLiquidSyntax: b } = N(), { validateSingleHtmlDocument: C } = L(), { getTemplateData: h } = A(), n = P();
|
|
17
17
|
return {
|
|
18
18
|
getCategories: async () => {
|
|
19
19
|
try {
|
|
20
|
-
const { data: e
|
|
21
|
-
return e
|
|
20
|
+
const { data: e } = await l("/newsletter/template-library/get-template-categories");
|
|
21
|
+
return Array.isArray(e) ? e : ((!w(e) || e.type !== "alert") && console.error("[TEMPLATE_LIBRARY_API] Unexpected get-template-categories response", e), i({
|
|
22
|
+
message: n("newsletter.template-library-service-error"),
|
|
23
|
+
type: T.Error
|
|
24
|
+
}), []);
|
|
22
25
|
} catch (e) {
|
|
23
|
-
return
|
|
26
|
+
return o(e, "Failed to fetch template categories"), [];
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
29
|
checkTemplateNameAvailability: async (e) => {
|
|
27
|
-
const { data: { status: t = !1 } } = await
|
|
30
|
+
const { data: { status: t = !1 } } = await l(
|
|
28
31
|
`/newsletter/template-library/template-name-exists?name=${e}`
|
|
29
32
|
);
|
|
30
33
|
return !t;
|
|
31
34
|
},
|
|
32
35
|
createCategory: async (e) => {
|
|
33
36
|
try {
|
|
34
|
-
const { data: { id: t } } = await
|
|
37
|
+
const { data: { id: t } } = await c(
|
|
35
38
|
"/newsletter/template-library/create-category",
|
|
36
39
|
{ name: e }
|
|
37
40
|
);
|
|
38
41
|
return t.toString();
|
|
39
42
|
} catch (t) {
|
|
40
|
-
return
|
|
43
|
+
return o(t, "Failed to create category"), "";
|
|
41
44
|
}
|
|
42
45
|
},
|
|
43
46
|
createTemplate: async () => {
|
|
44
47
|
var e, t, d, y;
|
|
45
48
|
try {
|
|
46
|
-
const { prepareTemplateDetails:
|
|
47
|
-
if (!
|
|
49
|
+
const { prepareTemplateDetails: m } = F(), s = q(), g = await h();
|
|
50
|
+
if (!C(g.html))
|
|
48
51
|
return !1;
|
|
49
|
-
const a = await
|
|
50
|
-
if (
|
|
52
|
+
const a = await m(g);
|
|
53
|
+
if (u("liquidSyntax") && !await b(a.compiledHtml))
|
|
51
54
|
return !1;
|
|
52
|
-
const
|
|
53
|
-
name:
|
|
54
|
-
categories:
|
|
55
|
-
productId: ((t = (e =
|
|
55
|
+
const v = {
|
|
56
|
+
name: s.getTemplateName,
|
|
57
|
+
categories: s.getSelectedCategoryIds,
|
|
58
|
+
productId: ((t = (e = p.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
|
|
56
59
|
editorType: H,
|
|
57
|
-
messageType: ((y = (d =
|
|
60
|
+
messageType: ((y = (d = p.value) == null ? void 0 : d.partner) == null ? void 0 : y.messageType) || 0,
|
|
58
61
|
content: r(a.compiledHtml),
|
|
59
62
|
css: r(a.css),
|
|
60
63
|
unsubscriptionPreferencePageStatus: !1,
|
|
@@ -65,34 +68,34 @@ const Z = () => {
|
|
|
65
68
|
recommendationConfigs: r({}),
|
|
66
69
|
isGuido: !0,
|
|
67
70
|
// eslint-disable-next-line camelcase
|
|
68
|
-
template_engine:
|
|
71
|
+
template_engine: u("liquidSyntax") ? 1 : 0,
|
|
69
72
|
stripoConfig: r({
|
|
70
73
|
editor: "stripo",
|
|
71
74
|
html: a.rawHtml,
|
|
72
75
|
css: a.css,
|
|
73
76
|
dynamicContentList: a.dynamicContentList
|
|
74
77
|
})
|
|
75
|
-
}, { data: f } = await
|
|
78
|
+
}, { data: f } = await c(
|
|
76
79
|
"/newsletter/template-library/create-template",
|
|
77
|
-
|
|
80
|
+
v
|
|
78
81
|
);
|
|
79
|
-
if (!
|
|
82
|
+
if (!w(f))
|
|
80
83
|
throw new Error("Unexpected create-template response");
|
|
81
|
-
return f.type === "alert" ? (
|
|
82
|
-
message:
|
|
84
|
+
return f.type === "alert" ? (i({
|
|
85
|
+
message: n(
|
|
83
86
|
"newsletter.template-library-save-alert",
|
|
84
|
-
{ templateName:
|
|
87
|
+
{ templateName: s.getTemplateName }
|
|
85
88
|
),
|
|
86
|
-
type:
|
|
87
|
-
}), !1) : (
|
|
88
|
-
message:
|
|
89
|
+
type: T.Error
|
|
90
|
+
}), !1) : (i({
|
|
91
|
+
message: n(
|
|
89
92
|
"newsletter.template-library-save-success",
|
|
90
|
-
{ templateName:
|
|
93
|
+
{ templateName: s.getTemplateName }
|
|
91
94
|
),
|
|
92
95
|
type: "success"
|
|
93
96
|
}), !0);
|
|
94
|
-
} catch (
|
|
95
|
-
return
|
|
97
|
+
} catch (m) {
|
|
98
|
+
return o(m, "Failed to create template"), !1;
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
};
|
|
@@ -415,6 +415,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
415
415
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
416
416
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
417
417
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
418
|
+
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
419
|
+
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
418
420
|
}, undefined>;
|
|
419
421
|
/**
|
|
420
422
|
* Default block types available in Stripo
|
|
@@ -834,6 +836,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
834
836
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
835
837
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
836
838
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
839
|
+
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
840
|
+
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
837
841
|
}, undefined>, {}>;
|
|
838
842
|
/** Block configuration */
|
|
839
843
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -105,6 +105,7 @@ export declare const useConfig: () => {
|
|
|
105
105
|
linkTrackingIds: boolean;
|
|
106
106
|
allowSaveWithErrors: boolean;
|
|
107
107
|
reusableRecommendationStrategy: boolean;
|
|
108
|
+
itemsPriceFormatting: boolean;
|
|
108
109
|
};
|
|
109
110
|
blocks: {
|
|
110
111
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -245,6 +246,7 @@ export declare const useConfig: () => {
|
|
|
245
246
|
linkTrackingIds: boolean;
|
|
246
247
|
allowSaveWithErrors: boolean;
|
|
247
248
|
reusableRecommendationStrategy: boolean;
|
|
249
|
+
itemsPriceFormatting: boolean;
|
|
248
250
|
} | null>;
|
|
249
251
|
blocks: import("vue").ComputedRef<{
|
|
250
252
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|