@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 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 o from "./Guido.vue2.js";
1
+ import a from "./Guido.vue2.js";
2
2
  /* empty css */
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
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(), e.isLegacyUnsubscribeConversionEnabled ? r(e.LegacyUnsubscribeConvertedModal) : a._e(), e.moduleDynamicContentStore.queue.length > 0 ? r(e.AmbiguousDynamicContentModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isSaveValidationEnabled ? r(e.ValidationErrorDrawer) : a._e(), e.isExternalDisplayConditionsEnabled ? r(e.DisplayConditionsHost) : a._e(), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(l) {
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 = [], s = /* @__PURE__ */ i(
9
+ }, t = [], d = /* @__PURE__ */ i(
10
+ a,
10
11
  o,
11
- n,
12
12
  t,
13
13
  !1,
14
14
  null,
15
- "0c5f11a1"
15
+ "d5ad6f2a"
16
16
  );
17
- const u = s.exports;
17
+ const p = d.exports;
18
18
  export {
19
- u as default
19
+ p as default
20
20
  };
@@ -1,215 +1,234 @@
1
- import { defineComponent as Se, defineAsyncComponent as a, ref as W, computed as l, watch as $, onMounted as he, onUnmounted as Ee } from "vue";
2
- import { useCortexBlueprintBridge as Ce } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as De } from "../composables/useEditorLock.js";
4
- import { startEditorOpenMetrics as we } from "../composables/useEditorOpenMetrics.js";
5
- import { provideGuidoActions as Te } from "../composables/useGuidoActions.js";
6
- import { useGuidoStateBridge as ke } from "../composables/useGuidoStateBridge.js";
7
- import { usePartner as Fe } from "../composables/usePartner.js";
8
- import { useSaveValidationRollout as Me } from "../composables/useSaveValidationRollout.js";
9
- import { useStripo as Ie } from "../composables/useStripo.js";
10
- import { useTimerClone as Le } from "../composables/useTimerClone.js";
11
- import { useToaster as Re } from "../composables/useToaster.js";
12
- import { useTranslations as Oe } from "../composables/useTranslations.js";
13
- import { migrate as Ue } from "../config/migrator/index.js";
14
- import { ModuleFolderDefaults as G } from "../enums/defaults.js";
15
- import { RIBBON_SELECTOR as Ae } from "../enums/onboarding.js";
16
- import { ToasterTypeOptions as Ne } from "../enums/toaster.js";
17
- import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as _e } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
- import { disposeUnsubscribeListeners as Pe } from "../extensions/Blocks/Unsubscribe/block.js";
19
- import { disposeDisplayConditionRequest as xe } from "../extensions/DisplayConditions/bridge.js";
20
- import Be from "./organisms/AutoSaveController.vue.js";
21
- import He from "./organisms/base/AuthErrorModal.vue.js";
22
- import Ve from "./organisms/base/Toaster.vue.js";
23
- import We from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
24
- import $e from "./organisms/header/HeaderWrapper.vue.js";
25
- import Ge from "./organisms/LoadingWrapper.vue.js";
26
- import ze from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
27
- import qe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
28
- import Ke from "./organisms/validation/ValidationErrorDrawer.vue.js";
29
- import { useStripoApi as je } from "../services/stripoApi.js";
30
- import { useConfigStore as Je } from "../stores/config.js";
31
- import { useDynamicContentStore as Qe } from "../stores/dynamic-content.js";
32
- import { useEditorStore as C } from "../stores/editor.js";
33
- import { useModuleDynamicContentStore as q } from "../stores/module-dynamic-content.js";
34
- import { useOnboardingStore as Xe } from "../stores/onboarding.js";
35
- import { usePreviewStore as Ye } from "../stores/preview.js";
36
- import { useSaveValidationStore as Ze } from "../stores/save-validation.js";
37
- import { useTemplateStore as et } from "../stores/template.js";
38
- import { useUnsubscribeStore as tt } from "../stores/unsubscribe.js";
39
- import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
40
- const Vt = /* @__PURE__ */ Se({
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(j, { expose: J, emit: i }) {
48
- const c = j, r = we(), Q = a(
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
- ), X = a(
51
+ ), re = s(
51
52
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
52
- ), Y = a(
53
+ ), ae = s(
53
54
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
54
- ), Z = a(
55
+ ), se = s(
55
56
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
56
- ), ee = a(
57
+ ), ce = s(
57
58
  () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
58
- ), D = W(), te = a(
59
+ ), F = L(), de = s(
59
60
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
60
- ), oe = a(
61
+ ), me = s(
61
62
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
62
- ), ne = a(
63
+ ), le = s(
63
64
  () => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
64
- ), y = W(), g = Qe(), w = tt(), re = q(), o = Je();
65
- c.ready && o.init(c.config);
66
- const d = C(), ie = Ye(), p = l(() => d.hasChanges), { isTestPartner: se } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: k } = Re(), F = Oe(), M = () => {
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 (d.isVersionHistoryOpen) {
69
- console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
70
- type: Ne.Warning,
71
- message: F("email-editor.save-blocked-outside-editor")
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 = D.value) == null ? void 0 : t.saveSilent();
76
- }, I = (t) => {
77
- d.loadingStatus = t;
78
+ return (t = F.value) == null ? void 0 : t.saveSilent();
79
+ }, H = (t) => {
80
+ l.loadingStatus = t;
78
81
  };
79
- Ce(), ke();
80
- const b = () => {
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) || G.SAVED_MODULES,
88
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
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: L, preloadRuntime: R } = Ie(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = De();
91
- let f = 0;
92
- const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Le(), ce = l(() => {
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
- }), de = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = l(() => o.externalDisplayConditions), le = l(
98
+ }), be = c(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Se = c(() => o.externalDisplayConditions), he = c(
96
99
  () => o.isFeatureEnabled("legacyUnsubscribeConversion")
97
- ), ue = l(
98
- () => !!z().recommendationConfigs.strategyId
100
+ ), Ce = c(
101
+ () => !!Z().recommendationConfigs.strategyId
99
102
  );
100
- Te({
103
+ He({
101
104
  onBack: () => {
102
- console.debug("guido:back"), i("back");
105
+ console.debug("guido:back"), r("back");
103
106
  },
104
107
  onSaveStart: () => {
105
- console.debug("guido:save:start"), i("save:start");
108
+ console.debug("guido:save:start"), r("save:start");
106
109
  },
107
110
  onSaveComplete: (t) => {
108
- const e = { ...t, metadata: b() };
109
- console.debug("guido:save:complete", e), i("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"), i("test-email:click");
115
+ console.debug("guido:test-email:click"), r("test-email:click");
113
116
  }
114
117
  });
115
- const P = (t) => {
116
- console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
117
- }, x = () => {
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
- $(() => p.value, () => {
121
- i("on-change", p.value);
139
+ Q(() => g.value, () => {
140
+ r("on-change", g.value);
122
141
  });
123
- const S = (t) => {
124
- const e = t, { attribute: s, position: u } = e.detail;
125
- console.debug("dynamic-content:open", e.detail), i("dynamic-content:open", s, u);
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 m = null;
128
- const h = () => {
146
+ let v = null;
147
+ const T = () => {
129
148
  var e;
130
- const t = document.querySelector(Ae);
131
- (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
132
- }, E = async () => {
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
- r.mark("host_ready");
153
+ a.mark("host_ready");
135
154
  try {
136
- o.initialized || o.init(c.config), d.templateId = o.templateId, r.setContext({
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, s = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
143
- w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
144
- const pe = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), fe = {
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
- }, ye = {
167
+ }, ke = {
149
168
  itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
150
- }, V = (ve) => r.timed(
169
+ }, J = (Fe) => a.timed(
151
170
  "migration",
152
- () => Ue(ve, pe, fe, ye)
171
+ () => ze(Fe, Ie, Te, ke)
153
172
  );
154
- let n = {
155
- html: s && await V(s),
156
- css: u
173
+ let i = {
174
+ html: n && await J(n),
175
+ css: f
157
176
  };
158
- n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
159
- const ge = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
160
- _(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
161
- const be = {
162
- preselectedDynamicContentList: B,
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"), i("ready");
183
+ console.debug("guido:ready"), r("ready");
165
184
  }
166
185
  };
167
- f = U(), await L(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
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), r.markFailed();
188
+ console.error("Failed to initialize Stripo editor:", e), a.markFailed();
170
189
  }
171
190
  };
172
- return he(async () => {
191
+ return Re(async () => {
173
192
  var e;
174
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), et().$reset(), Ze().$reset(), q().$reset(), Xe().resetOnboarding("recommendationLegacyStrategyOnboarding"), T(), h();
175
- const t = (e = y.value) == null ? void 0 : e.parentElement;
176
- if (t && (m = new ResizeObserver(h), m.observe(t)), R(), c.ready)
177
- await E();
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 s = $(() => c.ready, (u) => {
180
- u && (s(), E());
198
+ const n = Q(() => d.ready, (f) => {
199
+ f && (n(), k());
181
200
  });
182
201
  }
183
- document.addEventListener("dynamic-content:open", S);
184
- }), Ee(() => {
185
- if (Pe(), _e(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
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 = C();
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
- O(async () => {
195
- if (v(f))
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
- }), J({
220
+ }), ne({
203
221
  dynamicContent: {
204
- insert: P,
205
- close: x
222
+ insert: z,
223
+ close: q,
224
+ setInvalid: K
206
225
  },
207
- hasChanges: p,
208
- saveSilent: M,
209
- setLoading: I
210
- }), { __sfc: !0, openMetrics: r, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, AmbiguousDynamicContentModal: ne, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, moduleDynamicContentStore: re, props: c, configStore: o, editorStore: d, previewStore: ie, hasChanges: p, isTestPartner: se, isSaveValidationEnabled: ae, loadRollout: T, showToaster: k, trans: F, saveSilent: M, setLoading: I, emit: i, buildMetadata: b, initPlugin: L, preloadRuntime: R, runExclusive: O, beginMount: U, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: ce, isRrsEnabled: de, isExternalDisplayConditionsEnabled: me, isLegacyUnsubscribeConversionEnabled: le, hasAssignedStrategy: ue, insertDynamicContent: P, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Be, AuthErrorModal: He, Toaster: Ve, FilterSelectionDrawer: We, HeaderWrapper: $e, LoadingWrapper: Ge, SaveAsTemplateDrawer: ze, UnsubscribeWrapper: qe, ValidationErrorDrawer: Ke };
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
- Vt as default
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
+ };