@useinsider/guido 3.14.0-beta.8d5df20 → 3.14.0-beta.a865e56
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/dist/@types/config/schemas.js +92 -108
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +85 -91
- package/dist/composables/useActionsApi.js +22 -30
- package/dist/composables/useEmailTemplateApplier.js +6 -8
- package/dist/composables/useHtmlValidator.js +91 -89
- package/dist/composables/useTimerClone.js +19 -21
- package/dist/config/migrator/checkboxMigrator.js +20 -19
- package/dist/config/migrator/index.js +10 -11
- package/dist/config/migrator/radioButtonMigrator.js +26 -25
- package/dist/extensions/Blocks/Checkbox/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/Checkbox/constants/selectors.js +6 -0
- package/dist/extensions/Blocks/Checkbox/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Checkbox/extension.js +6 -5
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +15 -14
- package/dist/extensions/Blocks/Checkbox/template.js +10 -9
- package/dist/extensions/Blocks/RadioButton/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/RadioButton/constants/selectors.js +6 -0
- package/dist/extensions/Blocks/RadioButton/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/RadioButton/extension.js +5 -4
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +12 -11
- package/dist/extensions/Blocks/RadioButton/template.js +16 -9
- package/dist/extensions/Blocks/controlFactories.js +117 -115
- package/dist/guido.css +1 -1
- package/dist/library.js +5 -8
- package/dist/node_modules/valibot/dist/index.js +216 -230
- package/dist/src/@types/config/schemas.d.ts +0 -20
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -4
- package/dist/src/config/migrator/index.d.ts +1 -6
- package/dist/src/extensions/Blocks/Checkbox/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/library.d.ts +0 -1
- package/dist/src/stores/config.d.ts +0 -36
- package/dist/src/stores/editor.d.ts +0 -25
- package/dist/stores/editor.js +1 -4
- package/dist/utils/templatePreparation.js +61 -72
- package/package.json +1 -1
- package/dist/config/migrator/trackIdMigrator.js +0 -11
- package/dist/src/config/migrator/trackIdMigrator.d.ts +0 -6
- package/dist/src/utils/linkTrackingIds.d.ts +0 -25
- 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
|
}, {}>;
|
package/dist/stores/editor.js
CHANGED
|
@@ -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
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
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
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
-
if (!Number.isFinite(
|
|
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
|
|
31
|
-
if (!
|
|
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(
|
|
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
|
|
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:
|
|
46
|
-
language: e.language ??
|
|
47
|
-
size: e.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 ?? [...
|
|
51
|
-
filters: e.filters ?? [...
|
|
52
|
-
shuffleProducts: e.shuffleProducts ??
|
|
53
|
-
currencyCode: ((
|
|
54
|
-
currencyAlignment: ((
|
|
55
|
-
currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ??
|
|
56
|
-
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ??
|
|
57
|
-
currencyThousandSeparator: ((
|
|
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
|
-
|
|
56
|
+
o.seedBlockUrlConfig(n, y);
|
|
60
57
|
});
|
|
61
58
|
try {
|
|
62
|
-
await
|
|
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
|
|
71
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
87
|
-
const { compiledHtml:
|
|
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:
|
|
90
|
-
compiledSize:
|
|
91
|
-
reduction: `${
|
|
92
|
-
appliedRules:
|
|
93
|
-
executionTime: `${
|
|
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:
|
|
96
|
-
compiledHtml:
|
|
97
|
-
rawHtml:
|
|
98
|
-
css:
|
|
99
|
-
ampHtml:
|
|
100
|
-
ampErrors:
|
|
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:
|
|
92
|
+
campaignUrls: D.recommendationCampaignUrls,
|
|
104
93
|
configs: {}
|
|
105
94
|
},
|
|
106
95
|
unsubscribe: {
|
|
107
|
-
status:
|
|
108
|
-
config:
|
|
96
|
+
status: S.length > 0,
|
|
97
|
+
config: S
|
|
109
98
|
}
|
|
110
99
|
};
|
|
111
100
|
}
|
|
112
101
|
};
|
|
113
102
|
};
|
|
114
103
|
export {
|
|
115
|
-
|
|
116
|
-
|
|
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.14.0-beta.
|
|
3
|
+
"version": "3.14.0-beta.a865e56",
|
|
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,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 l = "data-ins-track-id", $ = "data-ins-track-seq", E = `(?:[^>"']|"[^"]*"|'[^']*')*`, N = new RegExp(`<a\\b${E}>`, "gi"), g = new RegExp(`<body\\b${E}>`, "i"), p = new RegExp(`<html\\b${E}>`, "i"), S = new RegExp(`\\b${l}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"), f = new RegExp(`\\b${$}\\s*=\\s*(?:"(\\d+)"|'(\\d+)'|(\\d+))`, "i"), b = "ins-track-seq", A = new RegExp(`<!--\\s*${b}:(\\d+)\\s*-->`, "i"), I = /^[1-9][0-9]{0,14}$/;
|
|
2
|
-
function w(e) {
|
|
3
|
-
const t = Number(e);
|
|
4
|
-
return Number.isSafeInteger(t) && t > 0 ? t : 0;
|
|
5
|
-
}
|
|
6
|
-
function q(e) {
|
|
7
|
-
var r;
|
|
8
|
-
const t = (a) => {
|
|
9
|
-
var i;
|
|
10
|
-
const c = (i = a.exec(e)) == null ? void 0 : i[0];
|
|
11
|
-
return c ? f.exec(c) : null;
|
|
12
|
-
}, n = t(g) ?? t(p), s = (n == null ? void 0 : n[1]) ?? (n == null ? void 0 : n[2]) ?? (n == null ? void 0 : n[3]) ?? ((r = A.exec(e)) == null ? void 0 : r[1]) ?? "";
|
|
13
|
-
return w(s);
|
|
14
|
-
}
|
|
15
|
-
function k(e, t) {
|
|
16
|
-
const n = `${$}="${t}"`, s = g.exec(e) ?? p.exec(e);
|
|
17
|
-
if (s) {
|
|
18
|
-
const [a] = s, c = f.exec(a), i = c ? a.replace(c[0], n) : a.replace(/\/?>$/, (T) => ` ${n}${T}`);
|
|
19
|
-
return e.slice(0, s.index) + i + e.slice(s.index + a.length);
|
|
20
|
-
}
|
|
21
|
-
const r = `<!--${b}:${t}-->`;
|
|
22
|
-
return A.test(e) ? e.replace(A, r) : `${r}${e}`;
|
|
23
|
-
}
|
|
24
|
-
function C(e, t, n) {
|
|
25
|
-
const s = `${l}="${n}"`;
|
|
26
|
-
return t ? e.replace(t[0], s) : e.replace(/^<a\b/i, (r) => `${r} ${s}`);
|
|
27
|
-
}
|
|
28
|
-
function P(e, t = 0) {
|
|
29
|
-
const n = /* @__PURE__ */ new Set();
|
|
30
|
-
let s = 0;
|
|
31
|
-
const r = [...e.matchAll(N)].map((o) => {
|
|
32
|
-
const [_] = o, u = S.exec(_), R = u ? u[1] ?? u[2] ?? u[3] ?? "" : "";
|
|
33
|
-
let d = null;
|
|
34
|
-
return I.test(R) && !n.has(Number(R)) && (d = Number(R), n.add(d), s = Math.max(s, d)), { index: o.index, tag: _, attrMatch: u, id: d };
|
|
35
|
-
}), a = q(e);
|
|
36
|
-
let c = Math.max(a, s, t), i = "", T = 0, x = !1;
|
|
37
|
-
return r.forEach((o) => {
|
|
38
|
-
i += e.slice(T, o.index), o.id === null ? (c += 1, i += C(o.tag, o.attrMatch, c), x = !0) : i += o.tag, T = o.index + o.tag.length;
|
|
39
|
-
}), i += e.slice(T), c > 0 && a !== c && (i = k(i, c), x = !0), { html: i, changed: x, nextSeq: c };
|
|
40
|
-
}
|
|
41
|
-
export {
|
|
42
|
-
l as TRACK_ID_ATTRIBUTE,
|
|
43
|
-
$ as TRACK_SEQ_ATTRIBUTE,
|
|
44
|
-
P as assignTrackingIds,
|
|
45
|
-
q as readTrackSeq
|
|
46
|
-
};
|