@useinsider/guido 3.30.2-beta.67ce15e → 3.30.2-beta.6873c0b

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.isBlockUnsubscribeLinksEnabled ? r(e.SfmcUnsubscribeConvertedModal) : 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.isBlockUnsubscribeLinksEnabled ? r(e.SfmcUnsubscribeConvertedModal) : 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
- }, s = [], t = /* @__PURE__ */ i(
9
+ }, t = [], d = /* @__PURE__ */ i(
10
+ a,
10
11
  o,
11
- n,
12
- s,
12
+ t,
13
13
  !1,
14
14
  null,
15
- "b0036f48"
15
+ "d52d4413"
16
16
  );
17
- const u = t.exports;
17
+ const p = d.exports;
18
18
  export {
19
- u as default
19
+ p as default
20
20
  };
@@ -1,105 +1,108 @@
1
- import { defineComponent as Ce, defineAsyncComponent as i, ref as W, computed as c, watch as $, onMounted as De, onUnmounted as ke } from "vue";
2
- import { useCortexBlueprintBridge as we } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as Fe } from "../composables/useEditorLock.js";
4
- import { startEditorOpenMetrics as Te } from "../composables/useEditorOpenMetrics.js";
5
- import { provideGuidoActions as Le } from "../composables/useGuidoActions.js";
6
- import { useGuidoStateBridge as Me } from "../composables/useGuidoStateBridge.js";
7
- import { usePartner as Ue } from "../composables/usePartner.js";
8
- import { useSaveValidationRollout as Ie } from "../composables/useSaveValidationRollout.js";
9
- import { useStripo as Re } from "../composables/useStripo.js";
10
- import { useTimerClone as Oe } from "../composables/useTimerClone.js";
11
- import { useToaster as Ae } from "../composables/useToaster.js";
12
- import { useTranslations as Ne } from "../composables/useTranslations.js";
13
- import { migrate as _e } from "../config/migrator/index.js";
14
- import { ModuleFolderDefaults as G } from "../enums/defaults.js";
15
- import { RIBBON_SELECTOR as Be } from "../enums/onboarding.js";
16
- import { ToasterTypeOptions as Pe } from "../enums/toaster.js";
17
- import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as xe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
- import { disposeUnsubscribeListeners as He } from "../extensions/Blocks/Unsubscribe/block.js";
19
- import { disposeDisplayConditionRequest as Ve } from "../extensions/DisplayConditions/bridge.js";
20
- import We from "./organisms/AutoSaveController.vue.js";
21
- import $e from "./organisms/base/AuthErrorModal.vue.js";
22
- import Ge from "./organisms/base/Toaster.vue.js";
23
- import ze from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
24
- import qe from "./organisms/header/HeaderWrapper.vue.js";
25
- import Ke from "./organisms/LoadingWrapper.vue.js";
26
- import je from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
27
- import Je from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
28
- import Qe from "./organisms/validation/ValidationErrorDrawer.vue.js";
29
- import { useStripoApi as Xe } from "../services/stripoApi.js";
30
- import { useConfigStore as Ye } from "../stores/config.js";
31
- import { useDynamicContentStore as Ze } 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 et } from "../stores/onboarding.js";
35
- import { usePreviewStore as tt } from "../stores/preview.js";
36
- import { useSaveValidationStore as ot } from "../stores/save-validation.js";
37
- import { useTemplateStore as nt } from "../stores/template.js";
38
- import { useUnsubscribeStore as rt } from "../stores/unsubscribe.js";
39
- import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
40
- const Gt = /* @__PURE__ */ Ce({
1
+ import { defineComponent as Oe, defineAsyncComponent as a, ref as w, computed as c, watch as F, onMounted as _e, onUnmounted as He } from "vue";
2
+ import { useCortexBlueprintBridge as Ne } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as Be } from "../composables/useEditorLock.js";
4
+ import { startEditorOpenMetrics as Pe } from "../composables/useEditorOpenMetrics.js";
5
+ import { provideGuidoActions as xe } from "../composables/useGuidoActions.js";
6
+ import { useGuidoStateBridge as Ve } from "../composables/useGuidoStateBridge.js";
7
+ import { useInvalidDynamicContentMarking as We } from "../composables/useInvalidDynamicContentMarking.js";
8
+ import { usePartner as $e } from "../composables/usePartner.js";
9
+ import { useSaveValidationRollout as Ge } from "../composables/useSaveValidationRollout.js";
10
+ import { useStripo as ze } from "../composables/useStripo.js";
11
+ import { useTimerClone as qe } from "../composables/useTimerClone.js";
12
+ import { useToaster as Ke } from "../composables/useToaster.js";
13
+ import { useTranslations as Ye } from "../composables/useTranslations.js";
14
+ import { migrate as je } from "../config/migrator/index.js";
15
+ import { ModuleFolderDefaults as ee } from "../enums/defaults.js";
16
+ import { RIBBON_SELECTOR as Je } from "../enums/onboarding.js";
17
+ import { ToasterTypeOptions as Qe } from "../enums/toaster.js";
18
+ import { useRecommendationExtensionStore as te, disposeStrategyPageReturnListeners as Xe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
19
+ import { disposeUnsubscribeListeners as Ze } from "../extensions/Blocks/Unsubscribe/block.js";
20
+ import { disposeDisplayConditionRequest as et } from "../extensions/DisplayConditions/bridge.js";
21
+ import tt from "./organisms/AutoSaveController.vue.js";
22
+ import ot from "./organisms/base/AuthErrorModal.vue.js";
23
+ import nt from "./organisms/base/Toaster.vue.js";
24
+ import it from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
25
+ import rt from "./organisms/header/HeaderWrapper.vue.js";
26
+ import at from "./organisms/LoadingWrapper.vue.js";
27
+ import st from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
28
+ import ct from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
29
+ import dt from "./organisms/validation/ValidationErrorDrawer.vue.js";
30
+ import { useStripoApi as lt } from "../services/stripoApi.js";
31
+ import { useConfigStore as mt } from "../stores/config.js";
32
+ import { useDynamicContentStore as ut } from "../stores/dynamic-content.js";
33
+ import { useEditorStore as M } from "../stores/editor.js";
34
+ import { useModuleDynamicContentStore as oe } from "../stores/module-dynamic-content.js";
35
+ import { useOnboardingStore as pt } from "../stores/onboarding.js";
36
+ import { usePreviewStore as vt } from "../stores/preview.js";
37
+ import { useSaveValidationStore as yt } from "../stores/save-validation.js";
38
+ import { useTemplateStore as ft } from "../stores/template.js";
39
+ import { useUnsubscribeStore as gt } from "../stores/unsubscribe.js";
40
+ import { readTrackFloor as ne } from "../utils/linkTrackingIds.js";
41
+ const io = /* @__PURE__ */ Oe({
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: r }) {
48
- const d = j, s = Te(), Q = i(
47
+ emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click", "dynamic-content:invalid-action"],
48
+ setup(ie, { expose: re, emit: r }) {
49
+ const l = ie, s = Pe(), ae = a(
49
50
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
50
- ), X = i(
51
+ ), se = a(
51
52
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
52
- ), Y = i(
53
+ ), ce = a(
53
54
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
54
- ), Z = i(
55
+ ), de = a(
55
56
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
56
- ), ee = i(
57
+ ), le = a(
57
58
  () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
58
- ), D = W(), te = i(
59
+ ), R = w(), me = a(
59
60
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
60
- ), oe = i(
61
+ ), ue = a(
61
62
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
62
- ), ne = i(
63
+ ), pe = a(
63
64
  () => import("./organisms/unsubscribe/SfmcUnsubscribeConvertedModal.vue.js")
64
- ), re = i(
65
+ ), ve = a(
65
66
  () => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
66
- ), y = W(), b = Ze(), k = rt(), se = q(), o = Ye();
67
- d.ready && o.init(d.config);
68
- const m = C(), ie = tt(), p = c(() => m.hasChanges), { isTestPartner: ae } = Ue(), { isEnabled: ce, loadRollout: w } = Ie(), { showToaster: F } = Ae(), T = Ne(), L = () => {
67
+ ), ye = a(
68
+ () => import("./organisms/dynamic-content/InvalidDynamicContentCard.vue.js")
69
+ ), U = 200, C = w(), m = ut(), A = gt(), fe = oe(), o = mt();
70
+ l.ready && o.init(l.config);
71
+ const u = M(), ge = vt(), g = c(() => u.hasChanges), { isTestPartner: be } = $e(), { isEnabled: Se, loadRollout: O } = Ge(), { showToaster: _ } = Ke(), H = Ye(), N = () => {
69
72
  var t;
70
- if (m.isVersionHistoryOpen) {
71
- console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), F({
72
- type: Pe.Warning,
73
- message: T("email-editor.save-blocked-outside-editor")
73
+ if (u.isVersionHistoryOpen) {
74
+ console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), _({
75
+ type: Qe.Warning,
76
+ message: H("email-editor.save-blocked-outside-editor")
74
77
  });
75
78
  return;
76
79
  }
77
- return (t = D.value) == null ? void 0 : t.saveSilent();
78
- }, M = (t) => {
79
- m.loadingStatus = t;
80
+ return (t = R.value) == null ? void 0 : t.saveSilent();
81
+ }, B = (t) => {
82
+ u.loadingStatus = t;
80
83
  };
81
- we(), Me();
82
- const g = () => {
84
+ Ne(), Ve();
85
+ const P = We(), h = () => {
83
86
  var t, e;
84
87
  return {
85
88
  emailId: o.templateId,
86
89
  userId: o.userId,
87
90
  username: o.username,
88
91
  partnerName: o.partnerName,
89
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
90
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
92
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || ee.SAVED_MODULES,
93
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || ee.DEFAULT_MODULES
91
94
  };
92
- }, { initPlugin: U, preloadRuntime: I } = Re(s), { runExclusive: R, beginMount: O, isCurrentMount: v } = Fe();
93
- let f = 0;
94
- const { getDefaultTemplate: A } = Xe(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Oe(), de = c(() => {
95
+ }, { initPlugin: x, preloadRuntime: V } = ze(s), { runExclusive: W, beginMount: $, isCurrentMount: E } = Be();
96
+ let b = 0;
97
+ const { getDefaultTemplate: G } = lt(), { cloneTimersOnSave: z, hasTimerBlocks: q } = qe(), Ce = c(() => {
95
98
  var t;
96
99
  return !((t = o.ui) != null && t.showHeader);
97
- }), me = c(() => o.isFeatureEnabled("reusableRecommendationStrategy")), le = c(() => o.externalDisplayConditions), ue = c(
100
+ }), he = c(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Ee = c(() => o.externalDisplayConditions), De = c(
98
101
  () => o.isFeatureEnabled("legacyUnsubscribeConversion")
99
- ), pe = c(() => o.isFeatureEnabled("blockUnsubscribeLinks")), fe = c(
100
- () => !!z().recommendationConfigs.strategyId
102
+ ), Ie = c(() => o.isFeatureEnabled("blockUnsubscribeLinks")), ke = c(
103
+ () => !!te().recommendationConfigs.strategyId
101
104
  );
102
- Le({
105
+ xe({
103
106
  onBack: () => {
104
107
  console.debug("guido:back"), r("back");
105
108
  },
@@ -107,61 +110,84 @@ const Gt = /* @__PURE__ */ Ce({
107
110
  console.debug("guido:save:start"), r("save:start");
108
111
  },
109
112
  onSaveComplete: (t) => {
110
- const e = { ...t, metadata: g() };
113
+ const e = { ...t, metadata: h() };
111
114
  console.debug("guido:save:complete", e), r("save:complete", e);
112
115
  },
113
116
  onTestEmailClick: () => {
114
117
  console.debug("guido:test-email:click"), r("test-email:click");
115
118
  }
116
119
  });
117
- const B = (t) => {
118
- console.debug("dynamic-content:close", t), b.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
119
- }, P = () => {
120
+ const K = (t) => {
121
+ console.debug("dynamic-content:close", t), m.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
122
+ }, Y = () => {
120
123
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
124
+ }, j = (t) => {
125
+ m.setInvalidDynamicContent(t);
126
+ }, d = w(null), J = c(() => d.value ? m.getInvalidDynamicContent(d.value.value) : void 0);
127
+ let p = null;
128
+ const f = () => {
129
+ p && (clearTimeout(p), p = null);
130
+ }, D = () => {
131
+ f(), p = setTimeout(() => {
132
+ p = null, d.value = null;
133
+ }, U);
134
+ }, I = (t) => {
135
+ var i;
136
+ const { detail: e } = t;
137
+ typeof ((i = e == null ? void 0 : e.entry) == null ? void 0 : i.value) != "string" || !e.position || (f(), d.value = { value: e.entry.value, position: e.position });
138
+ }, S = () => {
139
+ f(), d.value = null;
121
140
  };
122
- $(() => p.value, () => {
123
- r("on-change", p.value);
141
+ F(J, (t) => {
142
+ !t && d.value && S();
124
143
  });
125
- const S = (t) => {
126
- const e = t, { attribute: a, position: u } = e.detail;
127
- console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, u);
144
+ const Le = (t) => {
145
+ console.debug("dynamic-content:invalid-action", t), S(), r("dynamic-content:invalid-action", { value: t.value });
128
146
  };
129
- let l = null;
130
- const E = () => {
147
+ F(() => g.value, () => {
148
+ r("on-change", g.value);
149
+ });
150
+ const k = (t) => {
151
+ S();
152
+ const e = t, { attribute: i, position: y } = e.detail;
153
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", i, y);
154
+ };
155
+ let v = null;
156
+ const L = () => {
131
157
  var e;
132
- const t = document.querySelector(Be);
133
- (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
134
- }, h = async () => {
158
+ const t = document.querySelector(Je);
159
+ (e = C.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
160
+ }, T = async () => {
135
161
  var t;
136
162
  s.mark("host_ready");
137
163
  try {
138
- o.initialized || o.init(d.config), m.templateId = o.templateId, s.setContext({
164
+ o.initialized || o.init(l.config), u.templateId = o.templateId, s.setContext({
139
165
  partnerName: o.partnerName,
140
166
  productType: o.productType,
141
167
  templateId: o.templateId,
142
168
  variationId: o.variationId
143
169
  });
144
- const e = o.template, a = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
145
- k.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
146
- const ye = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), be = {
170
+ const e = o.template, i = (e == null ? void 0 : e.html) || "", y = (e == null ? void 0 : e.css) || "", Q = (e == null ? void 0 : e.preselectedDynamicContent) || [];
171
+ A.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
172
+ const Te = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, X = o.isFeatureEnabled("linkTrackingIds"), we = {
147
173
  partnerName: o.partnerName,
148
174
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
149
175
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
150
- }, ge = {
176
+ }, Fe = {
151
177
  itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
152
- }, V = (Ee, he) => s.timed(
178
+ }, Z = (Ue, Ae) => s.timed(
153
179
  "migration",
154
- () => _e(Ee, ye, be, ge, he)
180
+ () => je(Ue, Te, we, Fe, Ae)
155
181
  );
156
182
  let n = {
157
- html: a && await V(a, u),
158
- css: u
183
+ html: i && await Z(i, y),
184
+ css: y
159
185
  };
160
- n.html || (n = await s.timed("default_template", () => A()), n.html = await V(n.html, n.css));
161
- const ve = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
162
- _(n.html) && (n.html = await s.timed("timer_clone", () => N(n.html))), H && (m.trackIdSessionFloor = Math.max(ve, K(n.html)));
163
- const Se = {
164
- preselectedDynamicContentList: x,
186
+ n.html || (n = await s.timed("default_template", () => G()), n.html = await Z(n.html, n.css));
187
+ const Me = X ? ne(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
188
+ q(n.html) && (n.html = await s.timed("timer_clone", () => z(n.html))), X && (u.trackIdSessionFloor = Math.max(Me, ne(n.html)));
189
+ const Re = {
190
+ preselectedDynamicContentList: Q,
165
191
  onReady: () => {
166
192
  console.debug("guido:ready"), r("ready");
167
193
  },
@@ -170,52 +196,52 @@ const Gt = /* @__PURE__ */ Ce({
170
196
  r("on-change", !0);
171
197
  }
172
198
  };
173
- f = O(), await U(n, g(), Se, n.html !== a), b.selectedDynamicContentList = x;
199
+ b = $(), await x(n, h(), Re, n.html !== i), m.selectedDynamicContentList = Q;
174
200
  } catch (e) {
175
201
  console.error("Failed to initialize Stripo editor:", e), s.markFailed();
176
202
  }
177
203
  };
178
- return De(async () => {
204
+ return _e(async () => {
179
205
  var e;
180
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), nt().$reset(), ot().$reset(), q().$reset(), et().resetOnboarding("recommendationLegacyStrategyOnboarding"), w(), E();
181
- const t = (e = y.value) == null ? void 0 : e.parentElement;
182
- if (t && (l = new ResizeObserver(E), l.observe(t)), I(), d.ready)
183
- await h();
206
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), M().$reset(), ft().$reset(), yt().$reset(), oe().$reset(), m.setInvalidDynamicContent([]), pt().resetOnboarding("recommendationLegacyStrategyOnboarding"), O(), L();
207
+ const t = (e = C.value) == null ? void 0 : e.parentElement;
208
+ if (t && (v = new ResizeObserver(L), v.observe(t)), V(), document.addEventListener("dynamic-content:open", k), document.addEventListener("dynamic-content:invalid-hover", I), document.addEventListener("dynamic-content:invalid-leave", D), l.ready)
209
+ await T();
184
210
  else {
185
- const a = $(() => d.ready, (u) => {
186
- u && (a(), h());
211
+ const i = F(() => l.ready, (y) => {
212
+ y && (i(), T());
187
213
  });
188
214
  }
189
- document.addEventListener("dynamic-content:open", S);
190
- }), ke(() => {
191
- if (He(), xe(), s.dispose(), l == null || l.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
192
- Ve();
215
+ }), He(() => {
216
+ if (Ze(), Xe(), s.dispose(), P.dispose(), v == null || v.disconnect(), document.removeEventListener("dynamic-content:open", k), document.removeEventListener("dynamic-content:invalid-hover", I), document.removeEventListener("dynamic-content:invalid-leave", D), f(), E(b)) {
217
+ et();
193
218
  try {
194
- const t = C();
219
+ const t = M();
195
220
  t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
196
221
  } catch (t) {
197
222
  console.debug("Failed to close the editor readiness gate on unmount", t);
198
223
  }
199
224
  }
200
- R(async () => {
201
- if (v(f))
225
+ W(async () => {
226
+ if (E(b))
202
227
  try {
203
228
  window.UIEditor.removeEditor();
204
229
  } catch {
205
230
  console.debug("Failed to remove Stripo editor: No editor found");
206
231
  }
207
232
  }), o.reset();
208
- }), J({
233
+ }), re({
209
234
  dynamicContent: {
210
- insert: B,
211
- close: P
235
+ insert: K,
236
+ close: Y,
237
+ setInvalid: j
212
238
  },
213
- hasChanges: p,
214
- saveSilent: L,
215
- setLoading: M
216
- }), { __sfc: !0, openMetrics: s, PreviewContainer: Q, OnboardingWrapper: X, AssignStrategyDrawer: Y, RemoveStrategyModal: Z, DisplayConditionsHost: ee, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: te, LegacyUnsubscribeConvertedModal: oe, SfmcUnsubscribeConvertedModal: ne, AmbiguousDynamicContentModal: re, wrapperRef: y, dynamicContentStore: b, unsubscribeStore: k, moduleDynamicContentStore: se, props: d, configStore: o, editorStore: m, previewStore: ie, hasChanges: p, isTestPartner: ae, isSaveValidationEnabled: ce, loadRollout: w, showToaster: F, trans: T, saveSilent: L, setLoading: M, emit: r, buildMetadata: g, initPlugin: U, preloadRuntime: I, runExclusive: R, beginMount: O, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: A, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: de, isRrsEnabled: me, isExternalDisplayConditionsEnabled: le, isLegacyUnsubscribeConversionEnabled: ue, isBlockUnsubscribeLinksEnabled: pe, hasAssignedStrategy: fe, insertDynamicContent: B, closeDynamicContent: P, handleDynamicContentOpen: S, ribbonObserver: l, updateRibbonOffset: E, startEditor: h, AutoSaveController: We, AuthErrorModal: $e, Toaster: Ge, FilterSelectionDrawer: ze, HeaderWrapper: qe, LoadingWrapper: Ke, SaveAsTemplateDrawer: je, UnsubscribeWrapper: Je, ValidationErrorDrawer: Qe };
239
+ hasChanges: g,
240
+ saveSilent: N,
241
+ setLoading: B
242
+ }), { __sfc: !0, openMetrics: s, PreviewContainer: ae, OnboardingWrapper: se, AssignStrategyDrawer: ce, RemoveStrategyModal: de, DisplayConditionsHost: le, autoSaveControllerRef: R, LegacyStrategyUpdatedModal: me, LegacyUnsubscribeConvertedModal: ue, SfmcUnsubscribeConvertedModal: pe, AmbiguousDynamicContentModal: ve, InvalidDynamicContentCard: ye, INVALID_CARD_HIDE_DELAY: U, wrapperRef: C, dynamicContentStore: m, unsubscribeStore: A, moduleDynamicContentStore: fe, props: l, configStore: o, editorStore: u, previewStore: ge, hasChanges: g, isTestPartner: be, isSaveValidationEnabled: Se, loadRollout: O, showToaster: _, trans: H, saveSilent: N, setLoading: B, emit: r, invalidDynamicContentMarking: P, buildMetadata: h, initPlugin: x, preloadRuntime: V, runExclusive: W, beginMount: $, isCurrentMount: E, mountGeneration: b, getDefaultTemplate: G, cloneTimersOnSave: z, hasTimerBlocks: q, noHeader: Ce, isRrsEnabled: he, isExternalDisplayConditionsEnabled: Ee, isLegacyUnsubscribeConversionEnabled: De, isBlockUnsubscribeLinksEnabled: Ie, hasAssignedStrategy: ke, insertDynamicContent: K, closeDynamicContent: Y, setInvalidDynamicContent: j, hoveredInvalidDynamicContent: d, hoveredInvalidEntry: J, invalidCardHideTimer: p, cancelInvalidCardHide: f, scheduleInvalidCardHide: D, handleInvalidDynamicContentHover: I, hideInvalidCard: S, handleInvalidDynamicContentAction: Le, handleDynamicContentOpen: k, ribbonObserver: v, updateRibbonOffset: L, startEditor: T, AutoSaveController: tt, AuthErrorModal: ot, Toaster: nt, FilterSelectionDrawer: it, HeaderWrapper: rt, LoadingWrapper: at, SaveAsTemplateDrawer: st, UnsubscribeWrapper: ct, ValidationErrorDrawer: dt };
217
243
  }
218
244
  });
219
245
  export {
220
- Gt as default
246
+ io as default
221
247
  };
@@ -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
+ };
@@ -1,29 +1,30 @@
1
- var c = Object.defineProperty;
2
- var g = (o, s, t) => s in o ? c(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
3
- var r = (o, s, t) => g(o, typeof s != "symbol" ? s + "" : s, t);
1
+ var m = Object.defineProperty;
2
+ var g = (r, n, t) => n in r ? m(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
+ var o = (r, n, t) => g(r, typeof n != "symbol" ? n + "" : n, t);
4
4
  import { useConfig as d } from "../../composables/useConfig.js";
5
- import { findEditorShadowRoot as m } from "../../utils/editorShadowRoot.js";
6
- import { mergeTagToDynamicContent as u, dynamicContentToMergeTags as h } from "../../utils/genericUtil.js";
7
- import { UIElement as T, UIElementType as a, UEAttr as y, UIElementTagRegistry as C } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
- import { ExternalMergeTagsLibrary as E } from "./dynamic-content-modal.js";
9
- const l = "external-dynamic-content-ui-element", L = "button-add-dynamic-content";
10
- class B extends C {
11
- registerUiElements(s) {
12
- s[a.MERGETAGS] = l;
5
+ import { applyInvalidDynamicContentMarking as u } from "../../composables/useInvalidDynamicContentMarking.js";
6
+ import { getEditorCanvasFrame as l, getCanvasElementPosition as h } from "../../utils/editorCanvas.js";
7
+ import { mergeTagToDynamicContent as T, dynamicContentToMergeTags as C } from "../../utils/genericUtil.js";
8
+ import { UIElement as y, UIElementType as a, UEAttr as L, UIElementTagRegistry as k } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
9
+ import { ExternalMergeTagsLibrary as p } from "./dynamic-content-modal.js";
10
+ const c = "external-dynamic-content-ui-element", E = "button-add-dynamic-content";
11
+ class U extends k {
12
+ registerUiElements(n) {
13
+ n[a.MERGETAGS] = c;
13
14
  }
14
15
  }
15
- class x extends T {
16
+ class v extends y {
16
17
  constructor() {
17
18
  super(...arguments);
18
- r(this, "mergeTagsButton", null);
19
- r(this, "mergeTagsLibrary", null);
20
- r(this, "clickListener", null);
21
- r(this, "lastClickedElement", null);
22
- r(this, "lastClickedFrame", null);
23
- r(this, "mousedownListener", null);
19
+ o(this, "mergeTagsButton", null);
20
+ o(this, "mergeTagsLibrary", null);
21
+ o(this, "clickListener", null);
22
+ o(this, "lastClickedElement", null);
23
+ o(this, "lastClickedFrame", null);
24
+ o(this, "mousedownListener", null);
24
25
  }
25
26
  getId() {
26
- return l;
27
+ return c;
27
28
  }
28
29
  onRender(t) {
29
30
  var e;
@@ -45,8 +46,8 @@ class x extends T {
45
46
  onAttributeUpdated(t, e) {
46
47
  if (t !== "mergeTag" || !(e != null && e.value))
47
48
  return;
48
- const n = u(e), i = this._getLastClickedPosition();
49
- this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(n, i);
49
+ const i = T(e), s = this._getLastClickedPosition();
50
+ this.lastClickedElement = null, this.lastClickedFrame = null, this._openDynamicContentLibrary(i, s);
50
51
  }
51
52
  openMergeTagLibrary() {
52
53
  const t = this._getButtonPosition(), e = { value: "", text: "" };
@@ -57,14 +58,15 @@ class x extends T {
57
58
  * Dispatches event with dynamic content data and position
58
59
  */
59
60
  _openDynamicContentLibrary(t, e) {
60
- this.mergeTagsLibrary || (this.mergeTagsLibrary = new E()), this.mergeTagsLibrary.openMergeTagsLibrary(
61
+ this.mergeTagsLibrary || (this.mergeTagsLibrary = new p()), this.mergeTagsLibrary.openMergeTagsLibrary(
61
62
  t,
62
- (n) => {
63
- if (n.text && n.value) {
64
- const { isFeatureEnabled: i } = d();
65
- this.api.triggerValueChange(h([n], i("liquidSyntax"))[0]);
63
+ (i) => {
64
+ if (i.text && i.value) {
65
+ const { isFeatureEnabled: s } = d();
66
+ this.api.triggerValueChange(C([i], s("liquidSyntax"))[0]);
66
67
  } else
67
68
  this.api.triggerValueChange(null);
69
+ u();
68
70
  },
69
71
  e
70
72
  );
@@ -76,8 +78,8 @@ class x extends T {
76
78
  _getButtonPosition() {
77
79
  if (!this.mergeTagsButton)
78
80
  return { x: 0, y: 0, width: 0, height: 0 };
79
- const { x: t, y: e, width: n, height: i } = this.mergeTagsButton.getBoundingClientRect();
80
- return { x: t, y: e, width: n, height: i };
81
+ const { x: t, y: e, width: i, height: s } = this.mergeTagsButton.getBoundingClientRect();
82
+ return { x: t, y: e, width: i, height: s };
81
83
  }
82
84
  /**
83
85
  * Sets up coordinate tracking for merge tag clicks in the iframe
@@ -85,20 +87,12 @@ class x extends T {
85
87
  */
86
88
  _setupCoordinateTracking() {
87
89
  var e;
88
- const t = this._getEditorFrame();
89
- (e = t == null ? void 0 : t.contentWindow) != null && e.document && (this.mousedownListener = (n) => {
90
- const i = this._findMergeTagElement(n.target);
91
- i && (this.lastClickedElement = i, this.lastClickedFrame = t);
90
+ const t = l();
91
+ (e = t == null ? void 0 : t.contentWindow) != null && e.document && (this.mousedownListener = (i) => {
92
+ const s = this._findMergeTagElement(i.target);
93
+ s && (this.lastClickedElement = s, this.lastClickedFrame = t);
92
94
  }, t.contentWindow.document.addEventListener("mousedown", this.mousedownListener));
93
95
  }
94
- /**
95
- * Gets the editor iframe element
96
- */
97
- _getEditorFrame() {
98
- var e, n;
99
- const t = (e = m()) == null ? void 0 : e.querySelector("iframe");
100
- return (n = t == null ? void 0 : t.contentWindow) != null && n.document ? t : null;
101
- }
102
96
  /**
103
97
  * Finds merge tag element in the element tree
104
98
  */
@@ -111,19 +105,7 @@ class x extends T {
111
105
  */
112
106
  _getLastClickedPosition() {
113
107
  if (!(!this.lastClickedElement || !this.lastClickedFrame))
114
- return this._calculateAbsolutePosition(this.lastClickedFrame, this.lastClickedElement);
115
- }
116
- /**
117
- * Calculates absolute position of element relative to page
118
- */
119
- _calculateAbsolutePosition(t, e) {
120
- const n = t.getBoundingClientRect(), i = e.getBoundingClientRect();
121
- return {
122
- x: n.x + i.x,
123
- y: n.y + i.y,
124
- width: i.width,
125
- height: i.height
126
- };
108
+ return h(this.lastClickedFrame, this.lastClickedElement);
127
109
  }
128
110
  /**
129
111
  * Cleans up the coordinate tracking event listener
@@ -132,7 +114,7 @@ class x extends T {
132
114
  var e;
133
115
  if (!this.mousedownListener)
134
116
  return;
135
- const t = this._getEditorFrame();
117
+ const t = l();
136
118
  (e = t == null ? void 0 : t.contentWindow) != null && e.document && t.contentWindow.document.removeEventListener("mousedown", this.mousedownListener), this.mousedownListener = null;
137
119
  }
138
120
  /**
@@ -145,7 +127,7 @@ class x extends T {
145
127
  <${a.BUTTON}
146
128
  id="guido__btn-add-dynamic-content"
147
129
  class="btn btn-primary"
148
- ${y.BUTTON.name}="${L}">
130
+ ${L.BUTTON.name}="${E}">
149
131
  <${a.ICON} src="plus" class="icon icon-button color-primary">
150
132
  </${a.ICON}>
151
133
  ${this.api.translate("Add Dynamic Content")}
@@ -154,6 +136,6 @@ class x extends T {
154
136
  }
155
137
  }
156
138
  export {
157
- B as DynamicContentTagRegistry,
158
- x as DynamicContentUiElementExtension
139
+ U as DynamicContentTagRegistry,
140
+ v as DynamicContentUiElementExtension
159
141
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-c8351f74]{gap:16px}.validation-error-row[data-v-c8351f74]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-c8351f74]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-c8351f74]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-b0036f48]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-b0036f48]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-b0036f48]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-f5ff6219]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-f5ff6219]{min-height:504px}.iframe-wrapper[data-v-a7102458]{width:258px}.iframe-scaled[data-v-a7102458]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-c8351f74]{gap:16px}.validation-error-row[data-v-c8351f74]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-c8351f74]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-c8351f74]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-d52d4413]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-d52d4413]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-d52d4413]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-f5ff6219]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-f5ff6219]{min-height:504px}.iframe-wrapper[data-v-a7102458]{width:258px}.iframe-scaled[data-v-a7102458]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}.invalid-dynamic-content-card[data-v-749d0533]{position:fixed;z-index:1000;max-width:280px;padding:12px 16px;border:1px solid #dc2a2a;border-radius:4px;background-color:#fff;box-shadow:0 2px 8px #00000029}.invalid-dynamic-content-card__title[data-v-749d0533]{margin:0 0 4px;font-weight:600;color:#dc2a2a}.invalid-dynamic-content-card__description[data-v-749d0533]{margin:0;color:#4a4a4a}.invalid-dynamic-content-card__action[data-v-749d0533]{margin-top:8px;padding:0;border:none;background:none;color:#0a2ecc;cursor:pointer}.invalid-dynamic-content-card__action[data-v-749d0533]:hover{text-decoration:underline}
@@ -1,9 +1,9 @@
1
- const o = "3.30.2-beta.67ce15e", e = { stripo: { version: "2.87.0" } }, s = {
1
+ const o = "3.30.2-beta.6873c0b", s = { stripo: { version: "2.87.0" } }, t = {
2
2
  version: o,
3
- guido: e
3
+ guido: s
4
4
  };
5
5
  export {
6
- s as default,
7
- e as guido,
6
+ t as default,
7
+ s as guido,
8
8
  o as version
9
9
  };
@@ -13,6 +13,13 @@ export type BaseDynamicContent = {
13
13
  export type DynamicContent = BaseDynamicContent & {
14
14
  text: string;
15
15
  };
16
+ export type InvalidDynamicContent = {
17
+ value: string;
18
+ title: string;
19
+ description: string;
20
+ actionLabel: string;
21
+ actionAvailable: boolean;
22
+ };
16
23
  /**
17
24
  * A node in the partner-keyed dynamic-content tree (backend categorized-fields
18
25
  * shape). Category nodes carry `children`/`select_items`; leaf nodes are the
@@ -54,6 +61,10 @@ export type DynamicContentEvent = {
54
61
  attribute: DynamicContent;
55
62
  position?: PositionData;
56
63
  };
64
+ export type InvalidDynamicContentHoverEvent = {
65
+ entry: InvalidDynamicContent;
66
+ position: PositionData;
67
+ };
57
68
  export type MergeTagClickEvent = {
58
69
  position: PositionData;
59
70
  element: HTMLElement;
@@ -1,5 +1,5 @@
1
1
  import type { DynamicContent, GuidoConfigInput } from '@@/Types/config';
2
- import type { PositionData } from '@@/Types/generic';
2
+ import type { InvalidDynamicContent, PositionData } from '@@/Types/generic';
3
3
  import type { SavedTemplateDetails } from '@@/Types/stripo';
4
4
  type __VLS_Props = {
5
5
  /** Guido configuration object */
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
13
13
  dynamicContent: {
14
14
  insert: (data: DynamicContent) => void;
15
15
  close: () => void;
16
+ setInvalid: (list: InvalidDynamicContent[]) => void;
16
17
  };
17
18
  hasChanges: import("vue").ComputedRef<boolean>;
18
19
  saveSilent: () => Promise<{
@@ -50,6 +51,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
50
51
  ready: () => void;
51
52
  "onboarding:finished": () => void;
52
53
  "test-email:click": () => void;
54
+ "dynamic-content:invalid-action": (detail: {
55
+ value: string;
56
+ }) => void;
53
57
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
54
58
  ready: boolean;
55
59
  }>>>, {
@@ -0,0 +1,22 @@
1
+ import type { InvalidDynamicContent, PositionData } from '@@/Types/generic';
2
+ type __VLS_Props = {
3
+ entry: InvalidDynamicContent;
4
+ position: PositionData;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
7
+ "dynamic-content:invalid-action": (detail: {
8
+ value: string;
9
+ }) => void;
10
+ mouseenter: () => void;
11
+ mouseleave: () => void;
12
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToOption<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: import('vue').PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -0,0 +1,4 @@
1
+ export declare const applyInvalidDynamicContentMarking: () => void;
2
+ export declare const useInvalidDynamicContentMarking: () => {
3
+ dispose: () => void;
4
+ };
@@ -37,10 +37,6 @@ export declare class DynamicContentUiElementExtension extends UIElement {
37
37
  * Workaround from Stripo intercepting click events - tracks mousedown events instead
38
38
  */
39
39
  private _setupCoordinateTracking;
40
- /**
41
- * Gets the editor iframe element
42
- */
43
- private _getEditorFrame;
44
40
  /**
45
41
  * Finds merge tag element in the element tree
46
42
  */
@@ -50,10 +46,6 @@ export declare class DynamicContentUiElementExtension extends UIElement {
50
46
  * This ensures we always use the correct element's position even with rapid clicks
51
47
  */
52
48
  private _getLastClickedPosition;
53
- /**
54
- * Calculates absolute position of element relative to page
55
- */
56
- private _calculateAbsolutePosition;
57
49
  /**
58
50
  * Cleans up the coordinate tracking event listener
59
51
  */
@@ -6,4 +6,4 @@ export { useGuidoEmailEditorStore } from './public/editorState';
6
6
  export type { GuidoEmailEditorState } from './public/editorState';
7
7
  export { prefetchGuidoRuntime } from './public/prefetchRuntime';
8
8
  export type { StripoEventType } from './@types/events';
9
- export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
9
+ export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, InvalidDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
@@ -1,7 +1,8 @@
1
- import type { DynamicContent } from '@@/Types/generic';
1
+ import type { DynamicContent, InvalidDynamicContent } from '@@/Types/generic';
2
2
  export declare const useDynamicContentStore: import("pinia").StoreDefinition<"guidoDynamicContent", {
3
3
  selectedDynamicContent: DynamicContent;
4
4
  selectedDynamicContentList: DynamicContent[];
5
+ invalidDynamicContentList: InvalidDynamicContent[];
5
6
  }, {
6
7
  getSelectedDynamicContentList: (state: {
7
8
  selectedDynamicContent: {
@@ -22,9 +23,17 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
22
23
  } | undefined;
23
24
  text: string;
24
25
  }[];
26
+ invalidDynamicContentList: {
27
+ value: string;
28
+ title: string;
29
+ description: string;
30
+ actionLabel: string;
31
+ actionAvailable: boolean;
32
+ }[];
25
33
  } & import("pinia").PiniaCustomStateProperties<{
26
34
  selectedDynamicContent: DynamicContent;
27
35
  selectedDynamicContentList: DynamicContent[];
36
+ invalidDynamicContentList: InvalidDynamicContent[];
28
37
  }>) => {
29
38
  text: string;
30
39
  value: string;
@@ -34,6 +43,37 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
34
43
  value: string;
35
44
  } | undefined;
36
45
  }[];
46
+ getInvalidDynamicContent: (state: {
47
+ selectedDynamicContent: {
48
+ value: string;
49
+ fallback?: string | undefined;
50
+ format?: {
51
+ key: string;
52
+ value: string;
53
+ } | undefined;
54
+ text: string;
55
+ };
56
+ selectedDynamicContentList: {
57
+ value: string;
58
+ fallback?: string | undefined;
59
+ format?: {
60
+ key: string;
61
+ value: string;
62
+ } | undefined;
63
+ text: string;
64
+ }[];
65
+ invalidDynamicContentList: {
66
+ value: string;
67
+ title: string;
68
+ description: string;
69
+ actionLabel: string;
70
+ actionAvailable: boolean;
71
+ }[];
72
+ } & import("pinia").PiniaCustomStateProperties<{
73
+ selectedDynamicContent: DynamicContent;
74
+ selectedDynamicContentList: DynamicContent[];
75
+ invalidDynamicContentList: InvalidDynamicContent[];
76
+ }>) => (value: string) => InvalidDynamicContent | undefined;
37
77
  }, {
38
78
  setSelectedDynamicContent(dynamicContent: DynamicContent): void;
39
79
  /**
@@ -44,4 +84,5 @@ export declare const useDynamicContentStore: import("pinia").StoreDefinition<"gu
44
84
  * reactivity can't write a later mutation back into the host's catalog.
45
85
  */
46
86
  registerDynamicContent(items: DynamicContent[]): void;
87
+ setInvalidDynamicContent(list: unknown): void;
47
88
  }>;
@@ -0,0 +1,3 @@
1
+ import type { PositionData } from '@@/Types/generic';
2
+ export declare const getEditorCanvasFrame: () => HTMLIFrameElement | null;
3
+ export declare const getCanvasElementPosition: (frame: HTMLIFrameElement, element: HTMLElement) => PositionData;
@@ -9,6 +9,10 @@ const n = `.esd-x,
9
9
  border-radius: 4px !important;
10
10
  }
11
11
 
12
+ merge-tag-selector {
13
+ --guido-dc-invalid-color: #dc2a2a;
14
+ }
15
+
12
16
  .ue-preview-control-wrapper ue-icon-component:not([disabled=true]):not(.stripo-static-icon):hover {
13
17
  background: none;
14
18
  }
@@ -1,9 +1,17 @@
1
- import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
2
- import { defineStore as a } from "pinia";
3
- const c = a("guidoDynamicContent", {
1
+ import { removeDuplicatesFromArray as i } from "../utils/arrayUtil.js";
2
+ import { isPlainObject as o } from "../utils/genericUtil.js";
3
+ import { defineStore as l } from "pinia";
4
+ const n = (t) => typeof t == "string" ? t : "", c = (t) => !o(t) || typeof t.value != "string" || t.value === "" ? null : {
5
+ value: t.value,
6
+ title: n(t.title),
7
+ description: n(t.description),
8
+ actionLabel: n(t.actionLabel),
9
+ actionAvailable: t.actionAvailable === !0
10
+ }, m = l("guidoDynamicContent", {
4
11
  state: () => ({
5
12
  selectedDynamicContent: { text: "", value: "" },
6
- selectedDynamicContentList: []
13
+ selectedDynamicContentList: [],
14
+ invalidDynamicContentList: []
7
15
  }),
8
16
  actions: {
9
17
  setSelectedDynamicContent(t) {
@@ -18,17 +26,21 @@ const c = a("guidoDynamicContent", {
18
26
  */
19
27
  registerDynamicContent(t) {
20
28
  this.selectedDynamicContentList.push(...t.map((e) => ({ ...e })));
29
+ },
30
+ setInvalidDynamicContent(t) {
31
+ this.invalidDynamicContentList = Array.isArray(t) ? t.map(c).filter((e) => e !== null) : [];
21
32
  }
22
33
  },
23
34
  getters: {
24
- getSelectedDynamicContentList: (t) => n(t.selectedDynamicContentList).map((e) => ({
35
+ getSelectedDynamicContentList: (t) => i(t.selectedDynamicContentList).map((e) => ({
25
36
  text: e.text,
26
37
  value: e.value,
27
38
  fallback: e.fallback,
28
39
  format: e.format
29
- }))
40
+ })),
41
+ getInvalidDynamicContent: (t) => (e) => t.invalidDynamicContentList.find((a) => a.value === e)
30
42
  }
31
43
  });
32
44
  export {
33
- c as useDynamicContentStore
45
+ m as useDynamicContentStore
34
46
  };
@@ -0,0 +1,18 @@
1
+ import { findEditorShadowRoot as i } from "./editorShadowRoot.js";
2
+ const c = () => {
3
+ var e, n;
4
+ const t = (e = i()) == null ? void 0 : e.querySelector("iframe");
5
+ return (n = t == null ? void 0 : t.contentWindow) != null && n.document ? t : null;
6
+ }, d = (t, e) => {
7
+ const n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
8
+ return {
9
+ x: n.x + o.x,
10
+ y: n.y + o.y,
11
+ width: o.width,
12
+ height: o.height
13
+ };
14
+ };
15
+ export {
16
+ d as getCanvasElementPosition,
17
+ c as getEditorCanvasFrame
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.30.2-beta.67ce15e",
3
+ "version": "3.30.2-beta.6873c0b",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",