@useinsider/guido 3.30.0-beta.1360af2 → 3.30.0-beta.1881127
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 +17 -0
- package/dist/@types/config/schemas.js +7 -5
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +26 -25
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +16 -11
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -51
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
- package/dist/composables/useExport.js +7 -8
- package/dist/composables/useHtmlCompiler.js +15 -13
- package/dist/composables/useHtmlValidator.js +100 -102
- package/dist/composables/useStripo.js +59 -57
- package/dist/composables/useToaster.js +10 -11
- package/dist/composables/useVersionHistoryApi.js +21 -22
- package/dist/composables/validators/useLiquidValidator.js +24 -26
- package/dist/config/compiler/liquidCompilerRules.js +13 -5
- package/dist/config/migrator/itemsBlockMigrator.js +164 -161
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +141 -148
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +53 -53
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +39 -40
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +26 -27
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +32 -33
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +22 -23
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +78 -79
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +41 -50
- package/dist/extensions/DynamicContent/dynamic-content.js +56 -33
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/generic.d.ts +10 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +0 -2
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +11 -0
- package/dist/src/stores/config.d.ts +21 -0
- package/dist/src/stores/preview.d.ts +0 -3
- package/dist/src/utils/clipboardText.d.ts +1 -0
- package/dist/src/utils/genericUtil.d.ts +6 -1
- package/dist/src/utils/linkTokenPaste.d.ts +3 -0
- package/dist/src/utils/liquidLinkQuotes.d.ts +4 -0
- package/dist/stores/preview.js +15 -21
- package/dist/utils/clipboardText.js +31 -0
- package/dist/utils/genericUtil.js +55 -45
- package/dist/utils/linkTokenPaste.js +28 -0
- package/dist/utils/liquidLinkQuotes.js +10 -0
- package/dist/utils/pairProductVariables.js +98 -108
- package/package.json +1 -1
- package/dist/src/utils/ampPreviewSanitizer.d.ts +0 -5
- package/dist/utils/ampPreviewSanitizer.js +0 -46
package/README.md
CHANGED
|
@@ -173,6 +173,7 @@ const config: GuidoConfigInput = {
|
|
|
173
173
|
allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
|
|
174
174
|
allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
|
|
175
175
|
reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
|
|
176
|
+
dynamicContentSpecialLinks?: boolean, // Default: false - List the catalogue's URL attributes (token ends in `url` or `url_<n>`) and every Call an API variable as Stripo special links (Personalization tab of the link type selector)
|
|
176
177
|
legacyUnsubscribeConversion?: boolean, // Default: false - Convert legacy unsubscribe blocks that have no unsubscribe link into text blocks (on load and on module drop/copy) and show a warning modal.
|
|
177
178
|
accessibilityTesting?: boolean, // Default: false - Show the Accessibility Test entry in the header kebab menu (Stripo's checker: contrast, image alternatives, colour-vision simulation) and the tab-bar onboarding tour that points at it.
|
|
178
179
|
itemsPriceFormatting?: boolean, // Default: false - Items block price formatting: thousand/decimal separator + decimal count on the block root, raw price tags in the export (formatted at send time).
|
|
@@ -690,6 +691,22 @@ const closeModal = () => {
|
|
|
690
691
|
</script>
|
|
691
692
|
```
|
|
692
693
|
|
|
694
|
+
### Special links in the link type selector
|
|
695
|
+
|
|
696
|
+
Behind `features.dynamicContentSpecialLinks` (default `false`). Guido passes the `template.dynamicContentList`
|
|
697
|
+
catalogue to Stripo as `specialLinks`, one group per top-level category, keeping only the attributes whose
|
|
698
|
+
token ends in `url` or `url_<n>` (`last_visited_product_url`, `ins_apr_url_1`), each entry valued `{{token}}`.
|
|
699
|
+
Call an API variables are the exception: their tokens are id-based (`call_an_api_response_<id>`) and carry no
|
|
700
|
+
usable type, so the whole category is listed as its own group regardless of suffix. The link type dropdown of
|
|
701
|
+
link fields gains a **Personalization** tab with those groups and a search box; picking an entry writes the
|
|
702
|
+
token into the URL field and the dropdown label shows the entry's label.
|
|
703
|
+
|
|
704
|
+
- When no attribute matches (or the host passes no catalogue), `specialLinks` is not passed and the tab is not shown.
|
|
705
|
+
- Link fields only: the image path, alt text and button text are not covered; they keep Stripo's native
|
|
706
|
+
merge-tag dropdown fed by `mergeTags`.
|
|
707
|
+
- The list is fixed at editor init and the host picker is not involved, so nothing is added to the selected
|
|
708
|
+
list; `template.customFieldAttributes` must list every token for save validation.
|
|
709
|
+
|
|
693
710
|
### Saved-module token repair
|
|
694
711
|
|
|
695
712
|
Legacy or hand-written **saved modules** may carry tokens by display label
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
|
|
2
|
-
import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as
|
|
2
|
+
import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as h, boolean as a, array as n, transform as S, unknown as i, record as g, fallback as R, literal as u, lazy as T, looseObject as C, variant as I, union as k } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const b = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -91,7 +91,7 @@ const b = {
|
|
|
91
91
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
92
92
|
id: e(c()),
|
|
93
93
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
94
|
-
decimalCount: e(
|
|
94
|
+
decimalCount: e(k([t(), c()])),
|
|
95
95
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
96
96
|
productIds: e(n(i())),
|
|
97
97
|
/** Whether the block requested live products at send time */
|
|
@@ -125,7 +125,7 @@ const b = {
|
|
|
125
125
|
/** Block type marker used by some legacy variants */
|
|
126
126
|
blockType: e(t()),
|
|
127
127
|
/** Size variant marker (legacy data may use string or number) */
|
|
128
|
-
size: e(
|
|
128
|
+
size: e(k([t(), c()])),
|
|
129
129
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
130
130
|
verticalResponsiveness: e(a()),
|
|
131
131
|
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
@@ -247,6 +247,8 @@ const b = {
|
|
|
247
247
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
248
248
|
allowSaveWithErrors: e(a(), !0),
|
|
249
249
|
reusableRecommendationStrategy: e(a(), !1),
|
|
250
|
+
/** List the dynamic-content catalogue as Stripo special links in the link type selector */
|
|
251
|
+
dynamicContentSpecialLinks: e(a(), !1),
|
|
250
252
|
/** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
|
|
251
253
|
legacyUnsubscribeConversion: e(a(), !1),
|
|
252
254
|
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
@@ -320,7 +322,7 @@ const b = {
|
|
|
320
322
|
...d.entries,
|
|
321
323
|
type: u("custom"),
|
|
322
324
|
/** Custom processor function */
|
|
323
|
-
processor:
|
|
325
|
+
processor: h(
|
|
324
326
|
(s) => typeof s == "function",
|
|
325
327
|
"processor must be a function"
|
|
326
328
|
)
|
|
@@ -340,7 +342,7 @@ const b = {
|
|
|
340
342
|
* Return false to cancel the save operation.
|
|
341
343
|
*/
|
|
342
344
|
externalValidation: e(
|
|
343
|
-
|
|
345
|
+
h(
|
|
344
346
|
(s) => typeof s == "function",
|
|
345
347
|
"externalValidation must be a function"
|
|
346
348
|
)
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { defineComponent as Se, defineAsyncComponent as a, ref as W, computed as l, watch as $, onMounted as he, onUnmounted as Ee } from "vue";
|
|
2
2
|
import { useCortexBlueprintBridge as Ce } from "../composables/useCortexBlueprintBridge.js";
|
|
3
3
|
import { useEditorLock as De } from "../composables/useEditorLock.js";
|
|
4
|
-
import { startEditorOpenMetrics as
|
|
4
|
+
import { startEditorOpenMetrics as ke } from "../composables/useEditorOpenMetrics.js";
|
|
5
5
|
import { provideGuidoActions as Te } from "../composables/useGuidoActions.js";
|
|
6
|
-
import { useGuidoStateBridge as
|
|
6
|
+
import { useGuidoStateBridge as we } from "../composables/useGuidoStateBridge.js";
|
|
7
7
|
import { usePartner as Fe } from "../composables/usePartner.js";
|
|
8
8
|
import { useSaveValidationRollout as Me } from "../composables/useSaveValidationRollout.js";
|
|
9
|
-
import { useStripo as
|
|
10
|
-
import { useTimerClone as
|
|
9
|
+
import { useStripo as Le } from "../composables/useStripo.js";
|
|
10
|
+
import { useTimerClone as Ie } from "../composables/useTimerClone.js";
|
|
11
11
|
import { useToaster as Re } from "../composables/useToaster.js";
|
|
12
12
|
import { useTranslations as Oe } from "../composables/useTranslations.js";
|
|
13
13
|
import { migrate as Ue } from "../config/migrator/index.js";
|
|
14
14
|
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
15
15
|
import { RIBBON_SELECTOR as Ae } from "../enums/onboarding.js";
|
|
16
16
|
import { ToasterTypeOptions as Ne } from "../enums/toaster.js";
|
|
17
|
-
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as
|
|
18
|
-
import { disposeUnsubscribeListeners as
|
|
17
|
+
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Pe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
|
+
import { disposeUnsubscribeListeners as _e } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
19
19
|
import { disposeDisplayConditionRequest as xe } from "../extensions/DisplayConditions/bridge.js";
|
|
20
20
|
import Be from "./organisms/AutoSaveController.vue.js";
|
|
21
21
|
import He from "./organisms/base/AuthErrorModal.vue.js";
|
|
@@ -36,8 +36,9 @@ import { usePreviewStore as Ye } from "../stores/preview.js";
|
|
|
36
36
|
import { useSaveValidationStore as Ze } from "../stores/save-validation.js";
|
|
37
37
|
import { useTemplateStore as et } from "../stores/template.js";
|
|
38
38
|
import { useUnsubscribeStore as tt } from "../stores/unsubscribe.js";
|
|
39
|
+
import { disposeLinkTokenPaste as ot } from "../utils/linkTokenPaste.js";
|
|
39
40
|
import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
|
|
40
|
-
const
|
|
41
|
+
const $t = /* @__PURE__ */ Se({
|
|
41
42
|
__name: "Guido",
|
|
42
43
|
props: {
|
|
43
44
|
config: null,
|
|
@@ -45,7 +46,7 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
45
46
|
},
|
|
46
47
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
47
48
|
setup(j, { expose: J, emit: i }) {
|
|
48
|
-
const c = j, r =
|
|
49
|
+
const c = j, r = ke(), Q = a(
|
|
49
50
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
50
51
|
), X = a(
|
|
51
52
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
@@ -61,22 +62,22 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
61
62
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
62
63
|
), ne = a(
|
|
63
64
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
64
|
-
), y = W(), g = Qe(),
|
|
65
|
+
), y = W(), g = Qe(), k = tt(), re = q(), o = Je();
|
|
65
66
|
c.ready && o.init(c.config);
|
|
66
|
-
const d = C(), ie = Ye(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster:
|
|
67
|
+
const d = C(), ie = Ye(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: w } = Re(), F = Oe(), M = () => {
|
|
67
68
|
var t;
|
|
68
69
|
if (d.isVersionHistoryOpen) {
|
|
69
|
-
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }),
|
|
70
|
+
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), w({
|
|
70
71
|
type: Ne.Warning,
|
|
71
72
|
message: F("email-editor.save-blocked-outside-editor")
|
|
72
73
|
});
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
76
|
return (t = D.value) == null ? void 0 : t.saveSilent();
|
|
76
|
-
},
|
|
77
|
+
}, L = (t) => {
|
|
77
78
|
d.loadingStatus = t;
|
|
78
79
|
};
|
|
79
|
-
Ce(),
|
|
80
|
+
Ce(), we();
|
|
80
81
|
const b = () => {
|
|
81
82
|
var t, e;
|
|
82
83
|
return {
|
|
@@ -87,9 +88,9 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
87
88
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
|
|
88
89
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
|
|
89
90
|
};
|
|
90
|
-
}, { initPlugin:
|
|
91
|
+
}, { initPlugin: I, preloadRuntime: R } = Le(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = De();
|
|
91
92
|
let f = 0;
|
|
92
|
-
const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks:
|
|
93
|
+
const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: P } = Ie(), ce = l(() => {
|
|
93
94
|
var t;
|
|
94
95
|
return !((t = o.ui) != null && t.showHeader);
|
|
95
96
|
}), de = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = l(() => o.externalDisplayConditions), le = l(
|
|
@@ -112,7 +113,7 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
112
113
|
console.debug("guido:test-email:click"), i("test-email:click");
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
|
-
const
|
|
116
|
+
const _ = (t) => {
|
|
116
117
|
console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
117
118
|
}, x = () => {
|
|
118
119
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
@@ -140,7 +141,7 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
140
141
|
variationId: o.variationId
|
|
141
142
|
});
|
|
142
143
|
const e = o.template, s = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
143
|
-
|
|
144
|
+
k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
144
145
|
const pe = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), fe = {
|
|
145
146
|
partnerName: o.partnerName,
|
|
146
147
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
@@ -157,14 +158,14 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
157
158
|
};
|
|
158
159
|
n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
|
|
159
160
|
const ge = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
160
|
-
|
|
161
|
+
P(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
|
|
161
162
|
const be = {
|
|
162
163
|
preselectedDynamicContentList: B,
|
|
163
164
|
onReady: () => {
|
|
164
165
|
console.debug("guido:ready"), i("ready");
|
|
165
166
|
}
|
|
166
167
|
};
|
|
167
|
-
f = U(), await
|
|
168
|
+
f = U(), await I(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
|
|
168
169
|
} catch (e) {
|
|
169
170
|
console.error("Failed to initialize Stripo editor:", e), r.markFailed();
|
|
170
171
|
}
|
|
@@ -182,8 +183,8 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
182
183
|
}
|
|
183
184
|
document.addEventListener("dynamic-content:open", S);
|
|
184
185
|
}), Ee(() => {
|
|
185
|
-
if (
|
|
186
|
-
xe();
|
|
186
|
+
if (_e(), Pe(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
|
|
187
|
+
xe(), ot();
|
|
187
188
|
try {
|
|
188
189
|
const t = C();
|
|
189
190
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
@@ -201,15 +202,15 @@ const Vt = /* @__PURE__ */ Se({
|
|
|
201
202
|
}), o.reset();
|
|
202
203
|
}), J({
|
|
203
204
|
dynamicContent: {
|
|
204
|
-
insert:
|
|
205
|
+
insert: _,
|
|
205
206
|
close: x
|
|
206
207
|
},
|
|
207
208
|
hasChanges: p,
|
|
208
209
|
saveSilent: M,
|
|
209
|
-
setLoading:
|
|
210
|
-
}), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore:
|
|
210
|
+
setLoading: L
|
|
211
|
+
}), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: k, moduleDynamicContentStore: re, props: c, configStore: o, editorStore: d, previewStore: ie, hasChanges: p, isTestPartner: se, isSaveValidationEnabled: ae, loadRollout: T, showToaster: w, trans: F, saveSilent: M, setLoading: L, emit: i, buildMetadata: b, initPlugin: I, preloadRuntime: R, runExclusive: O, beginMount: U, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: P, noHeader: ce, isRrsEnabled: de, isExternalDisplayConditionsEnabled: me, isLegacyUnsubscribeConversionEnabled: le, hasAssignedStrategy: ue, insertDynamicContent: _, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Be, AuthErrorModal: He, Toaster: Ve, FilterSelectionDrawer: We, HeaderWrapper: $e, LoadingWrapper: Ge, SaveAsTemplateDrawer: ze, UnsubscribeWrapper: qe, ValidationErrorDrawer: Ke };
|
|
211
212
|
}
|
|
212
213
|
});
|
|
213
214
|
export {
|
|
214
|
-
|
|
215
|
+
$t as default
|
|
215
216
|
};
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./DesktopPreview.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var s = this, e = s._self._c,
|
|
6
|
-
return e("div", { staticClass: "desktop-preview-wrapper" }, [e("p", { staticClass: "f-s-1 f-w-600 l-h-1 t-t-u t-c-53 mb-6 l-s-5" }, [s._v(" " + s._s(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var a = function() {
|
|
5
|
+
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
+
return e("div", { staticClass: "desktop-preview-wrapper" }, [e("p", { staticClass: "f-s-1 f-w-600 l-h-1 t-t-u t-c-53 mb-6 l-s-5" }, [s._v(" " + s._s(t.trans("email-editor.desktop-preview")) + " ")]), e("div", { ref: "containerRef", staticClass: "desktop-preview d-f f-d-c o-h s-1" }, [e(t.DesktopBrowserHeader), e("div", { staticClass: "desktop-preview__content d-f f-g-1 o-h b-c-5 min-h-0" }, [e("div", { staticClass: "f-g-1 h-1 o-h b-c-4 min-w-0" }, [t.isContainerReady ? e("iframe", { staticClass: "desktop-preview__iframe d-b w-1 h-1 b-c-4 bor-s-n", attrs: { sandbox: `
|
|
7
|
+
allow-same-origin
|
|
8
|
+
allow-popups
|
|
9
|
+
allow-forms
|
|
10
|
+
allow-scripts
|
|
11
|
+
allow-popups-to-escape-sandbox`, srcdoc: t.previewStore.previewHtml }, on: { load: t.onIframeLoad } }) : s._e()])])], 1)]);
|
|
12
|
+
}, i = [], n = /* @__PURE__ */ r(
|
|
13
|
+
o,
|
|
10
14
|
a,
|
|
15
|
+
i,
|
|
11
16
|
!1,
|
|
12
17
|
null,
|
|
13
|
-
"
|
|
18
|
+
"cf946232"
|
|
14
19
|
);
|
|
15
|
-
const
|
|
20
|
+
const f = n.exports;
|
|
16
21
|
export {
|
|
17
|
-
|
|
22
|
+
f as default
|
|
18
23
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "./ContentView.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var t = this, s = t._self._c,
|
|
3
|
+
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var o = function() {
|
|
5
|
+
var t = this, s = t._self._c, a = t._self._setupProxy;
|
|
6
6
|
return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
|
|
7
7
|
return t.$emit("back-to-inbox");
|
|
8
|
-
} } }, [s(
|
|
9
|
-
}, i = [],
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
} } }, [s(a.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [t._v(t._s(a.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(a.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(a.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("div", { staticClass: "iframe-wrapper f-g-1 o-h" }, [s("iframe", { ref: "iframeRef", staticClass: "iframe-scaled d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: a.previewStore.previewHtml }, on: { load: a.onLoad } })])]);
|
|
9
|
+
}, i = [], r = /* @__PURE__ */ n(
|
|
10
|
+
e,
|
|
11
|
+
o,
|
|
12
12
|
i,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"f255b2bb"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const d = r.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
d as default
|
|
20
20
|
};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as b, defineAsyncComponent as T, ref as w, computed as o, watch as N } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { DOTTED_DATE_LOCALE as
|
|
6
|
-
import { URLS as
|
|
7
|
-
import { ToasterTypeOptions as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import { commitStrategyChange as
|
|
10
|
-
import
|
|
11
|
-
import { formatShortDate as
|
|
12
|
-
import { asText as
|
|
13
|
-
import { escapeHtml as
|
|
14
|
-
import { InSkeleton as
|
|
15
|
-
const it = /* @__PURE__ */
|
|
3
|
+
import { useToaster as R } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as P } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as U } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as G } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as M } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { commitStrategyChange as E } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
|
|
10
|
+
import $ from "./StrategyInfoBoxContent.vue.js";
|
|
11
|
+
import { formatShortDate as z } from "../../../../utils/dateUtil.js";
|
|
12
|
+
import { asText as D } from "../../../../utils/genericUtil.js";
|
|
13
|
+
import { escapeHtml as H } from "../../../../utils/htmlEscape.js";
|
|
14
|
+
import { InSkeleton as O } from "@useinsider/design-system-vue";
|
|
15
|
+
const it = /* @__PURE__ */ b({
|
|
16
16
|
__name: "AssignStrategyDrawer",
|
|
17
17
|
setup(F) {
|
|
18
|
-
const
|
|
19
|
-
render: (s) => s(
|
|
20
|
-
}),
|
|
21
|
-
loader: async () => (await
|
|
22
|
-
loadingComponent:
|
|
18
|
+
const g = () => import("@useinsider/design-system-organisms"), p = (t, r) => ({
|
|
19
|
+
render: (s) => s(O, { props: { sizing: { width: t, height: r } } })
|
|
20
|
+
}), I = T({
|
|
21
|
+
loader: async () => (await g()).OrgStrategyDetailModal,
|
|
22
|
+
loadingComponent: p(480, 240),
|
|
23
23
|
delay: 0
|
|
24
|
-
}),
|
|
25
|
-
loader: async () => (await
|
|
26
|
-
}), i = "guido-edit-strategy-",
|
|
27
|
-
|
|
24
|
+
}), h = T({
|
|
25
|
+
loader: async () => (await g()).OrgStrategyDropdown
|
|
26
|
+
}), i = "guido-edit-strategy-", x = { width: 480, height: 42 }, a = P(), e = M(), { showToaster: c } = R(), n = w(null), d = "legacy", l = w(!1), A = o(() => e.strategiesLoading || e.legacyConversionLoading), C = o(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: G.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
27
|
+
N(() => e.assignStrategyDrawerStatus, (t) => {
|
|
28
28
|
if (!t)
|
|
29
29
|
return;
|
|
30
30
|
const { strategyId: r } = e.recommendationConfigs;
|
|
31
|
-
n.value = r || (e.isLegacyStrategyBlock ?
|
|
31
|
+
n.value = r || (e.isLegacyStrategyBlock ? d : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
|
|
32
32
|
c({
|
|
33
|
-
type:
|
|
33
|
+
type: u.Error,
|
|
34
34
|
message: a("discovery-strategy.error-description")
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
-
const
|
|
39
|
-
const r =
|
|
38
|
+
const f = (t) => {
|
|
39
|
+
const r = D(t.updated_at || t.created_at);
|
|
40
40
|
if (!r)
|
|
41
41
|
return "";
|
|
42
|
-
const s =
|
|
42
|
+
const s = z(r, U);
|
|
43
43
|
return a("recommendation-strategy.last-updated-on", { value: s });
|
|
44
|
-
},
|
|
44
|
+
}, S = o(() => ({
|
|
45
45
|
text: a("ds-steps.legacy-strategy"),
|
|
46
|
-
value:
|
|
46
|
+
value: d,
|
|
47
47
|
hidden: !0
|
|
48
|
-
})),
|
|
48
|
+
})), m = o(() => e.strategies.map((t) => ({
|
|
49
49
|
text: t.name,
|
|
50
50
|
value: t.strategy_id,
|
|
51
51
|
infoBoxProps: {
|
|
@@ -54,10 +54,10 @@ const it = /* @__PURE__ */ N({
|
|
|
54
54
|
variant: "information",
|
|
55
55
|
size: "small",
|
|
56
56
|
class: "assign-strategy-info-box",
|
|
57
|
-
titleText:
|
|
57
|
+
titleText: H(D(t.name)),
|
|
58
58
|
descriptionStatus: !0,
|
|
59
|
-
descriptionText:
|
|
60
|
-
slot:
|
|
59
|
+
descriptionText: f(t),
|
|
60
|
+
slot: $,
|
|
61
61
|
slotProps: { strategy: t },
|
|
62
62
|
// The info box drops the option's value/text, so the id is the only channel
|
|
63
63
|
// that can carry the strategy back to the click handler.
|
|
@@ -70,17 +70,17 @@ const it = /* @__PURE__ */ N({
|
|
|
70
70
|
icon: "line-open-website"
|
|
71
71
|
}]
|
|
72
72
|
}
|
|
73
|
-
}))),
|
|
74
|
-
var
|
|
75
|
-
const r = (
|
|
73
|
+
}))), L = o(() => e.isLegacyStrategyBlock ? [S.value, ...m.value] : m.value), B = (t) => {
|
|
74
|
+
var _;
|
|
75
|
+
const r = (_ = t == null ? void 0 : t.id) != null && _.startsWith(i) ? t.id.slice(i.length) : "";
|
|
76
76
|
if (!r)
|
|
77
77
|
return;
|
|
78
|
-
const s = e.currentRecommendationId,
|
|
79
|
-
e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null),
|
|
80
|
-
},
|
|
78
|
+
const s = e.currentRecommendationId, y = e.recommendationConfigs.strategyId === r;
|
|
79
|
+
e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null), y && (e.removeStrategy(), s !== null && E(s, "Removed recommendation strategy")));
|
|
80
|
+
}, v = o(() => {
|
|
81
81
|
const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
|
|
82
82
|
return t ? { ...t, fallback_config: null } : null;
|
|
83
|
-
}),
|
|
83
|
+
}), k = o(() => ({
|
|
84
84
|
primaryButton: {
|
|
85
85
|
styling: "solid",
|
|
86
86
|
type: "primary",
|
|
@@ -92,10 +92,10 @@ const it = /* @__PURE__ */ N({
|
|
|
92
92
|
labelText: a("products.cancel")
|
|
93
93
|
}
|
|
94
94
|
}));
|
|
95
|
-
return { __sfc: !0, loadOrganisms:
|
|
95
|
+
return { __sfc: !0, loadOrganisms: g, skeleton: p, OrgStrategyDetailModal: I, OrgStrategyDropdown: h, EDIT_BUTTON_ID_PREFIX: i, SELECT_SKELETON_SIZING: x, trans: a, store: e, showToaster: c, selectedStrategyId: n, LEGACY_OPTION_VALUE: d, showSelectionError: l, strategiesLoading: A, drawerDescription: C, lastUpdatedText: f, legacyStrategyOption: S, remoteStrategyOptions: m, strategyOptions: L, onInfoBoxButtonClick: B, selectedStrategy: v, footerButtonGroupOptions: k, closeDrawer: () => {
|
|
96
96
|
e.closeAssignStrategyDrawer();
|
|
97
97
|
}, assignStrategy: async () => {
|
|
98
|
-
const t =
|
|
98
|
+
const t = v.value;
|
|
99
99
|
if (!t) {
|
|
100
100
|
l.value = !0;
|
|
101
101
|
return;
|
|
@@ -103,24 +103,24 @@ const it = /* @__PURE__ */ N({
|
|
|
103
103
|
let r = "";
|
|
104
104
|
try {
|
|
105
105
|
r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
|
|
106
|
-
} catch (
|
|
107
|
-
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed",
|
|
106
|
+
} catch (y) {
|
|
107
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", y);
|
|
108
108
|
}
|
|
109
109
|
if (!r) {
|
|
110
110
|
c({
|
|
111
|
-
type:
|
|
112
|
-
message: a("email-editor.strategy-assign-failed", { strategyName:
|
|
111
|
+
type: u.Error,
|
|
112
|
+
message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
113
113
|
});
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
const s = e.currentRecommendationId;
|
|
117
117
|
e.assignStrategy(t), c({
|
|
118
|
-
type:
|
|
119
|
-
message: a("email-editor.strategy-assigned-success", { strategyName:
|
|
120
|
-
}), e.closeAssignStrategyDrawer(), s !== null && await
|
|
118
|
+
type: u.Success,
|
|
119
|
+
message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
120
|
+
}), e.closeAssignStrategyDrawer(), s !== null && await E(s, "Assigned recommendation strategy");
|
|
121
121
|
}, onSelect: (t) => {
|
|
122
122
|
n.value = t.value, l.value = !1;
|
|
123
|
-
}, InSkeleton:
|
|
123
|
+
}, InSkeleton: O };
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
export {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ToasterTypeOptions as a } from "../enums/toaster.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const x = () => {
|
|
2
|
+
import { useActionsApi as m } from "./useActionsApi.js";
|
|
3
|
+
import { useHtmlCompiler as p } from "./useHtmlCompiler.js";
|
|
4
|
+
import { useToaster as d } from "./useToaster.js";
|
|
5
|
+
const H = () => {
|
|
7
6
|
const c = (s, o, n) => {
|
|
8
7
|
const i = new Blob([s], { type: n }), t = URL.createObjectURL(i), e = document.createElement("a");
|
|
9
8
|
e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
|
|
@@ -12,7 +11,7 @@ const x = () => {
|
|
|
12
11
|
return `${s}_${n}-${i}-${t}_${e}-${r}.html`;
|
|
13
12
|
};
|
|
14
13
|
return { exportHtml: async (s = !0) => {
|
|
15
|
-
const { getCompiledEmail: o } =
|
|
14
|
+
const { getCompiledEmail: o } = m(), { showToaster: n } = d(), { compileHtml: i } = p();
|
|
16
15
|
try {
|
|
17
16
|
const { html: t } = await o();
|
|
18
17
|
if (t) {
|
|
@@ -37,11 +36,11 @@ const x = () => {
|
|
|
37
36
|
const e = t instanceof Error ? t.message : String(t);
|
|
38
37
|
n({
|
|
39
38
|
type: a.Error,
|
|
40
|
-
message: `Error compiling email: ${
|
|
39
|
+
message: `Error compiling email: ${e}`
|
|
41
40
|
});
|
|
42
41
|
}
|
|
43
42
|
} };
|
|
44
43
|
};
|
|
45
44
|
export {
|
|
46
|
-
|
|
45
|
+
H as useExport
|
|
47
46
|
};
|
|
@@ -8,8 +8,8 @@ import { socialCompilerRules as H } from "../config/compiler/socialCompilerRules
|
|
|
8
8
|
import { unsubscribeCompilerRules as b } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
9
9
|
import { createHtmlCompiler as n } from "../utils/htmlCompiler.js";
|
|
10
10
|
import { computed as p } from "vue";
|
|
11
|
-
import { useConfig as
|
|
12
|
-
const
|
|
11
|
+
import { useConfig as k } from "./useConfig.js";
|
|
12
|
+
const x = /* @__PURE__ */ new Set([
|
|
13
13
|
// URL/tag encoding fixes — keep merge-tag and placeholder integrity intact.
|
|
14
14
|
"fix-url-encoding-start",
|
|
15
15
|
"fix-url-encoding-end",
|
|
@@ -31,6 +31,8 @@ const A = /* @__PURE__ */ new Set([
|
|
|
31
31
|
"add-universal-link-flags",
|
|
32
32
|
// Coupon placeholder replacement (only present when liquidSyntax is enabled).
|
|
33
33
|
"liquid-coupon-code",
|
|
34
|
+
// Liquid only: swaps the quotes inside {{ }} of href/src values, attribute-value edit only.
|
|
35
|
+
"liquid-single-quote-links",
|
|
34
36
|
// Pongo only: collapses line breaks inside {% %} tags, which pongo2 cannot parse in AMP either.
|
|
35
37
|
"pongo-single-line-tags",
|
|
36
38
|
// Editor-only attribute strip — AMP4EMAIL has no `contenteditable`, so leaving
|
|
@@ -38,29 +40,29 @@ const A = /* @__PURE__ */ new Set([
|
|
|
38
40
|
"remove-contenteditable",
|
|
39
41
|
"remove-dc-pending-marker"
|
|
40
42
|
]), M = () => {
|
|
41
|
-
const { compiler:
|
|
42
|
-
var
|
|
43
|
-
const e = ((
|
|
43
|
+
const { compiler: m, isFeatureEnabled: u, partner: a } = k(), c = p(() => {
|
|
44
|
+
var i, l;
|
|
45
|
+
const e = ((i = m.value) == null ? void 0 : i.customRules) || [];
|
|
44
46
|
return [
|
|
45
|
-
...!!((l =
|
|
47
|
+
...!!((l = m.value) != null && l.ignoreDefaultRules) ? [] : d,
|
|
46
48
|
...C,
|
|
47
49
|
...b,
|
|
48
50
|
...f,
|
|
49
51
|
...R,
|
|
50
52
|
...H,
|
|
51
|
-
...
|
|
52
|
-
...e.map((
|
|
53
|
-
...
|
|
54
|
-
priority:
|
|
53
|
+
...u("liquidSyntax") ? g : v,
|
|
54
|
+
...e.map((t, o) => ({
|
|
55
|
+
...t,
|
|
56
|
+
priority: t.priority + 1e3 + o
|
|
55
57
|
// Ensure additional rules run after default rules
|
|
56
58
|
}))
|
|
57
59
|
];
|
|
58
60
|
}), r = p(() => {
|
|
59
|
-
var
|
|
60
|
-
const e = c.value, s = n(e),
|
|
61
|
+
var t;
|
|
62
|
+
const e = c.value, s = n(e), i = n(e.filter((o) => x.has(o.id))), l = (t = a.value) == null ? void 0 : t.fallbackFont;
|
|
61
63
|
return {
|
|
62
64
|
compileHtml: (o) => s.compile(o, void 0, l),
|
|
63
|
-
compileAmpHtml: (o) =>
|
|
65
|
+
compileAmpHtml: (o) => i.compile(o, void 0, l)
|
|
64
66
|
};
|
|
65
67
|
});
|
|
66
68
|
return { compileHtml: (e) => r.value.compileHtml(e), compileAmpHtml: (e) => r.value.compileAmpHtml(e) };
|