@useinsider/guido 3.30.0-beta.c0e9c5a → 3.30.0-beta.c5a9a65
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 +14 -0
- package/dist/components/Guido.vue.js +9 -9
- package/dist/components/Guido.vue2.js +149 -130
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.js +22 -0
- package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue2.js +30 -0
- package/dist/composables/useInvalidDynamicContentMarking.js +105 -0
- package/dist/config/migrator/itemsBlockMigrator.js +164 -161
- package/dist/extensions/DynamicContent/dynamic-content.js +39 -57
- 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/extensions/DynamicContent/dynamic-content.d.ts +0 -8
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/dynamic-content.d.ts +42 -1
- package/dist/src/utils/editorCanvas.d.ts +3 -0
- package/dist/static/styles/customEditorStyle.css.js +4 -0
- package/dist/stores/dynamic-content.js +19 -7
- package/dist/utils/editorCanvas.js +18 -0
- package/dist/utils/pairProductVariables.js +98 -108
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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';
|
|
@@ -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 && e.hoveredInvalidEntry ? r(e.InvalidDynamicContentCard, { attrs: { entry: e.hoveredInvalidEntry, 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
|
-
}, t = [],
|
|
9
|
+
}, t = [], d = /* @__PURE__ */ i(
|
|
10
|
+
a,
|
|
10
11
|
o,
|
|
11
|
-
n,
|
|
12
12
|
t,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"d5ad6f2a"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const p = d.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
p as default
|
|
20
20
|
};
|
|
@@ -1,215 +1,234 @@
|
|
|
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 Me, defineAsyncComponent as s, ref as L, computed as c, watch as Q, onMounted as Re, onUnmounted as Ae } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as Oe } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as Ue } from "../composables/useEditorLock.js";
|
|
4
|
+
import { startEditorOpenMetrics as _e } from "../composables/useEditorOpenMetrics.js";
|
|
5
|
+
import { provideGuidoActions as He } from "../composables/useGuidoActions.js";
|
|
6
|
+
import { useGuidoStateBridge as Ne } from "../composables/useGuidoStateBridge.js";
|
|
7
|
+
import { useInvalidDynamicContentMarking as Pe } from "../composables/useInvalidDynamicContentMarking.js";
|
|
8
|
+
import { usePartner as xe } from "../composables/usePartner.js";
|
|
9
|
+
import { useSaveValidationRollout as Be } from "../composables/useSaveValidationRollout.js";
|
|
10
|
+
import { useStripo as Ve } from "../composables/useStripo.js";
|
|
11
|
+
import { useTimerClone as We } from "../composables/useTimerClone.js";
|
|
12
|
+
import { useToaster as $e } from "../composables/useToaster.js";
|
|
13
|
+
import { useTranslations as Ge } from "../composables/useTranslations.js";
|
|
14
|
+
import { migrate as ze } from "../config/migrator/index.js";
|
|
15
|
+
import { ModuleFolderDefaults as X } from "../enums/defaults.js";
|
|
16
|
+
import { RIBBON_SELECTOR as qe } from "../enums/onboarding.js";
|
|
17
|
+
import { ToasterTypeOptions as Ke } from "../enums/toaster.js";
|
|
18
|
+
import { useRecommendationExtensionStore as Z, disposeStrategyPageReturnListeners as Ye } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
19
|
+
import { disposeUnsubscribeListeners as je } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
20
|
+
import { disposeDisplayConditionRequest as Je } from "../extensions/DisplayConditions/bridge.js";
|
|
21
|
+
import Qe from "./organisms/AutoSaveController.vue.js";
|
|
22
|
+
import Xe from "./organisms/base/AuthErrorModal.vue.js";
|
|
23
|
+
import Ze from "./organisms/base/Toaster.vue.js";
|
|
24
|
+
import et from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
25
|
+
import tt from "./organisms/header/HeaderWrapper.vue.js";
|
|
26
|
+
import ot from "./organisms/LoadingWrapper.vue.js";
|
|
27
|
+
import nt from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
28
|
+
import it from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
29
|
+
import rt from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
30
|
+
import { useStripoApi as at } from "../services/stripoApi.js";
|
|
31
|
+
import { useConfigStore as st } from "../stores/config.js";
|
|
32
|
+
import { useDynamicContentStore as ct } 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 dt } from "../stores/onboarding.js";
|
|
36
|
+
import { usePreviewStore as mt } from "../stores/preview.js";
|
|
37
|
+
import { useSaveValidationStore as lt } from "../stores/save-validation.js";
|
|
38
|
+
import { useTemplateStore as ut } from "../stores/template.js";
|
|
39
|
+
import { useUnsubscribeStore as pt } from "../stores/unsubscribe.js";
|
|
40
|
+
import { readTrackFloor as te } from "../utils/linkTrackingIds.js";
|
|
41
|
+
const eo = /* @__PURE__ */ Me({
|
|
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: r }) {
|
|
49
|
+
const d = oe, a = _e(), ie = s(
|
|
49
50
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
50
|
-
),
|
|
51
|
+
), re = s(
|
|
51
52
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
52
|
-
),
|
|
53
|
+
), ae = s(
|
|
53
54
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
54
|
-
),
|
|
55
|
+
), se = s(
|
|
55
56
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
56
|
-
),
|
|
57
|
+
), ce = s(
|
|
57
58
|
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
58
|
-
),
|
|
59
|
+
), F = L(), de = s(
|
|
59
60
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
60
|
-
),
|
|
61
|
+
), me = s(
|
|
61
62
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
62
|
-
),
|
|
63
|
+
), le = s(
|
|
63
64
|
() => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
|
|
64
|
-
),
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
), ue = s(
|
|
66
|
+
() => import("./organisms/dynamic-content/InvalidDynamicContentCard.vue.js")
|
|
67
|
+
), M = 200, S = L(), m = ct(), R = pt(), pe = ee(), o = st();
|
|
68
|
+
d.ready && o.init(d.config);
|
|
69
|
+
const l = w(), ve = mt(), g = c(() => l.hasChanges), { isTestPartner: ye } = xe(), { isEnabled: fe, loadRollout: A } = Be(), { showToaster: O } = $e(), U = Ge(), _ = () => {
|
|
67
70
|
var t;
|
|
68
|
-
if (
|
|
69
|
-
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }),
|
|
70
|
-
type:
|
|
71
|
-
message:
|
|
71
|
+
if (l.isVersionHistoryOpen) {
|
|
72
|
+
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), O({
|
|
73
|
+
type: Ke.Warning,
|
|
74
|
+
message: U("email-editor.save-blocked-outside-editor")
|
|
72
75
|
});
|
|
73
76
|
return;
|
|
74
77
|
}
|
|
75
|
-
return (t =
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
+
return (t = F.value) == null ? void 0 : t.saveSilent();
|
|
79
|
+
}, H = (t) => {
|
|
80
|
+
l.loadingStatus = t;
|
|
78
81
|
};
|
|
79
|
-
|
|
80
|
-
const
|
|
82
|
+
Oe(), Ne();
|
|
83
|
+
const N = Pe(), h = () => {
|
|
81
84
|
var t, e;
|
|
82
85
|
return {
|
|
83
86
|
emailId: o.templateId,
|
|
84
87
|
userId: o.userId,
|
|
85
88
|
username: o.username,
|
|
86
89
|
partnerName: o.partnerName,
|
|
87
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
88
|
-
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
|
|
89
92
|
};
|
|
90
|
-
}, { initPlugin:
|
|
91
|
-
let
|
|
92
|
-
const { getDefaultTemplate:
|
|
93
|
+
}, { initPlugin: P, preloadRuntime: x } = Ve(a), { runExclusive: B, beginMount: V, isCurrentMount: C } = Ue();
|
|
94
|
+
let b = 0;
|
|
95
|
+
const { getDefaultTemplate: W } = at(), { cloneTimersOnSave: $, hasTimerBlocks: G } = We(), ge = c(() => {
|
|
93
96
|
var t;
|
|
94
97
|
return !((t = o.ui) != null && t.showHeader);
|
|
95
|
-
}),
|
|
98
|
+
}), be = c(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Se = c(() => o.externalDisplayConditions), he = c(
|
|
96
99
|
() => o.isFeatureEnabled("legacyUnsubscribeConversion")
|
|
97
|
-
),
|
|
98
|
-
() => !!
|
|
100
|
+
), Ce = c(
|
|
101
|
+
() => !!Z().recommendationConfigs.strategyId
|
|
99
102
|
);
|
|
100
|
-
|
|
103
|
+
He({
|
|
101
104
|
onBack: () => {
|
|
102
|
-
console.debug("guido:back"),
|
|
105
|
+
console.debug("guido:back"), r("back");
|
|
103
106
|
},
|
|
104
107
|
onSaveStart: () => {
|
|
105
|
-
console.debug("guido:save:start"),
|
|
108
|
+
console.debug("guido:save:start"), r("save:start");
|
|
106
109
|
},
|
|
107
110
|
onSaveComplete: (t) => {
|
|
108
|
-
const e = { ...t, metadata:
|
|
109
|
-
console.debug("guido:save:complete", e),
|
|
111
|
+
const e = { ...t, metadata: h() };
|
|
112
|
+
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
110
113
|
},
|
|
111
114
|
onTestEmailClick: () => {
|
|
112
|
-
console.debug("guido:test-email:click"),
|
|
115
|
+
console.debug("guido:test-email:click"), r("test-email:click");
|
|
113
116
|
}
|
|
114
117
|
});
|
|
115
|
-
const
|
|
116
|
-
console.debug("dynamic-content:close", t),
|
|
117
|
-
},
|
|
118
|
+
const z = (t) => {
|
|
119
|
+
console.debug("dynamic-content:close", t), m.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
120
|
+
}, q = () => {
|
|
118
121
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
122
|
+
}, K = (t) => {
|
|
123
|
+
m.setInvalidDynamicContent(t);
|
|
124
|
+
}, u = L(null), Ee = c(() => u.value ? m.getInvalidDynamicContent(u.value.value) : void 0);
|
|
125
|
+
let p = null;
|
|
126
|
+
const y = () => {
|
|
127
|
+
p && (clearTimeout(p), p = null);
|
|
128
|
+
}, E = () => {
|
|
129
|
+
y(), p = setTimeout(() => {
|
|
130
|
+
p = null, u.value = null;
|
|
131
|
+
}, M);
|
|
132
|
+
}, D = (t) => {
|
|
133
|
+
var n;
|
|
134
|
+
const { detail: e } = t;
|
|
135
|
+
typeof ((n = e == null ? void 0 : e.entry) == null ? void 0 : n.value) != "string" || !e.position || (y(), u.value = { value: e.entry.value, position: e.position });
|
|
136
|
+
}, De = (t) => {
|
|
137
|
+
console.debug("dynamic-content:invalid-action", t), y(), u.value = null, r("dynamic-content:invalid-action", { value: t.value });
|
|
119
138
|
};
|
|
120
|
-
|
|
121
|
-
|
|
139
|
+
Q(() => g.value, () => {
|
|
140
|
+
r("on-change", g.value);
|
|
122
141
|
});
|
|
123
|
-
const
|
|
124
|
-
const e = t, { attribute:
|
|
125
|
-
console.debug("dynamic-content:open", e.detail),
|
|
142
|
+
const I = (t) => {
|
|
143
|
+
const e = t, { attribute: n, position: f } = e.detail;
|
|
144
|
+
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", n, f);
|
|
126
145
|
};
|
|
127
|
-
let
|
|
128
|
-
const
|
|
146
|
+
let v = null;
|
|
147
|
+
const T = () => {
|
|
129
148
|
var e;
|
|
130
|
-
const t = document.querySelector(
|
|
131
|
-
(e =
|
|
132
|
-
},
|
|
149
|
+
const t = document.querySelector(qe);
|
|
150
|
+
(e = S.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
151
|
+
}, k = async () => {
|
|
133
152
|
var t;
|
|
134
|
-
|
|
153
|
+
a.mark("host_ready");
|
|
135
154
|
try {
|
|
136
|
-
o.initialized || o.init(
|
|
155
|
+
o.initialized || o.init(d.config), l.templateId = o.templateId, a.setContext({
|
|
137
156
|
partnerName: o.partnerName,
|
|
138
157
|
productType: o.productType,
|
|
139
158
|
templateId: o.templateId,
|
|
140
159
|
variationId: o.variationId
|
|
141
160
|
});
|
|
142
|
-
const e = o.template,
|
|
143
|
-
|
|
144
|
-
const
|
|
161
|
+
const e = o.template, n = (e == null ? void 0 : e.html) || "", f = (e == null ? void 0 : e.css) || "", Y = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
162
|
+
R.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
163
|
+
const Ie = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, j = o.isFeatureEnabled("linkTrackingIds"), Te = {
|
|
145
164
|
partnerName: o.partnerName,
|
|
146
165
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
147
166
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
148
|
-
},
|
|
167
|
+
}, ke = {
|
|
149
168
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
150
|
-
},
|
|
169
|
+
}, J = (Fe) => a.timed(
|
|
151
170
|
"migration",
|
|
152
|
-
() =>
|
|
171
|
+
() => ze(Fe, Ie, Te, ke)
|
|
153
172
|
);
|
|
154
|
-
let
|
|
155
|
-
html:
|
|
156
|
-
css:
|
|
173
|
+
let i = {
|
|
174
|
+
html: n && await J(n),
|
|
175
|
+
css: f
|
|
157
176
|
};
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
preselectedDynamicContentList:
|
|
177
|
+
i.html || (i = await a.timed("default_template", () => W()), i.html = await J(i.html));
|
|
178
|
+
const Le = j ? te(i.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
179
|
+
G(i.html) && (i.html = await a.timed("timer_clone", () => $(i.html))), j && (l.trackIdSessionFloor = Math.max(Le, te(i.html)));
|
|
180
|
+
const we = {
|
|
181
|
+
preselectedDynamicContentList: Y,
|
|
163
182
|
onReady: () => {
|
|
164
|
-
console.debug("guido:ready"),
|
|
183
|
+
console.debug("guido:ready"), r("ready");
|
|
165
184
|
}
|
|
166
185
|
};
|
|
167
|
-
|
|
186
|
+
b = V(), await P(i, h(), we, i.html !== n), m.selectedDynamicContentList = Y;
|
|
168
187
|
} catch (e) {
|
|
169
|
-
console.error("Failed to initialize Stripo editor:", e),
|
|
188
|
+
console.error("Failed to initialize Stripo editor:", e), a.markFailed();
|
|
170
189
|
}
|
|
171
190
|
};
|
|
172
|
-
return
|
|
191
|
+
return Re(async () => {
|
|
173
192
|
var e;
|
|
174
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
175
|
-
const t = (e =
|
|
176
|
-
if (t && (
|
|
177
|
-
await
|
|
193
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), Z().$reset(), w().$reset(), ut().$reset(), lt().$reset(), ee().$reset(), m.setInvalidDynamicContent([]), dt().resetOnboarding("recommendationLegacyStrategyOnboarding"), A(), T();
|
|
194
|
+
const t = (e = S.value) == null ? void 0 : e.parentElement;
|
|
195
|
+
if (t && (v = new ResizeObserver(T), v.observe(t)), x(), document.addEventListener("dynamic-content:open", I), document.addEventListener("dynamic-content:invalid-hover", D), document.addEventListener("dynamic-content:invalid-leave", E), d.ready)
|
|
196
|
+
await k();
|
|
178
197
|
else {
|
|
179
|
-
const
|
|
180
|
-
|
|
198
|
+
const n = Q(() => d.ready, (f) => {
|
|
199
|
+
f && (n(), k());
|
|
181
200
|
});
|
|
182
201
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
xe();
|
|
202
|
+
}), Ae(() => {
|
|
203
|
+
if (je(), Ye(), a.dispose(), N.dispose(), v == null || v.disconnect(), document.removeEventListener("dynamic-content:open", I), document.removeEventListener("dynamic-content:invalid-hover", D), document.removeEventListener("dynamic-content:invalid-leave", E), y(), C(b)) {
|
|
204
|
+
Je();
|
|
187
205
|
try {
|
|
188
|
-
const t =
|
|
206
|
+
const t = w();
|
|
189
207
|
t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
|
|
190
208
|
} catch (t) {
|
|
191
209
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
192
210
|
}
|
|
193
211
|
}
|
|
194
|
-
|
|
195
|
-
if (
|
|
212
|
+
B(async () => {
|
|
213
|
+
if (C(b))
|
|
196
214
|
try {
|
|
197
215
|
window.UIEditor.removeEditor();
|
|
198
216
|
} catch {
|
|
199
217
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
200
218
|
}
|
|
201
219
|
}), o.reset();
|
|
202
|
-
}),
|
|
220
|
+
}), ne({
|
|
203
221
|
dynamicContent: {
|
|
204
|
-
insert:
|
|
205
|
-
close:
|
|
222
|
+
insert: z,
|
|
223
|
+
close: q,
|
|
224
|
+
setInvalid: K
|
|
206
225
|
},
|
|
207
|
-
hasChanges:
|
|
208
|
-
saveSilent:
|
|
209
|
-
setLoading:
|
|
210
|
-
}), { __sfc: !0, openMetrics:
|
|
226
|
+
hasChanges: g,
|
|
227
|
+
saveSilent: _,
|
|
228
|
+
setLoading: H
|
|
229
|
+
}), { __sfc: !0, openMetrics: a, 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: m, unsubscribeStore: R, moduleDynamicContentStore: pe, props: d, configStore: o, editorStore: l, previewStore: ve, hasChanges: g, isTestPartner: ye, isSaveValidationEnabled: fe, loadRollout: A, showToaster: O, trans: U, saveSilent: _, setLoading: H, emit: r, invalidDynamicContentMarking: N, buildMetadata: h, initPlugin: P, preloadRuntime: x, runExclusive: B, beginMount: V, isCurrentMount: C, mountGeneration: b, getDefaultTemplate: W, cloneTimersOnSave: $, hasTimerBlocks: G, noHeader: ge, isRrsEnabled: be, isExternalDisplayConditionsEnabled: Se, isLegacyUnsubscribeConversionEnabled: he, hasAssignedStrategy: Ce, insertDynamicContent: z, closeDynamicContent: q, setInvalidDynamicContent: K, hoveredInvalidDynamicContent: u, hoveredInvalidEntry: Ee, invalidCardHideTimer: p, cancelInvalidCardHide: y, scheduleInvalidCardHide: E, handleInvalidDynamicContentHover: D, handleInvalidDynamicContentAction: De, handleDynamicContentOpen: I, ribbonObserver: v, updateRibbonOffset: T, startEditor: k, AutoSaveController: Qe, AuthErrorModal: Xe, Toaster: Ze, FilterSelectionDrawer: et, HeaderWrapper: tt, LoadingWrapper: ot, SaveAsTemplateDrawer: nt, UnsubscribeWrapper: it, ValidationErrorDrawer: rt };
|
|
211
230
|
}
|
|
212
231
|
});
|
|
213
232
|
export {
|
|
214
|
-
|
|
233
|
+
eo as default
|
|
215
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 r = function() {
|
|
5
|
+
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
6
|
+
return n("div", { ref: "cardRef", staticClass: "invalid-dynamic-content-card", style: e.cardStyle, attrs: { id: "guido__invalid-dynamic-content-card", "aria-labelledby": "guido__invalid-dynamic-content-card-title", role: "dialog" }, 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", attrs: { id: "guido__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 && t.entry.actionLabel ? 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
|
+
}, o = [], d = /* @__PURE__ */ c(
|
|
12
|
+
a,
|
|
13
|
+
r,
|
|
14
|
+
o,
|
|
15
|
+
!1,
|
|
16
|
+
null,
|
|
17
|
+
"749d0533"
|
|
18
|
+
);
|
|
19
|
+
const v = d.exports;
|
|
20
|
+
export {
|
|
21
|
+
v as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent as y, ref as u, onMounted as _, watch as x, nextTick as C, computed as R } from "vue";
|
|
2
|
+
const I = /* @__PURE__ */ y({
|
|
3
|
+
__name: "InvalidDynamicContentCard",
|
|
4
|
+
props: {
|
|
5
|
+
entry: null,
|
|
6
|
+
position: null
|
|
7
|
+
},
|
|
8
|
+
emits: ["dynamic-content:invalid-action", "mouseenter", "mouseleave"],
|
|
9
|
+
setup(m, { emit: s }) {
|
|
10
|
+
const t = m, i = 4, o = 8, r = u(), c = u({ width: 0, height: 0 }), a = () => {
|
|
11
|
+
var e;
|
|
12
|
+
const n = (e = r.value) == null ? void 0 : e.getBoundingClientRect();
|
|
13
|
+
n && (c.value = { width: n.width, height: n.height });
|
|
14
|
+
};
|
|
15
|
+
_(a), x(() => [t.entry, t.position], () => C(a));
|
|
16
|
+
const p = R(() => {
|
|
17
|
+
const { x: n, y: e, height: f = 0 } = t.position, { width: v, height: d } = c.value, h = e + f + i, l = e - i - d, w = h + d > window.innerHeight - o, g = window.innerWidth - v - o;
|
|
18
|
+
return {
|
|
19
|
+
top: `${w && l >= o ? l : h}px`,
|
|
20
|
+
left: `${Math.max(0, Math.min(n, g))}px`
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
return { __sfc: !0, CARD_OFFSET: i, VIEWPORT_MARGIN: o, props: t, emit: s, cardRef: r, cardSize: c, measureCard: a, cardStyle: p, onAction: () => {
|
|
24
|
+
s("dynamic-content:invalid-action", { value: t.entry.value });
|
|
25
|
+
} };
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
I as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useDynamicContentStore as f } from "../stores/dynamic-content.js";
|
|
2
|
+
import { useEditorStore as T } from "../stores/editor.js";
|
|
3
|
+
import { getEditorCanvasFrame as g, getCanvasElementPosition as S } from "../utils/editorCanvas.js";
|
|
4
|
+
import { watch as A } from "vue";
|
|
5
|
+
const C = "merge-tag-selector", E = "merge-tag-value", u = "guido-invalid-dynamic-content-style", v = ["", " "], h = (t) => v.flatMap((n) => v.map((e) => ({
|
|
6
|
+
exact: `{{${n}${t}${e}}}`,
|
|
7
|
+
prefix: `{{${n}${t}${e}|`
|
|
8
|
+
}))), D = (t, n) => h(n).some(({ exact: e, prefix: o }) => t === e || t.startsWith(o)), p = (t) => t.replace(/["\\|]/g, "\\$&").replace(/[\n\r\f]/g, (n) => `\\${n.charCodeAt(0).toString(16)} `), _ = (t) => {
|
|
9
|
+
const n = t.flatMap((e) => h(e).flatMap(({ exact: o, prefix: r }) => [`="${p(o)}"`, `^="${p(r)}"`]).map((o) => `${C}[${E}${o}]`).flatMap((o) => [`${o} .esd-merge-tag`, `${o} .esd-x`]));
|
|
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
|
+
}, y = (t, n) => {
|
|
16
|
+
const e = t.getAttribute(E) ?? "";
|
|
17
|
+
return n.find((o) => D(e, o.value));
|
|
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(C) : null;
|
|
21
|
+
}, $ = () => {
|
|
22
|
+
var t, n;
|
|
23
|
+
return ((n = (t = g()) == null ? void 0 : t.contentWindow) == null ? void 0 : n.document) ?? null;
|
|
24
|
+
}, L = (t, n) => {
|
|
25
|
+
var a;
|
|
26
|
+
const e = _(n), o = t.getElementById(u);
|
|
27
|
+
if (!e) {
|
|
28
|
+
o == null || o.remove();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (o) {
|
|
32
|
+
o.textContent !== e && (o.textContent = e);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const r = t.createElement("style");
|
|
36
|
+
r.id = u, r.textContent = e, (a = t.head ?? t.body) == null || a.appendChild(r);
|
|
37
|
+
}, P = () => {
|
|
38
|
+
const t = $();
|
|
39
|
+
if (t)
|
|
40
|
+
try {
|
|
41
|
+
const n = f().invalidDynamicContentList.map((e) => e.value);
|
|
42
|
+
L(t, n);
|
|
43
|
+
} catch (n) {
|
|
44
|
+
console.error("Failed to apply the invalid dynamic content marking", n);
|
|
45
|
+
}
|
|
46
|
+
}, k = () => {
|
|
47
|
+
const t = f(), n = T();
|
|
48
|
+
let e = null, o = null;
|
|
49
|
+
const r = () => {
|
|
50
|
+
o && (o = null, document.dispatchEvent(new CustomEvent("dynamic-content:invalid-leave")));
|
|
51
|
+
}, a = (i) => {
|
|
52
|
+
const s = x(i.target);
|
|
53
|
+
if (!s || s === o)
|
|
54
|
+
return;
|
|
55
|
+
const l = y(s, t.invalidDynamicContentList), m = g();
|
|
56
|
+
if (!l || !m)
|
|
57
|
+
return;
|
|
58
|
+
o = s;
|
|
59
|
+
const M = {
|
|
60
|
+
entry: { ...l },
|
|
61
|
+
position: S(m, s)
|
|
62
|
+
};
|
|
63
|
+
document.dispatchEvent(new CustomEvent("dynamic-content:invalid-hover", { detail: M }));
|
|
64
|
+
}, d = (i) => {
|
|
65
|
+
!o || w(i.relatedTarget) && o.contains(i.relatedTarget) || r();
|
|
66
|
+
}, c = () => {
|
|
67
|
+
e == null || e.removeEventListener("mouseover", a), e == null || e.removeEventListener("mouseout", d), e == null || e.removeEventListener("scroll", r, !0), e = null, r();
|
|
68
|
+
}, I = () => {
|
|
69
|
+
if (!n.isStripoInitialized) {
|
|
70
|
+
c();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const i = $(), s = t.invalidDynamicContentList.map((l) => l.value);
|
|
74
|
+
if (!i) {
|
|
75
|
+
c();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (L(i, s), s.length === 0) {
|
|
79
|
+
c();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
i !== e && (c(), i.addEventListener("mouseover", a), i.addEventListener("mouseout", d), i.addEventListener("scroll", r, !0), e = i), o && (!o.isConnected || !y(o, t.invalidDynamicContentList)) && r();
|
|
83
|
+
};
|
|
84
|
+
return A(
|
|
85
|
+
[
|
|
86
|
+
() => n.isStripoInitialized,
|
|
87
|
+
() => n.changeSeq,
|
|
88
|
+
() => n.isCodeEditorOpen,
|
|
89
|
+
() => n.isVersionHistoryOpen,
|
|
90
|
+
() => n.isPreviewModeOpen,
|
|
91
|
+
() => t.invalidDynamicContentList
|
|
92
|
+
],
|
|
93
|
+
() => {
|
|
94
|
+
try {
|
|
95
|
+
I();
|
|
96
|
+
} catch (i) {
|
|
97
|
+
console.error("Failed to track invalid dynamic content", i);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
), { dispose: c };
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
P as applyInvalidDynamicContentMarking,
|
|
104
|
+
k as useInvalidDynamicContentMarking
|
|
105
|
+
};
|