@useinsider/guido 3.24.0-beta.0aa04e8 → 3.24.0-beta.172ae7a
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 +9 -0
- package/dist/@types/config/schemas.js +18 -16
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +88 -84
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +17 -0
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +30 -0
- package/dist/composables/useActionsApi.js +2 -2
- package/dist/composables/useEditorTrackingIds.js +49 -0
- package/dist/composables/useModuleRepair.js +32 -23
- package/dist/config/migrator/index.js +10 -9
- package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +16 -0
- package/dist/config/migrator/unsubscribeMigrator.js +98 -94
- package/dist/enums/academy.js +2 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +10 -8
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +28 -24
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +23 -22
- package/dist/extensions/Blocks/Unsubscribe/block.js +96 -104
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -4
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/services/templateLibraryApi.js +39 -36
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useEditorTrackingIds.d.ts +7 -0
- package/dist/src/composables/useModuleRepair.d.ts +2 -11
- package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -1
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/stores/editor.d.ts +27 -0
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +10 -0
- package/dist/src/utils/linkTrackingIds.d.ts +19 -0
- package/dist/stores/editor.js +1 -0
- package/dist/utils/legacyUnsubscribeConversion.js +49 -0
- package/dist/utils/linkTrackingIds.js +82 -48
- package/dist/utils/templatePreparation.js +30 -33
- package/package.json +1 -1
- package/dist/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.js +0 -5
- package/dist/src/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.d.ts +0 -1
package/README.md
CHANGED
|
@@ -171,6 +171,7 @@ const config: GuidoConfigInput = {
|
|
|
171
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).
|
|
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
|
+
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.
|
|
174
175
|
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
176
|
},
|
|
176
177
|
|
|
@@ -704,6 +705,14 @@ multiple partners (e.g. architect) should key by partner and place the active pa
|
|
|
704
705
|
first. Omit the prop and the repair is a safe no-op — nothing is rewritten and no
|
|
705
706
|
toaster fires (useful before the host has wired the catalog).
|
|
706
707
|
|
|
708
|
+
With `features.legacyUnsubscribeConversion: true`, a dropped or copied module's legacy
|
|
709
|
+
unsubscribe block that has no unsubscribe link (the old editor reused it as plain text,
|
|
710
|
+
e.g. a company address) becomes a plain text block that keeps its content, and a warning
|
|
711
|
+
modal explains it. The same conversion runs when a template is opened. Register these
|
|
712
|
+
keys host-side: `email-editor.legacy-unsubscribe-converted-modal-title`,
|
|
713
|
+
`email-editor.legacy-unsubscribe-converted-modal-message` and
|
|
714
|
+
`email-editor.legacy-unsubscribe-converted-modal-visit-academy` (OK reuses `action-builder.ok`).
|
|
715
|
+
|
|
707
716
|
---
|
|
708
717
|
|
|
709
718
|
## Development
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
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
|
|
1
|
+
import { ModuleFolderDefaults as y } 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 b, custom as k, boolean as o, array as c, transform as S, 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
3
|
const p = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -84,10 +84,10 @@ const p = {
|
|
|
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
|
+
})), v = 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) */
|
|
@@ -132,7 +132,7 @@ const p = {
|
|
|
132
132
|
isPriceMovedToNextLine: e(o()),
|
|
133
133
|
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
134
134
|
isPriceDeletedForZeroSale: e(o())
|
|
135
|
-
}),
|
|
135
|
+
}), P = a({
|
|
136
136
|
/**
|
|
137
137
|
* Legacy recommendation block configs keyed by block ID.
|
|
138
138
|
* Pass this when loading a template authored with the v1
|
|
@@ -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(), N),
|
|
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(v, {}),
|
|
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 */
|
|
@@ -176,7 +176,7 @@ const p = {
|
|
|
176
176
|
trackIdCounter: e(
|
|
177
177
|
i(
|
|
178
178
|
s(),
|
|
179
|
-
|
|
179
|
+
S((n) => Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0)
|
|
180
180
|
),
|
|
181
181
|
0
|
|
182
182
|
),
|
|
@@ -190,11 +190,11 @@ const p = {
|
|
|
190
190
|
recommendationCampaignUrls: e(
|
|
191
191
|
i(
|
|
192
192
|
r(),
|
|
193
|
-
|
|
193
|
+
S((n) => n && typeof n == "object" ? { ...n } : void 0)
|
|
194
194
|
)
|
|
195
195
|
),
|
|
196
196
|
/** Migration-only inputs (legacy block configs) */
|
|
197
|
-
migration: e(
|
|
197
|
+
migration: e(P, {})
|
|
198
198
|
}), D = a({
|
|
199
199
|
/** Sender display name */
|
|
200
200
|
senderName: e(t(), ""),
|
|
@@ -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(), y.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(), y.DEFAULT_MODULES)
|
|
216
216
|
}), F = a({
|
|
217
217
|
/** Whether to show the header bar */
|
|
218
218
|
showHeader: e(o(), !0),
|
|
@@ -244,7 +244,9 @@ const p = {
|
|
|
244
244
|
linkTrackingIds: e(o(), !1),
|
|
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
|
-
reusableRecommendationStrategy: e(o(), !1)
|
|
247
|
+
reusableRecommendationStrategy: e(o(), !1),
|
|
248
|
+
/** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
|
|
249
|
+
legacyUnsubscribeConversion: e(o(), !1)
|
|
248
250
|
}), w = m([
|
|
249
251
|
"amp-accordion",
|
|
250
252
|
"amp-carousel",
|
|
@@ -367,7 +369,7 @@ export {
|
|
|
367
369
|
B as CustomBlockTypeSchema,
|
|
368
370
|
G as CustomRuleSchema,
|
|
369
371
|
w as DefaultBlockTypeSchema,
|
|
370
|
-
|
|
372
|
+
v as DynamicContentListSchema,
|
|
371
373
|
f as DynamicContentNodeSchema,
|
|
372
374
|
M as DynamicContentSchema,
|
|
373
375
|
O as EditorSchema,
|
|
@@ -376,14 +378,14 @@ export {
|
|
|
376
378
|
U as FeaturesSchema,
|
|
377
379
|
K as GuidoConfigSchema,
|
|
378
380
|
A as IdentitySchema,
|
|
379
|
-
|
|
381
|
+
N as LegacyRecommendationConfigSchema,
|
|
380
382
|
p as MessageType,
|
|
381
383
|
E as PartnerSchema,
|
|
382
384
|
l as ProductType,
|
|
383
385
|
_ as RegexRuleSchema,
|
|
384
386
|
q as RemoveRuleSchema,
|
|
385
387
|
H as ReplaceRuleSchema,
|
|
386
|
-
|
|
388
|
+
P as TemplateMigrationSchema,
|
|
387
389
|
x as TemplateSchema,
|
|
388
390
|
F as UISchema
|
|
389
391
|
};
|
|
@@ -3,7 +3,7 @@ import o from "./Guido.vue2.js";
|
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var a = this, r = a._self._c, e = a._self._setupProxy;
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), r(e.AutoSaveController, { ref: "autoSaveControllerRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.AuthErrorModal), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
9
|
}, s = [], n = /* @__PURE__ */ i(
|
|
@@ -12,9 +12,9 @@ var t = function() {
|
|
|
12
12
|
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"384468a6"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const v = n.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
v as default
|
|
20
20
|
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { startEditorOpenMetrics as
|
|
5
|
-
import { provideGuidoActions as
|
|
6
|
-
import { useGuidoStateBridge as
|
|
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
|
|
1
|
+
import { defineComponent as pe, defineAsyncComponent as m, ref as W, computed as u, watch as G, onMounted as fe, onUnmounted as ye } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ge } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as be } from "../composables/useEditorLock.js";
|
|
4
|
+
import { startEditorOpenMetrics as ve } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
+
import { provideGuidoActions as Se } from "../composables/useGuidoActions.js";
|
|
6
|
+
import { useGuidoStateBridge as he } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { usePartner as Ee } from "../composables/usePartner.js";
|
|
8
|
+
import { useSaveValidationRollout as Ce } 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 De } from "../composables/useTranslations.js";
|
|
13
|
+
import { migrate as Fe } from "../config/migrator/index.js";
|
|
14
14
|
import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
|
|
15
|
-
import { RIBBON_SELECTOR as
|
|
16
|
-
import { ToasterTypeOptions as
|
|
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
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { useStripoApi as
|
|
29
|
-
import { useConfigStore as
|
|
30
|
-
import { useDynamicContentStore as
|
|
31
|
-
import { useEditorStore as
|
|
32
|
-
import { usePreviewStore as
|
|
33
|
-
import { useSaveValidationStore as
|
|
34
|
-
import { useTemplateStore as
|
|
35
|
-
import { useUnsubscribeStore as
|
|
15
|
+
import { RIBBON_SELECTOR as Ie } from "../enums/onboarding.js";
|
|
16
|
+
import { ToasterTypeOptions as Me } from "../enums/toaster.js";
|
|
17
|
+
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Le } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
|
+
import { disposeUnsubscribeListeners as Re } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
19
|
+
import Ue from "./organisms/AutoSaveController.vue.js";
|
|
20
|
+
import Oe from "./organisms/base/AuthErrorModal.vue.js";
|
|
21
|
+
import Ne from "./organisms/base/Toaster.vue.js";
|
|
22
|
+
import _e from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
23
|
+
import Ae from "./organisms/header/HeaderWrapper.vue.js";
|
|
24
|
+
import Be from "./organisms/LoadingWrapper.vue.js";
|
|
25
|
+
import Pe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
26
|
+
import xe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
27
|
+
import He from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
28
|
+
import { useStripoApi as Ve } from "../services/stripoApi.js";
|
|
29
|
+
import { useConfigStore as We } from "../stores/config.js";
|
|
30
|
+
import { useDynamicContentStore as Ge } from "../stores/dynamic-content.js";
|
|
31
|
+
import { useEditorStore as C } from "../stores/editor.js";
|
|
32
|
+
import { usePreviewStore as $e } from "../stores/preview.js";
|
|
33
|
+
import { useSaveValidationStore as ze } from "../stores/save-validation.js";
|
|
34
|
+
import { useTemplateStore as qe } from "../stores/template.js";
|
|
35
|
+
import { useUnsubscribeStore as Ke } from "../stores/unsubscribe.js";
|
|
36
36
|
import { readTrackFloor as q } from "../utils/linkTrackingIds.js";
|
|
37
|
-
const
|
|
37
|
+
const Lt = /* @__PURE__ */ pe({
|
|
38
38
|
__name: "Guido",
|
|
39
39
|
props: {
|
|
40
40
|
config: null,
|
|
@@ -42,33 +42,35 @@ const Ft = /* @__PURE__ */ le({
|
|
|
42
42
|
},
|
|
43
43
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
44
44
|
setup(K, { expose: j, emit: s }) {
|
|
45
|
-
const a = K, n =
|
|
45
|
+
const a = K, n = ve(), J = m(
|
|
46
46
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
47
|
-
), Q =
|
|
47
|
+
), Q = m(
|
|
48
48
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
49
|
-
), X =
|
|
49
|
+
), X = m(
|
|
50
50
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
51
|
-
), Y =
|
|
51
|
+
), Y = m(
|
|
52
52
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
53
|
-
),
|
|
53
|
+
), w = W(), Z = m(
|
|
54
54
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
55
|
-
),
|
|
55
|
+
), ee = m(
|
|
56
|
+
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
57
|
+
), y = W(), g = Ge(), T = Ke(), o = We();
|
|
56
58
|
a.ready && o.init(a.config);
|
|
57
|
-
const c =
|
|
59
|
+
const c = C(), te = $e(), p = u(() => c.hasChanges), { isTestPartner: oe } = Ee(), { isEnabled: re, loadRollout: k } = Ce(), { showToaster: D } = ke(), F = De(), I = () => {
|
|
58
60
|
var t;
|
|
59
61
|
if (c.isVersionHistoryOpen) {
|
|
60
62
|
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), D({
|
|
61
|
-
type:
|
|
62
|
-
message:
|
|
63
|
+
type: Me.Warning,
|
|
64
|
+
message: F("email-editor.save-blocked-outside-editor")
|
|
63
65
|
});
|
|
64
66
|
return;
|
|
65
67
|
}
|
|
66
|
-
return (t =
|
|
68
|
+
return (t = w.value) == null ? void 0 : t.saveSilent();
|
|
67
69
|
}, M = (t) => {
|
|
68
70
|
c.loadingStatus = t;
|
|
69
71
|
};
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
+
ge(), he();
|
|
73
|
+
const b = () => {
|
|
72
74
|
var t, e;
|
|
73
75
|
return {
|
|
74
76
|
emailId: o.templateId,
|
|
@@ -78,15 +80,17 @@ const Ft = /* @__PURE__ */ le({
|
|
|
78
80
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
|
|
79
81
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
|
|
80
82
|
};
|
|
81
|
-
}, { initPlugin:
|
|
82
|
-
let
|
|
83
|
-
const { getDefaultTemplate: N } =
|
|
83
|
+
}, { initPlugin: L, preloadRuntime: R } = we(n), { runExclusive: U, beginMount: O, isCurrentMount: v } = be();
|
|
84
|
+
let f = 0;
|
|
85
|
+
const { getDefaultTemplate: N } = Ve(), { cloneTimersOnSave: _, hasTimerBlocks: A } = Te(), ne = u(() => {
|
|
84
86
|
var t;
|
|
85
87
|
return !((t = o.ui) != null && t.showHeader);
|
|
86
|
-
}),
|
|
88
|
+
}), se = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ie = u(
|
|
89
|
+
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
90
|
+
), ae = u(
|
|
87
91
|
() => !!z().recommendationConfigs.strategyId
|
|
88
92
|
);
|
|
89
|
-
|
|
93
|
+
Se({
|
|
90
94
|
onBack: () => {
|
|
91
95
|
console.debug("guido:back"), s("back");
|
|
92
96
|
},
|
|
@@ -94,7 +98,7 @@ const Ft = /* @__PURE__ */ le({
|
|
|
94
98
|
console.debug("guido:save:start"), s("save:start");
|
|
95
99
|
},
|
|
96
100
|
onSaveComplete: (t) => {
|
|
97
|
-
const e = { ...t, metadata:
|
|
101
|
+
const e = { ...t, metadata: b() };
|
|
98
102
|
console.debug("guido:save:complete", e), s("save:complete", e);
|
|
99
103
|
},
|
|
100
104
|
onTestEmailClick: () => {
|
|
@@ -106,17 +110,17 @@ const Ft = /* @__PURE__ */ le({
|
|
|
106
110
|
}, P = () => {
|
|
107
111
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
108
112
|
};
|
|
109
|
-
G(() =>
|
|
110
|
-
s("on-change",
|
|
113
|
+
G(() => p.value, () => {
|
|
114
|
+
s("on-change", p.value);
|
|
111
115
|
});
|
|
112
|
-
const
|
|
113
|
-
const e = t, { attribute: i, position:
|
|
114
|
-
console.debug("dynamic-content:open", e.detail), s("dynamic-content:open", i,
|
|
116
|
+
const S = (t) => {
|
|
117
|
+
const e = t, { attribute: i, position: l } = e.detail;
|
|
118
|
+
console.debug("dynamic-content:open", e.detail), s("dynamic-content:open", i, l);
|
|
115
119
|
};
|
|
116
120
|
let d = null;
|
|
117
121
|
const h = () => {
|
|
118
122
|
var e;
|
|
119
|
-
const t = document.querySelector(
|
|
123
|
+
const t = document.querySelector(Ie);
|
|
120
124
|
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
121
125
|
}, E = async () => {
|
|
122
126
|
var t;
|
|
@@ -128,56 +132,56 @@ const Ft = /* @__PURE__ */ le({
|
|
|
128
132
|
templateId: o.templateId,
|
|
129
133
|
variationId: o.variationId
|
|
130
134
|
});
|
|
131
|
-
const e = o.template, i = (e == null ? void 0 : e.html) || "",
|
|
132
|
-
|
|
133
|
-
const
|
|
135
|
+
const e = o.template, i = (e == null ? void 0 : e.html) || "", l = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
136
|
+
T.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
137
|
+
const ce = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), de = {
|
|
134
138
|
partnerName: o.partnerName,
|
|
135
139
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
136
140
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
137
|
-
}, V = (
|
|
141
|
+
}, V = (ue) => n.timed(
|
|
138
142
|
"migration",
|
|
139
|
-
() =>
|
|
143
|
+
() => Fe(ue, ce, de)
|
|
140
144
|
);
|
|
141
145
|
let r = {
|
|
142
146
|
html: i && await V(i),
|
|
143
|
-
css:
|
|
147
|
+
css: l
|
|
144
148
|
};
|
|
145
149
|
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
|
|
150
|
+
const me = H ? q(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
151
|
+
A(r.html) && (r.html = await n.timed("timer_clone", () => _(r.html))), H && (c.trackIdSessionFloor = Math.max(me, q(r.html)));
|
|
152
|
+
const le = {
|
|
149
153
|
preselectedDynamicContentList: x,
|
|
150
154
|
onReady: () => {
|
|
151
155
|
console.debug("guido:ready"), s("ready");
|
|
152
156
|
}
|
|
153
157
|
};
|
|
154
|
-
|
|
158
|
+
f = O(), await L(r, b(), le, r.html !== i), g.selectedDynamicContentList = x;
|
|
155
159
|
} catch (e) {
|
|
156
160
|
console.error("Failed to initialize Stripo editor:", e), n.markFailed();
|
|
157
161
|
}
|
|
158
162
|
};
|
|
159
|
-
return
|
|
163
|
+
return fe(async () => {
|
|
160
164
|
var e;
|
|
161
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(),
|
|
165
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), qe().$reset(), ze().$reset(), k(), h();
|
|
162
166
|
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
163
|
-
if (t && (d = new ResizeObserver(h), d.observe(t)),
|
|
167
|
+
if (t && (d = new ResizeObserver(h), d.observe(t)), R(), a.ready)
|
|
164
168
|
await E();
|
|
165
169
|
else {
|
|
166
|
-
const i = G(() => a.ready, (
|
|
167
|
-
|
|
170
|
+
const i = G(() => a.ready, (l) => {
|
|
171
|
+
l && (i(), E());
|
|
168
172
|
});
|
|
169
173
|
}
|
|
170
|
-
document.addEventListener("dynamic-content:open",
|
|
171
|
-
}),
|
|
172
|
-
if (
|
|
174
|
+
document.addEventListener("dynamic-content:open", S);
|
|
175
|
+
}), ye(() => {
|
|
176
|
+
if (Re(), Le(), n.dispose(), d == null || d.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f))
|
|
173
177
|
try {
|
|
174
|
-
const t =
|
|
178
|
+
const t = C();
|
|
175
179
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
176
180
|
} catch (t) {
|
|
177
181
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
178
182
|
}
|
|
179
|
-
|
|
180
|
-
if (
|
|
183
|
+
U(async () => {
|
|
184
|
+
if (v(f))
|
|
181
185
|
try {
|
|
182
186
|
window.UIEditor.removeEditor();
|
|
183
187
|
} catch {
|
|
@@ -189,12 +193,12 @@ const Ft = /* @__PURE__ */ le({
|
|
|
189
193
|
insert: B,
|
|
190
194
|
close: P
|
|
191
195
|
},
|
|
192
|
-
hasChanges:
|
|
193
|
-
saveSilent:
|
|
196
|
+
hasChanges: p,
|
|
197
|
+
saveSilent: I,
|
|
194
198
|
setLoading: M
|
|
195
|
-
}), { __sfc: !0, openMetrics: n, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, autoSaveControllerRef:
|
|
199
|
+
}), { __sfc: !0, openMetrics: n, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, autoSaveControllerRef: w, LegacyStrategyUpdatedModal: Z, LegacyUnsubscribeConvertedModal: ee, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: T, props: a, configStore: o, editorStore: c, previewStore: te, hasChanges: p, isTestPartner: oe, isSaveValidationEnabled: re, loadRollout: k, showToaster: D, trans: F, saveSilent: I, setLoading: M, emit: s, buildMetadata: b, initPlugin: L, preloadRuntime: R, runExclusive: U, beginMount: O, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: A, noHeader: ne, isRrsEnabled: se, isLegacyUnsubscribeConversionEnabled: ie, hasAssignedStrategy: ae, insertDynamicContent: B, closeDynamicContent: P, handleDynamicContentOpen: S, ribbonObserver: d, updateRibbonOffset: h, startEditor: E, AutoSaveController: Ue, AuthErrorModal: Oe, Toaster: Ne, FilterSelectionDrawer: _e, HeaderWrapper: Ae, LoadingWrapper: Be, SaveAsTemplateDrawer: Pe, UnsubscribeWrapper: xe, ValidationErrorDrawer: He };
|
|
196
200
|
}
|
|
197
201
|
});
|
|
198
202
|
export {
|
|
199
|
-
|
|
203
|
+
Lt as default
|
|
200
204
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import s from "./LegacyUnsubscribeConvertedModal.vue2.js";
|
|
2
|
+
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var n = function() {
|
|
4
|
+
var o = this, t = o._self._c, e = o._self._setupProxy;
|
|
5
|
+
return e.isVisible ? t(e.WpModal, { attrs: { id: "guido__legacy-unsubscribe-converted-modal", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.legacy-unsubscribe-converted-modal-title") }, on: { close: e.close, "primary-action": e.close, "secondary-action": e.openAcademy } }, [t("p", [o._v(o._s(e.trans("email-editor.legacy-unsubscribe-converted-modal-message")))])]) : o._e();
|
|
6
|
+
}, a = [], c = /* @__PURE__ */ r(
|
|
7
|
+
s,
|
|
8
|
+
n,
|
|
9
|
+
a,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const d = c.exports;
|
|
15
|
+
export {
|
|
16
|
+
d as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent as n, computed as t } from "vue";
|
|
2
|
+
import i from "../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useTranslations as a } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { ACADEMY_LINKS as c } from "../../../enums/academy.js";
|
|
5
|
+
import { useEditorStore as p } from "../../../stores/editor.js";
|
|
6
|
+
const L = /* @__PURE__ */ n({
|
|
7
|
+
__name: "LegacyUnsubscribeConvertedModal",
|
|
8
|
+
setup(d) {
|
|
9
|
+
const o = a(), e = p(), r = t(
|
|
10
|
+
() => e.isLegacyUnsubscribeModalRequested && e.isStripoInitialized
|
|
11
|
+
), s = t(() => ({
|
|
12
|
+
secondaryButton: {
|
|
13
|
+
type: "subtle-primary",
|
|
14
|
+
labelText: o("email-editor.legacy-unsubscribe-converted-modal-visit-academy")
|
|
15
|
+
},
|
|
16
|
+
primaryButton: {
|
|
17
|
+
type: "primary",
|
|
18
|
+
labelText: o("action-builder.ok")
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
return { __sfc: !0, trans: o, editorStore: e, isVisible: r, footerButtonOptions: s, close: () => {
|
|
22
|
+
e.isLegacyUnsubscribeModalRequested = !1;
|
|
23
|
+
}, openAcademy: () => {
|
|
24
|
+
window.open(c.LEGACY_UNSUBSCRIBE_MODULE, "_blank", "noopener,noreferrer");
|
|
25
|
+
}, WpModal: i };
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
L as default
|
|
30
|
+
};
|
|
@@ -111,8 +111,8 @@ const H = 1e4, T = 3e4, m = (n, l, A) => new Promise((C, p) => {
|
|
|
111
111
|
}),
|
|
112
112
|
updateHtmlAndCss: (t, e) => {
|
|
113
113
|
const { actionsApi: i } = r();
|
|
114
|
-
return m("updateHtmlAndCss", H, (a) => {
|
|
115
|
-
i.updateHtmlAndCss(t, e, () => a());
|
|
114
|
+
return m("updateHtmlAndCss", H, (a, o) => {
|
|
115
|
+
i.updateHtmlAndCss(t, e, () => a(), o);
|
|
116
116
|
});
|
|
117
117
|
},
|
|
118
118
|
editorSave: () => m(
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TRACK_ID_ATTRIBUTE as u, writeAnchorTrackIds as I, TRACK_SEQ_ATTRIBUTE as f, planTrackingIds as h, parseTrackSeq as w, readAnchorTrackIds as k } from "../utils/linkTrackingIds.js";
|
|
2
|
+
import { getEditorApi as A } from "../utils/stripoEditorApi.js";
|
|
3
|
+
import { ModificationDescription as x } from "../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
4
|
+
function T(t, r = []) {
|
|
5
|
+
const o = t.getType();
|
|
6
|
+
if (o === "comment") {
|
|
7
|
+
const e = t.getTextContent() ?? "", i = k(e);
|
|
8
|
+
return i.length && r.push({ kind: "comment", node: t, text: e, rawIds: i }), r;
|
|
9
|
+
}
|
|
10
|
+
if (o === "element") {
|
|
11
|
+
const e = t;
|
|
12
|
+
e.getTagName().toLowerCase() === "a" && r.push({ kind: "element", node: e, rawIds: [e.getAttribute(u) ?? ""] });
|
|
13
|
+
}
|
|
14
|
+
return t.childNodes().forEach((e) => T(e, r)), r;
|
|
15
|
+
}
|
|
16
|
+
function y(t, r) {
|
|
17
|
+
if (!t)
|
|
18
|
+
throw new Error("The editor exposes no editorCopilotApi.");
|
|
19
|
+
const o = t.getDocumentRootHtmlNode(), e = o.querySelector("body");
|
|
20
|
+
if (!e)
|
|
21
|
+
throw new Error("The editor document has no <body> to record tracking ids on.");
|
|
22
|
+
const i = T(o), s = h(
|
|
23
|
+
i.flatMap((d) => d.rawIds),
|
|
24
|
+
w(e.getAttribute(f)),
|
|
25
|
+
r
|
|
26
|
+
);
|
|
27
|
+
return { api: t, seqHost: e, hosts: i, plan: s };
|
|
28
|
+
}
|
|
29
|
+
const H = () => ({ writeTrackingIds: (r) => {
|
|
30
|
+
const { editorCopilotApi: o } = A();
|
|
31
|
+
let e;
|
|
32
|
+
try {
|
|
33
|
+
e = y(o, r);
|
|
34
|
+
} catch (n) {
|
|
35
|
+
return console.warn("Tracking ids skipped for this save:", n), { changed: !1, nextSeq: r };
|
|
36
|
+
}
|
|
37
|
+
const { api: i, seqHost: s, hosts: d, plan: c } = e;
|
|
38
|
+
if (!c.changed)
|
|
39
|
+
return { changed: !1, nextSeq: c.nextSeq };
|
|
40
|
+
const a = i.getTemplateModifier();
|
|
41
|
+
let l = 0;
|
|
42
|
+
return d.forEach((n) => {
|
|
43
|
+
const m = n.rawIds.map((p, g) => c.reassigned[l + g] ? c.ids[l + g] : null);
|
|
44
|
+
l += n.rawIds.length, !m.every((p) => p === null) && (n.kind === "element" ? a.modifyHtml(n.node).setAttribute(u, String(m[0])) : a.modifyHtml(n.node).replaceWith(`<!--${I(n.text, m)}-->`));
|
|
45
|
+
}), a.modifyHtml(s).setAttribute(f, String(c.nextSeq)), a.apply(new x("Updated Insider tracking IDs").asHidden()), { changed: !0, nextSeq: c.nextSeq };
|
|
46
|
+
} });
|
|
47
|
+
export {
|
|
48
|
+
H as useEditorTrackingIds
|
|
49
|
+
};
|
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { useConfig as f } from "./useConfig.js";
|
|
2
|
+
import { useToaster as d } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as C } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as h } from "../enums/toaster.js";
|
|
5
|
+
import { useEditorStore as T } from "../stores/editor.js";
|
|
6
|
+
import { buildDynamicContentLookup as v, convertModuleDynamicContent as D } from "../utils/dynamicContentConverter.js";
|
|
7
|
+
import { flattenDynamicContentList as L } from "../utils/genericUtil.js";
|
|
7
8
|
import { repairItemsCurrencyAttributes as M } from "../utils/itemsCurrencyRepair.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
import { convertLegacyUnsubscribeInModuleHtml as O } from "../utils/legacyUnsubscribeConversion.js";
|
|
10
|
+
const E = "dynamic-content.unresolved-attributes-on-drop", Y = () => {
|
|
11
|
+
const { template: p, isFeatureEnabled: s } = f(), { showToaster: y } = d(), b = C();
|
|
12
|
+
return { handleModuleAdd: (t, r) => {
|
|
13
|
+
var c, l, u;
|
|
12
14
|
try {
|
|
13
|
-
if ((
|
|
15
|
+
if ((t == null ? void 0 : t.action) !== "ADD" && (t == null ? void 0 : t.action) !== "COPY")
|
|
14
16
|
return;
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
17
|
+
const e = (c = r == null ? void 0 : r.getTargetNode) == null ? void 0 : c.call(r), n = (l = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : l.call(e);
|
|
18
|
+
if (!e || typeof n != "string")
|
|
17
19
|
return;
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
let o = M(n), i = !1;
|
|
21
|
+
s("legacyUnsubscribeConversion") && ({ html: o, converted: i } = O(o));
|
|
22
|
+
const a = v(L((u = p.value) == null ? void 0 : u.dynamicContentList));
|
|
23
|
+
let m = [];
|
|
24
|
+
if (a.size > 0 && ({ html: o, unresolved: m } = D(o, a, s("liquidSyntax"))), o !== n && r.modifyHtml(e).replaceWith(o), i)
|
|
25
|
+
try {
|
|
26
|
+
T().isLegacyUnsubscribeModalRequested = !0;
|
|
27
|
+
} catch (g) {
|
|
28
|
+
console.error("Failed to request the legacy unsubscribe modal:", g);
|
|
29
|
+
}
|
|
30
|
+
m.length > 0 && y({
|
|
31
|
+
type: h.Warning,
|
|
32
|
+
message: b(E)
|
|
24
33
|
});
|
|
25
|
-
} catch (
|
|
26
|
-
console.error("Failed to repair module on add:",
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.error("Failed to repair module on add:", e);
|
|
27
36
|
}
|
|
28
37
|
} };
|
|
29
38
|
};
|
|
30
39
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
E as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
|
|
41
|
+
Y as useModuleRepair
|
|
33
42
|
};
|