@useinsider/guido 3.24.0-beta.e71f772 → 3.24.0-beta.f838378
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +55 -56
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +2 -2
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +3 -3
- package/dist/composables/useActionsApi.js +2 -2
- package/dist/composables/useBlocksConfig.js +20 -22
- package/dist/composables/useDisplayConditions.js +7 -8
- package/dist/composables/useEditorTrackingIds.js +49 -0
- package/dist/composables/useHtmlCompiler.js +2 -0
- package/dist/composables/useStripo.js +70 -70
- package/dist/config/compiler/htmlCompilerRules.js +14 -6
- package/dist/extensions/DisplayConditions/control.js +17 -19
- package/dist/extensions/DisplayConditions/display-conditions.css.js +2 -2
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/services/templateLibraryApi.js +39 -36
- package/dist/src/@types/display-condition.d.ts +1 -0
- package/dist/src/composables/useEditorTrackingIds.d.ts +7 -0
- package/dist/src/composables/useStripo.d.ts +1 -1
- package/dist/src/extensions/DisplayConditions/control.d.ts +0 -1
- package/dist/src/stores/display-condition.d.ts +2 -0
- package/dist/src/utils/linkTrackingIds.d.ts +24 -22
- package/dist/src/utils/trimHrefWhitespace.d.ts +5 -0
- package/dist/static/styles/variables.css.js +1 -0
- package/dist/utils/displayCondition.js +19 -16
- package/dist/utils/linkTrackingIds.js +72 -72
- package/dist/utils/templatePreparation.js +59 -72
- package/dist/utils/trimHrefWhitespace.js +10 -0
- package/package.json +1 -1
- package/dist/extensions/LinkTracking/extension.js +0 -17
- package/dist/extensions/LinkTracking/writer.js +0 -41
- package/dist/src/extensions/LinkTracking/extension.d.ts +0 -2
- package/dist/src/extensions/LinkTracking/writer.d.ts +0 -13
package/README.md
CHANGED
|
@@ -124,7 +124,12 @@ const config: GuidoConfigInput = {
|
|
|
124
124
|
// host-side). Omit it and the repair is a silent no-op. Default: {}.
|
|
125
125
|
dynamicContentList?: DynamicContentList,
|
|
126
126
|
selectedUnsubscribePages?: number[],
|
|
127
|
-
|
|
127
|
+
// Default: false. Stripo opens its stored copy for the templateId unless this is true;
|
|
128
|
+
// Guido sets it itself when a load-time migration rewrote the html. Set it to true
|
|
129
|
+
// whenever the host changed html under an existing templateId outside the editor.
|
|
130
|
+
// Behaviour change: releases up to v3.23.0 forced a recreate for any non-empty html and
|
|
131
|
+
// ignored this option, so a host that sends `false` now gets Stripo's stored copy.
|
|
132
|
+
forceRecreate?: boolean,
|
|
128
133
|
migration?: {
|
|
129
134
|
// Legacy block configs keyed by block ID. Consumed once by the migrator
|
|
130
135
|
// when upgrading templates authored with v1 block formats. See the
|
|
@@ -7,9 +7,9 @@ import { useGuidoStateBridge as he } from "../composables/useGuidoStateBridge.js
|
|
|
7
7
|
import { usePartner as Ee } from "../composables/usePartner.js";
|
|
8
8
|
import { useSaveValidationRollout as Ce } from "../composables/useSaveValidationRollout.js";
|
|
9
9
|
import { useStripo as De } from "../composables/useStripo.js";
|
|
10
|
-
import { useTimerClone as
|
|
11
|
-
import { useToaster as
|
|
12
|
-
import { useTranslations as
|
|
10
|
+
import { useTimerClone as we } from "../composables/useTimerClone.js";
|
|
11
|
+
import { useToaster as Te } from "../composables/useToaster.js";
|
|
12
|
+
import { useTranslations as ke } from "../composables/useTranslations.js";
|
|
13
13
|
import { migrate as Ie } from "../config/migrator/index.js";
|
|
14
14
|
import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
|
|
15
15
|
import { RIBBON_SELECTOR as Re } from "../enums/onboarding.js";
|
|
@@ -17,34 +17,33 @@ import { ToasterTypeOptions as Fe } from "../enums/toaster.js";
|
|
|
17
17
|
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Me } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
18
|
import { disposeUnsubscribeListeners as Le } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
19
19
|
import { disposeDisplayConditionRequest as Oe } from "../extensions/DisplayConditions/bridge.js";
|
|
20
|
-
import
|
|
21
|
-
import Ne from "./organisms/
|
|
22
|
-
import _e from "./organisms/base/
|
|
23
|
-
import Ae from "./organisms/
|
|
24
|
-
import xe from "./organisms/
|
|
25
|
-
import Be from "./organisms/
|
|
26
|
-
import He from "./organisms/
|
|
27
|
-
import Pe from "./organisms/
|
|
28
|
-
import Ve from "./organisms/
|
|
29
|
-
import We from "
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { useDynamicContentStore as ze } from "../stores/dynamic-content.js";
|
|
20
|
+
import Ue from "./organisms/AutoSaveController.vue.js";
|
|
21
|
+
import Ne from "./organisms/base/AuthErrorModal.vue.js";
|
|
22
|
+
import _e from "./organisms/base/Toaster.vue.js";
|
|
23
|
+
import Ae from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
24
|
+
import xe from "./organisms/header/HeaderWrapper.vue.js";
|
|
25
|
+
import Be from "./organisms/LoadingWrapper.vue.js";
|
|
26
|
+
import He from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
27
|
+
import Pe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
28
|
+
import Ve from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
29
|
+
import { useStripoApi as We } from "../services/stripoApi.js";
|
|
30
|
+
import { useConfigStore as Ge } from "../stores/config.js";
|
|
31
|
+
import { useDynamicContentStore as $e } from "../stores/dynamic-content.js";
|
|
33
32
|
import { useEditorStore as C } from "../stores/editor.js";
|
|
34
|
-
import { usePreviewStore as
|
|
35
|
-
import { useSaveValidationStore as
|
|
36
|
-
import { useTemplateStore as
|
|
37
|
-
import { useUnsubscribeStore as
|
|
33
|
+
import { usePreviewStore as ze } from "../stores/preview.js";
|
|
34
|
+
import { useSaveValidationStore as qe } from "../stores/save-validation.js";
|
|
35
|
+
import { useTemplateStore as Ke } from "../stores/template.js";
|
|
36
|
+
import { useUnsubscribeStore as je } from "../stores/unsubscribe.js";
|
|
38
37
|
import { readTrackFloor as q } from "../utils/linkTrackingIds.js";
|
|
39
|
-
const
|
|
38
|
+
const Ot = /* @__PURE__ */ ue({
|
|
40
39
|
__name: "Guido",
|
|
41
40
|
props: {
|
|
42
41
|
config: null,
|
|
43
42
|
ready: { type: Boolean, default: !0 }
|
|
44
43
|
},
|
|
45
44
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
46
|
-
setup(K, { expose: j, emit:
|
|
47
|
-
const a = K,
|
|
45
|
+
setup(K, { expose: j, emit: s }) {
|
|
46
|
+
const a = K, r = be(), J = m(
|
|
48
47
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
49
48
|
), Q = m(
|
|
50
49
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
@@ -56,12 +55,12 @@ const Nt = /* @__PURE__ */ ue({
|
|
|
56
55
|
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
57
56
|
), D = W(), ee = m(
|
|
58
57
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
59
|
-
), y = W(), g =
|
|
58
|
+
), y = W(), g = $e(), w = je(), o = Ge();
|
|
60
59
|
a.ready && o.init(a.config);
|
|
61
|
-
const c = C(), te =
|
|
60
|
+
const c = C(), te = ze(), u = p(() => c.hasChanges), { isTestPartner: oe } = Ee(), { isEnabled: ne, loadRollout: T } = Ce(), { showToaster: k } = Te(), I = ke(), R = () => {
|
|
62
61
|
var t;
|
|
63
62
|
if (c.isVersionHistoryOpen) {
|
|
64
|
-
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }),
|
|
63
|
+
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
|
|
65
64
|
type: Fe.Warning,
|
|
66
65
|
message: I("email-editor.save-blocked-outside-editor")
|
|
67
66
|
});
|
|
@@ -82,27 +81,27 @@ const Nt = /* @__PURE__ */ ue({
|
|
|
82
81
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
|
|
83
82
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
|
|
84
83
|
};
|
|
85
|
-
}, { initPlugin: M, preloadRuntime: L } = De(
|
|
84
|
+
}, { initPlugin: M, preloadRuntime: L } = De(r), { runExclusive: O, beginMount: U, isCurrentMount: b } = ve();
|
|
86
85
|
let f = 0;
|
|
87
|
-
const { getDefaultTemplate: N } =
|
|
86
|
+
const { getDefaultTemplate: N } = We(), { cloneTimersOnSave: _, hasTimerBlocks: A } = we(), re = p(() => {
|
|
88
87
|
var t;
|
|
89
88
|
return !((t = o.ui) != null && t.showHeader);
|
|
90
|
-
}),
|
|
89
|
+
}), se = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ie = p(() => o.externalDisplayConditions), ae = p(
|
|
91
90
|
() => !!z().recommendationConfigs.strategyId
|
|
92
91
|
);
|
|
93
92
|
Se({
|
|
94
93
|
onBack: () => {
|
|
95
|
-
console.debug("guido:back"),
|
|
94
|
+
console.debug("guido:back"), s("back");
|
|
96
95
|
},
|
|
97
96
|
onSaveStart: () => {
|
|
98
|
-
console.debug("guido:save:start"),
|
|
97
|
+
console.debug("guido:save:start"), s("save:start");
|
|
99
98
|
},
|
|
100
99
|
onSaveComplete: (t) => {
|
|
101
100
|
const e = { ...t, metadata: v() };
|
|
102
|
-
console.debug("guido:save:complete", e),
|
|
101
|
+
console.debug("guido:save:complete", e), s("save:complete", e);
|
|
103
102
|
},
|
|
104
103
|
onTestEmailClick: () => {
|
|
105
|
-
console.debug("guido:test-email:click"),
|
|
104
|
+
console.debug("guido:test-email:click"), s("test-email:click");
|
|
106
105
|
}
|
|
107
106
|
});
|
|
108
107
|
const x = (t) => {
|
|
@@ -111,11 +110,11 @@ const Nt = /* @__PURE__ */ ue({
|
|
|
111
110
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
112
111
|
};
|
|
113
112
|
G(() => u.value, () => {
|
|
114
|
-
|
|
113
|
+
s("on-change", u.value);
|
|
115
114
|
});
|
|
116
115
|
const S = (t) => {
|
|
117
|
-
const e = t, { attribute:
|
|
118
|
-
console.debug("dynamic-content:open", e.detail),
|
|
116
|
+
const e = t, { attribute: i, position: l } = e.detail;
|
|
117
|
+
console.debug("dynamic-content:open", e.detail), s("dynamic-content:open", i, l);
|
|
119
118
|
};
|
|
120
119
|
let d = null;
|
|
121
120
|
const h = () => {
|
|
@@ -124,57 +123,57 @@ const Nt = /* @__PURE__ */ ue({
|
|
|
124
123
|
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
125
124
|
}, E = async () => {
|
|
126
125
|
var t;
|
|
127
|
-
|
|
126
|
+
r.mark("host_ready");
|
|
128
127
|
try {
|
|
129
|
-
o.initialized || o.init(a.config), c.templateId = o.templateId,
|
|
128
|
+
o.initialized || o.init(a.config), c.templateId = o.templateId, r.setContext({
|
|
130
129
|
partnerName: o.partnerName,
|
|
131
130
|
productType: o.productType,
|
|
132
131
|
templateId: o.templateId,
|
|
133
132
|
variationId: o.variationId
|
|
134
133
|
});
|
|
135
|
-
const e = o.template,
|
|
136
|
-
|
|
134
|
+
const e = o.template, i = (e == null ? void 0 : e.html) || "", l = (e == null ? void 0 : e.css) || "", H = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
135
|
+
w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
137
136
|
const ce = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, P = o.isFeatureEnabled("linkTrackingIds"), de = {
|
|
138
137
|
partnerName: o.partnerName,
|
|
139
138
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
140
139
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
141
|
-
}, V = (pe) =>
|
|
140
|
+
}, V = (pe) => r.timed(
|
|
142
141
|
"migration",
|
|
143
142
|
() => Ie(pe, ce, de)
|
|
144
143
|
);
|
|
145
|
-
let
|
|
146
|
-
html:
|
|
144
|
+
let n = {
|
|
145
|
+
html: i && await V(i),
|
|
147
146
|
css: l
|
|
148
147
|
};
|
|
149
|
-
|
|
150
|
-
const me = P ? q(
|
|
151
|
-
A(
|
|
148
|
+
n.html || (n = await r.timed("default_template", () => N()), n.html = await V(n.html));
|
|
149
|
+
const me = P ? q(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
150
|
+
A(n.html) && (n.html = await r.timed("timer_clone", () => _(n.html))), P && (c.trackIdSessionFloor = Math.max(me, q(n.html)));
|
|
152
151
|
const le = {
|
|
153
152
|
preselectedDynamicContentList: H,
|
|
154
153
|
onReady: () => {
|
|
155
|
-
console.debug("guido:ready"),
|
|
154
|
+
console.debug("guido:ready"), s("ready");
|
|
156
155
|
}
|
|
157
156
|
};
|
|
158
|
-
f = U(), await M(
|
|
157
|
+
f = U(), await M(n, v(), le, n.html !== i), g.selectedDynamicContentList = H;
|
|
159
158
|
} catch (e) {
|
|
160
|
-
console.error("Failed to initialize Stripo editor:", e),
|
|
159
|
+
console.error("Failed to initialize Stripo editor:", e), r.markFailed();
|
|
161
160
|
}
|
|
162
161
|
};
|
|
163
162
|
return fe(async () => {
|
|
164
163
|
var e;
|
|
165
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(),
|
|
164
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), Ke().$reset(), qe().$reset(), T(), h();
|
|
166
165
|
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
167
166
|
if (t && (d = new ResizeObserver(h), d.observe(t)), L(), a.ready)
|
|
168
167
|
await E();
|
|
169
168
|
else {
|
|
170
|
-
const
|
|
171
|
-
l && (
|
|
169
|
+
const i = G(() => a.ready, (l) => {
|
|
170
|
+
l && (i(), E());
|
|
172
171
|
});
|
|
173
172
|
}
|
|
174
173
|
document.addEventListener("dynamic-content:open", S);
|
|
175
174
|
}), ye(() => {
|
|
176
|
-
if (Le(), Me(),
|
|
177
|
-
Oe()
|
|
175
|
+
if (Le(), Me(), r.dispose(), d == null || d.disconnect(), document.removeEventListener("dynamic-content:open", S), b(f)) {
|
|
176
|
+
Oe();
|
|
178
177
|
try {
|
|
179
178
|
const t = C();
|
|
180
179
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
@@ -198,9 +197,9 @@ const Nt = /* @__PURE__ */ ue({
|
|
|
198
197
|
hasChanges: u,
|
|
199
198
|
saveSilent: R,
|
|
200
199
|
setLoading: F
|
|
201
|
-
}), { __sfc: !0, openMetrics:
|
|
200
|
+
}), { __sfc: !0, openMetrics: r, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, DisplayConditionsHost: Z, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: ee, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, props: a, configStore: o, editorStore: c, previewStore: te, hasChanges: u, isTestPartner: oe, isSaveValidationEnabled: ne, loadRollout: T, showToaster: k, trans: I, saveSilent: R, setLoading: F, emit: s, buildMetadata: v, initPlugin: M, preloadRuntime: L, runExclusive: O, beginMount: U, isCurrentMount: b, mountGeneration: f, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: A, noHeader: re, isRrsEnabled: se, isExternalDisplayConditionsEnabled: ie, hasAssignedStrategy: ae, insertDynamicContent: x, closeDynamicContent: B, handleDynamicContentOpen: S, ribbonObserver: d, updateRibbonOffset: h, startEditor: E, AutoSaveController: Ue, AuthErrorModal: Ne, Toaster: _e, FilterSelectionDrawer: Ae, HeaderWrapper: xe, LoadingWrapper: Be, SaveAsTemplateDrawer: He, UnsubscribeWrapper: Pe, ValidationErrorDrawer: Ve };
|
|
202
201
|
}
|
|
203
202
|
});
|
|
204
203
|
export {
|
|
205
|
-
|
|
204
|
+
Ot as default
|
|
206
205
|
};
|
|
@@ -11,7 +11,7 @@ var n = function() {
|
|
|
11
11
|
return e.updateField("name", o);
|
|
12
12
|
} } }), t(e.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-description-input", name: "displayConditionDescription", "character-counter-status": !1, "disabled-status": e.isSaving, "label-text": e.descriptionLabel, "max-character-length": e.DISPLAY_CONDITION_LIMITS.DESCRIPTION_MAX, "placeholder-text": e.trans(`${e.KEY}.condition-description-placeholder`), "state-message": e.errors.description || "", states: e.errors.description ? "error" : "default", "tooltip-status": !1, value: e.draft.description }, on: { input: function(o) {
|
|
13
13
|
return e.updateField("description", o);
|
|
14
|
-
} } }), t("div", { staticClass: "guido-display-condition-create__separator" }), t("p", { staticClass: "guido-display-condition-create__method-title mt-0 mb-4 f-s-1 f-w-600 l-h-6 l-s-5 t-t-u t-c-55" }, [i._v(" " + i._s(e.trans(`${e.KEY}.select-method`)) + " ")]), t("div", { staticClass: "guido-display-condition-create__methods d-f mb-4" }, [t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-logic-builder", disable: "", disabled: "", name: "displayConditionMethod", selected: "codeOnly", value: "logicBuilder", label: e.trans(`${e.KEY}.logic-builder`) } }), t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-code-only", name: "displayConditionMethod", selected: "codeOnly", value: "codeOnly", label: e.trans(`${e.KEY}.code-only`) } })], 1), t(e.CodeEditorField, { ref: "codeBeforeRef", staticClass: "mb-3", attrs: { id: "guido__display-condition-code-before", disabled: e.isSaving, error: e.errors.codeBefore, label: e.trans(`${e.KEY}.code-before`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeBefore }, on: { input: function(o) {
|
|
14
|
+
} } }), t("div", { staticClass: "guido-display-condition-create__separator t-c-3" }), t("p", { staticClass: "guido-display-condition-create__method-title mt-0 mb-4 f-s-1 f-w-600 l-h-6 l-s-5 t-t-u t-c-55" }, [i._v(" " + i._s(e.trans(`${e.KEY}.select-method`)) + " ")]), t("div", { staticClass: "guido-display-condition-create__methods d-f mb-4" }, [t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-logic-builder", disable: "", disabled: "", name: "displayConditionMethod", selected: "codeOnly", value: "logicBuilder", label: e.trans(`${e.KEY}.logic-builder`) } }), t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-code-only", name: "displayConditionMethod", selected: "codeOnly", value: "codeOnly", label: e.trans(`${e.KEY}.code-only`) } })], 1), t(e.CodeEditorField, { ref: "codeBeforeRef", staticClass: "mb-3", attrs: { id: "guido__display-condition-code-before", disabled: e.isSaving, error: e.errors.codeBefore, label: e.trans(`${e.KEY}.code-before`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeBefore }, on: { input: function(o) {
|
|
15
15
|
return e.updateField("codeBefore", o);
|
|
16
16
|
} } }), t(e.CodeEditorField, { ref: "codeAfterRef", attrs: { id: "guido__display-condition-code-after", disabled: e.isSaving, error: e.errors.codeAfter, label: e.trans(`${e.KEY}.code-after`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeAfter }, on: { input: function(o) {
|
|
17
17
|
return e.updateField("codeAfter", o);
|
|
@@ -22,7 +22,7 @@ var n = function() {
|
|
|
22
22
|
s,
|
|
23
23
|
!1,
|
|
24
24
|
null,
|
|
25
|
-
"
|
|
25
|
+
"929822bc"
|
|
26
26
|
);
|
|
27
27
|
const f = d.exports;
|
|
28
28
|
export {
|
|
@@ -18,9 +18,9 @@ var a = function() {
|
|
|
18
18
|
return t.closeMenu(i);
|
|
19
19
|
}, optionClick: function(n) {
|
|
20
20
|
return t.requestDelete(i);
|
|
21
|
-
} } })], 1), e("span", { staticClass: "guido-display-condition-card__divider" }), e(t.InButtonV2, { attrs: { id: `guido__display-condition-expand-${i.id}`, styling: "text", type: "secondary", "label-text-status": !1, "left-icon": t.expandedId === i.id ? "filled-dropdown-up" : "filled-dropdown-down", "selected-status": t.expandedId === i.id, "tooltip-options": t.expandTooltip(i), "tooltip-text": t.trans(`${t.KEY}.preview`) }, on: { click: function(n) {
|
|
21
|
+
} } })], 1), e("span", { staticClass: "guido-display-condition-card__divider b-c-6" }), e(t.InButtonV2, { attrs: { id: `guido__display-condition-expand-${i.id}`, styling: "text", type: "secondary", "label-text-status": !1, "left-icon": t.expandedId === i.id ? "filled-dropdown-up" : "filled-dropdown-down", "selected-status": t.expandedId === i.id, "tooltip-options": t.expandTooltip(i), "tooltip-text": t.trans(`${t.KEY}.preview`) }, on: { click: function(n) {
|
|
22
22
|
return t.toggleExpanded(i);
|
|
23
|
-
} } })], 1)]), t.expandedId === i.id ? e("pre", { staticClass: "guido-display-condition-card__code bor-w-1 bor-s-s bor-c-50 bor-r-1 b-c-4 f-s-2 l-h-2" }, [s._v(s._s(t.codeOf(i)))]) : s._e()]);
|
|
23
|
+
} } })], 1)]), t.expandedId === i.id ? e("pre", { staticClass: "guido-display-condition-card__code bor-w-1 bor-s-s bor-c-50 bor-r-1 b-c-4 t-c-35 f-s-2 l-h-2" }, [s._v(s._s(t.codeOf(i)))]) : s._e()]);
|
|
24
24
|
}), 0)], 1)]), t.store.pendingDelete ? e("div", { staticClass: "guido-display-condition-select__delete-modal" }, [e(t.WpModal, { attrs: { id: "guido__display-condition-delete-modal", size: "X-small", state: "danger", "close-on-outside-click": !1, "footer-button-options": t.deleteModalButtons, title: t.trans(`${t.KEY}.delete-confirm-title`) }, on: { close: t.closeDeleteModal, "primary-action": t.confirmDelete } }, [e("p", { staticClass: "guido-display-condition-select__delete-text m-0 t-c-55" }, [s._v(" " + s._s(t.trans(`${t.KEY}.delete-confirm-description`, { name: t.store.pendingDelete.name })) + " ")])])], 1) : s._e()], 1);
|
|
25
25
|
}, l = [], c = /* @__PURE__ */ d(
|
|
26
26
|
o,
|
|
@@ -28,7 +28,7 @@ var a = function() {
|
|
|
28
28
|
l,
|
|
29
29
|
!1,
|
|
30
30
|
null,
|
|
31
|
-
"
|
|
31
|
+
"0d740001"
|
|
32
32
|
);
|
|
33
33
|
const f = c.exports;
|
|
34
34
|
export {
|
|
@@ -111,8 +111,8 @@ const H = 1e4, T = 3e4, m = (n, l, A) => new Promise((C, p) => {
|
|
|
111
111
|
}),
|
|
112
112
|
updateHtmlAndCss: (t, e) => {
|
|
113
113
|
const { actionsApi: i } = r();
|
|
114
|
-
return m("updateHtmlAndCss", H, (a) => {
|
|
115
|
-
i.updateHtmlAndCss(t, e, () => a());
|
|
114
|
+
return m("updateHtmlAndCss", H, (a, o) => {
|
|
115
|
+
i.updateHtmlAndCss(t, e, () => a(), o);
|
|
116
116
|
});
|
|
117
117
|
},
|
|
118
118
|
editorSave: () => m(
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import s from "../extensions/LinkTracking/extension.js";
|
|
2
1
|
import l from "../extensions/ModulesTabIcons/extension.js";
|
|
3
2
|
import { useConfigStore as r } from "../stores/config.js";
|
|
4
|
-
const
|
|
3
|
+
const i = {
|
|
5
4
|
"amp-accordion": "ampAccordionEnabled",
|
|
6
5
|
"amp-carousel": "ampCarouselEnabled",
|
|
7
6
|
"amp-form-controls": "ampFormControlsEnabled",
|
|
@@ -15,7 +14,7 @@ const c = {
|
|
|
15
14
|
"text-block": "textEnabled",
|
|
16
15
|
"timer-block": "timerEnabled",
|
|
17
16
|
"video-block": "videoEnabled"
|
|
18
|
-
},
|
|
17
|
+
}, c = {
|
|
19
18
|
"dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
|
|
20
19
|
"checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
|
|
21
20
|
"radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
|
|
@@ -23,50 +22,49 @@ const c = {
|
|
|
23
22
|
"unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
|
|
24
23
|
"coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
|
|
25
24
|
"items-block": () => import("../extensions/Blocks/Items/extension.js")
|
|
26
|
-
},
|
|
25
|
+
}, b = (n) => {
|
|
27
26
|
if (!n || !n.length)
|
|
28
27
|
return {};
|
|
29
28
|
const t = {};
|
|
30
29
|
return n.forEach((o) => {
|
|
31
|
-
const e =
|
|
30
|
+
const e = i[o];
|
|
32
31
|
e && (t[e] = !1);
|
|
33
32
|
}), t;
|
|
34
|
-
},
|
|
35
|
-
const
|
|
33
|
+
}, m = async ({ externalDisplayConditions: n }) => {
|
|
34
|
+
const t = [l];
|
|
36
35
|
if (n) {
|
|
37
|
-
const
|
|
38
|
-
|
|
36
|
+
const o = await import("../extensions/DisplayConditions/extension.js");
|
|
37
|
+
t.push(o.default);
|
|
39
38
|
}
|
|
40
|
-
return t
|
|
41
|
-
},
|
|
42
|
-
const o = await
|
|
39
|
+
return t;
|
|
40
|
+
}, d = async (n, t = { externalDisplayConditions: !1 }) => {
|
|
41
|
+
const o = await m(t);
|
|
43
42
|
if (!n || !n.length)
|
|
44
43
|
return o;
|
|
45
44
|
const e = await Promise.all(
|
|
46
|
-
n.map(async (
|
|
47
|
-
const
|
|
48
|
-
return
|
|
45
|
+
n.map(async (a) => {
|
|
46
|
+
const s = c[a];
|
|
47
|
+
return s ? (await s()).default : null;
|
|
49
48
|
})
|
|
50
49
|
);
|
|
51
50
|
return [
|
|
52
51
|
...o,
|
|
53
|
-
...e.filter((
|
|
52
|
+
...e.filter((a) => a !== null)
|
|
54
53
|
];
|
|
55
|
-
},
|
|
54
|
+
}, k = () => {
|
|
56
55
|
const n = r();
|
|
57
56
|
return {
|
|
58
57
|
getStripoBlocksConfig: async () => {
|
|
59
58
|
const o = n.blocks;
|
|
60
59
|
return {
|
|
61
|
-
baseBlocks:
|
|
62
|
-
extensions: await
|
|
63
|
-
externalDisplayConditions: n.externalDisplayConditions
|
|
64
|
-
linkTrackingIds: n.isFeatureEnabled("linkTrackingIds")
|
|
60
|
+
baseBlocks: b(o == null ? void 0 : o.excludeDefaults),
|
|
61
|
+
extensions: await d(o == null ? void 0 : o.includeCustoms, {
|
|
62
|
+
externalDisplayConditions: n.externalDisplayConditions
|
|
65
63
|
})
|
|
66
64
|
};
|
|
67
65
|
}
|
|
68
66
|
};
|
|
69
67
|
};
|
|
70
68
|
export {
|
|
71
|
-
|
|
69
|
+
k as useBlocksConfig
|
|
72
70
|
};
|
|
@@ -8,8 +8,8 @@ import { useConfigStore as q } from "../stores/config.js";
|
|
|
8
8
|
import { useDisplayConditionStore as P } from "../stores/display-condition.js";
|
|
9
9
|
import { findInvalidCodeFields as Y, nextConditionId as w } from "../utils/displayCondition.js";
|
|
10
10
|
import { escapeHtml as R } from "../utils/htmlEscape.js";
|
|
11
|
-
import { computed as
|
|
12
|
-
const
|
|
11
|
+
import { computed as b } from "vue";
|
|
12
|
+
const B = "email-editor.display-conditions", i = B, F = 409, S = (n, m, r) => ({
|
|
13
13
|
id: w(),
|
|
14
14
|
name: n.name.trim(),
|
|
15
15
|
description: n.description.trim(),
|
|
@@ -22,10 +22,9 @@ const X = "email-editor.display-conditions", i = X, b = 409, S = (n, m, r) => ({
|
|
|
22
22
|
codeBefore: n.codeBefore,
|
|
23
23
|
codeAfter: n.codeAfter
|
|
24
24
|
}), ne = () => {
|
|
25
|
-
const n = P(), m = q(), r = O(), o = x(), { showToaster: p } = M(), u =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}), f = (e) => {
|
|
25
|
+
const n = P(), m = q(), r = O(), o = x(), { showToaster: p } = M(), u = b(
|
|
26
|
+
() => m.isFeatureEnabled("liquidSyntax") ? "liquid" : "pongo"
|
|
27
|
+
), f = (e) => {
|
|
29
28
|
const t = { condition: e };
|
|
30
29
|
return document.dispatchEvent(new CustomEvent(I.APPLY, { detail: t })), n.close(), t.applied === !0;
|
|
31
30
|
}, D = () => {
|
|
@@ -88,7 +87,7 @@ const X = "email-editor.display-conditions", i = X, b = 409, S = (n, m, r) => ({
|
|
|
88
87
|
o(`${i}.created-and-saved`, c(t.name))
|
|
89
88
|
), {};
|
|
90
89
|
} catch (t) {
|
|
91
|
-
return (t == null ? void 0 : t.status) ===
|
|
90
|
+
return (t == null ? void 0 : t.status) === F ? { name: o(`${i}.error-name-exists`) } : (E(t, o(`${i}.save-failed`, c(e.name.trim()))), null);
|
|
92
91
|
}
|
|
93
92
|
},
|
|
94
93
|
select: (e) => {
|
|
@@ -112,6 +111,6 @@ const X = "email-editor.display-conditions", i = X, b = 409, S = (n, m, r) => ({
|
|
|
112
111
|
};
|
|
113
112
|
};
|
|
114
113
|
export {
|
|
115
|
-
|
|
114
|
+
B as DISPLAY_CONDITIONS_TRANS_KEY,
|
|
116
115
|
ne as useDisplayConditions
|
|
117
116
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TRACK_ID_ATTRIBUTE as u, writeAnchorTrackIds as I, TRACK_SEQ_ATTRIBUTE as f, planTrackingIds as h, parseTrackSeq as w, readAnchorTrackIds as k } from "../utils/linkTrackingIds.js";
|
|
2
|
+
import { getEditorApi as A } from "../utils/stripoEditorApi.js";
|
|
3
|
+
import { ModificationDescription as x } from "../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
4
|
+
function T(t, r = []) {
|
|
5
|
+
const o = t.getType();
|
|
6
|
+
if (o === "comment") {
|
|
7
|
+
const e = t.getTextContent() ?? "", i = k(e);
|
|
8
|
+
return i.length && r.push({ kind: "comment", node: t, text: e, rawIds: i }), r;
|
|
9
|
+
}
|
|
10
|
+
if (o === "element") {
|
|
11
|
+
const e = t;
|
|
12
|
+
e.getTagName().toLowerCase() === "a" && r.push({ kind: "element", node: e, rawIds: [e.getAttribute(u) ?? ""] });
|
|
13
|
+
}
|
|
14
|
+
return t.childNodes().forEach((e) => T(e, r)), r;
|
|
15
|
+
}
|
|
16
|
+
function y(t, r) {
|
|
17
|
+
if (!t)
|
|
18
|
+
throw new Error("The editor exposes no editorCopilotApi.");
|
|
19
|
+
const o = t.getDocumentRootHtmlNode(), e = o.querySelector("body");
|
|
20
|
+
if (!e)
|
|
21
|
+
throw new Error("The editor document has no <body> to record tracking ids on.");
|
|
22
|
+
const i = T(o), s = h(
|
|
23
|
+
i.flatMap((d) => d.rawIds),
|
|
24
|
+
w(e.getAttribute(f)),
|
|
25
|
+
r
|
|
26
|
+
);
|
|
27
|
+
return { api: t, seqHost: e, hosts: i, plan: s };
|
|
28
|
+
}
|
|
29
|
+
const H = () => ({ writeTrackingIds: (r) => {
|
|
30
|
+
const { editorCopilotApi: o } = A();
|
|
31
|
+
let e;
|
|
32
|
+
try {
|
|
33
|
+
e = y(o, r);
|
|
34
|
+
} catch (n) {
|
|
35
|
+
return console.warn("Tracking ids skipped for this save:", n), { changed: !1, nextSeq: r };
|
|
36
|
+
}
|
|
37
|
+
const { api: i, seqHost: s, hosts: d, plan: c } = e;
|
|
38
|
+
if (!c.changed)
|
|
39
|
+
return { changed: !1, nextSeq: c.nextSeq };
|
|
40
|
+
const a = i.getTemplateModifier();
|
|
41
|
+
let l = 0;
|
|
42
|
+
return d.forEach((n) => {
|
|
43
|
+
const m = n.rawIds.map((p, g) => c.reassigned[l + g] ? c.ids[l + g] : null);
|
|
44
|
+
l += n.rawIds.length, !m.every((p) => p === null) && (n.kind === "element" ? a.modifyHtml(n.node).setAttribute(u, String(m[0])) : a.modifyHtml(n.node).replaceWith(`<!--${I(n.text, m)}-->`));
|
|
45
|
+
}), a.modifyHtml(s).setAttribute(f, String(c.nextSeq)), a.apply(new x("Updated Insider tracking IDs").asHidden()), { changed: !0, nextSeq: c.nextSeq };
|
|
46
|
+
} });
|
|
47
|
+
export {
|
|
48
|
+
H as useEditorTrackingIds
|
|
49
|
+
};
|
|
@@ -16,6 +16,8 @@ const x = /* @__PURE__ */ new Set([
|
|
|
16
16
|
"fix-tags-end",
|
|
17
17
|
// Unwrap translate-injected <font dir="auto"> tags — pure removal, never emits AMP-forbidden output.
|
|
18
18
|
"strip-font-tags",
|
|
19
|
+
// Trim whitespace inside href values — attribute-value edit only, emits nothing new.
|
|
20
|
+
"trim-href-whitespace",
|
|
19
21
|
// Image domain corrections — plain string replacement.
|
|
20
22
|
"replace-old-image-domain",
|
|
21
23
|
"replace-old-v2-image-domain",
|