@useinsider/guido 3.24.0-beta.2ad6e30 → 3.24.0-beta.468d41f
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 +1 -1
- package/dist/@types/config/schemas.js +16 -16
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +79 -77
- package/dist/composables/useModuleRepair.js +14 -12
- package/dist/composables/useSave.js +52 -57
- package/dist/composables/useSaveValidation.js +110 -118
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +33 -48
- package/dist/config/migrator/index.js +16 -15
- package/dist/config/migrator/itemsPriceFormatMigrator.js +20 -0
- package/dist/enums/save-validation.js +1 -1
- package/dist/extensions/Blocks/Items/block.js +115 -77
- package/dist/extensions/Blocks/Items/constants/currency.js +59 -14
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +33 -22
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +62 -51
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +18 -17
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -31
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +145 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +141 -120
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +1 -1
- package/dist/extensions/Blocks/Items/extension.js +9 -8
- package/dist/extensions/Blocks/Items/items.css.js +19 -0
- package/dist/extensions/Blocks/Items/settingsPanel.js +34 -25
- package/dist/extensions/Blocks/Items/template.js +250 -212
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +185 -0
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +1 -0
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/@types/config/schemas.d.ts +4 -4
- package/dist/src/composables/useConfig.d.ts +2 -2
- package/dist/src/composables/useSaveValidation.d.ts +1 -1
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -4
- package/dist/src/config/migrator/index.d.ts +4 -1
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +1 -0
- package/dist/src/enums/save-validation.d.ts +1 -2
- package/dist/src/extensions/Blocks/Items/block.d.ts +6 -9
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +23 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +4 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +61 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +12 -0
- package/dist/src/stores/config.d.ts +20 -20
- package/dist/src/utils/itemsCurrencyRepair.d.ts +5 -1
- package/dist/utils/itemsCurrencyRepair.js +29 -24
- package/dist/utils/pairProductVariables.js +119 -99
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -172,7 +172,7 @@ const config: GuidoConfigInput = {
|
|
|
172
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).
|
|
173
173
|
reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
|
|
174
174
|
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.
|
|
175
|
-
|
|
175
|
+
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).
|
|
176
176
|
},
|
|
177
177
|
|
|
178
178
|
// Optional: Callbacks
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
|
|
2
|
-
import { object as a, number as s, optional as e, string as t, picklist as m, pipe as i, minLength as
|
|
3
|
-
const
|
|
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 T, union as h, lazy as I } from "../../node_modules/valibot/dist/index.js";
|
|
3
|
+
const p = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
6
6
|
/** Transactional/system emails */
|
|
@@ -16,12 +16,12 @@ const b = {
|
|
|
16
16
|
/** Unique identifier for the template being edited */
|
|
17
17
|
templateId: i(
|
|
18
18
|
t(),
|
|
19
|
-
|
|
19
|
+
b(1, "templateId is required")
|
|
20
20
|
),
|
|
21
21
|
/** Unique identifier for the user editing the template */
|
|
22
22
|
userId: i(
|
|
23
23
|
t(),
|
|
24
|
-
|
|
24
|
+
b(1, "userId is required")
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
27
|
variationId: e(t()),
|
|
@@ -42,7 +42,7 @@ const b = {
|
|
|
42
42
|
/** Partner/organization name (required) */
|
|
43
43
|
name: i(
|
|
44
44
|
t(),
|
|
45
|
-
|
|
45
|
+
b(1, "partner.name is required")
|
|
46
46
|
),
|
|
47
47
|
/** Product type identifier */
|
|
48
48
|
productType: e(
|
|
@@ -55,8 +55,8 @@ const b = {
|
|
|
55
55
|
),
|
|
56
56
|
/** Message type (promotional or transactional) */
|
|
57
57
|
messageType: e(
|
|
58
|
-
m([
|
|
59
|
-
|
|
58
|
+
m([p.PROMOTIONAL, p.TRANSACTIONAL]),
|
|
59
|
+
p.PROMOTIONAL
|
|
60
60
|
),
|
|
61
61
|
/** Display name for the current user */
|
|
62
62
|
username: e(t(), "Guido User"),
|
|
@@ -84,10 +84,10 @@ const b = {
|
|
|
84
84
|
children: e(c(f)),
|
|
85
85
|
// eslint-disable-next-line camelcase -- backend field name
|
|
86
86
|
select_items: e(c(f))
|
|
87
|
-
})),
|
|
87
|
+
})), P = g(
|
|
88
88
|
t(),
|
|
89
89
|
R(c(f), [])
|
|
90
|
-
),
|
|
90
|
+
), N = 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 b = {
|
|
|
140
140
|
* strategy, currency, locale, and layout data.
|
|
141
141
|
*/
|
|
142
142
|
recommendationConfigs: e(
|
|
143
|
-
g(t(),
|
|
143
|
+
g(t(), N),
|
|
144
144
|
{}
|
|
145
145
|
)
|
|
146
146
|
}), x = a({
|
|
@@ -159,7 +159,7 @@ const b = {
|
|
|
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(P, {}),
|
|
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 */
|
|
@@ -245,8 +245,8 @@ const b = {
|
|
|
245
245
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
246
246
|
allowSaveWithErrors: e(o(), !0),
|
|
247
247
|
reusableRecommendationStrategy: e(o(), !1),
|
|
248
|
-
/**
|
|
249
|
-
|
|
248
|
+
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
249
|
+
itemsPriceFormatting: e(o(), !1)
|
|
250
250
|
}), w = m([
|
|
251
251
|
"amp-accordion",
|
|
252
252
|
"amp-carousel",
|
|
@@ -369,7 +369,7 @@ export {
|
|
|
369
369
|
B as CustomBlockTypeSchema,
|
|
370
370
|
G as CustomRuleSchema,
|
|
371
371
|
w as DefaultBlockTypeSchema,
|
|
372
|
-
|
|
372
|
+
P as DynamicContentListSchema,
|
|
373
373
|
f as DynamicContentNodeSchema,
|
|
374
374
|
M as DynamicContentSchema,
|
|
375
375
|
O as EditorSchema,
|
|
@@ -378,8 +378,8 @@ export {
|
|
|
378
378
|
U as FeaturesSchema,
|
|
379
379
|
K as GuidoConfigSchema,
|
|
380
380
|
A as IdentitySchema,
|
|
381
|
-
|
|
382
|
-
|
|
381
|
+
N as LegacyRecommendationConfigSchema,
|
|
382
|
+
p as MessageType,
|
|
383
383
|
E as PartnerSchema,
|
|
384
384
|
l as ProductType,
|
|
385
385
|
_ as RegexRuleSchema,
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
1
|
+
import { defineComponent as ue, defineAsyncComponent as l, ref as W, computed as f, watch as G, onMounted as pe, onUnmounted as fe } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ge } from "../composables/useCortexBlueprintBridge.js";
|
|
3
3
|
import { useEditorLock as ye } from "../composables/useEditorLock.js";
|
|
4
|
-
import { startEditorOpenMetrics as
|
|
5
|
-
import { provideGuidoActions as
|
|
4
|
+
import { startEditorOpenMetrics as ve } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
+
import { provideGuidoActions as be } from "../composables/useGuidoActions.js";
|
|
6
6
|
import { useGuidoStateBridge as Se } from "../composables/useGuidoStateBridge.js";
|
|
7
|
-
import { usePartner as
|
|
8
|
-
import { useSaveValidationRollout as
|
|
9
|
-
import { useStripo as
|
|
10
|
-
import { useTimerClone as
|
|
11
|
-
import { useToaster as
|
|
12
|
-
import { useTranslations as
|
|
13
|
-
import { migrate as
|
|
7
|
+
import { usePartner as he } from "../composables/usePartner.js";
|
|
8
|
+
import { useSaveValidationRollout as Ee } from "../composables/useSaveValidationRollout.js";
|
|
9
|
+
import { useStripo as we } from "../composables/useStripo.js";
|
|
10
|
+
import { useTimerClone as Te } from "../composables/useTimerClone.js";
|
|
11
|
+
import { useToaster as ke } from "../composables/useToaster.js";
|
|
12
|
+
import { useTranslations as Ce } from "../composables/useTranslations.js";
|
|
13
|
+
import { migrate as De } from "../config/migrator/index.js";
|
|
14
14
|
import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
|
|
15
|
-
import { RIBBON_SELECTOR as
|
|
15
|
+
import { RIBBON_SELECTOR as Fe } from "../enums/onboarding.js";
|
|
16
16
|
import { ToasterTypeOptions as Ie } from "../enums/toaster.js";
|
|
17
|
-
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as
|
|
18
|
-
import { disposeUnsubscribeListeners as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
17
|
+
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Me } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
|
+
import { disposeUnsubscribeListeners as Re } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
19
|
+
import Le from "./organisms/AutoSaveController.vue.js";
|
|
20
|
+
import Oe from "./organisms/base/AuthErrorModal.vue.js";
|
|
21
|
+
import Ue from "./organisms/base/Toaster.vue.js";
|
|
22
|
+
import Ne from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
23
|
+
import _e from "./organisms/header/HeaderWrapper.vue.js";
|
|
24
|
+
import Ae from "./organisms/LoadingWrapper.vue.js";
|
|
25
|
+
import Pe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
26
26
|
import Be from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
27
|
-
import
|
|
28
|
-
import { useStripoApi as
|
|
29
|
-
import { useConfigStore as
|
|
30
|
-
import { useDynamicContentStore as
|
|
27
|
+
import xe from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
28
|
+
import { useStripoApi as He } from "../services/stripoApi.js";
|
|
29
|
+
import { useConfigStore as Ve } from "../stores/config.js";
|
|
30
|
+
import { useDynamicContentStore as We } from "../stores/dynamic-content.js";
|
|
31
31
|
import { useEditorStore as w } from "../stores/editor.js";
|
|
32
|
-
import { usePreviewStore as
|
|
33
|
-
import { useSaveValidationStore as
|
|
34
|
-
import { useTemplateStore as
|
|
35
|
-
import { useUnsubscribeStore as
|
|
32
|
+
import { usePreviewStore as Ge } from "../stores/preview.js";
|
|
33
|
+
import { useSaveValidationStore as $e } from "../stores/save-validation.js";
|
|
34
|
+
import { useTemplateStore as ze } from "../stores/template.js";
|
|
35
|
+
import { useUnsubscribeStore as qe } from "../stores/unsubscribe.js";
|
|
36
36
|
import { readTrackFloor as q } from "../utils/linkTrackingIds.js";
|
|
37
|
-
const
|
|
37
|
+
const Mt = /* @__PURE__ */ ue({
|
|
38
38
|
__name: "Guido",
|
|
39
39
|
props: {
|
|
40
40
|
config: null,
|
|
41
41
|
ready: { type: Boolean, default: !0 }
|
|
42
42
|
},
|
|
43
43
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
44
|
-
setup(K, { expose: j, emit:
|
|
45
|
-
const a = K, n =
|
|
44
|
+
setup(K, { expose: j, emit: i }) {
|
|
45
|
+
const a = K, n = ve(), J = l(
|
|
46
46
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
47
47
|
), Q = l(
|
|
48
48
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
@@ -52,14 +52,14 @@ const Ft = /* @__PURE__ */ le({
|
|
|
52
52
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
53
53
|
), T = W(), Z = l(
|
|
54
54
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
55
|
-
),
|
|
55
|
+
), g = W(), y = We(), k = qe(), o = Ve();
|
|
56
56
|
a.ready && o.init(a.config);
|
|
57
|
-
const c = w(), ee =
|
|
57
|
+
const c = w(), ee = Ge(), u = f(() => c.hasChanges), { isTestPartner: te } = he(), { isEnabled: oe, loadRollout: C } = Ee(), { showToaster: D } = ke(), F = Ce(), I = () => {
|
|
58
58
|
var t;
|
|
59
59
|
if (c.isVersionHistoryOpen) {
|
|
60
60
|
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), D({
|
|
61
61
|
type: Ie.Warning,
|
|
62
|
-
message:
|
|
62
|
+
message: F("email-editor.save-blocked-outside-editor")
|
|
63
63
|
});
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
@@ -67,7 +67,7 @@ const Ft = /* @__PURE__ */ le({
|
|
|
67
67
|
}, M = (t) => {
|
|
68
68
|
c.loadingStatus = t;
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
ge(), Se();
|
|
71
71
|
const v = () => {
|
|
72
72
|
var t, e;
|
|
73
73
|
return {
|
|
@@ -78,46 +78,46 @@ const Ft = /* @__PURE__ */ le({
|
|
|
78
78
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
|
|
79
79
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
|
|
80
80
|
};
|
|
81
|
-
}, { initPlugin: R, preloadRuntime: L } =
|
|
81
|
+
}, { initPlugin: R, preloadRuntime: L } = we(n), { runExclusive: O, beginMount: U, isCurrentMount: b } = ye();
|
|
82
82
|
let p = 0;
|
|
83
|
-
const { getDefaultTemplate: N } =
|
|
83
|
+
const { getDefaultTemplate: N } = He(), { cloneTimersOnSave: _, hasTimerBlocks: A } = Te(), re = f(() => {
|
|
84
84
|
var t;
|
|
85
85
|
return !((t = o.ui) != null && t.showHeader);
|
|
86
|
-
}), ne = f(() => o.isFeatureEnabled("reusableRecommendationStrategy")),
|
|
86
|
+
}), ne = f(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ie = f(
|
|
87
87
|
() => !!z().recommendationConfigs.strategyId
|
|
88
88
|
);
|
|
89
|
-
|
|
89
|
+
be({
|
|
90
90
|
onBack: () => {
|
|
91
|
-
console.debug("guido:back"),
|
|
91
|
+
console.debug("guido:back"), i("back");
|
|
92
92
|
},
|
|
93
93
|
onSaveStart: () => {
|
|
94
|
-
console.debug("guido:save:start"),
|
|
94
|
+
console.debug("guido:save:start"), i("save:start");
|
|
95
95
|
},
|
|
96
96
|
onSaveComplete: (t) => {
|
|
97
97
|
const e = { ...t, metadata: v() };
|
|
98
|
-
console.debug("guido:save:complete", e),
|
|
98
|
+
console.debug("guido:save:complete", e), i("save:complete", e);
|
|
99
99
|
},
|
|
100
100
|
onTestEmailClick: () => {
|
|
101
|
-
console.debug("guido:test-email:click"),
|
|
101
|
+
console.debug("guido:test-email:click"), i("test-email:click");
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
const
|
|
105
|
-
console.debug("dynamic-content:close", t),
|
|
106
|
-
},
|
|
104
|
+
const P = (t) => {
|
|
105
|
+
console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
106
|
+
}, B = () => {
|
|
107
107
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
108
108
|
};
|
|
109
109
|
G(() => u.value, () => {
|
|
110
|
-
|
|
110
|
+
i("on-change", u.value);
|
|
111
111
|
});
|
|
112
|
-
const
|
|
113
|
-
const e = t, { attribute:
|
|
114
|
-
console.debug("dynamic-content:open", e.detail),
|
|
112
|
+
const S = (t) => {
|
|
113
|
+
const e = t, { attribute: s, position: m } = e.detail;
|
|
114
|
+
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, m);
|
|
115
115
|
};
|
|
116
116
|
let d = null;
|
|
117
117
|
const h = () => {
|
|
118
118
|
var e;
|
|
119
|
-
const t = document.querySelector(
|
|
120
|
-
(e =
|
|
119
|
+
const t = document.querySelector(Fe);
|
|
120
|
+
(e = g.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
121
121
|
}, E = async () => {
|
|
122
122
|
var t;
|
|
123
123
|
n.mark("host_ready");
|
|
@@ -128,48 +128,50 @@ const Ft = /* @__PURE__ */ le({
|
|
|
128
128
|
templateId: o.templateId,
|
|
129
129
|
variationId: o.variationId
|
|
130
130
|
});
|
|
131
|
-
const e = o.template,
|
|
131
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", m = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
132
132
|
k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
133
|
-
const
|
|
133
|
+
const se = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), ae = {
|
|
134
134
|
partnerName: o.partnerName,
|
|
135
135
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
136
136
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
137
|
-
},
|
|
137
|
+
}, ce = {
|
|
138
|
+
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
139
|
+
}, V = (le) => n.timed(
|
|
138
140
|
"migration",
|
|
139
|
-
() =>
|
|
141
|
+
() => De(le, se, ae, ce)
|
|
140
142
|
);
|
|
141
143
|
let r = {
|
|
142
|
-
html:
|
|
144
|
+
html: s && await V(s),
|
|
143
145
|
css: m
|
|
144
146
|
};
|
|
145
147
|
r.html || (r = await n.timed("default_template", () => N()), r.html = await V(r.html));
|
|
146
|
-
const
|
|
147
|
-
A(r.html) && (r.html = await n.timed("timer_clone", () => _(r.html))), H && (c.trackIdSessionFloor = Math.max(
|
|
148
|
-
const
|
|
148
|
+
const de = H ? q(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
149
|
+
A(r.html) && (r.html = await n.timed("timer_clone", () => _(r.html))), H && (c.trackIdSessionFloor = Math.max(de, q(r.html)));
|
|
150
|
+
const me = {
|
|
149
151
|
preselectedDynamicContentList: x,
|
|
150
152
|
onReady: () => {
|
|
151
|
-
console.debug("guido:ready"),
|
|
153
|
+
console.debug("guido:ready"), i("ready");
|
|
152
154
|
}
|
|
153
155
|
};
|
|
154
|
-
p = U(), await R(r, v(),
|
|
156
|
+
p = U(), await R(r, v(), me, r.html !== s), y.selectedDynamicContentList = x;
|
|
155
157
|
} catch (e) {
|
|
156
158
|
console.error("Failed to initialize Stripo editor:", e), n.markFailed();
|
|
157
159
|
}
|
|
158
160
|
};
|
|
159
|
-
return
|
|
161
|
+
return pe(async () => {
|
|
160
162
|
var e;
|
|
161
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), w().$reset(),
|
|
162
|
-
const t = (e =
|
|
163
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), w().$reset(), ze().$reset(), $e().$reset(), C(), h();
|
|
164
|
+
const t = (e = g.value) == null ? void 0 : e.parentElement;
|
|
163
165
|
if (t && (d = new ResizeObserver(h), d.observe(t)), L(), a.ready)
|
|
164
166
|
await E();
|
|
165
167
|
else {
|
|
166
|
-
const
|
|
167
|
-
m && (
|
|
168
|
+
const s = G(() => a.ready, (m) => {
|
|
169
|
+
m && (s(), E());
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
|
-
document.addEventListener("dynamic-content:open",
|
|
171
|
-
}),
|
|
172
|
-
if (
|
|
172
|
+
document.addEventListener("dynamic-content:open", S);
|
|
173
|
+
}), fe(() => {
|
|
174
|
+
if (Re(), Me(), n.dispose(), d == null || d.disconnect(), document.removeEventListener("dynamic-content:open", S), b(p))
|
|
173
175
|
try {
|
|
174
176
|
const t = w();
|
|
175
177
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
@@ -177,7 +179,7 @@ const Ft = /* @__PURE__ */ le({
|
|
|
177
179
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
178
180
|
}
|
|
179
181
|
O(async () => {
|
|
180
|
-
if (
|
|
182
|
+
if (b(p))
|
|
181
183
|
try {
|
|
182
184
|
window.UIEditor.removeEditor();
|
|
183
185
|
} catch {
|
|
@@ -186,15 +188,15 @@ const Ft = /* @__PURE__ */ le({
|
|
|
186
188
|
}), o.reset();
|
|
187
189
|
}), j({
|
|
188
190
|
dynamicContent: {
|
|
189
|
-
insert:
|
|
190
|
-
close:
|
|
191
|
+
insert: P,
|
|
192
|
+
close: B
|
|
191
193
|
},
|
|
192
194
|
hasChanges: u,
|
|
193
|
-
saveSilent:
|
|
195
|
+
saveSilent: I,
|
|
194
196
|
setLoading: M
|
|
195
|
-
}), { __sfc: !0, openMetrics: n, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, autoSaveControllerRef: T, LegacyStrategyUpdatedModal: Z, wrapperRef:
|
|
197
|
+
}), { __sfc: !0, openMetrics: n, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, autoSaveControllerRef: T, LegacyStrategyUpdatedModal: Z, wrapperRef: g, dynamicContentStore: y, unsubscribeStore: k, props: a, configStore: o, editorStore: c, previewStore: ee, hasChanges: u, isTestPartner: te, isSaveValidationEnabled: oe, loadRollout: C, showToaster: D, trans: F, saveSilent: I, setLoading: M, emit: i, buildMetadata: v, initPlugin: R, preloadRuntime: L, runExclusive: O, beginMount: U, isCurrentMount: b, mountGeneration: p, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: A, noHeader: re, isRrsEnabled: ne, hasAssignedStrategy: ie, insertDynamicContent: P, closeDynamicContent: B, handleDynamicContentOpen: S, ribbonObserver: d, updateRibbonOffset: h, startEditor: E, AutoSaveController: Le, AuthErrorModal: Oe, Toaster: Ue, FilterSelectionDrawer: Ne, HeaderWrapper: _e, LoadingWrapper: Ae, SaveAsTemplateDrawer: Pe, UnsubscribeWrapper: Be, ValidationErrorDrawer: xe };
|
|
196
198
|
}
|
|
197
199
|
});
|
|
198
200
|
export {
|
|
199
|
-
|
|
201
|
+
Mt as default
|
|
200
202
|
};
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
1
|
+
import { useConfig as T } from "./useConfig.js";
|
|
2
|
+
import { useToaster as g } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as C } 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", d = () => {
|
|
9
|
+
const { template: p, isFeatureEnabled: s } = T(), { showToaster: a } = g(), y = C();
|
|
10
10
|
return { handleModuleAdd: (e, o) => {
|
|
11
|
-
var
|
|
11
|
+
var c, l, i;
|
|
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 = (c = o == null ? void 0 : o.getTargetNode) == null ? void 0 : c.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
|
-
|
|
18
|
+
let n = M(r, {
|
|
19
|
+
convertToPriceFormat: s("itemsPriceFormatting")
|
|
20
|
+
});
|
|
21
|
+
const u = f(O((i = p.value) == null ? void 0 : i.dynamicContentList));
|
|
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({
|
|
22
24
|
type: D.Warning,
|
|
23
25
|
message: y(N)
|
|
24
26
|
});
|
|
@@ -29,5 +31,5 @@ const N = "dynamic-content.unresolved-attributes-on-drop", R = () => {
|
|
|
29
31
|
};
|
|
30
32
|
export {
|
|
31
33
|
N as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
|
|
32
|
-
|
|
34
|
+
d as useModuleRepair
|
|
33
35
|
};
|
|
@@ -1,96 +1,91 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { useSaveStart as
|
|
5
|
-
import { useSaveValidation as
|
|
6
|
-
import { useSaveValidationRollout as
|
|
7
|
-
import { useSyncModuleExtractor as
|
|
1
|
+
import { useActionsApi as q } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as O } from "./useConfig.js";
|
|
3
|
+
import { useEditorLock as D } from "./useEditorLock.js";
|
|
4
|
+
import { useSaveStart as F, useSaveComplete as j } from "./useGuidoActions.js";
|
|
5
|
+
import { useSaveValidation as z } from "./useSaveValidation.js";
|
|
6
|
+
import { useSaveValidationRollout as G } from "./useSaveValidationRollout.js";
|
|
7
|
+
import { useSyncModuleExtractor as I } from "./useSyncModuleExtractor.js";
|
|
8
8
|
import { ToasterTypeOptions as J } from "../enums/toaster.js";
|
|
9
9
|
import { useStripoApi as K } from "../services/stripoApi.js";
|
|
10
|
-
import { useConfigStore as
|
|
11
|
-
import { useDynamicContentStore as
|
|
12
|
-
import { useSaveValidationStore as
|
|
13
|
-
import { useTemplatePreparation as
|
|
14
|
-
import { useAllowlist as
|
|
15
|
-
import { useHtmlValidator as
|
|
16
|
-
import { useToaster as
|
|
17
|
-
import { useCouponBlockValidator as
|
|
18
|
-
import { useHtmlDocumentCountValidator as
|
|
19
|
-
import { useLiquidValidator as
|
|
20
|
-
import { useSyncModuleBlockValidator as
|
|
10
|
+
import { useConfigStore as N } from "../stores/config.js";
|
|
11
|
+
import { useDynamicContentStore as Q } from "../stores/dynamic-content.js";
|
|
12
|
+
import { useSaveValidationStore as X } from "../stores/save-validation.js";
|
|
13
|
+
import { useTemplatePreparation as Y, getHtmlReferencedUnsubscribePages as Z } from "../utils/templatePreparation.js";
|
|
14
|
+
import { useAllowlist as _ } from "./useAllowlist.js";
|
|
15
|
+
import { useHtmlValidator as $ } from "./useHtmlValidator.js";
|
|
16
|
+
import { useToaster as tt } from "./useToaster.js";
|
|
17
|
+
import { useCouponBlockValidator as et } from "./validators/useCouponBlockValidator.js";
|
|
18
|
+
import { useHtmlDocumentCountValidator as ot } from "./validators/useHtmlDocumentCountValidator.js";
|
|
19
|
+
import { useLiquidValidator as it } from "./validators/useLiquidValidator.js";
|
|
20
|
+
import { useSyncModuleBlockValidator as st } from "./validators/useSyncModuleBlockValidator.js";
|
|
21
21
|
import { useUnsubscribeBlockValidator as at } from "./validators/useUnsubscribeBlockValidator.js";
|
|
22
22
|
const Pt = () => {
|
|
23
|
-
const n =
|
|
24
|
-
|
|
25
|
-
validateUnsubscribeBlockHasTemplate: g,
|
|
26
|
-
validateNoInsiderUnsubscribeCode: V
|
|
27
|
-
} = at(), { validateSyncModuleBlocks: l } = rt(), { validateSingleHtmlDocument: c } = it(), { callbacks: a, isFeatureEnabled: u } = D(), { extractSyncModuleData: x } = G(), { setSyncModuleUnsubscriptionPages: k } = K(), { editorSave: C, getTemplateData: m } = O(), { showToaster: h } = et(), { getBlockedDomains: B, resolveToast: T } = $(), { prepareTemplateDetails: p } = Z(), { collectSaveValidationErrors: L } = j(), { isEnabled: P } = z(), U = Y(), A = X(), w = Q(), { runExclusive: d } = F(), f = async (t, e, i) => {
|
|
28
|
-
if (!u("allowlistEnabled"))
|
|
23
|
+
const n = F(), w = j(), { validateHtml: y } = $(), { validateLiquidSyntax: E } = it(), { validateCouponBlockTags: b } = et(), { validateUnsubscribeBlockUniqueness: g, validateUnsubscribeBlockHasTemplate: H } = at(), { validateSyncModuleBlocks: l } = st(), { validateSingleHtmlDocument: c } = ot(), { callbacks: r, isFeatureEnabled: v } = O(), { extractSyncModuleData: V } = I(), { setSyncModuleUnsubscriptionPages: x } = K(), { editorSave: C, getTemplateData: u } = q(), { showToaster: k } = tt(), { getBlockedDomains: h, resolveToast: B } = _(), { prepareTemplateDetails: p } = Y(), { collectSaveValidationErrors: T } = z(), { isEnabled: P } = G(), L = X(), U = Q(), S = N(), { runExclusive: m } = D(), d = async (t, e, i) => {
|
|
24
|
+
if (!v("allowlistEnabled"))
|
|
29
25
|
return !1;
|
|
30
|
-
const o = await
|
|
26
|
+
const o = await h(t, e);
|
|
31
27
|
if (!o.length)
|
|
32
28
|
return !1;
|
|
33
29
|
if (!i) {
|
|
34
|
-
const s = await
|
|
35
|
-
s != null && s.message &&
|
|
30
|
+
const s = await B(o);
|
|
31
|
+
s != null && s.message && k({
|
|
36
32
|
type: J.Warning,
|
|
37
33
|
message: s.message,
|
|
38
34
|
actionButton: s.actionButton
|
|
39
35
|
});
|
|
40
36
|
}
|
|
41
37
|
return !0;
|
|
42
|
-
},
|
|
38
|
+
}, A = async (t) => !b(t.compiledHtml) || !g(t.compiledHtml) || !H(t.compiledHtml) ? !1 : v("liquidSyntax") ? E(t.compiledHtml) : y(t.compiledHtml, t.dynamicContentList, !0), f = async (t, e) => {
|
|
43
39
|
if (!await C())
|
|
44
40
|
return;
|
|
45
|
-
const { unsubscribePayload: o, stripoModules: s } =
|
|
46
|
-
if (await
|
|
47
|
-
const
|
|
48
|
-
|
|
41
|
+
const { unsubscribePayload: o, stripoModules: s } = V(t.rawHtml);
|
|
42
|
+
if (await x(o), t.modules = s, !e.suppress) {
|
|
43
|
+
const a = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
|
|
44
|
+
w({ ...t, ...a, silent: e.silent });
|
|
49
45
|
}
|
|
50
46
|
return t;
|
|
51
|
-
},
|
|
47
|
+
}, M = async (t, e) => {
|
|
52
48
|
var s;
|
|
53
49
|
n();
|
|
54
|
-
const i = await
|
|
50
|
+
const i = await u();
|
|
55
51
|
if (!c(i.html, e))
|
|
56
52
|
return;
|
|
57
53
|
const o = await p(i);
|
|
58
54
|
if (l(o.rawHtml, e)) {
|
|
59
55
|
if (P.value && !e) {
|
|
60
|
-
const
|
|
56
|
+
const a = await T(
|
|
61
57
|
o.compiledHtml,
|
|
62
|
-
o.dynamicContentList
|
|
63
|
-
o.rawHtml
|
|
58
|
+
o.dynamicContentList
|
|
64
59
|
);
|
|
65
|
-
if (
|
|
66
|
-
|
|
60
|
+
if (a.length) {
|
|
61
|
+
L.open(a, "save");
|
|
67
62
|
return;
|
|
68
63
|
}
|
|
69
|
-
} else if (!await
|
|
64
|
+
} else if (!await A(o))
|
|
70
65
|
return;
|
|
71
|
-
if (!((s =
|
|
72
|
-
return
|
|
66
|
+
if (!((s = r.value) != null && s.externalValidation && !await r.value.externalValidation(o)) && !await d(o.compiledHtml, o.css, e))
|
|
67
|
+
return f(o, { silent: e, suppress: t });
|
|
73
68
|
}
|
|
74
|
-
},
|
|
69
|
+
}, W = async () => {
|
|
75
70
|
var i;
|
|
76
|
-
if (!
|
|
71
|
+
if (!S.allowSaveWithErrors)
|
|
77
72
|
return;
|
|
78
73
|
n();
|
|
79
|
-
const t = await
|
|
74
|
+
const t = await u();
|
|
80
75
|
if (!c(t.html, !1))
|
|
81
76
|
return;
|
|
82
77
|
const e = await p(t);
|
|
83
|
-
if (l(e.rawHtml, !1) && !((i =
|
|
84
|
-
return
|
|
85
|
-
},
|
|
86
|
-
if (!
|
|
78
|
+
if (l(e.rawHtml, !1) && !((i = r.value) != null && i.externalValidation && !await r.value.externalValidation(e)) && !await d(e.compiledHtml, e.css, !1))
|
|
79
|
+
return f(e, { silent: !1, blankCompiled: !0 });
|
|
80
|
+
}, R = async () => {
|
|
81
|
+
if (!S.allowSaveWithErrors)
|
|
87
82
|
return;
|
|
88
83
|
n();
|
|
89
|
-
const { html: t, css: e } = await
|
|
90
|
-
if (!c(t, !0) || !l(t, !0) || await
|
|
84
|
+
const { html: t, css: e } = await u();
|
|
85
|
+
if (!c(t, !0) || !l(t, !0) || await d(t, e, !0))
|
|
91
86
|
return;
|
|
92
|
-
const i =
|
|
93
|
-
dynamicContentList:
|
|
87
|
+
const i = Z(t), o = {
|
|
88
|
+
dynamicContentList: U.getSelectedDynamicContentList,
|
|
94
89
|
compiledHtml: "",
|
|
95
90
|
rawHtml: t,
|
|
96
91
|
css: e,
|
|
@@ -104,11 +99,11 @@ const Pt = () => {
|
|
|
104
99
|
config: i
|
|
105
100
|
}
|
|
106
101
|
};
|
|
107
|
-
return
|
|
102
|
+
return f(o, { silent: !0 });
|
|
108
103
|
};
|
|
109
|
-
return { save: (t = !1, e = !1) =>
|
|
110
|
-
() =>
|
|
111
|
-
), saveWithErrors: () =>
|
|
104
|
+
return { save: (t = !1, e = !1) => m(
|
|
105
|
+
() => M(t, e)
|
|
106
|
+
), saveWithErrors: () => m(W), saveRawOnly: () => m(R) };
|
|
112
107
|
};
|
|
113
108
|
export {
|
|
114
109
|
Pt as useSave
|