@useinsider/guido 3.15.0-beta.36d3655 → 3.15.0-beta.3e8c8d2

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 (50) hide show
  1. package/dist/@types/config/schemas.js +92 -108
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +85 -91
  4. package/dist/composables/useActionsApi.js +22 -30
  5. package/dist/composables/useEmailTemplateApplier.js +23 -25
  6. package/dist/composables/useHtmlValidator.js +50 -50
  7. package/dist/composables/useTimerClone.js +19 -21
  8. package/dist/config/i18n/en/labels.json.js +7 -3
  9. package/dist/config/migrator/index.js +11 -12
  10. package/dist/config/migrator/itemsBlockMigrator.js +1 -1
  11. package/dist/config/migrator/recommendation/compositionMapper.js +26 -23
  12. package/dist/config/migrator/recommendation/htmlBuilder.js +156 -155
  13. package/dist/enums/recommendation.js +17 -17
  14. package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
  15. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +18 -15
  16. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +363 -322
  17. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +8 -8
  18. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +271 -231
  19. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +16 -16
  20. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +16 -16
  21. package/dist/extensions/Blocks/Recommendation/templates/utils.js +120 -120
  22. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +55 -54
  23. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +89 -0
  24. package/dist/extensions/Blocks/common-control.js +42 -35
  25. package/dist/guido.css +1 -1
  26. package/dist/library.js +5 -8
  27. package/dist/node_modules/valibot/dist/index.js +216 -230
  28. package/dist/src/@types/config/schemas.d.ts +0 -20
  29. package/dist/src/composables/useActionsApi.d.ts +1 -1
  30. package/dist/src/composables/useConfig.d.ts +0 -4
  31. package/dist/src/composables/useHtmlValidator.d.ts +3 -2
  32. package/dist/src/config/migrator/index.d.ts +1 -6
  33. package/dist/src/config/migrator/recommendation/types.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  35. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +6 -0
  36. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +27 -5
  37. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -2
  38. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -11
  39. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +47 -0
  40. package/dist/src/extensions/Blocks/common-control.d.ts +3 -1
  41. package/dist/src/library.d.ts +0 -1
  42. package/dist/src/stores/config.d.ts +0 -36
  43. package/dist/src/stores/editor.d.ts +0 -25
  44. package/dist/stores/editor.js +1 -4
  45. package/dist/utils/templatePreparation.js +61 -72
  46. package/package.json +1 -1
  47. package/dist/config/migrator/trackIdMigrator.js +0 -11
  48. package/dist/src/config/migrator/trackIdMigrator.d.ts +0 -6
  49. package/dist/src/utils/linkTrackingIds.d.ts +0 -25
  50. package/dist/utils/linkTrackingIds.js +0 -46
@@ -9,7 +9,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
9
9
  isStripoInitialized: boolean;
10
10
  templateId: string;
11
11
  syncModulesEnabled: boolean;
12
- trackIdSessionFloor: number;
13
12
  }, {
14
13
  isEditorToolbarVisible: (state: {
15
14
  loadingStatus: boolean;
@@ -22,7 +21,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
22
21
  isStripoInitialized: boolean;
23
22
  templateId: string;
24
23
  syncModulesEnabled: boolean;
25
- trackIdSessionFloor: number;
26
24
  } & import("pinia").PiniaCustomStateProperties<{
27
25
  loadingStatus: boolean;
28
26
  isCodeEditorOpen: boolean;
@@ -34,7 +32,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
34
32
  isStripoInitialized: boolean;
35
33
  templateId: string;
36
34
  syncModulesEnabled: boolean;
37
- trackIdSessionFloor: number;
38
35
  }>) => boolean;
39
36
  isUndoButtonDisabled: (state: {
40
37
  loadingStatus: boolean;
@@ -47,7 +44,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
47
44
  isStripoInitialized: boolean;
48
45
  templateId: string;
49
46
  syncModulesEnabled: boolean;
50
- trackIdSessionFloor: number;
51
47
  } & import("pinia").PiniaCustomStateProperties<{
52
48
  loadingStatus: boolean;
53
49
  isCodeEditorOpen: boolean;
@@ -59,7 +55,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
59
55
  isStripoInitialized: boolean;
60
56
  templateId: string;
61
57
  syncModulesEnabled: boolean;
62
- trackIdSessionFloor: number;
63
58
  }>) => boolean;
64
59
  isRedoButtonDisabled: (state: {
65
60
  loadingStatus: boolean;
@@ -72,7 +67,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
72
67
  isStripoInitialized: boolean;
73
68
  templateId: string;
74
69
  syncModulesEnabled: boolean;
75
- trackIdSessionFloor: number;
76
70
  } & import("pinia").PiniaCustomStateProperties<{
77
71
  loadingStatus: boolean;
78
72
  isCodeEditorOpen: boolean;
@@ -84,7 +78,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
84
78
  isStripoInitialized: boolean;
85
79
  templateId: string;
86
80
  syncModulesEnabled: boolean;
87
- trackIdSessionFloor: number;
88
81
  }>) => boolean;
89
82
  isCodeEditorButtonDisabled: (state: {
90
83
  loadingStatus: boolean;
@@ -97,7 +90,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
97
90
  isStripoInitialized: boolean;
98
91
  templateId: string;
99
92
  syncModulesEnabled: boolean;
100
- trackIdSessionFloor: number;
101
93
  } & import("pinia").PiniaCustomStateProperties<{
102
94
  loadingStatus: boolean;
103
95
  isCodeEditorOpen: boolean;
@@ -109,7 +101,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
109
101
  isStripoInitialized: boolean;
110
102
  templateId: string;
111
103
  syncModulesEnabled: boolean;
112
- trackIdSessionFloor: number;
113
104
  }>) => boolean;
114
105
  isPreviewButtonDisabled: (state: {
115
106
  loadingStatus: boolean;
@@ -122,7 +113,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
122
113
  isStripoInitialized: boolean;
123
114
  templateId: string;
124
115
  syncModulesEnabled: boolean;
125
- trackIdSessionFloor: number;
126
116
  } & import("pinia").PiniaCustomStateProperties<{
127
117
  loadingStatus: boolean;
128
118
  isCodeEditorOpen: boolean;
@@ -134,7 +124,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
134
124
  isStripoInitialized: boolean;
135
125
  templateId: string;
136
126
  syncModulesEnabled: boolean;
137
- trackIdSessionFloor: number;
138
127
  }>) => boolean;
139
128
  isViewOptionsDisabled: (state: {
140
129
  loadingStatus: boolean;
@@ -147,7 +136,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
147
136
  isStripoInitialized: boolean;
148
137
  templateId: string;
149
138
  syncModulesEnabled: boolean;
150
- trackIdSessionFloor: number;
151
139
  } & import("pinia").PiniaCustomStateProperties<{
152
140
  loadingStatus: boolean;
153
141
  isCodeEditorOpen: boolean;
@@ -159,7 +147,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
159
147
  isStripoInitialized: boolean;
160
148
  templateId: string;
161
149
  syncModulesEnabled: boolean;
162
- trackIdSessionFloor: number;
163
150
  }>) => boolean;
164
151
  isVersionHistoryButtonDisabled: (state: {
165
152
  loadingStatus: boolean;
@@ -172,7 +159,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
172
159
  isStripoInitialized: boolean;
173
160
  templateId: string;
174
161
  syncModulesEnabled: boolean;
175
- trackIdSessionFloor: number;
176
162
  } & import("pinia").PiniaCustomStateProperties<{
177
163
  loadingStatus: boolean;
178
164
  isCodeEditorOpen: boolean;
@@ -184,7 +170,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
184
170
  isStripoInitialized: boolean;
185
171
  templateId: string;
186
172
  syncModulesEnabled: boolean;
187
- trackIdSessionFloor: number;
188
173
  }>) => boolean;
189
174
  isExportButtonDisabled: (state: {
190
175
  loadingStatus: boolean;
@@ -197,7 +182,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
197
182
  isStripoInitialized: boolean;
198
183
  templateId: string;
199
184
  syncModulesEnabled: boolean;
200
- trackIdSessionFloor: number;
201
185
  } & import("pinia").PiniaCustomStateProperties<{
202
186
  loadingStatus: boolean;
203
187
  isCodeEditorOpen: boolean;
@@ -209,7 +193,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
209
193
  isStripoInitialized: boolean;
210
194
  templateId: string;
211
195
  syncModulesEnabled: boolean;
212
- trackIdSessionFloor: number;
213
196
  }>) => boolean;
214
197
  isSaveAsButtonDisabled: (state: {
215
198
  loadingStatus: boolean;
@@ -222,7 +205,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
222
205
  isStripoInitialized: boolean;
223
206
  templateId: string;
224
207
  syncModulesEnabled: boolean;
225
- trackIdSessionFloor: number;
226
208
  } & import("pinia").PiniaCustomStateProperties<{
227
209
  loadingStatus: boolean;
228
210
  isCodeEditorOpen: boolean;
@@ -234,7 +216,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
234
216
  isStripoInitialized: boolean;
235
217
  templateId: string;
236
218
  syncModulesEnabled: boolean;
237
- trackIdSessionFloor: number;
238
219
  }>) => boolean;
239
220
  isTestButtonDisabled: (state: {
240
221
  loadingStatus: boolean;
@@ -247,7 +228,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
247
228
  isStripoInitialized: boolean;
248
229
  templateId: string;
249
230
  syncModulesEnabled: boolean;
250
- trackIdSessionFloor: number;
251
231
  } & import("pinia").PiniaCustomStateProperties<{
252
232
  loadingStatus: boolean;
253
233
  isCodeEditorOpen: boolean;
@@ -259,7 +239,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
259
239
  isStripoInitialized: boolean;
260
240
  templateId: string;
261
241
  syncModulesEnabled: boolean;
262
- trackIdSessionFloor: number;
263
242
  }>) => boolean;
264
243
  isSaveButtonDisabled: (state: {
265
244
  loadingStatus: boolean;
@@ -272,7 +251,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
272
251
  isStripoInitialized: boolean;
273
252
  templateId: string;
274
253
  syncModulesEnabled: boolean;
275
- trackIdSessionFloor: number;
276
254
  } & import("pinia").PiniaCustomStateProperties<{
277
255
  loadingStatus: boolean;
278
256
  isCodeEditorOpen: boolean;
@@ -284,7 +262,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
284
262
  isStripoInitialized: boolean;
285
263
  templateId: string;
286
264
  syncModulesEnabled: boolean;
287
- trackIdSessionFloor: number;
288
265
  }>) => boolean;
289
266
  isInSaveableState: (state: {
290
267
  loadingStatus: boolean;
@@ -297,7 +274,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
297
274
  isStripoInitialized: boolean;
298
275
  templateId: string;
299
276
  syncModulesEnabled: boolean;
300
- trackIdSessionFloor: number;
301
277
  } & import("pinia").PiniaCustomStateProperties<{
302
278
  loadingStatus: boolean;
303
279
  isCodeEditorOpen: boolean;
@@ -309,6 +285,5 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
309
285
  isStripoInitialized: boolean;
310
286
  templateId: string;
311
287
  syncModulesEnabled: boolean;
312
- trackIdSessionFloor: number;
313
288
  }>) => boolean;
314
289
  }, {}>;
@@ -10,10 +10,7 @@ const o = e("guidoEditor", {
10
10
  hasChanges: !1,
11
11
  isStripoInitialized: !1,
12
12
  templateId: "",
13
- syncModulesEnabled: !1,
14
- // In-session id high-water mark; floors tracking-id minting so ids
15
- // deleted by a version restore / paste-over are never reused.
16
- trackIdSessionFloor: 0
13
+ syncModulesEnabled: !1
17
14
  }),
18
15
  getters: {
19
16
  // Middle Slot
@@ -1,65 +1,62 @@
1
- import { useActionsApi as k } from "../composables/useActionsApi.js";
2
- import { useConfig as U } from "../composables/useConfig.js";
3
- import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
4
- import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
- import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
- import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
- import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
- import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
10
- import { useEditorStore as z } from "../stores/editor.js";
11
- import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
12
- import { assignTrackingIds as v } from "./linkTrackingIds.js";
13
- function O(m) {
14
- const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
- return n.forEach((i) => {
16
- const o = i.getAttribute(A.PAGE_LIST);
17
- o && t.push(...R(o));
1
+ import { useActionsApi as P } from "../composables/useActionsApi.js";
2
+ import { useHtmlCompiler as w } from "../composables/useHtmlCompiler.js";
3
+ import { DEFAULT_CURRENCY as l, DEFAULT_NODE_CONFIG as i } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
4
+ import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { mapLegacyStrategy as E } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
6
+ import { DATA_ATTRIBUTES as h } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
7
+ import { parsePageList as H } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
8
+ import { useDynamicContentStore as U } from "../stores/dynamic-content.js";
9
+ import { useUnsubscribeStore as F } from "../stores/unsubscribe.js";
10
+ function L(s) {
11
+ const o = new DOMParser().parseFromString(s, "text/html").querySelectorAll(`[${h.PAGE_LIST}]`), t = [];
12
+ return o.forEach((a) => {
13
+ const n = a.getAttribute(h.PAGE_LIST);
14
+ n && t.push(...H(n));
18
15
  }), [...new Set(t)];
19
16
  }
20
- async function M(m) {
21
- const a = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
- if (a.length === 0)
17
+ async function R(s) {
18
+ const m = new DOMParser().parseFromString(s, "text/html").querySelectorAll(".recommendation-block-v2");
19
+ if (m.length === 0)
23
20
  return;
24
- const n = C();
25
- a.forEach((t) => {
26
- var r, l, g, f, c;
27
- const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
28
- if (!Number.isFinite(o))
21
+ const o = b();
22
+ m.forEach((t) => {
23
+ var c, p, g, f, r;
24
+ const a = t.getAttribute("recommendation-id"), n = a ? Number(a) : NaN;
25
+ if (!Number.isFinite(n))
29
26
  return;
30
- const p = t.getAttribute("esd-ext-config");
31
- if (!p)
27
+ const d = t.getAttribute("esd-ext-config");
28
+ if (!d)
32
29
  return;
33
30
  let e;
34
31
  try {
35
- e = JSON.parse(p);
32
+ e = JSON.parse(d);
36
33
  } catch {
37
34
  return;
38
35
  }
39
36
  if (!e || typeof e != "object" || Array.isArray(e))
40
37
  return;
41
- const h = {
38
+ const y = {
42
39
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
43
40
  // already-saved blocks that never re-run the migrator don't emit a
44
41
  // strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
45
- strategy: L(e.strategy) || s.strategy,
46
- language: e.language ?? s.language,
47
- size: e.size ?? s.size,
42
+ strategy: E(e.strategy) || i.strategy,
43
+ language: e.language ?? i.language,
44
+ size: e.size ?? i.size,
48
45
  // Spread the default arrays so each block gets a fresh reference
49
46
  // instead of sharing the singleton in DEFAULT_NODE_CONFIG.
50
- productIds: e.productIds ?? [...s.productIds],
51
- filters: e.filters ?? [...s.filters],
52
- shuffleProducts: e.shuffleProducts ?? s.shuffleProducts,
53
- currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
54
- currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
55
- currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
56
- currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
57
- currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
47
+ productIds: e.productIds ?? [...i.productIds],
48
+ filters: e.filters ?? [...i.filters],
49
+ shuffleProducts: e.shuffleProducts ?? i.shuffleProducts,
50
+ currencyCode: ((c = e.currency) == null ? void 0 : c.code) ?? l.code,
51
+ currencyAlignment: ((p = e.currency) == null ? void 0 : p.alignment) ?? l.alignment,
52
+ currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? l.decimalCount,
53
+ currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? l.decimalSeparator,
54
+ currencyThousandSeparator: ((r = e.currency) == null ? void 0 : r.thousandSeparator) ?? l.thousandSeparator
58
55
  };
59
- n.seedBlockUrlConfig(o, h);
56
+ o.seedBlockUrlConfig(n, y);
60
57
  });
61
58
  try {
62
- await n.fetchRecommendationCreateData();
59
+ await o.fetchRecommendationCreateData();
63
60
  } catch (t) {
64
61
  console.warn(
65
62
  "Recommendation reference data pre-load failed; validator will skip the availability check.",
@@ -67,51 +64,43 @@ async function M(m) {
67
64
  );
68
65
  }
69
66
  }
70
- const Z = () => {
71
- const m = N(), u = z(), a = _(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
67
+ const G = () => {
68
+ const s = U(), u = F(), { getCompiledEmail: m, getTemplateData: o } = P(), { compileHtml: t, compileAmpHtml: a } = w();
72
69
  return {
73
70
  prepareTemplateDetails: async () => {
74
- let { html: r, css: l, syncModulesIds: g = [] } = await t();
75
- if (e("linkTrackingIds"))
76
- try {
77
- const { html: y, changed: H, nextSeq: I } = v(r, u.trackIdSessionFloor);
78
- u.trackIdSessionFloor = I, H && (r = y, await i(y, l));
79
- } catch (y) {
80
- console.error("Tracking-id step failed, saving anyway:", y);
81
- }
82
- const { html: f, ampHtml: c = "", ampErrors: T = [] } = await n({
71
+ const { html: d, ampHtml: e = "", ampErrors: y = [] } = await m({
83
72
  minimize: !0,
84
73
  resetDataSavedFlag: !1
85
- });
86
- a.selectedUnsubscribePages.length && await a.fetchTemplates(), await M(r);
87
- const { compiledHtml: w, stats: S, appliedRules: D } = o(f), E = c && p(c).compiledHtml, P = m.getSelectedDynamicContentList, F = C(), b = O(r);
74
+ }), { html: c, css: p, syncModulesIds: g = [] } = await o();
75
+ u.selectedUnsubscribePages.length && await u.fetchTemplates(), await R(c);
76
+ const { compiledHtml: f, stats: r, appliedRules: A } = t(d), C = e && a(e).compiledHtml, T = s.getSelectedDynamicContentList, D = b(), S = L(c);
88
77
  return console.debug("HTML Compilation Stats:", {
89
- originalSize: S.originalSize,
90
- compiledSize: S.compiledSize,
91
- reduction: `${S.reductionPercentage.toFixed(2)}%`,
92
- appliedRules: D,
93
- executionTime: `${S.executionTime.toFixed(2)}ms`
78
+ originalSize: r.originalSize,
79
+ compiledSize: r.compiledSize,
80
+ reduction: `${r.reductionPercentage.toFixed(2)}%`,
81
+ appliedRules: A,
82
+ executionTime: `${r.executionTime.toFixed(2)}ms`
94
83
  }), {
95
- dynamicContentList: P,
96
- compiledHtml: w,
97
- rawHtml: r,
98
- css: l,
99
- ampHtml: E,
100
- ampErrors: T,
84
+ dynamicContentList: T,
85
+ compiledHtml: f,
86
+ rawHtml: c,
87
+ css: p,
88
+ ampHtml: C,
89
+ ampErrors: y,
101
90
  modules: g.map(Number),
102
91
  recommendation: {
103
- campaignUrls: F.recommendationCampaignUrls,
92
+ campaignUrls: D.recommendationCampaignUrls,
104
93
  configs: {}
105
94
  },
106
95
  unsubscribe: {
107
- status: b.length > 0,
108
- config: b
96
+ status: S.length > 0,
97
+ config: S
109
98
  }
110
99
  };
111
100
  }
112
101
  };
113
102
  };
114
103
  export {
115
- O as getHtmlReferencedUnsubscribePages,
116
- Z as useTemplatePreparation
104
+ L as getHtmlReferencedUnsubscribePages,
105
+ G as useTemplatePreparation
117
106
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.15.0-beta.36d3655",
3
+ "version": "3.15.0-beta.3e8c8d2",
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",
@@ -1,11 +0,0 @@
1
- import { assignTrackingIds as a } from "../../utils/linkTrackingIds.js";
2
- function c(r, o = 0) {
3
- try {
4
- return a(r, o).html;
5
- } catch (t) {
6
- return console.error("TrackIdMigrator failed:", t), r;
7
- }
8
- }
9
- export {
10
- c as migrateTrackIds
11
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Backfills persistent link tracking ids (SD-141414) at load so legacy
3
- * templates, library imports and externally edited HTML enter the editor
4
- * already tagged — before Stripo sees the document (no dirty flag, no undo).
5
- */
6
- export declare function migrateTrackIds(html: string, floor?: number): string;
@@ -1,25 +0,0 @@
1
- /**
2
- * Persistent link tracking ids for the click heatmap (SD-141414).
3
- * Pure string transforms — no DOM parse/serialize round-trip, safe for both
4
- * Stripo raw HTML and hand-authored HTML-editor documents. Shared with email-fe.
5
- */
6
- export declare const TRACK_ID_ATTRIBUTE = "data-ins-track-id";
7
- export declare const TRACK_SEQ_ATTRIBUTE = "data-ins-track-seq";
8
- export interface TrackingIdResult {
9
- html: string;
10
- changed: boolean;
11
- nextSeq: number;
12
- }
13
- /**
14
- * Reads the persisted id high-water mark: <body> attr, then <html> attr,
15
- * then the leading comment fallback. Returns 0 when absent.
16
- */
17
- export declare function readTrackSeq(html: string): number;
18
- /**
19
- * Ensures every <a> opening tag carries a unique positive-integer id and the
20
- * document records the id high-water mark. Ids are minted above
21
- * max(persisted seq, max id in document, floor) so deleted ids are never
22
- * reused — even after a version restore or paste-over (floor = session floor).
23
- * Idempotent: a document already normalized returns changed=false.
24
- */
25
- export declare function assignTrackingIds(html: string, floor?: number): TrackingIdResult;
@@ -1,46 +0,0 @@
1
- const $ = "data-ins-track-id", l = "data-ins-track-seq", E = `(?:[^>"']|"[^"]*"|'[^']*')*`, S = new RegExp(`<a\\b${E}>`, "gi"), p = new RegExp(`<body\\b${E}>`, "i"), b = new RegExp(`<html\\b${E}>`, "i"), I = new RegExp(`\\b${$}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"), N = new RegExp(`\\b${l}\\s*=\\s*(?:"(\\d+)"|'(\\d+)'|(\\d+))`, "i"), f = "ins-track-seq", x = new RegExp(`<!--\\s*${f}:(\\d+)\\s*-->`, "i"), w = /^[1-9][0-9]{0,14}$/, q = 999999999999999;
2
- function C(e) {
3
- const n = Number(e);
4
- return Number.isSafeInteger(n) && n > 0 ? n : 0;
5
- }
6
- function k(e) {
7
- var a;
8
- const n = (r) => {
9
- var c;
10
- const o = (c = r.exec(e)) == null ? void 0 : c[0];
11
- return o ? N.exec(o) : null;
12
- }, t = n(p) ?? n(b), s = (t == null ? void 0 : t[1]) ?? (t == null ? void 0 : t[2]) ?? (t == null ? void 0 : t[3]) ?? ((a = x.exec(e)) == null ? void 0 : a[1]) ?? "";
13
- return C(s);
14
- }
15
- function D(e, n) {
16
- const t = `${l}="${n}"`, s = p.exec(e) ?? b.exec(e);
17
- if (s) {
18
- const [r] = s, o = N.exec(r), c = o ? r.replace(o[0], t) : r.replace(/\/?>$/, (T) => ` ${t}${T}`);
19
- return e.slice(0, s.index) + c + e.slice(s.index + r.length);
20
- }
21
- const a = `<!--${f}:${n}-->`;
22
- return x.test(e) ? e.replace(x, a) : `${a}${e}`;
23
- }
24
- function M(e, n, t) {
25
- const s = `${$}="${t}"`;
26
- return n ? e.replace(n[0], s) : e.replace(/^<a\b/i, (a) => `${a} ${s}`);
27
- }
28
- function P(e, n = 0) {
29
- const t = /* @__PURE__ */ new Set();
30
- let s = 0;
31
- const a = [...e.matchAll(S)].map((i) => {
32
- const [g] = i, u = I.exec(g), _ = u ? u[1] ?? u[2] ?? u[3] ?? "" : "";
33
- let d = null;
34
- return w.test(_) && !t.has(Number(_)) && (d = Number(_), t.add(d), s = Math.max(s, d)), { index: i.index, tag: g, attrMatch: u, id: d };
35
- }), r = k(e), o = Number.isSafeInteger(n) && n > 0 && n < q ? n : 0;
36
- let c = Math.max(r, s, o), T = "", A = 0, R = !1;
37
- return a.forEach((i) => {
38
- T += e.slice(A, i.index), i.id === null ? (c += 1, T += M(i.tag, i.attrMatch, c), R = !0) : T += i.tag, A = i.index + i.tag.length;
39
- }), T += e.slice(A), c > 0 && r !== c && (T = D(T, c), R = !0), { html: T, changed: R, nextSeq: c };
40
- }
41
- export {
42
- $ as TRACK_ID_ATTRIBUTE,
43
- l as TRACK_SEQ_ATTRIBUTE,
44
- P as assignTrackingIds,
45
- k as readTrackSeq
46
- };