@useinsider/guido 3.13.1-beta.a1e3c5f → 3.13.1-beta.a813d24
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 +13 -15
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +66 -67
- package/dist/config/migrator/index.js +10 -11
- package/dist/guido.css +1 -1
- package/dist/library.js +9 -14
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +12 -12
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/config/migrator/index.d.ts +1 -4
- package/dist/src/library.d.ts +0 -2
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/stores/editor.d.ts +0 -25
- package/dist/stores/editor.js +1 -4
- package/dist/utils/templatePreparation.js +59 -70
- package/package.json +3 -3
- 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 -44
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
2
|
-
import { object as a, number as n, optional as e, string as t, picklist as r, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as
|
|
1
|
+
import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as r, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as f, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const d = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -12,7 +12,7 @@ const d = {
|
|
|
12
12
|
ARCHITECT: 49,
|
|
13
13
|
/** Unsubscribe page builder */
|
|
14
14
|
UNSUBSCRIBE_PAGES: 97
|
|
15
|
-
},
|
|
15
|
+
}, A = a({
|
|
16
16
|
/** Unique identifier for the template being edited */
|
|
17
17
|
templateId: p(
|
|
18
18
|
t(),
|
|
@@ -25,7 +25,7 @@ const d = {
|
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
27
|
variationId: e(t())
|
|
28
|
-
}),
|
|
28
|
+
}), I = a({
|
|
29
29
|
/** Fallback font name (e.g., "Georgia") */
|
|
30
30
|
name: t(),
|
|
31
31
|
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
@@ -53,7 +53,7 @@ const d = {
|
|
|
53
53
|
/** Display name for the current user */
|
|
54
54
|
username: e(t(), "Guido User"),
|
|
55
55
|
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
56
|
-
fallbackFont: e(
|
|
56
|
+
fallbackFont: e(I)
|
|
57
57
|
}), v = a({
|
|
58
58
|
/** Display text for the dynamic content */
|
|
59
59
|
text: t(),
|
|
@@ -83,7 +83,7 @@ const d = {
|
|
|
83
83
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
84
84
|
id: e(n()),
|
|
85
85
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
86
|
-
decimalCount: e(
|
|
86
|
+
decimalCount: e(f([t(), n()])),
|
|
87
87
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
88
88
|
productIds: e(c(s())),
|
|
89
89
|
/** Whether the block requested live products at send time */
|
|
@@ -117,7 +117,7 @@ const d = {
|
|
|
117
117
|
/** Block type marker used by some legacy variants */
|
|
118
118
|
blockType: e(t()),
|
|
119
119
|
/** Size variant marker (legacy data may use string or number) */
|
|
120
|
-
size: e(
|
|
120
|
+
size: e(f([t(), n()])),
|
|
121
121
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
122
122
|
verticalResponsiveness: e(o()),
|
|
123
123
|
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
@@ -175,9 +175,9 @@ const d = {
|
|
|
175
175
|
/** Email header settings */
|
|
176
176
|
emailHeader: e(N, { senderName: "", subject: "" }),
|
|
177
177
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
178
|
-
savedModulesFolderName: e(t(),
|
|
178
|
+
savedModulesFolderName: e(t(), y.SAVED_MODULES),
|
|
179
179
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
180
|
-
defaultModulesFolderName: e(t(),
|
|
180
|
+
defaultModulesFolderName: e(t(), y.DEFAULT_MODULES)
|
|
181
181
|
}), x = a({
|
|
182
182
|
/** Whether to show the header bar */
|
|
183
183
|
showHeader: e(o(), !0),
|
|
@@ -203,9 +203,7 @@ const d = {
|
|
|
203
203
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
204
204
|
autosave: e(o(), !1),
|
|
205
205
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
206
|
-
allowlistEnabled: e(o(), !1)
|
|
207
|
-
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
208
|
-
linkTrackingIds: e(o(), !1)
|
|
206
|
+
allowlistEnabled: e(o(), !1)
|
|
209
207
|
}), U = r([
|
|
210
208
|
"amp-accordion",
|
|
211
209
|
"amp-carousel",
|
|
@@ -301,7 +299,7 @@ const d = {
|
|
|
301
299
|
}), K = a({
|
|
302
300
|
// Required sections
|
|
303
301
|
/** Identity configuration (required) */
|
|
304
|
-
identity:
|
|
302
|
+
identity: A,
|
|
305
303
|
/** Partner configuration (required) */
|
|
306
304
|
partner: L,
|
|
307
305
|
// Optional sections (with defaults)
|
|
@@ -333,10 +331,10 @@ export {
|
|
|
333
331
|
v as DynamicContentSchema,
|
|
334
332
|
O as EditorSchema,
|
|
335
333
|
N as EmailHeaderSchema,
|
|
336
|
-
|
|
334
|
+
I as FallbackFontSchema,
|
|
337
335
|
F as FeaturesSchema,
|
|
338
336
|
K as GuidoConfigSchema,
|
|
339
|
-
|
|
337
|
+
A as IdentitySchema,
|
|
340
338
|
P as LegacyRecommendationConfigSchema,
|
|
341
339
|
d as MessageType,
|
|
342
340
|
L as PartnerSchema,
|
|
@@ -1,50 +1,49 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
4
|
-
import { useGuidoStateBridge as
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import { useStripo as
|
|
7
|
-
import { useTimerClone as
|
|
8
|
-
import { migrate as
|
|
1
|
+
import { defineComponent as q, defineAsyncComponent as M, ref as U, computed as _, watch as B, onMounted as K, onUnmounted as V } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as j } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as Q } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as X } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as Y } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as Z } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as I } from "../config/migrator/index.js";
|
|
9
9
|
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useStripoApi as
|
|
20
|
-
import { useConfigStore as
|
|
21
|
-
import { useDynamicContentStore as
|
|
22
|
-
import { useEditorStore as
|
|
23
|
-
import { usePreviewStore as
|
|
24
|
-
import { useTemplateStore as
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
|
|
27
|
-
const $e = /* @__PURE__ */ K({
|
|
10
|
+
import { RIBBON_SELECTOR as ee } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as te } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import oe from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import ne from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import se from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import ie from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ce from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as de } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as me } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as ue } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as pe } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
|
|
26
|
+
const xe = /* @__PURE__ */ q({
|
|
28
27
|
__name: "Guido",
|
|
29
28
|
props: {
|
|
30
29
|
config: null,
|
|
31
30
|
ready: { type: Boolean, default: !0 }
|
|
32
31
|
},
|
|
33
32
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
|
-
setup(
|
|
35
|
-
const i =
|
|
33
|
+
setup(P, { expose: A, emit: n }) {
|
|
34
|
+
const i = P, W = M(
|
|
36
35
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
),
|
|
36
|
+
), x = M(
|
|
38
37
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
), g =
|
|
38
|
+
), g = U(), l = U(), u = le(), S = fe(), o = me();
|
|
40
39
|
i.ready && o.init(i.config);
|
|
41
|
-
const
|
|
40
|
+
const d = O(), G = ue(), m = _(() => d.hasChanges), { isTestPartner: H } = X(), h = () => {
|
|
42
41
|
var t;
|
|
43
42
|
return (t = g.value) == null ? void 0 : t.handleSave(!0);
|
|
44
43
|
}, b = (t) => {
|
|
45
|
-
|
|
44
|
+
d.loadingStatus = t;
|
|
46
45
|
};
|
|
47
|
-
|
|
46
|
+
j(), Q();
|
|
48
47
|
const p = () => {
|
|
49
48
|
var t, e;
|
|
50
49
|
return {
|
|
@@ -55,78 +54,78 @@ const $e = /* @__PURE__ */ K({
|
|
|
55
54
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
56
55
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
57
56
|
};
|
|
58
|
-
}, { initPlugin: E, preloadRuntime: w } =
|
|
57
|
+
}, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(), $ = _(() => {
|
|
59
58
|
var t;
|
|
60
59
|
return !((t = o.ui) != null && t.showHeader);
|
|
61
60
|
});
|
|
62
|
-
|
|
61
|
+
J({
|
|
63
62
|
onBack: () => {
|
|
64
|
-
console.debug("guido:back"),
|
|
63
|
+
console.debug("guido:back"), n("back");
|
|
65
64
|
},
|
|
66
65
|
onSaveStart: () => {
|
|
67
|
-
console.debug("guido:save:start"),
|
|
66
|
+
console.debug("guido:save:start"), n("save:start");
|
|
68
67
|
},
|
|
69
68
|
onSaveComplete: (t) => {
|
|
70
69
|
const e = { ...t, metadata: p() };
|
|
71
|
-
console.debug("guido:save:complete", e),
|
|
70
|
+
console.debug("guido:save:complete", e), n("save:complete", e);
|
|
72
71
|
},
|
|
73
72
|
onTestEmailClick: () => {
|
|
74
|
-
console.debug("guido:test-email:click"),
|
|
73
|
+
console.debug("guido:test-email:click"), n("test-email:click");
|
|
75
74
|
}
|
|
76
75
|
});
|
|
77
|
-
const
|
|
76
|
+
const L = (t) => {
|
|
78
77
|
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
79
|
-
},
|
|
78
|
+
}, R = () => {
|
|
80
79
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
81
80
|
};
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
B(() => m.value, () => {
|
|
82
|
+
n("on-change", m.value);
|
|
84
83
|
});
|
|
85
84
|
const f = (t) => {
|
|
86
|
-
const e = t, { attribute: s, position:
|
|
87
|
-
console.debug("dynamic-content:open", e.detail),
|
|
85
|
+
const e = t, { attribute: s, position: c } = e.detail;
|
|
86
|
+
console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s, c);
|
|
88
87
|
};
|
|
89
88
|
let a = null;
|
|
90
89
|
const y = () => {
|
|
91
90
|
var e;
|
|
92
|
-
const t = document.querySelector(
|
|
91
|
+
const t = document.querySelector(ee);
|
|
93
92
|
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
94
93
|
}, v = async () => {
|
|
95
94
|
var t;
|
|
96
95
|
try {
|
|
97
|
-
o.initialized || o.init(i.config),
|
|
98
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "",
|
|
96
|
+
o.initialized || o.init(i.config), d.templateId = o.templateId;
|
|
97
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", c = (e == null ? void 0 : e.css) || "", k = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
99
98
|
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
100
|
-
const
|
|
101
|
-
let
|
|
102
|
-
html: s && await
|
|
103
|
-
css:
|
|
99
|
+
const F = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {};
|
|
100
|
+
let r = {
|
|
101
|
+
html: s && await I(s, F),
|
|
102
|
+
css: c
|
|
104
103
|
};
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
preselectedDynamicContentList:
|
|
104
|
+
r.html || (r = await C(), r.html = await I(r.html, F)), T(r.html) && (r.html = await D(r.html));
|
|
105
|
+
const z = {
|
|
106
|
+
preselectedDynamicContentList: k,
|
|
108
107
|
onReady: () => {
|
|
109
|
-
console.debug("guido:ready"),
|
|
108
|
+
console.debug("guido:ready"), n("ready");
|
|
110
109
|
}
|
|
111
110
|
};
|
|
112
|
-
await E(
|
|
111
|
+
await E(r, p(), z), u.selectedDynamicContentList = k;
|
|
113
112
|
} catch (e) {
|
|
114
113
|
console.error("Failed to initialize Stripo editor:", e);
|
|
115
114
|
}
|
|
116
115
|
};
|
|
117
|
-
return
|
|
116
|
+
return K(async () => {
|
|
118
117
|
var e;
|
|
119
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
118
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), O().$reset(), pe().$reset(), y();
|
|
120
119
|
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
121
120
|
if (t && (a = new ResizeObserver(y), a.observe(t)), w(), i.ready)
|
|
122
121
|
await v();
|
|
123
122
|
else {
|
|
124
|
-
const s =
|
|
125
|
-
|
|
123
|
+
const s = B(() => i.ready, (c) => {
|
|
124
|
+
c && (s(), v());
|
|
126
125
|
});
|
|
127
126
|
}
|
|
128
127
|
document.addEventListener("dynamic-content:open", f);
|
|
129
|
-
}),
|
|
128
|
+
}), V(() => {
|
|
130
129
|
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f);
|
|
131
130
|
try {
|
|
132
131
|
window.UIEditor.removeEditor();
|
|
@@ -134,17 +133,17 @@ const $e = /* @__PURE__ */ K({
|
|
|
134
133
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
135
134
|
}
|
|
136
135
|
o.reset();
|
|
137
|
-
}),
|
|
136
|
+
}), A({
|
|
138
137
|
dynamicContent: {
|
|
139
|
-
insert:
|
|
140
|
-
close:
|
|
138
|
+
insert: L,
|
|
139
|
+
close: R
|
|
141
140
|
},
|
|
142
141
|
hasChanges: m,
|
|
143
142
|
saveSilent: h,
|
|
144
143
|
setLoading: b
|
|
145
|
-
}), { __sfc: !0, PreviewContainer:
|
|
144
|
+
}), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: d, previewStore: G, hasChanges: m, isTestPartner: H, saveSilent: h, setLoading: b, emit: n, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: $, insertDynamicContent: L, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: oe, Toaster: ne, FilterSelectionDrawer: re, HeaderWrapper: se, LoadingWrapper: ie, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ce };
|
|
146
145
|
}
|
|
147
146
|
});
|
|
148
147
|
export {
|
|
149
|
-
|
|
148
|
+
xe as default
|
|
150
149
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import { migrateCouponBlock as
|
|
1
|
+
import { migrateCheckbox as t } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as i } from "./couponBlockMigrator.js";
|
|
3
3
|
import { migrateItemsBlock as e } from "./itemsBlockMigrator.js";
|
|
4
|
-
import { migrateRadioButton as
|
|
5
|
-
import { migrateRecommendation as
|
|
6
|
-
import { migrateSocialIcons as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return r = i(r), r = c(r), r = await f(r), r = a(r), r = g(r, o), r = e(r), r = n(r), t.linkTrackingIds && (r = p(r)), r;
|
|
4
|
+
import { migrateRadioButton as a } from "./radioButtonMigrator.js";
|
|
5
|
+
import { migrateRecommendation as c } from "./recommendationMigrator.js";
|
|
6
|
+
import { migrateSocialIcons as g } from "./socialIconMigrator.js";
|
|
7
|
+
import { migrateUnsubscribe as n } from "./unsubscribeMigrator.js";
|
|
8
|
+
const k = async (o, r = {}) => {
|
|
9
|
+
let m = o;
|
|
10
|
+
return m = t(m), m = a(m), m = await n(m), m = i(m), m = c(m, r), m = e(m), m = g(m), m;
|
|
12
11
|
};
|
|
13
12
|
export {
|
|
14
|
-
|
|
13
|
+
k as migrate
|
|
15
14
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__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-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__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-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-5079a1c8]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-5079a1c8]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-5079a1c8]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-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}
|
package/dist/library.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { default as a } from "./components/Guido.vue.js";
|
|
2
|
-
import { MessageType as
|
|
2
|
+
import { MessageType as f, ProductType as t } from "./@types/config/schemas.js";
|
|
3
3
|
import "./@types/config/defaults.js";
|
|
4
|
-
import { getValidationErrors as
|
|
5
|
-
import { TRACK_ID_ATTRIBUTE as m, TRACK_SEQ_ATTRIBUTE as l, assignTrackingIds as x, readTrackSeq as A } from "./utils/linkTrackingIds.js";
|
|
4
|
+
import { getValidationErrors as s, isValidConfig as d, parseConfig as g, parseConfigSafe as n, validateConfig as l } from "./@types/config/validator.js";
|
|
6
5
|
export {
|
|
7
6
|
a as Guido,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
d as parseConfig,
|
|
16
|
-
g as parseConfigSafe,
|
|
17
|
-
A as readTrackSeq,
|
|
18
|
-
n as validateConfig
|
|
7
|
+
f as MessageType,
|
|
8
|
+
t as ProductType,
|
|
9
|
+
s as getValidationErrors,
|
|
10
|
+
d as isValidConfig,
|
|
11
|
+
g as parseConfig,
|
|
12
|
+
n as parseConfigSafe,
|
|
13
|
+
l as validateConfig
|
|
19
14
|
};
|
|
@@ -41,9 +41,9 @@ ${s.map((o) => ` - ${o}`).join(`
|
|
|
41
41
|
};
|
|
42
42
|
v.validatedClasses = /* @__PURE__ */ new Set();
|
|
43
43
|
v.validationErrors = /* @__PURE__ */ new Map();
|
|
44
|
-
var i = v, z = /* @__PURE__ */ ((e) => (e.BLOCK = "BLOCK", e.CONTAINER = "CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e))(z || {}), P = class
|
|
44
|
+
var i = v, z = /* @__PURE__ */ ((e) => (e.BLOCK = "BLOCK", e.CONTAINER = "CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e))(z || {}), P = class T extends i {
|
|
45
45
|
constructor() {
|
|
46
|
-
super(
|
|
46
|
+
super(T.REQUIRED_METHODS, T);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Determines if the block should be available for use in the editor.
|
|
@@ -222,9 +222,9 @@ var i = v, z = /* @__PURE__ */ ((e) => (e.BLOCK = "BLOCK", e.CONTAINER = "CONTAI
|
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
P.REQUIRED_METHODS = ["getId", "getTemplate", "getIcon", "getName", "getDescription"];
|
|
225
|
-
var qe = P, Z = class
|
|
225
|
+
var qe = P, Z = class c extends i {
|
|
226
226
|
constructor() {
|
|
227
|
-
super(
|
|
227
|
+
super(c.REQUIRED_METHODS, c);
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
230
|
* @deprecated - use {@link getPreviewInnerHtml} instead
|
|
@@ -339,12 +339,12 @@ var j = {
|
|
|
339
339
|
height: "height"
|
|
340
340
|
}, Je = {
|
|
341
341
|
BLOCK_IMAGE: j
|
|
342
|
-
}, U = "esd-block-button", w = "esd-block-text", K = "esd-block-image", J = "esd-structure", ee = "esd-block-video", te = "esd-block-social", re = "esd-block-banner", ae = "esd-block-timer", ne = "esd-block-menu", se = "esd-block-html", ie = "esd-block-spacer", le = "esd-container-frame", Ee = "esd-stripe", oe = "esd-amp-form", I = ((e) => (e.BUTTON = `.${U}`, e.TEXT = `.${w}`, e.IMAGE = `.${K}`, e.STRUCTURE = `.${J}`, e.VIDEO = `.${ee}`, e.SOCIAL = `.${te}`, e.BANNER = `.${re}`, e.TIMER = `.${ae}`, e.MENU = `.${ne}`, e.HTML = `.${se}`, e.SPACER = `.${ie}`, e.CONTAINER = `.${le}`, e.STRIPE = `.${Ee}`, e.FORM = `.${oe}`, e))(I || {}), de = /* @__PURE__ */ ((e) => (e.BLOCK_IMAGE = "BLOCK_IMAGE", e.BLOCK_TEXT = "BLOCK_TEXT", e.BLOCK_BUTTON = "BLOCK_BUTTON", e.BLOCK_SPACER = "BLOCK_SPACER", e.BLOCK_VIDEO = "BLOCK_VIDEO", e.BLOCK_SOCIAL = "BLOCK_SOCIAL", e.BLOCK_BANNER = "BLOCK_BANNER", e.BLOCK_TIMER = "BLOCK_TIMER", e.BLOCK_MENU = "BLOCK_MENU", e.BLOCK_MENU_ITEM = "BLOCK_MENU_ITEM", e.BLOCK_HTML = "BLOCK_HTML", e.BLOCK_AMP_CAROUSEL = "BLOCK_AMP_CAROUSEL", e.BLOCK_AMP_ACCORDION = "BLOCK_AMP_ACCORDION", e.BLOCK_AMP_FORM = "BLOCK_AMP_FORM", e.CONTAINER = "CONTAINER", e.FORM_CONTAINER = "FORM_CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e.EMPTY_CONTAINER = "EMPTY_CONTAINER", e.CUSTOM_BLOCK_LINK = "CUSTOM_BLOCK_LINK", e.CUSTOM_BLOCK_IMAGE = "CUSTOM_BLOCK_IMAGE", e.CUSTOM_BLOCK_TEXT = "CUSTOM_BLOCK_TEXT", e))(de || {}), F = /* @__PURE__ */ ((e) => (e.ANCHOR_LINK_CONTAINER = "anchorLinkFormContainer", e.APPLY_CONDITION = "applyCondition", e.APPLY_CONDITION_SWITCHER = "applyConditionSwitcher", e.BACKGROUND_COLOR = "backgroundColor", e.BACKGROUND_IMAGE = "generalImageContainer", e.TEXT_COLOR = "textColor", e.TEXT_STYLE = "textStyle", e.TEXT_SIZE = "textSize", e.TEXT_LINE_SPACING = "textLineSpacing", e.TEXT_ALIGN = "textAlign", e.FIXED_HEIGHT_SWITCHER = "fixedHeightSwitcherForm", e.HIDDEN_NODE = "hiddenNode", e.SMART_BLOCK = "smartBlock", e.SYNCHRONIZED_MODULE = "synchronizedModuleForm", e.FONT_FAMILY = "generalFontFamilyForm", e.BLOCK_INTERNAL_INDENTS = "generalBlockInternalIndents", e.STRUCTURE_INTERNAL_INDENTS = "generalStructureInternalIndents", e))(F || {}), H = /* @__PURE__ */ ((e) => (e.ADJUST_TO_WIDTH = "adjustToWidth", e.ALIGNMENT = "buttonAlignment", e.BORDER = "buttonBorder", e.BORDER_RADIUS = "buttonBorderRadius", e.COLOR = "buttonColor", e.BUTTON_BLOCK_BACKGROUND_COLOR = "buttonBlockBackgroundColor", e.EXTERNAL_INDENTS = "buttonExternalIndents", e.FIXED_HEIGHT = "buttonFixedHeightForm", e.FONT_COLOR = "buttonFontColor", e.FONT_FAMILY = "buttonFontFamily", e.FONT_SIZE = "buttonFontSize", e.ICON = "buttonIconContainer", e.ICON_ALIGN = "buttonIconAlign", e.ICON_INDENT = "buttonIconIndent", e.ICON_WIDTH = "buttonIconWidth", e.IMAGE = "buttonImageForm", e.INTERNAL_INDENTS = "buttonInternalIndents", e.LINK = "buttonLink", e.MIME_TYPE = "buttonMimeTypeForm", e.SWITCHER_HOVERED_STYLES = "buttonSwitcherHoveredStylesForm", e.TEXT = "buttonText", e.TEXT_STYLE_AND_COLOR = "buttonTextStyleAndColorForm", e.HOVERED_BORDER_COLOR = "hoveredStyleBorderButtonForm", e.HOVERED_COLOR = "hoveredButtonColorForm", e.HOVERED_TEXT_COLOR = "hoveredButtonTextColorForm", e))(H || {}), k = /* @__PURE__ */ ((e) => (e.HIDDEN_NODE = "hiddenNodeText", e.PARAGRAPH_STYLE = "paragraphStyleForm", e.ALIGN = "textAlignmentForm", e.ANCHOR_CONTAINER = "textAnchorForm", e.FONT_BACKGROUND_COLOR = "textBlockFontBackgroundColor", e.TEXT_BLOCK_BACKGROUND_COLOR = "textBlockBackgroundColor", e.FONT_COLOR = "textBlockFontColor", e.TEXT_BLOCK_FONT_FAMILY = "textBlockFontFamily", e.FONT_FAMILY = "textFontFamily", e.FONT_SIZE = "textBlockFontSize", e.FONT_WEIGHT = "textBlockFontWeight", e.DIRECTION = "textBlockDirectionForm", e.INSERT_FORM = "textBlockInsertForm", e.LINK_DATA = "textBlockLinkDataForm", e.FORMAT = "textBlockTextFormatForm", e.FIXED_HEIGHT = "textFixedHeightForm", e.INTERNAL_INDENTS = "textInternalIndents", e.LINE_HEIGHT = "textLineHeightForm", e.MIME_TYPE = "textMimeTypeForm", e.NO_LINE_WRAPS = "textNoLineWrapsForm", e))(k || {}), p = /* @__PURE__ */ ((e) => (e.ALT_TEXT = "altText", e.LINK = "blockLink", e.ALIGNMENT = "imageAlignment", e.ANCHOR_LINK_CONTAINER = "imageAnchorLinkContainerForm", e.BORDER_RADIUS = "imageBorderRadiusForm", e.IMAGE = "imageImageForm", e.EXTERNAL_INDENTS = "imageExternalIndents", e.MIME_TYPE = "imageMimeTypeForm", e.RESPONSIVE = "imageResponsive", e.ROLLOVER_IMAGE = "imageRolloverImageForm", e.ROLLOVER_SWITCHER = "imageRolloverSwitcherForm", e.SIZE = "imageSizeContainer", e))(p || {}), ue = /* @__PURE__ */ ((e) => (e.BACKGROUND_COLOR = "containerBackgroundColorForm", e.BORDER_FORM = "containerBorderForm", e.BORDER_RADIUS = "containerBorderRadiusForm", e.EXTERNAL_INDENTS = "containerExternalIndentsForm", e.IMAGE_CONTAINER = "containerImageContainerForm", e.MIME_TYPE = "containerMimeTypeForm", e.DISPLAY_CONDITIONS = "displayConditions", e.HIDDEN_NODE = "containerHiddenNodeForm", e))(ue || {}), n = {
|
|
342
|
+
}, U = "esd-block-button", w = "esd-block-text", K = "esd-block-image", J = "esd-structure", ee = "esd-block-video", te = "esd-block-social", re = "esd-block-banner", ae = "esd-block-timer", ne = "esd-block-menu", se = "esd-block-html", ie = "esd-block-spacer", le = "esd-container-frame", Ee = "esd-stripe", oe = "esd-amp-form", I = ((e) => (e.BUTTON = `.${U}`, e.TEXT = `.${w}`, e.IMAGE = `.${K}`, e.STRUCTURE = `.${J}`, e.VIDEO = `.${ee}`, e.SOCIAL = `.${te}`, e.BANNER = `.${re}`, e.TIMER = `.${ae}`, e.MENU = `.${ne}`, e.HTML = `.${se}`, e.SPACER = `.${ie}`, e.CONTAINER = `.${le}`, e.STRIPE = `.${Ee}`, e.FORM = `.${oe}`, e))(I || {}), de = /* @__PURE__ */ ((e) => (e.BLOCK_IMAGE = "BLOCK_IMAGE", e.BLOCK_TEXT = "BLOCK_TEXT", e.BLOCK_BUTTON = "BLOCK_BUTTON", e.BLOCK_SPACER = "BLOCK_SPACER", e.BLOCK_VIDEO = "BLOCK_VIDEO", e.BLOCK_SOCIAL = "BLOCK_SOCIAL", e.BLOCK_BANNER = "BLOCK_BANNER", e.BLOCK_TIMER = "BLOCK_TIMER", e.BLOCK_MENU = "BLOCK_MENU", e.BLOCK_MENU_ITEM = "BLOCK_MENU_ITEM", e.BLOCK_HTML = "BLOCK_HTML", e.BLOCK_AMP_CAROUSEL = "BLOCK_AMP_CAROUSEL", e.BLOCK_AMP_ACCORDION = "BLOCK_AMP_ACCORDION", e.BLOCK_AMP_FORM = "BLOCK_AMP_FORM", e.CONTAINER = "CONTAINER", e.FORM_CONTAINER = "FORM_CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e.EMPTY_CONTAINER = "EMPTY_CONTAINER", e.CUSTOM_BLOCK_LINK = "CUSTOM_BLOCK_LINK", e.CUSTOM_BLOCK_IMAGE = "CUSTOM_BLOCK_IMAGE", e.CUSTOM_BLOCK_TEXT = "CUSTOM_BLOCK_TEXT", e))(de || {}), F = /* @__PURE__ */ ((e) => (e.ANCHOR_LINK_CONTAINER = "anchorLinkFormContainer", e.APPLY_CONDITION = "applyCondition", e.APPLY_CONDITION_SWITCHER = "applyConditionSwitcher", e.BACKGROUND_COLOR = "backgroundColor", e.BACKGROUND_IMAGE = "generalImageContainer", e.TEXT_COLOR = "textColor", e.TEXT_STYLE = "textStyle", e.TEXT_SIZE = "textSize", e.TEXT_LINE_SPACING = "textLineSpacing", e.TEXT_ALIGN = "textAlign", e.FIXED_HEIGHT_SWITCHER = "fixedHeightSwitcherForm", e.HIDDEN_NODE = "hiddenNode", e.SMART_BLOCK = "smartBlock", e.SYNCHRONIZED_MODULE = "synchronizedModuleForm", e.FONT_FAMILY = "generalFontFamilyForm", e.BLOCK_INTERNAL_INDENTS = "generalBlockInternalIndents", e.STRUCTURE_INTERNAL_INDENTS = "generalStructureInternalIndents", e))(F || {}), H = /* @__PURE__ */ ((e) => (e.ADJUST_TO_WIDTH = "adjustToWidth", e.ALIGNMENT = "buttonAlignment", e.BORDER = "buttonBorder", e.BORDER_RADIUS = "buttonBorderRadius", e.COLOR = "buttonColor", e.BUTTON_BLOCK_BACKGROUND_COLOR = "buttonBlockBackgroundColor", e.EXTERNAL_INDENTS = "buttonExternalIndents", e.FIXED_HEIGHT = "buttonFixedHeightForm", e.FONT_COLOR = "buttonFontColor", e.FONT_FAMILY = "buttonFontFamily", e.FONT_SIZE = "buttonFontSize", e.FONT_WEIGHT = "buttonFontWeight", e.ICON = "buttonIconContainer", e.ICON_ALIGN = "buttonIconAlign", e.ICON_INDENT = "buttonIconIndent", e.ICON_WIDTH = "buttonIconWidth", e.IMAGE = "buttonImageForm", e.INTERNAL_INDENTS = "buttonInternalIndents", e.LINK = "buttonLink", e.MIME_TYPE = "buttonMimeTypeForm", e.SWITCHER_HOVERED_STYLES = "buttonSwitcherHoveredStylesForm", e.TEXT = "buttonText", e.TEXT_STYLE_AND_COLOR = "buttonTextStyleAndColorForm", e.HOVERED_BORDER_COLOR = "hoveredStyleBorderButtonForm", e.HOVERED_COLOR = "hoveredButtonColorForm", e.HOVERED_TEXT_COLOR = "hoveredButtonTextColorForm", e))(H || {}), k = /* @__PURE__ */ ((e) => (e.HIDDEN_NODE = "hiddenNodeText", e.PARAGRAPH_STYLE = "paragraphStyleForm", e.ALIGN = "textAlignmentForm", e.ANCHOR_CONTAINER = "textAnchorForm", e.FONT_BACKGROUND_COLOR = "textBlockFontBackgroundColor", e.TEXT_BLOCK_BACKGROUND_COLOR = "textBlockBackgroundColor", e.FONT_COLOR = "textBlockFontColor", e.TEXT_BLOCK_FONT_FAMILY = "textBlockFontFamily", e.FONT_FAMILY = "textFontFamily", e.FONT_SIZE = "textBlockFontSize", e.FONT_WEIGHT = "textBlockFontWeight", e.DIRECTION = "textBlockDirectionForm", e.INSERT_FORM = "textBlockInsertForm", e.LINK_DATA = "textBlockLinkDataForm", e.FORMAT = "textBlockTextFormatForm", e.FIXED_HEIGHT = "textFixedHeightForm", e.INTERNAL_INDENTS = "textInternalIndents", e.LINE_HEIGHT = "textLineHeightForm", e.MIME_TYPE = "textMimeTypeForm", e.NO_LINE_WRAPS = "textNoLineWrapsForm", e))(k || {}), p = /* @__PURE__ */ ((e) => (e.ALT_TEXT = "altText", e.LINK = "blockLink", e.ALIGNMENT = "imageAlignment", e.ANCHOR_LINK_CONTAINER = "imageAnchorLinkContainerForm", e.BORDER_RADIUS = "imageBorderRadiusForm", e.IMAGE = "imageImageForm", e.EXTERNAL_INDENTS = "imageExternalIndents", e.MIME_TYPE = "imageMimeTypeForm", e.RESPONSIVE = "imageResponsive", e.ROLLOVER_IMAGE = "imageRolloverImageForm", e.ROLLOVER_SWITCHER = "imageRolloverSwitcherForm", e.SIZE = "imageSizeContainer", e))(p || {}), ue = /* @__PURE__ */ ((e) => (e.BACKGROUND_COLOR = "containerBackgroundColorForm", e.BORDER_FORM = "containerBorderForm", e.BORDER_RADIUS = "containerBorderRadiusForm", e.EXTERNAL_INDENTS = "containerExternalIndentsForm", e.IMAGE_CONTAINER = "containerImageContainerForm", e.MIME_TYPE = "containerMimeTypeForm", e.DISPLAY_CONDITIONS = "displayConditions", e.HIDDEN_NODE = "containerHiddenNodeForm", e))(ue || {}), n = {
|
|
343
343
|
BLOCK_BUTTON: H,
|
|
344
344
|
BLOCK_TEXT: k,
|
|
345
345
|
BLOCK_IMAGE: p,
|
|
346
346
|
GENERAL: F
|
|
347
|
-
}, Ie = /* @__PURE__ */ ((e) => (e.SAVE_AS_MODULE = "saveAsModule", e.IMPROVE_WITH_AI = "improveWithAI", e.MOVE = "move", e.COPY = "copy", e.REMOVE = "remove", e.CLEAR_CONTAINER = "clearContainer", e.EXTERNAL_DISPLAY_CONDITION = "externalDisplayCondition", e))(Ie || {}),
|
|
347
|
+
}, Ie = /* @__PURE__ */ ((e) => (e.SAVE_AS_MODULE = "saveAsModule", e.IMPROVE_WITH_AI = "improveWithAI", e.MOVE = "move", e.COPY = "copy", e.REMOVE = "remove", e.CLEAR_CONTAINER = "clearContainer", e.EXTERNAL_DISPLAY_CONDITION = "externalDisplayCondition", e))(Ie || {}), Te = /* @__PURE__ */ ((e) => (e.previewDeviceMode = "previewDeviceMode", e.panelPosition = "panelPosition", e.themeMode = "themeMode", e))(Te || {}), ce = /* @__PURE__ */ ((e) => (e.DESKTOP = "DESKTOP", e.MOBILE = "MOBILE", e))(ce || {}), be = /* @__PURE__ */ ((e) => (e.SETTINGS = "settings", e.STYLES = "styles", e.DATA = "data", e))(be || {}), a = {
|
|
348
348
|
name: "name",
|
|
349
349
|
disabled: "disabled"
|
|
350
350
|
}, he = {
|
|
@@ -619,7 +619,7 @@ var j = {
|
|
|
619
619
|
}
|
|
620
620
|
};
|
|
621
621
|
G.REQUIRED_METHODS = ["getId", "getTemplate"];
|
|
622
|
-
var
|
|
622
|
+
var Tt = G, Xe = class m extends i {
|
|
623
623
|
constructor() {
|
|
624
624
|
super(m.REQUIRED_METHODS, m);
|
|
625
625
|
}
|
|
@@ -694,7 +694,7 @@ var V = class extends x {
|
|
|
694
694
|
const t = e.querySelectorAll(I.IMAGE), r = e.asElement().hasClass(K) ? [e] : [];
|
|
695
695
|
return t.length ? t : r;
|
|
696
696
|
}
|
|
697
|
-
},
|
|
697
|
+
}, ct = class extends V {
|
|
698
698
|
getParentControlId() {
|
|
699
699
|
return n.BLOCK_IMAGE.EXTERNAL_INDENTS;
|
|
700
700
|
}
|
|
@@ -1215,17 +1215,17 @@ export {
|
|
|
1215
1215
|
It as ButtonTextStyleAndFontColorBuiltInControl,
|
|
1216
1216
|
ue as ContainerControls,
|
|
1217
1217
|
Ie as ContextActionType,
|
|
1218
|
-
|
|
1219
|
-
|
|
1218
|
+
Tt as Control,
|
|
1219
|
+
Te as EditorStatePropertyType,
|
|
1220
1220
|
Ve as Extension,
|
|
1221
1221
|
Nt as ExtensionBuilder,
|
|
1222
1222
|
F as GeneralControls,
|
|
1223
1223
|
Dt as IconsRegistry,
|
|
1224
1224
|
p as ImageControls,
|
|
1225
|
-
|
|
1225
|
+
ct as ImageMarginsBuiltInControl,
|
|
1226
1226
|
bt as ImageSizeBuiltInControl,
|
|
1227
1227
|
St as ModificationDescription,
|
|
1228
|
-
|
|
1228
|
+
ce as PreviewDeviceMode,
|
|
1229
1229
|
ht as SettingsPanelRegistry,
|
|
1230
1230
|
mt as SettingsPanelTab,
|
|
1231
1231
|
be as SettingsTab,
|
package/dist/package.json.js
CHANGED
|
@@ -385,8 +385,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
385
385
|
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
386
386
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
387
387
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
388
|
-
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
389
|
-
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
390
388
|
}, undefined>;
|
|
391
389
|
/**
|
|
392
390
|
* Default block types available in Stripo
|
|
@@ -776,8 +774,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
776
774
|
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
777
775
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
778
776
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
779
|
-
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
780
|
-
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
781
777
|
}, undefined>, {}>;
|
|
782
778
|
/** Block configuration */
|
|
783
779
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -97,7 +97,6 @@ export declare const useConfig: () => {
|
|
|
97
97
|
liquidSyntax: boolean;
|
|
98
98
|
autosave: boolean;
|
|
99
99
|
allowlistEnabled: boolean;
|
|
100
|
-
linkTrackingIds: boolean;
|
|
101
100
|
};
|
|
102
101
|
blocks: {
|
|
103
102
|
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")[];
|
|
@@ -230,7 +229,6 @@ export declare const useConfig: () => {
|
|
|
230
229
|
liquidSyntax: boolean;
|
|
231
230
|
autosave: boolean;
|
|
232
231
|
allowlistEnabled: boolean;
|
|
233
|
-
linkTrackingIds: boolean;
|
|
234
232
|
} | null>;
|
|
235
233
|
blocks: import("vue").ComputedRef<{
|
|
236
234
|
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")[];
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
2
|
-
export
|
|
3
|
-
linkTrackingIds?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>, options?: MigrateOptions) => Promise<string>;
|
|
2
|
+
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>) => Promise<string>;
|
package/dist/src/library.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { default as Guido } from './components/Guido.vue';
|
|
2
2
|
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, TemplateMigrationConfig, LegacyRecommendationConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, DynamicContent, EmailHeader, DefaultBlockType, CustomBlockType, ValidationResult, ValidationError, } from './@types/config';
|
|
3
3
|
export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidationErrors, MessageType, ProductType, } from './@types/config';
|
|
4
|
-
export { assignTrackingIds, readTrackSeq, TRACK_ID_ATTRIBUTE, TRACK_SEQ_ATTRIBUTE, } from './utils/linkTrackingIds';
|
|
5
|
-
export type { TrackingIdResult } from './utils/linkTrackingIds';
|
|
6
4
|
export type { StripoEventType } from './@types/events';
|
|
7
5
|
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
@@ -102,7 +102,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
102
102
|
liquidSyntax: boolean;
|
|
103
103
|
autosave: boolean;
|
|
104
104
|
allowlistEnabled: boolean;
|
|
105
|
-
linkTrackingIds: boolean;
|
|
106
105
|
};
|
|
107
106
|
blocks: {
|
|
108
107
|
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")[];
|
|
@@ -241,7 +240,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
241
240
|
liquidSyntax: boolean;
|
|
242
241
|
autosave: boolean;
|
|
243
242
|
allowlistEnabled: boolean;
|
|
244
|
-
linkTrackingIds: boolean;
|
|
245
243
|
};
|
|
246
244
|
blocks: {
|
|
247
245
|
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")[];
|
|
@@ -380,7 +378,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
380
378
|
liquidSyntax: boolean;
|
|
381
379
|
autosave: boolean;
|
|
382
380
|
allowlistEnabled: boolean;
|
|
383
|
-
linkTrackingIds: boolean;
|
|
384
381
|
};
|
|
385
382
|
blocks: {
|
|
386
383
|
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")[];
|
|
@@ -519,7 +516,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
519
516
|
liquidSyntax: boolean;
|
|
520
517
|
autosave: boolean;
|
|
521
518
|
allowlistEnabled: boolean;
|
|
522
|
-
linkTrackingIds: boolean;
|
|
523
519
|
};
|
|
524
520
|
blocks: {
|
|
525
521
|
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")[];
|
|
@@ -658,7 +654,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
658
654
|
liquidSyntax: boolean;
|
|
659
655
|
autosave: boolean;
|
|
660
656
|
allowlistEnabled: boolean;
|
|
661
|
-
linkTrackingIds: boolean;
|
|
662
657
|
};
|
|
663
658
|
blocks: {
|
|
664
659
|
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")[];
|
|
@@ -797,7 +792,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
797
792
|
liquidSyntax: boolean;
|
|
798
793
|
autosave: boolean;
|
|
799
794
|
allowlistEnabled: boolean;
|
|
800
|
-
linkTrackingIds: boolean;
|
|
801
795
|
};
|
|
802
796
|
blocks: {
|
|
803
797
|
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")[];
|
|
@@ -936,7 +930,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
936
930
|
liquidSyntax: boolean;
|
|
937
931
|
autosave: boolean;
|
|
938
932
|
allowlistEnabled: boolean;
|
|
939
|
-
linkTrackingIds: boolean;
|
|
940
933
|
};
|
|
941
934
|
blocks: {
|
|
942
935
|
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")[];
|
|
@@ -1075,7 +1068,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1075
1068
|
liquidSyntax: boolean;
|
|
1076
1069
|
autosave: boolean;
|
|
1077
1070
|
allowlistEnabled: boolean;
|
|
1078
|
-
linkTrackingIds: boolean;
|
|
1079
1071
|
};
|
|
1080
1072
|
blocks: {
|
|
1081
1073
|
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")[];
|
|
@@ -1214,7 +1206,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1214
1206
|
liquidSyntax: boolean;
|
|
1215
1207
|
autosave: boolean;
|
|
1216
1208
|
allowlistEnabled: boolean;
|
|
1217
|
-
linkTrackingIds: boolean;
|
|
1218
1209
|
};
|
|
1219
1210
|
blocks: {
|
|
1220
1211
|
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")[];
|
|
@@ -1353,7 +1344,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1353
1344
|
liquidSyntax: boolean;
|
|
1354
1345
|
autosave: boolean;
|
|
1355
1346
|
allowlistEnabled: boolean;
|
|
1356
|
-
linkTrackingIds: boolean;
|
|
1357
1347
|
};
|
|
1358
1348
|
blocks: {
|
|
1359
1349
|
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")[];
|
|
@@ -1492,7 +1482,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1492
1482
|
liquidSyntax: boolean;
|
|
1493
1483
|
autosave: boolean;
|
|
1494
1484
|
allowlistEnabled: boolean;
|
|
1495
|
-
linkTrackingIds: boolean;
|
|
1496
1485
|
};
|
|
1497
1486
|
blocks: {
|
|
1498
1487
|
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")[];
|
|
@@ -1631,7 +1620,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1631
1620
|
liquidSyntax: boolean;
|
|
1632
1621
|
autosave: boolean;
|
|
1633
1622
|
allowlistEnabled: boolean;
|
|
1634
|
-
linkTrackingIds: boolean;
|
|
1635
1623
|
};
|
|
1636
1624
|
blocks: {
|
|
1637
1625
|
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")[];
|
|
@@ -1770,7 +1758,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1770
1758
|
liquidSyntax: boolean;
|
|
1771
1759
|
autosave: boolean;
|
|
1772
1760
|
allowlistEnabled: boolean;
|
|
1773
|
-
linkTrackingIds: boolean;
|
|
1774
1761
|
};
|
|
1775
1762
|
blocks: {
|
|
1776
1763
|
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")[];
|
|
@@ -1909,7 +1896,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1909
1896
|
liquidSyntax: boolean;
|
|
1910
1897
|
autosave: boolean;
|
|
1911
1898
|
allowlistEnabled: boolean;
|
|
1912
|
-
linkTrackingIds: boolean;
|
|
1913
1899
|
};
|
|
1914
1900
|
blocks: {
|
|
1915
1901
|
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")[];
|
|
@@ -2048,7 +2034,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2048
2034
|
liquidSyntax: boolean;
|
|
2049
2035
|
autosave: boolean;
|
|
2050
2036
|
allowlistEnabled: boolean;
|
|
2051
|
-
linkTrackingIds: boolean;
|
|
2052
2037
|
};
|
|
2053
2038
|
blocks: {
|
|
2054
2039
|
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")[];
|
|
@@ -2187,7 +2172,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2187
2172
|
liquidSyntax: boolean;
|
|
2188
2173
|
autosave: boolean;
|
|
2189
2174
|
allowlistEnabled: boolean;
|
|
2190
|
-
linkTrackingIds: boolean;
|
|
2191
2175
|
};
|
|
2192
2176
|
blocks: {
|
|
2193
2177
|
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")[];
|
|
@@ -2326,7 +2310,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2326
2310
|
liquidSyntax: boolean;
|
|
2327
2311
|
autosave: boolean;
|
|
2328
2312
|
allowlistEnabled: boolean;
|
|
2329
|
-
linkTrackingIds: boolean;
|
|
2330
2313
|
};
|
|
2331
2314
|
blocks: {
|
|
2332
2315
|
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")[];
|
|
@@ -2467,7 +2450,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2467
2450
|
liquidSyntax: boolean;
|
|
2468
2451
|
autosave: boolean;
|
|
2469
2452
|
allowlistEnabled: boolean;
|
|
2470
|
-
linkTrackingIds: boolean;
|
|
2471
2453
|
};
|
|
2472
2454
|
blocks: {
|
|
2473
2455
|
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")[];
|
|
@@ -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((a) => {
|
|
16
|
-
const r = a.getAttribute(C.PAGE_LIST);
|
|
17
|
-
r && t.push(...R(r));
|
|
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 m = new DOMParser().parseFromString(
|
|
17
|
+
async function R(s) {
|
|
18
|
+
const m = new DOMParser().parseFromString(s, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
22
19
|
if (m.length === 0)
|
|
23
20
|
return;
|
|
24
|
-
const
|
|
21
|
+
const o = b();
|
|
25
22
|
m.forEach((t) => {
|
|
26
|
-
var
|
|
27
|
-
const a = t.getAttribute("recommendation-id"),
|
|
28
|
-
if (!Number.isFinite(
|
|
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: ((
|
|
56
|
-
currencyDecimalSeparator: ((
|
|
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(c) {
|
|
|
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 (p("linkTrackingIds"))
|
|
76
|
-
try {
|
|
77
|
-
const h = z(), { html: A, changed: H, nextSeq: I } = v(o, h.trackIdSessionFloor);
|
|
78
|
-
H && (t(A, l), o = A), h.trackIdSessionFloor = I;
|
|
79
|
-
} catch (h) {
|
|
80
|
-
console.error("Tracking-id assignment failed, saving without new ids:", h);
|
|
81
|
-
}
|
|
82
|
-
const { html: f, ampHtml: i = "", ampErrors: S = [] } = await m({
|
|
71
|
+
const { html: d, ampHtml: e = "", ampErrors: y = [] } = await m({
|
|
83
72
|
minimize: !0,
|
|
84
73
|
resetDataSavedFlag: !1
|
|
85
|
-
});
|
|
86
|
-
u.selectedUnsubscribePages.length && await u.fetchTemplates(), await
|
|
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.13.1-beta.
|
|
3
|
+
"version": "3.13.1-beta.a813d24",
|
|
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",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"author": "",
|
|
44
44
|
"license": "ISC",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
46
|
+
"@stripoinc/ui-editor-extensions": "3.9.0",
|
|
47
47
|
"@useinsider/design-system-vue": "1.3.0",
|
|
48
48
|
"@vueuse/core": "11.3.0",
|
|
49
49
|
"lodash-es": "4.17.21",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
"guido": {
|
|
115
115
|
"stripo": {
|
|
116
|
-
"version": "2.
|
|
116
|
+
"version": "2.72.1"
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -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): 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,44 +0,0 @@
|
|
|
1
|
-
const E = "data-ins-track-id", g = "data-ins-track-seq", N = /<a\b[^>]*>/gi, $ = /\bdata-ins-track-id\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i, R = /\bdata-ins-track-seq\s*=\s*(?:"(\d+)"|'(\d+)'|(\d+))/i, f = /<body\b[^>]*>/i, b = /<html\b[^>]*>/i, A = /<!--\s*ins-track-seq:(\d+)\s*-->/i, k = /^[1-9][0-9]{0,14}$/;
|
|
2
|
-
function S(e) {
|
|
3
|
-
const s = Number(e);
|
|
4
|
-
return Number.isSafeInteger(s) && s > 0 ? s : 0;
|
|
5
|
-
}
|
|
6
|
-
function x(e) {
|
|
7
|
-
var i, a, c;
|
|
8
|
-
const n = [(i = f.exec(e)) == null ? void 0 : i[0], (a = b.exec(e)) == null ? void 0 : a[0]].reduce(
|
|
9
|
-
(T, o) => T ?? (o ? R.exec(o) : null),
|
|
10
|
-
null
|
|
11
|
-
), t = (n == null ? void 0 : n[1]) ?? (n == null ? void 0 : n[2]) ?? (n == null ? void 0 : n[3]) ?? ((c = A.exec(e)) == null ? void 0 : c[1]) ?? "";
|
|
12
|
-
return S(t);
|
|
13
|
-
}
|
|
14
|
-
function I(e, s) {
|
|
15
|
-
const n = `${g}="${s}"`, t = f.exec(e) ?? b.exec(e);
|
|
16
|
-
if (t) {
|
|
17
|
-
const [i] = t, a = R.exec(i), c = a ? i.replace(a[0], n) : i.replace(/\/?>$/, (T) => ` ${n}${T}`);
|
|
18
|
-
return e.slice(0, t.index) + c + e.slice(t.index + i.length);
|
|
19
|
-
}
|
|
20
|
-
return A.test(e) ? e.replace(A, `<!--ins-track-seq:${s}-->`) : `<!--ins-track-seq:${s}-->${e}`;
|
|
21
|
-
}
|
|
22
|
-
function p(e, s, n) {
|
|
23
|
-
const t = `${E}="${n}"`;
|
|
24
|
-
return s ? e.replace(s[0], t) : e.replace(/^<a\b/i, (i) => `${i} ${t}`);
|
|
25
|
-
}
|
|
26
|
-
function q(e, s = 0) {
|
|
27
|
-
const n = /* @__PURE__ */ new Set();
|
|
28
|
-
let t = 0;
|
|
29
|
-
const i = [...e.matchAll(N)].map((r) => {
|
|
30
|
-
const [_] = r, u = $.exec(_), l = u ? u[1] ?? u[2] ?? u[3] ?? "" : "";
|
|
31
|
-
let d = null;
|
|
32
|
-
return k.test(l) && !n.has(Number(l)) && (d = Number(l), n.add(d), t = Math.max(t, d)), { index: r.index, tag: _, attrMatch: u, id: d };
|
|
33
|
-
});
|
|
34
|
-
let a = Math.max(x(e), t, s), c = "", T = 0, o = !1;
|
|
35
|
-
return i.forEach((r) => {
|
|
36
|
-
c += e.slice(T, r.index), r.id === null ? (a += 1, c += p(r.tag, r.attrMatch, a), o = !0) : c += r.tag, T = r.index + r.tag.length;
|
|
37
|
-
}), c += e.slice(T), a > 0 && x(c) !== a && (c = I(c, a), o = !0), { html: c, changed: o, nextSeq: a };
|
|
38
|
-
}
|
|
39
|
-
export {
|
|
40
|
-
E as TRACK_ID_ATTRIBUTE,
|
|
41
|
-
g as TRACK_SEQ_ATTRIBUTE,
|
|
42
|
-
q as assignTrackingIds,
|
|
43
|
-
x as readTrackSeq
|
|
44
|
-
};
|