@useinsider/guido 3.30.0-beta.a94eba0 → 3.30.0-beta.b86be87
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 +15 -12
- package/dist/components/Guido.vue.js +10 -10
- package/dist/components/Guido.vue2.js +140 -123
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.js +22 -0
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue2.js +21 -0
- package/dist/composables/useInvalidDynamicContentMarking.js +113 -0
- package/dist/composables/useModuleRepair.js +50 -56
- package/dist/composables/useStripo.js +63 -67
- package/dist/config/migrator/index.js +9 -10
- package/dist/enums/academy.js +1 -2
- package/dist/extensions/DynamicContent/dynamic-content.js +28 -26
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/@types/generic.d.ts +11 -0
- package/dist/src/components/Guido.vue.d.ts +5 -1
- package/dist/src/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.d.ts +22 -0
- package/dist/src/composables/useInvalidDynamicContentMarking.d.ts +4 -0
- package/dist/src/composables/useModuleRepair.d.ts +1 -1
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/dynamic-content.d.ts +42 -1
- package/dist/src/stores/editor.d.ts +0 -54
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +0 -3
- package/dist/static/styles/customEditorStyle.css.js +4 -0
- package/dist/stores/dynamic-content.js +19 -7
- package/dist/stores/editor.js +0 -2
- package/dist/utils/legacyUnsubscribeConversion.js +28 -69
- package/package.json +1 -1
- package/dist/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js +0 -17
- package/dist/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue2.js +0 -30
- package/dist/config/migrator/sfmcUnsubscribeTextMigrator.js +0 -20
- package/dist/src/components/organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.d.ts +0 -2
- package/dist/src/config/migrator/sfmcUnsubscribeTextMigrator.d.ts +0 -1
package/README.md
CHANGED
|
@@ -176,7 +176,7 @@ const config: GuidoConfigInput = {
|
|
|
176
176
|
legacyUnsubscribeConversion?: boolean, // Default: false - Convert legacy unsubscribe blocks that have no unsubscribe link into text blocks (on load and on module drop/copy) and show a warning modal.
|
|
177
177
|
accessibilityTesting?: boolean, // Default: false - Show the Accessibility Test entry in the header kebab menu (Stripo's checker: contrast, image alternatives, colour-vision simulation) and the tab-bar onboarding tour that points at it.
|
|
178
178
|
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).
|
|
179
|
-
blockUnsubscribeLinks?: boolean, // Default: false - Warn on save when the design carries an Insider unsubscribe link or code ({{ins-*-unsubscribe-link}}, <%asm_*_raw_url%>, <%unsub%>): the legacy save is rejected with a warning toaster; with the validation drawer on it is a warning row that "Save and Continue" can skip. Launch blocking is up to the host.
|
|
179
|
+
blockUnsubscribeLinks?: boolean, // Default: false - Warn on save when the design carries an Insider unsubscribe link or code ({{ins-*-unsubscribe-link}}, <%asm_*_raw_url%>, <%unsub%>): the legacy save is rejected with a warning toaster; with the validation drawer on it is a warning row that "Save and Continue" can skip. Launch blocking is up to the host. Set true for accounts whose unsubscribes are managed outside Insider (SFMC).
|
|
180
180
|
},
|
|
181
181
|
|
|
182
182
|
// Optional: Callbacks
|
|
@@ -235,6 +235,7 @@ one-way. While `ready` is `false` every `features` toggle reads as disabled.
|
|
|
235
235
|
|-------|---------|-------------|
|
|
236
236
|
| `ready` | - | Editor is loaded and ready |
|
|
237
237
|
| `dynamic-content:open` | `DynamicContent \| null` | User wants to insert dynamic content |
|
|
238
|
+
| `dynamic-content:invalid-action` | `{ value: string }` | User clicked the link on an invalid chip's hover card; `value` is the chip's token |
|
|
238
239
|
| `back` | - | Back button clicked |
|
|
239
240
|
| `save:start` | - | Save process started |
|
|
240
241
|
| `save:complete` | `SavedTemplateDetails` | Save completed successfully (includes `metadata`) |
|
|
@@ -297,6 +298,18 @@ guidoRef.value?.dynamicContent.insert({
|
|
|
297
298
|
// Close dynamic content modal
|
|
298
299
|
guidoRef.value?.dynamicContent.close();
|
|
299
300
|
|
|
301
|
+
// Mark chips as invalid (red, with a hover card). Each call replaces the list;
|
|
302
|
+
// an empty list clears every mark. `value` is the token, without braces.
|
|
303
|
+
guidoRef.value?.dynamicContent.setInvalid([
|
|
304
|
+
{
|
|
305
|
+
value: 'zc_profile.i12.city',
|
|
306
|
+
title: 'Dynamic Content Unavailable',
|
|
307
|
+
description: 'Segment name',
|
|
308
|
+
actionLabel: 'Update Segment',
|
|
309
|
+
actionAvailable: true,
|
|
310
|
+
},
|
|
311
|
+
] satisfies InvalidDynamicContent[]);
|
|
312
|
+
|
|
300
313
|
// Silent save (no UI feedback)
|
|
301
314
|
guidoRef.value?.saveSilent();
|
|
302
315
|
|
|
@@ -575,6 +588,7 @@ import type {
|
|
|
575
588
|
DynamicContent,
|
|
576
589
|
DynamicContentList,
|
|
577
590
|
DynamicContentNode,
|
|
591
|
+
InvalidDynamicContent,
|
|
578
592
|
DefaultBlockType,
|
|
579
593
|
CustomBlockType,
|
|
580
594
|
} from '@useinsider/guido';
|
|
@@ -721,17 +735,6 @@ keys host-side: `email-editor.legacy-unsubscribe-converted-modal-title`,
|
|
|
721
735
|
`email-editor.legacy-unsubscribe-converted-modal-message` and
|
|
722
736
|
`email-editor.legacy-unsubscribe-converted-modal-visit-academy` (OK reuses `action-builder.ok`).
|
|
723
737
|
|
|
724
|
-
With `features.blockUnsubscribeLinks: true`, every unsubscribe block (v2 or legacy, with or
|
|
725
|
-
without a link) becomes a plain text block when a template is opened and when a module is
|
|
726
|
-
dropped or copied. Inside a converted block, a link to an Insider unsubscribe or preferences
|
|
727
|
-
merge tag or code, or an unsubscribe link left with an empty href, is removed and
|
|
728
|
-
keeps its visible text; other links keep their URL and text and only lose the unsubscribe link markers. One info
|
|
729
|
-
modal is shown per template open or per drop that converted a block, and a load-time conversion
|
|
730
|
-
marks the editor as changed so the next save or autosave stores it.
|
|
731
|
-
Register these keys host-side: `email-editor.sfmc-unsubscribe-converted-modal-title`
|
|
732
|
-
and `email-editor.sfmc-unsubscribe-converted-modal-message` (Visit Academy reuses
|
|
733
|
-
`email-editor.legacy-unsubscribe-converted-modal-visit-academy`, OK reuses `action-builder.ok`).
|
|
734
|
-
|
|
735
738
|
---
|
|
736
739
|
|
|
737
740
|
## Development
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
5
|
-
var
|
|
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) :
|
|
4
|
+
var o = function() {
|
|
5
|
+
var n = this, r = n._self._c, e = n._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) : n._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) : n._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : n._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : n._e(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : n._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : n._e(), e.hoveredInvalidDynamicContent ? r(e.InvalidDynamicContentCard, { attrs: { entry: e.hoveredInvalidDynamicContent.entry, position: e.hoveredInvalidDynamicContent.position }, on: { "dynamic-content:invalid-action": e.handleInvalidDynamicContentAction, mouseenter: e.cancelInvalidCardHide, mouseleave: e.scheduleInvalidCardHide } }) : n._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : n._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : n._e(), e.isTestPartner() ? n._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(l) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
},
|
|
9
|
+
}, t = [], d = /* @__PURE__ */ i(
|
|
10
|
+
a,
|
|
10
11
|
o,
|
|
11
|
-
|
|
12
|
-
s,
|
|
12
|
+
t,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"b7cb4d33"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const p = d.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
p as default
|
|
20
20
|
};
|
|
@@ -1,105 +1,106 @@
|
|
|
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 {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
|
|
1
|
+
import { defineComponent as Fe, defineAsyncComponent as a, ref as L, computed as u, watch as Q, onMounted as Me, onUnmounted as Re } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as Ae } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as Oe } from "../composables/useEditorLock.js";
|
|
4
|
+
import { startEditorOpenMetrics as Ue } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
+
import { provideGuidoActions as _e } from "../composables/useGuidoActions.js";
|
|
6
|
+
import { useGuidoStateBridge as He } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { useInvalidDynamicContentMarking as Ne } from "../composables/useInvalidDynamicContentMarking.js";
|
|
8
|
+
import { usePartner as Pe } from "../composables/usePartner.js";
|
|
9
|
+
import { useSaveValidationRollout as xe } from "../composables/useSaveValidationRollout.js";
|
|
10
|
+
import { useStripo as Be } from "../composables/useStripo.js";
|
|
11
|
+
import { useTimerClone as Ve } from "../composables/useTimerClone.js";
|
|
12
|
+
import { useToaster as We } from "../composables/useToaster.js";
|
|
13
|
+
import { useTranslations as $e } from "../composables/useTranslations.js";
|
|
14
|
+
import { migrate as Ge } from "../config/migrator/index.js";
|
|
15
|
+
import { ModuleFolderDefaults as X } from "../enums/defaults.js";
|
|
16
|
+
import { RIBBON_SELECTOR as ze } from "../enums/onboarding.js";
|
|
17
|
+
import { ToasterTypeOptions as qe } from "../enums/toaster.js";
|
|
18
|
+
import { useRecommendationExtensionStore as Z, disposeStrategyPageReturnListeners as Ke } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
19
|
+
import { disposeUnsubscribeListeners as Ye } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
20
|
+
import { disposeDisplayConditionRequest as je } from "../extensions/DisplayConditions/bridge.js";
|
|
21
|
+
import Je from "./organisms/AutoSaveController.vue.js";
|
|
22
|
+
import Qe from "./organisms/base/AuthErrorModal.vue.js";
|
|
23
|
+
import Xe from "./organisms/base/Toaster.vue.js";
|
|
24
|
+
import Ze from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
25
|
+
import et from "./organisms/header/HeaderWrapper.vue.js";
|
|
26
|
+
import tt from "./organisms/LoadingWrapper.vue.js";
|
|
27
|
+
import ot from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
28
|
+
import nt from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
29
|
+
import it from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
30
|
+
import { useStripoApi as rt } from "../services/stripoApi.js";
|
|
31
|
+
import { useConfigStore as at } from "../stores/config.js";
|
|
32
|
+
import { useDynamicContentStore as st } from "../stores/dynamic-content.js";
|
|
33
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
34
|
+
import { useModuleDynamicContentStore as ee } from "../stores/module-dynamic-content.js";
|
|
35
|
+
import { useOnboardingStore as ct } from "../stores/onboarding.js";
|
|
36
|
+
import { usePreviewStore as dt } from "../stores/preview.js";
|
|
37
|
+
import { useSaveValidationStore as mt } from "../stores/save-validation.js";
|
|
38
|
+
import { useTemplateStore as lt } from "../stores/template.js";
|
|
39
|
+
import { useUnsubscribeStore as ut } from "../stores/unsubscribe.js";
|
|
40
|
+
import { readTrackFloor as te } from "../utils/linkTrackingIds.js";
|
|
41
|
+
const Zt = /* @__PURE__ */ Fe({
|
|
41
42
|
__name: "Guido",
|
|
42
43
|
props: {
|
|
43
44
|
config: null,
|
|
44
45
|
ready: { type: Boolean, default: !0 }
|
|
45
46
|
},
|
|
46
|
-
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
47
|
-
setup(
|
|
48
|
-
const
|
|
47
|
+
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click", "dynamic-content:invalid-action"],
|
|
48
|
+
setup(oe, { expose: ne, emit: i }) {
|
|
49
|
+
const c = oe, r = Ue(), ie = a(
|
|
49
50
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
50
|
-
),
|
|
51
|
+
), re = a(
|
|
51
52
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
52
|
-
),
|
|
53
|
+
), ae = a(
|
|
53
54
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
54
|
-
),
|
|
55
|
+
), se = a(
|
|
55
56
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
56
|
-
),
|
|
57
|
+
), ce = a(
|
|
57
58
|
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
58
|
-
),
|
|
59
|
+
), F = L(), de = a(
|
|
59
60
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
60
|
-
),
|
|
61
|
+
), me = a(
|
|
61
62
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
62
|
-
),
|
|
63
|
-
() => import("./organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js")
|
|
64
|
-
), re = s(
|
|
63
|
+
), le = a(
|
|
65
64
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
66
|
-
),
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
), ue = a(
|
|
66
|
+
() => import("./organisms/dynamic-content/InvalidDynamicContentCard.vue.js")
|
|
67
|
+
), M = 200, S = L(), p = st(), R = ut(), pe = ee(), o = at();
|
|
68
|
+
c.ready && o.init(c.config);
|
|
69
|
+
const d = w(), ve = dt(), f = u(() => d.hasChanges), { isTestPartner: ye } = Pe(), { isEnabled: fe, loadRollout: A } = xe(), { showToaster: O } = We(), U = $e(), _ = () => {
|
|
69
70
|
var t;
|
|
70
|
-
if (
|
|
71
|
-
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }),
|
|
72
|
-
type:
|
|
73
|
-
message:
|
|
71
|
+
if (d.isVersionHistoryOpen) {
|
|
72
|
+
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), O({
|
|
73
|
+
type: qe.Warning,
|
|
74
|
+
message: U("email-editor.save-blocked-outside-editor")
|
|
74
75
|
});
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
|
-
return (t =
|
|
78
|
-
},
|
|
79
|
-
|
|
78
|
+
return (t = F.value) == null ? void 0 : t.saveSilent();
|
|
79
|
+
}, H = (t) => {
|
|
80
|
+
d.loadingStatus = t;
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
const
|
|
82
|
+
Ae(), He();
|
|
83
|
+
const N = Ne(), h = () => {
|
|
83
84
|
var t, e;
|
|
84
85
|
return {
|
|
85
86
|
emailId: o.templateId,
|
|
86
87
|
userId: o.userId,
|
|
87
88
|
username: o.username,
|
|
88
89
|
partnerName: o.partnerName,
|
|
89
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
90
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
90
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || X.SAVED_MODULES,
|
|
91
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || X.DEFAULT_MODULES
|
|
91
92
|
};
|
|
92
|
-
}, { initPlugin:
|
|
93
|
-
let
|
|
94
|
-
const { getDefaultTemplate:
|
|
93
|
+
}, { initPlugin: P, preloadRuntime: x } = Be(r), { runExclusive: B, beginMount: V, isCurrentMount: C } = Oe();
|
|
94
|
+
let g = 0;
|
|
95
|
+
const { getDefaultTemplate: W } = rt(), { cloneTimersOnSave: $, hasTimerBlocks: G } = Ve(), ge = u(() => {
|
|
95
96
|
var t;
|
|
96
97
|
return !((t = o.ui) != null && t.showHeader);
|
|
97
|
-
}),
|
|
98
|
+
}), be = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Se = u(() => o.externalDisplayConditions), he = u(
|
|
98
99
|
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
99
|
-
),
|
|
100
|
-
() => !!
|
|
100
|
+
), Ce = u(
|
|
101
|
+
() => !!Z().recommendationConfigs.strategyId
|
|
101
102
|
);
|
|
102
|
-
|
|
103
|
+
_e({
|
|
103
104
|
onBack: () => {
|
|
104
105
|
console.debug("guido:back"), i("back");
|
|
105
106
|
},
|
|
@@ -107,111 +108,127 @@ const $t = /* @__PURE__ */ he({
|
|
|
107
108
|
console.debug("guido:save:start"), i("save:start");
|
|
108
109
|
},
|
|
109
110
|
onSaveComplete: (t) => {
|
|
110
|
-
const e = { ...t, metadata:
|
|
111
|
+
const e = { ...t, metadata: h() };
|
|
111
112
|
console.debug("guido:save:complete", e), i("save:complete", e);
|
|
112
113
|
},
|
|
113
114
|
onTestEmailClick: () => {
|
|
114
115
|
console.debug("guido:test-email:click"), i("test-email:click");
|
|
115
116
|
}
|
|
116
117
|
});
|
|
117
|
-
const
|
|
118
|
-
console.debug("dynamic-content:close", t),
|
|
119
|
-
},
|
|
118
|
+
const z = (t) => {
|
|
119
|
+
console.debug("dynamic-content:close", t), p.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
120
|
+
}, q = () => {
|
|
120
121
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
122
|
+
}, K = (t) => {
|
|
123
|
+
p.setInvalidDynamicContent(t);
|
|
124
|
+
}, b = L(null);
|
|
125
|
+
let m = null;
|
|
126
|
+
const v = () => {
|
|
127
|
+
m && (clearTimeout(m), m = null);
|
|
128
|
+
}, E = () => {
|
|
129
|
+
v(), m = setTimeout(() => {
|
|
130
|
+
m = null, b.value = null;
|
|
131
|
+
}, M);
|
|
132
|
+
}, D = (t) => {
|
|
133
|
+
const { detail: e } = t;
|
|
134
|
+
!(e != null && e.entry) || !e.position || (v(), b.value = { entry: e.entry, position: e.position });
|
|
135
|
+
}, Ee = (t) => {
|
|
136
|
+
console.debug("dynamic-content:invalid-action", t), v(), b.value = null, i("dynamic-content:invalid-action", { value: t.value });
|
|
121
137
|
};
|
|
122
|
-
|
|
123
|
-
i("on-change",
|
|
138
|
+
Q(() => f.value, () => {
|
|
139
|
+
i("on-change", f.value);
|
|
124
140
|
});
|
|
125
|
-
const
|
|
126
|
-
const e = t, { attribute:
|
|
127
|
-
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open",
|
|
141
|
+
const I = (t) => {
|
|
142
|
+
const e = t, { attribute: s, position: y } = e.detail;
|
|
143
|
+
console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, y);
|
|
128
144
|
};
|
|
129
145
|
let l = null;
|
|
130
|
-
const
|
|
146
|
+
const T = () => {
|
|
131
147
|
var e;
|
|
132
|
-
const t = document.querySelector(
|
|
133
|
-
(e =
|
|
134
|
-
},
|
|
148
|
+
const t = document.querySelector(ze);
|
|
149
|
+
(e = S.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
150
|
+
}, k = async () => {
|
|
135
151
|
var t;
|
|
136
152
|
r.mark("host_ready");
|
|
137
153
|
try {
|
|
138
|
-
o.initialized || o.init(
|
|
154
|
+
o.initialized || o.init(c.config), d.templateId = o.templateId, r.setContext({
|
|
139
155
|
partnerName: o.partnerName,
|
|
140
156
|
productType: o.productType,
|
|
141
157
|
templateId: o.templateId,
|
|
142
158
|
variationId: o.variationId
|
|
143
159
|
});
|
|
144
|
-
const e = o.template,
|
|
145
|
-
|
|
146
|
-
const
|
|
160
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", y = (e == null ? void 0 : e.css) || "", Y = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
161
|
+
R.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
162
|
+
const De = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, j = o.isFeatureEnabled("linkTrackingIds"), Ie = {
|
|
147
163
|
partnerName: o.partnerName,
|
|
148
164
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
149
165
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
150
|
-
},
|
|
166
|
+
}, Te = {
|
|
151
167
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
152
|
-
},
|
|
168
|
+
}, J = (we) => r.timed(
|
|
153
169
|
"migration",
|
|
154
|
-
() =>
|
|
170
|
+
() => Ge(we, De, Ie, Te)
|
|
155
171
|
);
|
|
156
172
|
let n = {
|
|
157
|
-
html:
|
|
158
|
-
css:
|
|
173
|
+
html: s && await J(s),
|
|
174
|
+
css: y
|
|
159
175
|
};
|
|
160
|
-
n.html || (n = await r.timed("default_template", () =>
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
preselectedDynamicContentList:
|
|
176
|
+
n.html || (n = await r.timed("default_template", () => W()), n.html = await J(n.html));
|
|
177
|
+
const ke = j ? te(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
178
|
+
G(n.html) && (n.html = await r.timed("timer_clone", () => $(n.html))), j && (d.trackIdSessionFloor = Math.max(ke, te(n.html)));
|
|
179
|
+
const Le = {
|
|
180
|
+
preselectedDynamicContentList: Y,
|
|
165
181
|
onReady: () => {
|
|
166
182
|
console.debug("guido:ready"), i("ready");
|
|
167
183
|
}
|
|
168
184
|
};
|
|
169
|
-
|
|
185
|
+
g = V(), await P(n, h(), Le, n.html !== s), p.selectedDynamicContentList = Y;
|
|
170
186
|
} catch (e) {
|
|
171
187
|
console.error("Failed to initialize Stripo editor:", e), r.markFailed();
|
|
172
188
|
}
|
|
173
189
|
};
|
|
174
|
-
return
|
|
190
|
+
return Me(async () => {
|
|
175
191
|
var e;
|
|
176
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
177
|
-
const t = (e =
|
|
178
|
-
if (t && (l = new ResizeObserver(
|
|
179
|
-
await
|
|
192
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), Z().$reset(), w().$reset(), lt().$reset(), mt().$reset(), ee().$reset(), p.setInvalidDynamicContent([]), ct().resetOnboarding("recommendationLegacyStrategyOnboarding"), A(), T();
|
|
193
|
+
const t = (e = S.value) == null ? void 0 : e.parentElement;
|
|
194
|
+
if (t && (l = new ResizeObserver(T), l.observe(t)), x(), c.ready)
|
|
195
|
+
await k();
|
|
180
196
|
else {
|
|
181
|
-
const
|
|
182
|
-
|
|
197
|
+
const s = Q(() => c.ready, (y) => {
|
|
198
|
+
y && (s(), k());
|
|
183
199
|
});
|
|
184
200
|
}
|
|
185
|
-
document.addEventListener("dynamic-content:open",
|
|
186
|
-
}),
|
|
187
|
-
if (
|
|
188
|
-
|
|
201
|
+
document.addEventListener("dynamic-content:open", I), document.addEventListener("dynamic-content:invalid-hover", D), document.addEventListener("dynamic-content:invalid-leave", E);
|
|
202
|
+
}), Re(() => {
|
|
203
|
+
if (Ye(), Ke(), r.dispose(), N.dispose(), l == null || l.disconnect(), document.removeEventListener("dynamic-content:open", I), document.removeEventListener("dynamic-content:invalid-hover", D), document.removeEventListener("dynamic-content:invalid-leave", E), v(), C(g)) {
|
|
204
|
+
je();
|
|
189
205
|
try {
|
|
190
|
-
const t =
|
|
206
|
+
const t = w();
|
|
191
207
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
192
208
|
} catch (t) {
|
|
193
209
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
194
210
|
}
|
|
195
211
|
}
|
|
196
|
-
|
|
197
|
-
if (
|
|
212
|
+
B(async () => {
|
|
213
|
+
if (C(g))
|
|
198
214
|
try {
|
|
199
215
|
window.UIEditor.removeEditor();
|
|
200
216
|
} catch {
|
|
201
217
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
202
218
|
}
|
|
203
219
|
}), o.reset();
|
|
204
|
-
}),
|
|
220
|
+
}), ne({
|
|
205
221
|
dynamicContent: {
|
|
206
|
-
insert:
|
|
207
|
-
close:
|
|
222
|
+
insert: z,
|
|
223
|
+
close: q,
|
|
224
|
+
setInvalid: K
|
|
208
225
|
},
|
|
209
|
-
hasChanges:
|
|
210
|
-
saveSilent:
|
|
211
|
-
setLoading:
|
|
212
|
-
}), { __sfc: !0, openMetrics: r, PreviewContainer:
|
|
226
|
+
hasChanges: f,
|
|
227
|
+
saveSilent: _,
|
|
228
|
+
setLoading: H
|
|
229
|
+
}), { __sfc: !0, openMetrics: r, PreviewContainer: ie, OnboardingWrapper: re, AssignStrategyDrawer: ae, RemoveStrategyModal: se, DisplayConditionsHost: ce, autoSaveControllerRef: F, LegacyStrategyUpdatedModal: de, LegacyUnsubscribeConvertedModal: me, AmbiguousDynamicContentModal: le, InvalidDynamicContentCard: ue, INVALID_CARD_HIDE_DELAY: M, wrapperRef: S, dynamicContentStore: p, unsubscribeStore: R, moduleDynamicContentStore: pe, props: c, configStore: o, editorStore: d, previewStore: ve, hasChanges: f, isTestPartner: ye, isSaveValidationEnabled: fe, loadRollout: A, showToaster: O, trans: U, saveSilent: _, setLoading: H, emit: i, invalidDynamicContentMarking: N, buildMetadata: h, initPlugin: P, preloadRuntime: x, runExclusive: B, beginMount: V, isCurrentMount: C, mountGeneration: g, getDefaultTemplate: W, cloneTimersOnSave: $, hasTimerBlocks: G, noHeader: ge, isRrsEnabled: be, isExternalDisplayConditionsEnabled: Se, isLegacyUnsubscribeConversionEnabled: he, hasAssignedStrategy: Ce, insertDynamicContent: z, closeDynamicContent: q, setInvalidDynamicContent: K, hoveredInvalidDynamicContent: b, invalidCardHideTimer: m, cancelInvalidCardHide: v, scheduleInvalidCardHide: E, handleInvalidDynamicContentHover: D, handleInvalidDynamicContentAction: Ee, handleDynamicContentOpen: I, ribbonObserver: l, updateRibbonOffset: T, startEditor: k, AutoSaveController: Je, AuthErrorModal: Qe, Toaster: Xe, FilterSelectionDrawer: Ze, HeaderWrapper: et, LoadingWrapper: tt, SaveAsTemplateDrawer: ot, UnsubscribeWrapper: nt, ValidationErrorDrawer: it };
|
|
213
230
|
}
|
|
214
231
|
});
|
|
215
232
|
export {
|
|
216
|
-
|
|
233
|
+
Zt as default
|
|
217
234
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import a from "./InvalidDynamicContentCard.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import c from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var o = function() {
|
|
5
|
+
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
6
|
+
return n("div", { staticClass: "invalid-dynamic-content-card", style: e.cardStyle, attrs: { id: "guido__invalid-dynamic-content-card", role: "tooltip" }, on: { mouseenter: function(i) {
|
|
7
|
+
return e.emit("mouseenter");
|
|
8
|
+
}, mouseleave: function(i) {
|
|
9
|
+
return e.emit("mouseleave");
|
|
10
|
+
} } }, [n("p", { staticClass: "invalid-dynamic-content-card__title" }, [t._v(" " + t._s(t.entry.title) + " ")]), n("p", { staticClass: "invalid-dynamic-content-card__description" }, [t._v(" " + t._s(t.entry.description) + " ")]), t.entry.actionAvailable ? n("button", { staticClass: "invalid-dynamic-content-card__action", attrs: { id: "guido__invalid-dynamic-content-card-action", type: "button" }, on: { click: e.onAction } }, [t._v(" " + t._s(t.entry.actionLabel) + " ")]) : t._e()]);
|
|
11
|
+
}, r = [], s = /* @__PURE__ */ c(
|
|
12
|
+
a,
|
|
13
|
+
o,
|
|
14
|
+
r,
|
|
15
|
+
!1,
|
|
16
|
+
null,
|
|
17
|
+
"007c64e1"
|
|
18
|
+
);
|
|
19
|
+
const v = s.exports;
|
|
20
|
+
export {
|
|
21
|
+
v as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as c, computed as s } from "vue";
|
|
2
|
+
const l = /* @__PURE__ */ c({
|
|
3
|
+
__name: "InvalidDynamicContentCard",
|
|
4
|
+
props: {
|
|
5
|
+
entry: null,
|
|
6
|
+
position: null
|
|
7
|
+
},
|
|
8
|
+
emits: ["dynamic-content:invalid-action", "mouseenter", "mouseleave"],
|
|
9
|
+
setup(e, { emit: t }) {
|
|
10
|
+
const n = e, o = 4, i = s(() => ({
|
|
11
|
+
top: `${n.position.y + (n.position.height ?? 0) + o}px`,
|
|
12
|
+
left: `${n.position.x}px`
|
|
13
|
+
}));
|
|
14
|
+
return { __sfc: !0, CARD_OFFSET: o, props: n, emit: t, cardStyle: i, onAction: () => {
|
|
15
|
+
t("dynamic-content:invalid-action", { value: n.entry.value });
|
|
16
|
+
} };
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
l as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { useDynamicContentStore as g } from "../stores/dynamic-content.js";
|
|
2
|
+
import { useEditorStore as L } from "../stores/editor.js";
|
|
3
|
+
import { findEditorShadowRoot as S } from "../utils/editorShadowRoot.js";
|
|
4
|
+
import { watch as T } from "vue";
|
|
5
|
+
const p = "merge-tag-selector", y = "merge-tag-value", m = "guido-invalid-dynamic-content-style", $ = (t) => t.replace(/["\\]/g, "\\$&").replace(/[\n\r\f]/g, (n) => `\\${n.charCodeAt(0).toString(16)} `), M = (t) => {
|
|
6
|
+
const n = t.flatMap((o) => {
|
|
7
|
+
const e = $(o);
|
|
8
|
+
return [`="{{${e}}}"`, `^="{{${e}\\|"`, `="{{ ${e} }}"`, `^="{{ ${e} \\|"`].map((i) => `${p}[${y}${i}]`).flatMap((i) => [`${i} .esd-merge-tag`, `${i} .esd-x`]);
|
|
9
|
+
});
|
|
10
|
+
return n.length === 0 ? "" : `${n.join(`,
|
|
11
|
+
`)} {
|
|
12
|
+
color: var(--guido-dc-invalid-color) !important;
|
|
13
|
+
border-color: var(--guido-dc-invalid-color) !important;
|
|
14
|
+
}`;
|
|
15
|
+
}, v = (t) => {
|
|
16
|
+
const n = /^\{\{([^}]*)\}\}/.exec(t.getAttribute(y) ?? "");
|
|
17
|
+
return (n == null ? void 0 : n[1].split("|")[0].trim()) ?? "";
|
|
18
|
+
}, w = (t) => typeof (t == null ? void 0 : t.nodeType) == "number", x = (t) => {
|
|
19
|
+
const n = t;
|
|
20
|
+
return typeof (n == null ? void 0 : n.closest) == "function" ? n.closest(p) : null;
|
|
21
|
+
}, f = () => {
|
|
22
|
+
var t;
|
|
23
|
+
return ((t = S()) == null ? void 0 : t.querySelector("iframe")) ?? null;
|
|
24
|
+
}, C = () => {
|
|
25
|
+
var t, n;
|
|
26
|
+
return ((n = (t = f()) == null ? void 0 : t.contentWindow) == null ? void 0 : n.document) ?? null;
|
|
27
|
+
}, A = (t, n) => {
|
|
28
|
+
const o = t.getBoundingClientRect(), e = n.getBoundingClientRect();
|
|
29
|
+
return {
|
|
30
|
+
x: o.x + e.x,
|
|
31
|
+
y: o.y + e.y,
|
|
32
|
+
width: e.width,
|
|
33
|
+
height: e.height
|
|
34
|
+
};
|
|
35
|
+
}, h = (t, n) => {
|
|
36
|
+
var c;
|
|
37
|
+
const o = M(n), e = t.getElementById(m);
|
|
38
|
+
if (!o) {
|
|
39
|
+
e == null || e.remove();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (e) {
|
|
43
|
+
e.textContent !== o && (e.textContent = o);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const i = t.createElement("style");
|
|
47
|
+
i.id = m, i.textContent = o, (c = t.head ?? t.body) == null || c.appendChild(i);
|
|
48
|
+
}, B = () => {
|
|
49
|
+
const t = C();
|
|
50
|
+
if (t)
|
|
51
|
+
try {
|
|
52
|
+
const n = g().invalidDynamicContentList.map((o) => o.value);
|
|
53
|
+
h(t, n);
|
|
54
|
+
} catch (n) {
|
|
55
|
+
console.error("Failed to apply the invalid dynamic content marking", n);
|
|
56
|
+
}
|
|
57
|
+
}, G = () => {
|
|
58
|
+
const t = g(), n = L();
|
|
59
|
+
let o = null, e = null;
|
|
60
|
+
const i = () => {
|
|
61
|
+
e && (e = null, document.dispatchEvent(new CustomEvent("dynamic-content:invalid-leave")));
|
|
62
|
+
}, c = (r) => {
|
|
63
|
+
const s = x(r.target);
|
|
64
|
+
if (!s || s === e)
|
|
65
|
+
return;
|
|
66
|
+
const l = t.getInvalidDynamicContent(v(s)), u = f();
|
|
67
|
+
if (!l || !u)
|
|
68
|
+
return;
|
|
69
|
+
e = s;
|
|
70
|
+
const I = {
|
|
71
|
+
entry: { ...l },
|
|
72
|
+
position: A(u, s)
|
|
73
|
+
};
|
|
74
|
+
document.dispatchEvent(new CustomEvent("dynamic-content:invalid-hover", { detail: I }));
|
|
75
|
+
}, d = (r) => {
|
|
76
|
+
!e || w(r.relatedTarget) && e.contains(r.relatedTarget) || i();
|
|
77
|
+
}, a = () => {
|
|
78
|
+
o == null || o.removeEventListener("mouseover", c), o == null || o.removeEventListener("mouseout", d), o == null || o.removeEventListener("scroll", i, !0), o = null, i();
|
|
79
|
+
}, E = () => {
|
|
80
|
+
if (!n.isStripoInitialized) {
|
|
81
|
+
a();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const r = C(), s = t.invalidDynamicContentList.map((l) => l.value);
|
|
85
|
+
if (!r) {
|
|
86
|
+
a();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (h(r, s), s.length === 0) {
|
|
90
|
+
a();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
r !== o && (a(), r.addEventListener("mouseover", c), r.addEventListener("mouseout", d), r.addEventListener("scroll", i, !0), o = r), e && (!e.isConnected || !s.includes(v(e))) && i();
|
|
94
|
+
};
|
|
95
|
+
return T(
|
|
96
|
+
[
|
|
97
|
+
() => n.isStripoInitialized,
|
|
98
|
+
() => n.changeSeq,
|
|
99
|
+
() => t.invalidDynamicContentList
|
|
100
|
+
],
|
|
101
|
+
() => {
|
|
102
|
+
try {
|
|
103
|
+
E();
|
|
104
|
+
} catch (r) {
|
|
105
|
+
console.error("Failed to track invalid dynamic content", r);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
), { dispose: a };
|
|
109
|
+
};
|
|
110
|
+
export {
|
|
111
|
+
B as applyInvalidDynamicContentMarking,
|
|
112
|
+
G as useInvalidDynamicContentMarking
|
|
113
|
+
};
|