@useinsider/guido 3.23.0-beta.9f6bfbf → 3.23.0-beta.df89564
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 -2
- package/dist/@types/config/schemas.js +15 -17
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +56 -58
- package/dist/composables/useModuleRepair.js +12 -14
- package/dist/composables/useStripo.js +70 -70
- package/dist/config/migrator/index.js +15 -16
- package/dist/extensions/Blocks/Items/block.js +77 -115
- package/dist/extensions/Blocks/Items/constants/currency.js +14 -59
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +22 -33
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +51 -62
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +17 -18
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +31 -42
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +120 -141
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +1 -1
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/items.css.js +0 -19
- package/dist/extensions/Blocks/Items/settingsPanel.js +25 -34
- package/dist/extensions/Blocks/Items/template.js +212 -250
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +0 -1
- package/dist/guido.css +1 -1
- 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/composables/useStripo.d.ts +1 -1
- package/dist/src/config/migrator/index.d.ts +1 -4
- package/dist/src/extensions/Blocks/Items/block.d.ts +9 -6
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +0 -32
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -4
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +0 -12
- package/dist/src/stores/config.d.ts +0 -20
- package/dist/src/utils/itemsCurrencyRepair.d.ts +1 -5
- package/dist/utils/itemsCurrencyRepair.js +24 -29
- package/dist/utils/pairProductVariables.js +99 -119
- package/package.json +1 -1
- package/dist/config/migrator/itemsPriceFormatMigrator.js +0 -20
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +0 -145
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +0 -185
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +0 -23
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +0 -61
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
|
|
@@ -166,7 +171,6 @@ const config: GuidoConfigInput = {
|
|
|
166
171
|
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).
|
|
167
172
|
allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
|
|
168
173
|
reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
|
|
169
|
-
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).
|
|
170
174
|
},
|
|
171
175
|
|
|
172
176
|
// Optional: Callbacks
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
1
|
+
import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
|
|
2
2
|
import { object as a, number as s, optional as e, string as t, picklist as m, pipe as i, minLength as b, custom as k, boolean as o, array as c, transform as y, unknown as r, record as g, fallback as R, literal as u, looseObject as C, variant as I, union as h, lazy as T } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const p = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
@@ -76,18 +76,18 @@ const p = {
|
|
|
76
76
|
value: t()
|
|
77
77
|
})
|
|
78
78
|
)
|
|
79
|
-
}),
|
|
79
|
+
}), S = T(() => C({
|
|
80
80
|
text: e(t()),
|
|
81
81
|
// eslint-disable-next-line camelcase -- backend field name
|
|
82
82
|
tag_text: e(t()),
|
|
83
83
|
value: e(t()),
|
|
84
|
-
children: e(c(
|
|
84
|
+
children: e(c(S)),
|
|
85
85
|
// eslint-disable-next-line camelcase -- backend field name
|
|
86
|
-
select_items: e(c(
|
|
87
|
-
})),
|
|
86
|
+
select_items: e(c(S))
|
|
87
|
+
})), N = g(
|
|
88
88
|
t(),
|
|
89
|
-
R(c(
|
|
90
|
-
),
|
|
89
|
+
R(c(S), [])
|
|
90
|
+
), P = C({
|
|
91
91
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
92
92
|
id: e(s()),
|
|
93
93
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
@@ -140,7 +140,7 @@ const p = {
|
|
|
140
140
|
* strategy, currency, locale, and layout data.
|
|
141
141
|
*/
|
|
142
142
|
recommendationConfigs: e(
|
|
143
|
-
g(t(),
|
|
143
|
+
g(t(), P),
|
|
144
144
|
{}
|
|
145
145
|
)
|
|
146
146
|
}), x = a({
|
|
@@ -159,7 +159,7 @@ const p = {
|
|
|
159
159
|
* (first) partner's leaf attributes into the label→token map that repairs
|
|
160
160
|
* label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
|
|
161
161
|
*/
|
|
162
|
-
dynamicContentList: e(
|
|
162
|
+
dynamicContentList: e(N, {}),
|
|
163
163
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
164
164
|
customFieldAttributes: e(c(t()), []),
|
|
165
165
|
/** Selected unsubscribe page IDs */
|
|
@@ -210,9 +210,9 @@ const p = {
|
|
|
210
210
|
/** Email header settings */
|
|
211
211
|
emailHeader: e(D, { senderName: "", subject: "" }),
|
|
212
212
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
213
|
-
savedModulesFolderName: e(t(),
|
|
213
|
+
savedModulesFolderName: e(t(), f.SAVED_MODULES),
|
|
214
214
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
215
|
-
defaultModulesFolderName: e(t(),
|
|
215
|
+
defaultModulesFolderName: e(t(), f.DEFAULT_MODULES)
|
|
216
216
|
}), F = a({
|
|
217
217
|
/** Whether to show the header bar */
|
|
218
218
|
showHeader: e(o(), !0),
|
|
@@ -243,9 +243,7 @@ const p = {
|
|
|
243
243
|
linkTrackingIds: e(o(), !1),
|
|
244
244
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
245
245
|
allowSaveWithErrors: e(o(), !0),
|
|
246
|
-
reusableRecommendationStrategy: e(o(), !1)
|
|
247
|
-
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
248
|
-
itemsPriceFormatting: e(o(), !1)
|
|
246
|
+
reusableRecommendationStrategy: e(o(), !1)
|
|
249
247
|
}), w = m([
|
|
250
248
|
"amp-accordion",
|
|
251
249
|
"amp-carousel",
|
|
@@ -368,8 +366,8 @@ export {
|
|
|
368
366
|
B as CustomBlockTypeSchema,
|
|
369
367
|
G as CustomRuleSchema,
|
|
370
368
|
w as DefaultBlockTypeSchema,
|
|
371
|
-
|
|
372
|
-
|
|
369
|
+
N as DynamicContentListSchema,
|
|
370
|
+
S as DynamicContentNodeSchema,
|
|
373
371
|
M as DynamicContentSchema,
|
|
374
372
|
O as EditorSchema,
|
|
375
373
|
D as EmailHeaderSchema,
|
|
@@ -377,7 +375,7 @@ export {
|
|
|
377
375
|
U as FeaturesSchema,
|
|
378
376
|
K as GuidoConfigSchema,
|
|
379
377
|
A as IdentitySchema,
|
|
380
|
-
|
|
378
|
+
P as LegacyRecommendationConfigSchema,
|
|
381
379
|
p as MessageType,
|
|
382
380
|
E as PartnerSchema,
|
|
383
381
|
l as ProductType,
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { startEditorOpenMetrics as
|
|
1
|
+
import { defineComponent as de, defineAsyncComponent as l, ref as W, computed as f, watch as G, onMounted as me, onUnmounted as le } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ue } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as pe } from "../composables/useEditorLock.js";
|
|
4
|
+
import { startEditorOpenMetrics as fe } from "../composables/useEditorOpenMetrics.js";
|
|
5
5
|
import { provideGuidoActions as ye } from "../composables/useGuidoActions.js";
|
|
6
|
-
import { useGuidoStateBridge as
|
|
7
|
-
import { usePartner as
|
|
8
|
-
import { useSaveValidationRollout as
|
|
9
|
-
import { useStripo as
|
|
10
|
-
import { useTimerClone as
|
|
11
|
-
import { migrate as
|
|
6
|
+
import { useGuidoStateBridge as ge } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { usePartner as ve } from "../composables/usePartner.js";
|
|
8
|
+
import { useSaveValidationRollout as Se } from "../composables/useSaveValidationRollout.js";
|
|
9
|
+
import { useStripo as be } from "../composables/useStripo.js";
|
|
10
|
+
import { useTimerClone as he } from "../composables/useTimerClone.js";
|
|
11
|
+
import { migrate as Ee } from "../config/migrator/index.js";
|
|
12
12
|
import { ModuleFolderDefaults as H } from "../enums/defaults.js";
|
|
13
|
-
import { RIBBON_SELECTOR as
|
|
13
|
+
import { RIBBON_SELECTOR as we } from "../enums/onboarding.js";
|
|
14
14
|
import { useRecommendationExtensionStore as V, disposeStrategyPageReturnListeners as ke } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
15
15
|
import { disposeUnsubscribeListeners as Ce } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
16
16
|
import De from "./organisms/AutoSaveController.vue.js";
|
|
17
17
|
import Ie from "./organisms/base/AuthErrorModal.vue.js";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import { useStripoApi as
|
|
18
|
+
import Fe from "./organisms/base/Toaster.vue.js";
|
|
19
|
+
import Me from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
20
|
+
import Re from "./organisms/header/HeaderWrapper.vue.js";
|
|
21
|
+
import Te from "./organisms/LoadingWrapper.vue.js";
|
|
22
|
+
import Le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
23
|
+
import Ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
24
|
+
import Ne from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
25
|
+
import { useStripoApi as _e } from "../services/stripoApi.js";
|
|
26
26
|
import { useConfigStore as Ae } from "../stores/config.js";
|
|
27
27
|
import { useDynamicContentStore as Be } from "../stores/dynamic-content.js";
|
|
28
28
|
import { useEditorStore as w } from "../stores/editor.js";
|
|
29
29
|
import { usePreviewStore as Oe } from "../stores/preview.js";
|
|
30
|
-
import { useSaveValidationStore as
|
|
31
|
-
import { useTemplateStore as
|
|
32
|
-
import { useUnsubscribeStore as
|
|
30
|
+
import { useSaveValidationStore as Pe } from "../stores/save-validation.js";
|
|
31
|
+
import { useTemplateStore as xe } from "../stores/template.js";
|
|
32
|
+
import { useUnsubscribeStore as We } from "../stores/unsubscribe.js";
|
|
33
33
|
import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
|
|
34
|
-
const
|
|
34
|
+
const ht = /* @__PURE__ */ de({
|
|
35
35
|
__name: "Guido",
|
|
36
36
|
props: {
|
|
37
37
|
config: null,
|
|
@@ -39,7 +39,7 @@ const Et = /* @__PURE__ */ me({
|
|
|
39
39
|
},
|
|
40
40
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
41
41
|
setup(z, { expose: q, emit: a }) {
|
|
42
|
-
const s = z, n =
|
|
42
|
+
const s = z, n = fe(), K = l(
|
|
43
43
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
44
44
|
), j = l(
|
|
45
45
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
@@ -49,15 +49,15 @@ const Et = /* @__PURE__ */ me({
|
|
|
49
49
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
50
50
|
), X = l(
|
|
51
51
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
52
|
-
),
|
|
52
|
+
), k = W(), y = W(), g = Be(), C = We(), o = Ae();
|
|
53
53
|
s.ready && o.init(s.config);
|
|
54
|
-
const d = w(), Y = Oe(), u = f(() => d.hasChanges), { isTestPartner: Z } =
|
|
54
|
+
const d = w(), Y = Oe(), u = f(() => d.hasChanges), { isTestPartner: Z } = ve(), { isEnabled: ee, loadRollout: D } = Se(), I = () => {
|
|
55
55
|
var t;
|
|
56
|
-
return (t =
|
|
57
|
-
},
|
|
56
|
+
return (t = k.value) == null ? void 0 : t.handleSave(!0);
|
|
57
|
+
}, F = (t) => {
|
|
58
58
|
d.loadingStatus = t;
|
|
59
59
|
};
|
|
60
|
-
|
|
60
|
+
ue(), ge();
|
|
61
61
|
const v = () => {
|
|
62
62
|
var t, e;
|
|
63
63
|
return {
|
|
@@ -68,9 +68,9 @@ const Et = /* @__PURE__ */ me({
|
|
|
68
68
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || H.SAVED_MODULES,
|
|
69
69
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || H.DEFAULT_MODULES
|
|
70
70
|
};
|
|
71
|
-
}, { initPlugin: M, preloadRuntime: R } =
|
|
71
|
+
}, { initPlugin: M, preloadRuntime: R } = be(n), { runExclusive: T, beginMount: L, isCurrentMount: S } = pe();
|
|
72
72
|
let p = 0;
|
|
73
|
-
const { getDefaultTemplate: U } =
|
|
73
|
+
const { getDefaultTemplate: U } = _e(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = he(), te = f(() => {
|
|
74
74
|
var t;
|
|
75
75
|
return !((t = o.ui) != null && t.showHeader);
|
|
76
76
|
}), oe = f(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = f(
|
|
@@ -91,9 +91,9 @@ const Et = /* @__PURE__ */ me({
|
|
|
91
91
|
console.debug("guido:test-email:click"), a("test-email:click");
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
const
|
|
95
|
-
console.debug("dynamic-content:close", t),
|
|
96
|
-
},
|
|
94
|
+
const A = (t) => {
|
|
95
|
+
console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
96
|
+
}, B = () => {
|
|
97
97
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
98
98
|
};
|
|
99
99
|
G(() => u.value, () => {
|
|
@@ -106,8 +106,8 @@ const Et = /* @__PURE__ */ me({
|
|
|
106
106
|
let c = null;
|
|
107
107
|
const h = () => {
|
|
108
108
|
var e;
|
|
109
|
-
const t = document.querySelector(
|
|
110
|
-
(e =
|
|
109
|
+
const t = document.querySelector(we);
|
|
110
|
+
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
111
111
|
}, E = async () => {
|
|
112
112
|
var t;
|
|
113
113
|
n.mark("host_ready");
|
|
@@ -118,40 +118,38 @@ const Et = /* @__PURE__ */ me({
|
|
|
118
118
|
templateId: o.templateId,
|
|
119
119
|
variationId: o.variationId
|
|
120
120
|
});
|
|
121
|
-
const e = o.template, i = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "",
|
|
122
|
-
|
|
123
|
-
const ne = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {},
|
|
121
|
+
const e = o.template, i = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", O = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
122
|
+
C.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
123
|
+
const ne = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, P = o.isFeatureEnabled("linkTrackingIds"), ae = {
|
|
124
124
|
partnerName: o.partnerName,
|
|
125
125
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
126
126
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
127
|
-
},
|
|
128
|
-
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
129
|
-
}, x = (de) => n.timed(
|
|
127
|
+
}, x = (ce) => n.timed(
|
|
130
128
|
"migration",
|
|
131
|
-
() =>
|
|
129
|
+
() => Ee(ce, ne, ae)
|
|
132
130
|
);
|
|
133
131
|
let r = {
|
|
134
132
|
html: i && await x(i),
|
|
135
133
|
css: m
|
|
136
134
|
};
|
|
137
135
|
r.html || (r = await n.timed("default_template", () => U()), r.html = await x(r.html));
|
|
138
|
-
const
|
|
139
|
-
_(r.html) && (r.html = await n.timed("timer_clone", () => N(r.html))),
|
|
140
|
-
const
|
|
141
|
-
preselectedDynamicContentList:
|
|
136
|
+
const ie = P ? $(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
137
|
+
_(r.html) && (r.html = await n.timed("timer_clone", () => N(r.html))), P && (d.trackIdSessionFloor = Math.max(ie, $(r.html)));
|
|
138
|
+
const se = {
|
|
139
|
+
preselectedDynamicContentList: O,
|
|
142
140
|
onReady: () => {
|
|
143
141
|
console.debug("guido:ready"), a("ready");
|
|
144
142
|
}
|
|
145
143
|
};
|
|
146
|
-
p = L(), await M(r, v(),
|
|
144
|
+
p = L(), await M(r, v(), se, r.html !== i), g.selectedDynamicContentList = O;
|
|
147
145
|
} catch (e) {
|
|
148
146
|
console.error("Failed to initialize Stripo editor:", e), n.markFailed();
|
|
149
147
|
}
|
|
150
148
|
};
|
|
151
|
-
return
|
|
149
|
+
return me(async () => {
|
|
152
150
|
var e;
|
|
153
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), V().$reset(), w().$reset(),
|
|
154
|
-
const t = (e =
|
|
151
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), V().$reset(), w().$reset(), xe().$reset(), Pe().$reset(), D(), h();
|
|
152
|
+
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
155
153
|
if (t && (c = new ResizeObserver(h), c.observe(t)), R(), s.ready)
|
|
156
154
|
await E();
|
|
157
155
|
else {
|
|
@@ -160,7 +158,7 @@ const Et = /* @__PURE__ */ me({
|
|
|
160
158
|
});
|
|
161
159
|
}
|
|
162
160
|
document.addEventListener("dynamic-content:open", b);
|
|
163
|
-
}),
|
|
161
|
+
}), le(() => {
|
|
164
162
|
if (Ce(), ke(), n.dispose(), c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", b), S(p))
|
|
165
163
|
try {
|
|
166
164
|
w().isStripoInitialized = !1;
|
|
@@ -177,15 +175,15 @@ const Et = /* @__PURE__ */ me({
|
|
|
177
175
|
}), o.reset();
|
|
178
176
|
}), q({
|
|
179
177
|
dynamicContent: {
|
|
180
|
-
insert:
|
|
181
|
-
close:
|
|
178
|
+
insert: A,
|
|
179
|
+
close: B
|
|
182
180
|
},
|
|
183
181
|
hasChanges: u,
|
|
184
|
-
saveSilent:
|
|
185
|
-
setLoading:
|
|
186
|
-
}), { __sfc: !0, openMetrics: n, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef:
|
|
182
|
+
saveSilent: I,
|
|
183
|
+
setLoading: F
|
|
184
|
+
}), { __sfc: !0, openMetrics: n, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, LegacyStrategyUpdatedModal: X, headerWrapperRef: k, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: C, props: s, configStore: o, editorStore: d, previewStore: Y, hasChanges: u, isTestPartner: Z, isSaveValidationEnabled: ee, loadRollout: D, saveSilent: I, setLoading: F, emit: a, buildMetadata: v, initPlugin: M, preloadRuntime: R, runExclusive: T, beginMount: L, isCurrentMount: S, mountGeneration: p, getDefaultTemplate: U, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: te, isRrsEnabled: oe, hasAssignedStrategy: re, insertDynamicContent: A, closeDynamicContent: B, handleDynamicContentOpen: b, ribbonObserver: c, updateRibbonOffset: h, startEditor: E, AutoSaveController: De, AuthErrorModal: Ie, Toaster: Fe, FilterSelectionDrawer: Me, HeaderWrapper: Re, LoadingWrapper: Te, SaveAsTemplateDrawer: Le, UnsubscribeWrapper: Ue, ValidationErrorDrawer: Ne };
|
|
187
185
|
}
|
|
188
186
|
});
|
|
189
187
|
export {
|
|
190
|
-
|
|
188
|
+
ht as default
|
|
191
189
|
};
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
1
|
+
import { useConfig as C } from "./useConfig.js";
|
|
2
|
+
import { useToaster as T } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as g } from "./useTranslations.js";
|
|
4
4
|
import { ToasterTypeOptions as D } from "../enums/toaster.js";
|
|
5
5
|
import { buildDynamicContentLookup as f, convertModuleDynamicContent as h } from "../utils/dynamicContentConverter.js";
|
|
6
6
|
import { flattenDynamicContentList as O } from "../utils/genericUtil.js";
|
|
7
7
|
import { repairItemsCurrencyAttributes as M } from "../utils/itemsCurrencyRepair.js";
|
|
8
|
-
const N = "dynamic-content.unresolved-attributes-on-drop",
|
|
9
|
-
const { template: p, isFeatureEnabled:
|
|
8
|
+
const N = "dynamic-content.unresolved-attributes-on-drop", R = () => {
|
|
9
|
+
const { template: p, isFeatureEnabled: m } = C(), { showToaster: a } = T(), y = g();
|
|
10
10
|
return { handleModuleAdd: (e, o) => {
|
|
11
|
-
var
|
|
11
|
+
var s, l, u;
|
|
12
12
|
try {
|
|
13
13
|
if ((e == null ? void 0 : e.action) !== "ADD" && (e == null ? void 0 : e.action) !== "COPY")
|
|
14
14
|
return;
|
|
15
|
-
const t = (
|
|
15
|
+
const t = (s = o == null ? void 0 : o.getTargetNode) == null ? void 0 : s.call(o), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
|
|
16
16
|
if (!t || typeof r != "string")
|
|
17
17
|
return;
|
|
18
|
-
let n = M(r
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let m = [];
|
|
23
|
-
u.size > 0 && ({ html: n, unresolved: m } = h(n, u, s("liquidSyntax"))), n !== r && o.modifyHtml(t).replaceWith(n), m.length > 0 && a({
|
|
18
|
+
let n = M(r);
|
|
19
|
+
const c = f(O((u = p.value) == null ? void 0 : u.dynamicContentList));
|
|
20
|
+
let i = [];
|
|
21
|
+
c.size > 0 && ({ html: n, unresolved: i } = h(n, c, m("liquidSyntax"))), n !== r && o.modifyHtml(t).replaceWith(n), i.length > 0 && a({
|
|
24
22
|
type: D.Warning,
|
|
25
23
|
message: y(N)
|
|
26
24
|
});
|
|
@@ -31,5 +29,5 @@ const N = "dynamic-content.unresolved-attributes-on-drop", d = () => {
|
|
|
31
29
|
};
|
|
32
30
|
export {
|
|
33
31
|
N as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
|
|
34
|
-
|
|
32
|
+
R as useModuleRepair
|
|
35
33
|
};
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import { useModuleRepair as
|
|
7
|
-
import { useStripoEventHandler as
|
|
8
|
-
import { useStripoNotifications as
|
|
9
|
-
import { useToaster as
|
|
10
|
-
import { localePatch as
|
|
1
|
+
import { useActionsApi as N } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as j } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as z } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as v } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as $ } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useModuleRepair as G } from "./useModuleRepair.js";
|
|
7
|
+
import { useStripoEventHandler as X } from "./useStripoEventHandler.js";
|
|
8
|
+
import { useStripoNotifications as J } from "./useStripoNotifications.js";
|
|
9
|
+
import { useToaster as K } from "./useToaster.js";
|
|
10
|
+
import { localePatch as Q } from "../config/i18n/index.js";
|
|
11
11
|
import { en as B } from "../config/i18n/en/index.js";
|
|
12
|
-
import { ToasterTypeOptions as
|
|
13
|
-
import { useStripoApi as
|
|
14
|
-
import
|
|
15
|
-
import { useEditorStore as
|
|
16
|
-
import { buildMergeTagEntries as
|
|
17
|
-
import { getStripoRuntimeBaseUrl as
|
|
18
|
-
let d = null,
|
|
19
|
-
const
|
|
20
|
-
const { features: u, template: m, isFeatureEnabled: p } =
|
|
12
|
+
import { ToasterTypeOptions as W } from "../enums/toaster.js";
|
|
13
|
+
import { useStripoApi as Y } from "../services/stripoApi.js";
|
|
14
|
+
import Z from "../static/styles/customEditorStyle.css.js";
|
|
15
|
+
import { useEditorStore as T } from "../stores/editor.js";
|
|
16
|
+
import { buildMergeTagEntries as ee, flattenDynamicContentList as te } from "../utils/genericUtil.js";
|
|
17
|
+
import { getStripoRuntimeBaseUrl as oe } from "../utils/stripoRuntime.js";
|
|
18
|
+
let d = null, F = !1;
|
|
19
|
+
const ke = (t) => {
|
|
20
|
+
const { features: u, template: m, isFeatureEnabled: p } = z(), { handleError: f, showToaster: A } = K(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: U } = Y(), { handleEvent: V } = X(), { handleModuleAdd: D } = G(), { getStripoBlocksConfig: I } = j(), { getStripoNotifications: L } = J(), g = () => d || (d = new Promise((n, a) => {
|
|
21
21
|
if (document.getElementById("UiEditorScript")) {
|
|
22
|
-
|
|
22
|
+
n();
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
const i =
|
|
25
|
+
const i = oe();
|
|
26
26
|
if (!i) {
|
|
27
|
-
|
|
27
|
+
a(
|
|
28
28
|
new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
|
|
29
29
|
);
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
}, document.body.appendChild(
|
|
32
|
+
const s = `${i}UIEditor.js`, e = document.createElement("script");
|
|
33
|
+
e.id = "UiEditorScript", e.type = "module", e.src = s, e.onload = () => {
|
|
34
|
+
F = !0, n();
|
|
35
|
+
}, e.onerror = () => {
|
|
36
|
+
e.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
|
|
37
|
+
}, document.body.appendChild(e);
|
|
38
38
|
}), d.catch(() => {
|
|
39
39
|
d = null;
|
|
40
|
-
}), d),
|
|
41
|
-
var
|
|
42
|
-
const o =
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
40
|
+
}), d), q = async (n, a, i, s = [], e = !1, c = !1) => {
|
|
41
|
+
var w, k, b, _;
|
|
42
|
+
const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions: x } = await I();
|
|
43
|
+
t.mark("blocks_config_ready");
|
|
44
|
+
const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0, O = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), H = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
45
|
+
t.setTemplate({ html: S, css: y, forceRecreate: C }), v().importCss(), t.mark("init_editor"), await window.UIEditor.initEditor(
|
|
46
46
|
document.querySelector("#guido-editor"),
|
|
47
47
|
{
|
|
48
|
-
metadata:
|
|
49
|
-
html:
|
|
50
|
-
css:
|
|
51
|
-
forceRecreate:
|
|
48
|
+
metadata: a,
|
|
49
|
+
html: S,
|
|
50
|
+
css: y,
|
|
51
|
+
forceRecreate: C,
|
|
52
52
|
locale: "en",
|
|
53
53
|
undoButtonSelector: "#guido__undo-button",
|
|
54
54
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -58,12 +58,12 @@ const we = (e) => {
|
|
|
58
58
|
customAppearanceMergetags: !p("liquidSyntax"),
|
|
59
59
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
60
60
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
61
|
-
customViewStyles:
|
|
62
|
-
conditionsEnabled:
|
|
63
|
-
customConditionsEnabled:
|
|
61
|
+
customViewStyles: Z,
|
|
62
|
+
conditionsEnabled: h,
|
|
63
|
+
customConditionsEnabled: h,
|
|
64
64
|
enableXSSSecurity: !0,
|
|
65
|
-
modulesDisabled:
|
|
66
|
-
syncModulesEnabled:
|
|
65
|
+
modulesDisabled: O,
|
|
66
|
+
syncModulesEnabled: e,
|
|
67
67
|
messageSettingsEnabled: !0,
|
|
68
68
|
displayGmailAnnotations: !0,
|
|
69
69
|
displayHiddenPreheader: !1,
|
|
@@ -73,37 +73,37 @@ const we = (e) => {
|
|
|
73
73
|
copyPasteEnabled: !1,
|
|
74
74
|
selectElementAfterDrop: !0,
|
|
75
75
|
sameFontSizeForOutlook: !0,
|
|
76
|
-
allowedScriptSourceDomains:
|
|
77
|
-
...
|
|
76
|
+
allowedScriptSourceDomains: H,
|
|
77
|
+
...E ? { baseBlocks: E } : {},
|
|
78
78
|
editorFonts: {
|
|
79
79
|
showDefaultStandardFonts: !0,
|
|
80
80
|
showDefaultNotStandardFonts: !0,
|
|
81
|
-
customFonts:
|
|
81
|
+
customFonts: s
|
|
82
82
|
},
|
|
83
83
|
mergeTags: [
|
|
84
84
|
{
|
|
85
|
-
entries:
|
|
85
|
+
entries: ee(
|
|
86
86
|
i.preselectedDynamicContentList,
|
|
87
|
-
|
|
87
|
+
te((_ = m.value) == null ? void 0 : _.dynamicContentList),
|
|
88
88
|
p("liquidSyntax")
|
|
89
89
|
)
|
|
90
90
|
}
|
|
91
91
|
],
|
|
92
92
|
async onTokenRefreshRequest(r) {
|
|
93
93
|
try {
|
|
94
|
-
|
|
95
|
-
const l = await
|
|
96
|
-
|
|
94
|
+
t.mark("token_start");
|
|
95
|
+
const l = await P();
|
|
96
|
+
t.mark("token_end"), r(l);
|
|
97
97
|
} catch (l) {
|
|
98
98
|
f(l, "Failed to refresh token");
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
onTemplateLoaded() {
|
|
102
102
|
try {
|
|
103
|
-
const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } =
|
|
104
|
-
|
|
103
|
+
const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = N(), { injectFullStory: M } = $();
|
|
104
|
+
v().importCss(), r(), M(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
|
|
105
105
|
o.hasChanges = !1;
|
|
106
|
-
}, 1e3),
|
|
106
|
+
}, 1e3), t.markReady();
|
|
107
107
|
} catch (r) {
|
|
108
108
|
f(r, "Failed to load custom interface appearance");
|
|
109
109
|
}
|
|
@@ -120,9 +120,9 @@ const we = (e) => {
|
|
|
120
120
|
onDataChanged() {
|
|
121
121
|
o.hasChanges = !0, o.changeSeq += 1;
|
|
122
122
|
},
|
|
123
|
-
onEvent:
|
|
124
|
-
onModuleAdd:
|
|
125
|
-
notifications:
|
|
123
|
+
onEvent: V,
|
|
124
|
+
onModuleAdd: D,
|
|
125
|
+
notifications: L(),
|
|
126
126
|
// Stripo deselects the block on any click outside the canvas, so every surface
|
|
127
127
|
// that belongs to the block's own flow has to be listed here (SD-153273).
|
|
128
128
|
ignoreClickOutsideSelectors: [
|
|
@@ -132,29 +132,29 @@ const we = (e) => {
|
|
|
132
132
|
".in-modal-v2-wrapper",
|
|
133
133
|
".in-toasts-wrapper"
|
|
134
134
|
],
|
|
135
|
-
extensions:
|
|
136
|
-
localePatch:
|
|
135
|
+
extensions: x,
|
|
136
|
+
localePatch: Q
|
|
137
137
|
}
|
|
138
138
|
);
|
|
139
139
|
};
|
|
140
|
-
return { initPlugin: async (a,
|
|
141
|
-
const
|
|
140
|
+
return { initPlugin: async (n, a, i, s = !1) => {
|
|
141
|
+
const e = T();
|
|
142
142
|
try {
|
|
143
|
-
|
|
144
|
-
const [
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
t.mark("plugin_start"), t.setScriptPreloaded(F), await g(), t.mark("script_ready");
|
|
144
|
+
const [c, o] = await Promise.all([
|
|
145
|
+
R(),
|
|
146
|
+
U()
|
|
147
147
|
]);
|
|
148
|
-
|
|
148
|
+
t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await q(n, a, i, c, o, s);
|
|
149
149
|
} catch {
|
|
150
|
-
|
|
151
|
-
type:
|
|
150
|
+
e.loadingStatus = !1, A({
|
|
151
|
+
type: W.Error,
|
|
152
152
|
message: B["An error has occurred. Please report the error code to support."],
|
|
153
153
|
actionButton: {
|
|
154
154
|
text: B["Reload page"],
|
|
155
155
|
onClick: () => window.location.reload()
|
|
156
156
|
}
|
|
157
|
-
}),
|
|
157
|
+
}), t.markFailed();
|
|
158
158
|
}
|
|
159
159
|
}, preloadRuntime: () => {
|
|
160
160
|
g().catch(() => {
|
|
@@ -162,5 +162,5 @@ const we = (e) => {
|
|
|
162
162
|
} };
|
|
163
163
|
};
|
|
164
164
|
export {
|
|
165
|
-
|
|
165
|
+
ke as useStripo
|
|
166
166
|
};
|