@useinsider/guido 3.12.0-beta.ab050f8 → 3.12.0-beta.b9402d1

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,11 +1,10 @@
1
1
  import { createBlockBackgroundColorControl as o } from "../../../controlFactories.js";
2
2
  import { RecommendationControlId as r } from "../../constants/controlIds.js";
3
3
  import { BLOCK_ROOT_SELECTOR as t } from "../../constants/selectors.js";
4
- const C = ".esd-block-text", m = o(
4
+ const c = o(
5
5
  r.BLOCK_BACKGROUND,
6
- t,
7
- C
6
+ t
8
7
  );
9
8
  export {
10
- m as BlockBackgroundColorControl
9
+ c as BlockBackgroundColorControl
11
10
  };
@@ -1,79 +1,79 @@
1
- import { TextAlignBuiltInControl as C, TextColorBuiltInControl as T, TextSizeBuiltInControl as B, TextStyleBuiltInControl as m, TextFontFamilyBuiltInControl as y, ButtonBackgroundColorBuiltInControl as g, TextPaddingsBuiltInControl as A, ImageSizeBuiltInControl as S, ImageMarginsBuiltInControl as I, ButtonAlignBuiltInControl as b, ButtonBorderBuiltInControl as k, ButtonBorderRadiusBuiltInControl as N, ButtonColorBuiltInControl as h, ButtonFontFamilyBuiltInControl as q, ButtonMarginsBuiltInControl as p, ButtonPaddingsBuiltInControl as $, ButtonTextBuiltInControl as F, ButtonTextSizeBuiltInControl as v, ButtonTextStyleAndFontColorBuiltInControl as M, ButtonFitToContainerBuiltInControl as R, TextLineSpacingBuiltInControl as _ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- const O = "buttonTextStyleForm", f = "backgroundColor", x = /* @__PURE__ */ new Set(["", "transparent", "rgba(0, 0, 0, 0)"]), E = ["elementColor", f], K = "esd-extension-block-id";
3
- function U(r, e, o) {
1
+ import { TextAlignBuiltInControl as C, TextColorBuiltInControl as B, TextSizeBuiltInControl as T, TextStyleBuiltInControl as m, TextFontFamilyBuiltInControl as y, ButtonBackgroundColorBuiltInControl as a, TextPaddingsBuiltInControl as I, ImageSizeBuiltInControl as S, ImageMarginsBuiltInControl as b, ButtonAlignBuiltInControl as A, ButtonBorderBuiltInControl as k, ButtonBorderRadiusBuiltInControl as N, ButtonColorBuiltInControl as h, ButtonFontFamilyBuiltInControl as p, ButtonMarginsBuiltInControl as q, ButtonPaddingsBuiltInControl as $, ButtonTextBuiltInControl as F, ButtonTextSizeBuiltInControl as v, ButtonTextStyleAndFontColorBuiltInControl as M, ButtonFitToContainerBuiltInControl as R, TextLineSpacingBuiltInControl as _ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ const O = "buttonTextStyleForm", g = "backgroundColor", f = /* @__PURE__ */ new Set(["", "transparent", "rgba(0, 0, 0, 0)"]), E = ["elementColor", g];
3
+ function L(o, e, r) {
4
4
  return class extends C {
5
5
  getId() {
6
- return r;
6
+ return o;
7
7
  }
8
8
  getTargetNodes(n) {
9
- if (!e || !o)
9
+ if (!e || !r)
10
10
  return [n];
11
- const t = n.closest(o);
11
+ const t = n.closest(r);
12
12
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
13
13
  }
14
14
  };
15
15
  }
16
- function Y(r, e, o) {
17
- return class extends T {
16
+ function P(o, e, r) {
17
+ return class extends B {
18
18
  getId() {
19
- return r;
19
+ return o;
20
20
  }
21
21
  getTargetNodes(n) {
22
- if (!e || !o)
22
+ if (!e || !r)
23
23
  return [n];
24
- const t = n.closest(o);
24
+ const t = n.closest(r);
25
25
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
26
26
  }
27
27
  };
28
28
  }
29
- function G(r, e, o) {
30
- return class extends B {
29
+ function U(o, e, r) {
30
+ return class extends T {
31
31
  getId() {
32
- return r;
32
+ return o;
33
33
  }
34
34
  getTargetNodes(n) {
35
- if (!e || !o)
35
+ if (!e || !r)
36
36
  return [n];
37
- const t = n.closest(o);
37
+ const t = n.closest(r);
38
38
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
39
39
  }
40
40
  };
41
41
  }
42
- function H(r, e, o) {
42
+ function Y(o, e, r) {
43
43
  return class extends m {
44
44
  getId() {
45
- return r;
45
+ return o;
46
46
  }
47
47
  getTargetNodes(n) {
48
- if (!e || !o)
48
+ if (!e || !r)
49
49
  return [n];
50
- const t = n.closest(o);
50
+ const t = n.closest(r);
51
51
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
52
52
  }
53
53
  };
54
54
  }
55
- function V(r, e, o) {
55
+ function G(o, e, r) {
56
56
  return class extends y {
57
57
  getId() {
58
- return r;
58
+ return o;
59
59
  }
60
60
  getTargetNodes(n) {
61
- if (!e || !o)
61
+ if (!e || !r)
62
62
  return [n];
63
- const t = n.closest(o);
63
+ const t = n.closest(r);
64
64
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
65
65
  }
66
66
  };
67
67
  }
68
- function w(r, e, o) {
69
- return class extends g {
68
+ function H(o, e, r) {
69
+ return class extends a {
70
70
  getId() {
71
- return r;
71
+ return o;
72
72
  }
73
73
  getTargetNodes(n) {
74
- if (!e || !o)
74
+ if (!e || !r)
75
75
  return [n];
76
- const t = n.closest(o);
76
+ const t = n.closest(r);
77
77
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
78
78
  }
79
79
  /**
@@ -89,7 +89,7 @@ function w(r, e, o) {
89
89
  const t = this.getTargetNodes(n);
90
90
  if (!t.length)
91
91
  return;
92
- const s = this.api.getValues()[f], i = !s || x.has(s), l = this.api.getDocumentModifier();
92
+ const s = this.api.getValues()[g], i = !s || f.has(s), l = this.api.getDocumentModifier();
93
93
  return t.forEach((u) => {
94
94
  const c = l.modifyHtml(u);
95
95
  i ? c.removeStyle("background-color") : c.setStyle("background-color", s);
@@ -97,44 +97,35 @@ function w(r, e, o) {
97
97
  }
98
98
  };
99
99
  }
100
- function L(r) {
101
- const e = E.find((n) => n in r);
100
+ function K(o) {
101
+ const e = E.find((n) => n in o);
102
102
  if (!e)
103
103
  return;
104
- const o = r[e];
105
- return typeof o == "string" ? o : "";
104
+ const r = o[e];
105
+ return typeof r == "string" ? r : "";
106
106
  }
107
- function z(r, e) {
108
- return e.startsWith(".") && "hasClass" in r && r.hasClass(e.slice(1));
107
+ function z(o, e) {
108
+ return e.startsWith(".") && "hasClass" in o && o.hasClass(e.slice(1));
109
109
  }
110
- function a(r, e) {
110
+ function d(o, e) {
111
111
  try {
112
- return z(r, e) ? r : r.closest(e) ?? void 0;
112
+ return z(o, e) ? o : o.closest(e) ?? void 0;
113
113
  } catch {
114
114
  return;
115
115
  }
116
116
  }
117
- function D(r, e) {
118
- if (!("querySelectorAll" in r))
119
- return [];
120
- try {
121
- return r.querySelectorAll(e).filter((o) => "getAttribute" in o && !o.getAttribute(K));
122
- } catch {
123
- return [];
124
- }
125
- }
126
- function W(r, e, o) {
127
- return class extends g {
117
+ function V(o, e) {
118
+ return class extends a {
128
119
  getId() {
129
- return r;
120
+ return o;
130
121
  }
131
122
  /** The parent control renders its own generic title; restore the block-level wording. */
132
123
  getLabels() {
133
124
  return { title: this.api.translate("Block Background Color") };
134
125
  }
135
- getTargetNodes(n) {
136
- const t = a(n, e);
137
- return t ? [t] : [];
126
+ getTargetNodes(r) {
127
+ const n = d(r, e);
128
+ return n ? [n] : [];
138
129
  }
139
130
  /**
140
131
  * Writes the picked background onto the block as an inline style plus a `bgcolor`
@@ -142,153 +133,147 @@ function W(r, e, o) {
142
133
  * write never reaches the block element (verified at runtime). `bgcolor` is the
143
134
  * channel Outlook honours on a `<td>`, and matches what the migrator emits.
144
135
  */
145
- getAdditionalModifications(n) {
146
- const t = a(n, e);
147
- if (!t)
136
+ getAdditionalModifications(r) {
137
+ const n = d(r, e);
138
+ if (!n)
148
139
  return;
149
- const s = L(this.api.getValues());
150
- if (s === void 0)
140
+ const t = K(this.api.getValues());
141
+ if (t === void 0)
151
142
  return;
152
- const i = !s || x.has(s), l = this.api.getDocumentModifier();
153
- return [
154
- t,
155
- ...D(t, o)
156
- ].forEach((c) => {
157
- const d = l.modifyHtml(c);
158
- i ? d.removeStyle("background-color").removeAttribute("bgcolor") : d.setStyle("background-color", s).setAttribute("bgcolor", s);
159
- }), l;
143
+ const s = !t || f.has(t), i = this.api.getDocumentModifier(), l = i.modifyHtml(n);
144
+ return s ? l.removeStyle("background-color").removeAttribute("bgcolor") : l.setStyle("background-color", t).setAttribute("bgcolor", t), i;
160
145
  }
161
146
  };
162
147
  }
163
- function X(r, e, o) {
164
- return class extends A {
148
+ function w(o, e, r) {
149
+ return class extends I {
165
150
  getId() {
166
- return r;
151
+ return o;
167
152
  }
168
153
  getTargetNodes(n) {
169
- if (!e || !o)
154
+ if (!e || !r)
170
155
  return [n];
171
- const t = n.closest(o);
156
+ const t = n.closest(r);
172
157
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
173
158
  }
174
159
  };
175
160
  }
176
- function j(r, e, o) {
161
+ function W(o, e, r) {
177
162
  return class extends _ {
178
163
  getId() {
179
- return r;
164
+ return o;
180
165
  }
181
166
  getTargetNodes(n) {
182
167
  return [n];
183
168
  }
184
169
  };
185
170
  }
186
- function J(r, e, o = ".ins-recommendation-product-container") {
187
- return class extends b {
171
+ function X(o, e, r = ".ins-recommendation-product-container") {
172
+ return class extends A {
188
173
  getId() {
189
- return r;
174
+ return o;
190
175
  }
191
176
  getTargetNodes(n) {
192
- const t = n.closest(o);
177
+ const t = n.closest(r);
193
178
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
194
179
  }
195
180
  };
196
181
  }
197
- function Q(r, e, o = ".ins-recommendation-product-container") {
182
+ function j(o, e, r = ".ins-recommendation-product-container") {
198
183
  return class extends h {
199
184
  getId() {
200
- return r;
185
+ return o;
201
186
  }
202
187
  getTargetNodes(n) {
203
- const t = n.closest(o);
188
+ const t = n.closest(r);
204
189
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
205
190
  }
206
191
  };
207
192
  }
208
- function Z(r, e, o = ".ins-recommendation-product-container") {
193
+ function J(o, e, r = ".ins-recommendation-product-container") {
209
194
  return class extends k {
210
195
  getId() {
211
- return r;
196
+ return o;
212
197
  }
213
198
  getTargetNodes(n) {
214
- const t = n.closest(o);
199
+ const t = n.closest(r);
215
200
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
216
201
  }
217
202
  };
218
203
  }
219
- function tt(r, e, o = ".ins-recommendation-product-container") {
204
+ function Q(o, e, r = ".ins-recommendation-product-container") {
220
205
  return class extends N {
221
206
  getId() {
222
- return r;
207
+ return o;
223
208
  }
224
209
  getTargetNodes(n) {
225
- const t = n.closest(o);
210
+ const t = n.closest(r);
226
211
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
227
212
  }
228
213
  };
229
214
  }
230
- function et(r, e, o = ".ins-recommendation-product-container") {
231
- return class extends q {
215
+ function Z(o, e, r = ".ins-recommendation-product-container") {
216
+ return class extends p {
232
217
  getId() {
233
- return r;
218
+ return o;
234
219
  }
235
220
  getTargetNodes(n) {
236
- const t = n.closest(o);
221
+ const t = n.closest(r);
237
222
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
238
223
  }
239
224
  };
240
225
  }
241
- function nt(r, e, o = ".ins-recommendation-product-container") {
242
- return class extends p {
226
+ function tt(o, e, r = ".ins-recommendation-product-container") {
227
+ return class extends q {
243
228
  getId() {
244
- return r;
229
+ return o;
245
230
  }
246
231
  getTargetNodes(n) {
247
- const t = n.closest(o);
232
+ const t = n.closest(r);
248
233
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
249
234
  }
250
235
  };
251
236
  }
252
- function rt(r, e, o = ".ins-recommendation-product-container") {
237
+ function et(o, e, r = ".ins-recommendation-product-container") {
253
238
  return class extends $ {
254
239
  getId() {
255
- return r;
240
+ return o;
256
241
  }
257
242
  getTargetNodes(n) {
258
- const t = n.closest(o);
243
+ const t = n.closest(r);
259
244
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
260
245
  }
261
246
  };
262
247
  }
263
- function ot(r, e, o = ".ins-recommendation-product-container") {
248
+ function nt(o, e, r = ".ins-recommendation-product-container") {
264
249
  return class extends F {
265
250
  getId() {
266
- return r;
251
+ return o;
267
252
  }
268
253
  getTargetNodes(n) {
269
- const t = n.closest(o);
254
+ const t = n.closest(r);
270
255
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
271
256
  }
272
257
  };
273
258
  }
274
- function st(r, e, o = ".ins-recommendation-product-container") {
259
+ function rt(o, e, r = ".ins-recommendation-product-container") {
275
260
  return class extends v {
276
261
  getId() {
277
- return r;
262
+ return o;
278
263
  }
279
264
  getTargetNodes(n) {
280
- const t = n.closest(o);
265
+ const t = n.closest(r);
281
266
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
282
267
  }
283
268
  };
284
269
  }
285
- function it(r, e, o) {
270
+ function ot(o, e, r) {
286
271
  return class extends M {
287
272
  getId() {
288
- return r;
273
+ return o;
289
274
  }
290
275
  getTargetNodes(n) {
291
- const t = n.closest(o);
276
+ const t = n.closest(r);
292
277
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
293
278
  }
294
279
  /**
@@ -302,7 +287,7 @@ function it(r, e, o) {
302
287
  * when this runs. Returned modifications are merged into the parent control's patch.
303
288
  */
304
289
  getAdditionalModifications(n) {
305
- const t = n.closest(o);
290
+ const t = n.closest(r);
306
291
  if (!t)
307
292
  return;
308
293
  const s = t.querySelectorAll(`[esd-extension-block-id="${e}"] a.es-button`);
@@ -312,31 +297,31 @@ function it(r, e, o) {
312
297
  if (!i)
313
298
  return;
314
299
  const l = i.bold ? "bold" : "normal", u = i.italic ? "italic" : "normal", c = this.api.getDocumentModifier();
315
- return s.forEach((d) => {
316
- c.modifyHtml(d).setStyle("font-weight", l).setStyle("font-style", u);
300
+ return s.forEach((x) => {
301
+ c.modifyHtml(x).setStyle("font-weight", l).setStyle("font-style", u);
317
302
  }), c;
318
303
  }
319
304
  };
320
305
  }
321
- function lt(r, e, o) {
306
+ function st(o, e, r) {
322
307
  return class extends R {
323
308
  getId() {
324
- return r;
309
+ return o;
325
310
  }
326
311
  getTargetNodes(n) {
327
- const t = n.closest(o);
312
+ const t = n.closest(r);
328
313
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
329
314
  }
330
315
  };
331
316
  }
332
- function ct(r, e, o) {
317
+ function it(o, e, r) {
333
318
  return class extends S {
334
319
  getId() {
335
- return r;
320
+ return o;
336
321
  }
337
322
  getTargetNodes(n) {
338
323
  try {
339
- const t = n.closest(o);
324
+ const t = n.closest(r);
340
325
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
341
326
  } catch {
342
327
  return [];
@@ -344,14 +329,14 @@ function ct(r, e, o) {
344
329
  }
345
330
  };
346
331
  }
347
- function ut(r, e, o) {
348
- return class extends I {
332
+ function lt(o, e, r) {
333
+ return class extends b {
349
334
  getId() {
350
- return r;
335
+ return o;
351
336
  }
352
337
  getTargetNodes(n) {
353
338
  try {
354
- const t = n.closest(o);
339
+ const t = n.closest(r);
355
340
  return t ? t.querySelectorAll(`[esd-extension-block-id="${e}"]`) : [];
356
341
  } catch {
357
342
  return [];
@@ -360,26 +345,26 @@ function ut(r, e, o) {
360
345
  };
361
346
  }
362
347
  export {
363
- W as createBlockBackgroundColorControl,
364
- J as createButtonAlignControl,
365
- Z as createButtonBorderControl,
366
- tt as createButtonBorderRadiusControl,
367
- Q as createButtonColorControl,
368
- lt as createButtonFitToContainerControl,
369
- et as createButtonFontFamilyControl,
370
- nt as createButtonMarginsControl,
371
- rt as createButtonPaddingsControl,
372
- ot as createButtonTextControl,
373
- st as createButtonTextSizeControl,
374
- it as createButtonTextStyleAndFontColorControl,
375
- ut as createImageMarginsControl,
376
- ct as createImageSizeControl,
377
- X as createPaddingsControl,
378
- U as createTextAlignControl,
379
- w as createTextBackgroundColorControl,
380
- Y as createTextColorControl,
381
- V as createTextFontFamilyControl,
382
- j as createTextLineSpacingControl,
383
- G as createTextSizeControl,
384
- H as createTextStyleControl
348
+ V as createBlockBackgroundColorControl,
349
+ X as createButtonAlignControl,
350
+ J as createButtonBorderControl,
351
+ Q as createButtonBorderRadiusControl,
352
+ j as createButtonColorControl,
353
+ st as createButtonFitToContainerControl,
354
+ Z as createButtonFontFamilyControl,
355
+ tt as createButtonMarginsControl,
356
+ et as createButtonPaddingsControl,
357
+ nt as createButtonTextControl,
358
+ rt as createButtonTextSizeControl,
359
+ ot as createButtonTextStyleAndFontColorControl,
360
+ lt as createImageMarginsControl,
361
+ it as createImageSizeControl,
362
+ w as createPaddingsControl,
363
+ L as createTextAlignControl,
364
+ H as createTextBackgroundColorControl,
365
+ P as createTextColorControl,
366
+ G as createTextFontFamilyControl,
367
+ W as createTextLineSpacingControl,
368
+ U as createTextSizeControl,
369
+ Y as createTextStyleControl
385
370
  };
@@ -120,11 +120,10 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
120
120
  *
121
121
  * Stripo's built-in block-background control resolves its own target and descends to the
122
122
  * nearest `.esd-block-text`, which inside a Recommendation block is the title cell rather
123
- * than the block itself (SD-145082). Overriding `getTargetNodes` moves that resolution here.
123
+ * than the block itself (SD-145082). Overriding `getTargetNodes` moves that resolution here
124
+ * so the color lands on the block `<td>` only — inner text blocks keep their own controls.
124
125
  */
125
- export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string,
126
- /** Extra cells inside the block to keep in sync — e.g. a title cell holding a pre-fix color. */
127
- additionalTargetSelector?: string): {
126
+ export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string): {
128
127
  new (): {
129
128
  getId(): string;
130
129
  /** The parent control renders its own generic title; restore the block-level wording. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.12.0-beta.ab050f8",
3
+ "version": "3.12.0-beta.b9402d1",
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",