@useinsider/guido 3.30.1-beta.34bc10d → 3.30.1-beta.49c2d00

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.
Files changed (37) hide show
  1. package/README.md +14 -0
  2. package/dist/@types/config/schemas.js +4 -4
  3. package/dist/@types/email-be/html-validation.js +1 -1
  4. package/dist/components/Guido.vue.js +9 -9
  5. package/dist/components/Guido.vue2.js +156 -130
  6. package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.js +22 -0
  7. package/dist/components/organisms/dynamic-content/InvalidDynamicContentCard.vue2.js +30 -0
  8. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +2 -2
  9. package/dist/composables/useInvalidDynamicContentMarking.js +105 -0
  10. package/dist/enums/defaults.js +5 -4
  11. package/dist/enums/email-be.js +9 -20
  12. package/dist/extensions/DynamicContent/dynamic-content.js +39 -57
  13. package/dist/guido.css +1 -1
  14. package/dist/node_modules/valibot/dist/index.js +90 -95
  15. package/dist/package.json.js +1 -1
  16. package/dist/services/emailBe/errors/ApiError.js +26 -27
  17. package/dist/services/templateLibraryApi.js +87 -59
  18. package/dist/src/@types/generic.d.ts +11 -0
  19. package/dist/src/@types/save-as-template.d.ts +23 -1
  20. package/dist/src/components/Guido.vue.d.ts +5 -1
  21. package/dist/src/components/organisms/dynamic-content/InvalidDynamicContentCard.vue.d.ts +22 -0
  22. package/dist/src/composables/useInvalidDynamicContentMarking.d.ts +4 -0
  23. package/dist/src/enums/email-be.d.ts +0 -11
  24. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +0 -8
  25. package/dist/src/library.d.ts +1 -1
  26. package/dist/src/stores/dynamic-content.d.ts +42 -1
  27. package/dist/src/utils/editorCanvas.d.ts +3 -0
  28. package/dist/static/styles/customEditorStyle.css.js +4 -0
  29. package/dist/stores/dynamic-content.js +19 -7
  30. package/dist/utils/editorCanvas.js +18 -0
  31. package/package.json +1 -1
  32. package/dist/@types/email-be/templates.js +0 -15
  33. package/dist/services/emailBe/templates/TemplateService.js +0 -149
  34. package/dist/services/emailBe/templates/index.js +0 -6
  35. package/dist/src/@types/email-be/templates.d.ts +0 -40
  36. package/dist/src/services/emailBe/templates/TemplateService.d.ts +0 -13
  37. package/dist/src/services/emailBe/templates/index.d.ts +0 -2
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,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
- import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as k, boolean as a, array as n, transform as S, unknown as i, variant as R, record as g, fallback as T, looseObject as C, union as h, literal as u, lazy as I } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as k, boolean as a, array as n, transform as S, unknown as i, record as g, fallback as R, literal as u, lazy as T, looseObject as C, variant as I, union as h } from "../../node_modules/valibot/dist/index.js";
3
3
  const b = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -76,7 +76,7 @@ const b = {
76
76
  value: t()
77
77
  })
78
78
  )
79
- }), f = I(() => C({
79
+ }), f = T(() => C({
80
80
  text: e(t()),
81
81
  // eslint-disable-next-line camelcase -- backend field name
82
82
  tag_text: e(t()),
@@ -86,7 +86,7 @@ const b = {
86
86
  select_items: e(n(f))
87
87
  })), P = g(
88
88
  t(),
89
- T(n(f), [])
89
+ R(n(f), [])
90
90
  ), v = C({
91
91
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
92
92
  id: e(c()),
@@ -324,7 +324,7 @@ const b = {
324
324
  (s) => typeof s == "function",
325
325
  "processor must be a function"
326
326
  )
327
- }), V = R("type", [
327
+ }), V = I("type", [
328
328
  H,
329
329
  _,
330
330
  q,
@@ -1,4 +1,4 @@
1
- import { pipe as o, check as i, object as r, array as l, boolean as s, string as e, fallback as m, nullable as d, union as t, number as a, record as h, transform as u, tuple as p } from "../../node_modules/valibot/dist/index.js";
1
+ import { pipe as o, check as i, object as r, array as l, boolean as s, string as e, fallback as m, union as t, nullable as d, record as h, number as a, transform as u, tuple as p } from "../../node_modules/valibot/dist/index.js";
2
2
  const b = r({
3
3
  code: e(),
4
4
  trans: r({
@@ -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
+ "a12504dd"
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,241 @@
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 Re, defineAsyncComponent as s, ref as w, computed as d, watch as F, onMounted as Ae, onUnmounted as Oe } from "vue";
2
+ import { useCortexBlueprintBridge as Ue } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as _e } from "../composables/useEditorLock.js";
4
+ import { startEditorOpenMetrics as He } from "../composables/useEditorOpenMetrics.js";
5
+ import { provideGuidoActions as Ne } from "../composables/useGuidoActions.js";
6
+ import { useGuidoStateBridge as Pe } from "../composables/useGuidoStateBridge.js";
7
+ import { useInvalidDynamicContentMarking as xe } from "../composables/useInvalidDynamicContentMarking.js";
8
+ import { usePartner as Be } from "../composables/usePartner.js";
9
+ import { useSaveValidationRollout as Ve } from "../composables/useSaveValidationRollout.js";
10
+ import { useStripo as We } from "../composables/useStripo.js";
11
+ import { useTimerClone as $e } from "../composables/useTimerClone.js";
12
+ import { useToaster as Ge } from "../composables/useToaster.js";
13
+ import { useTranslations as ze } from "../composables/useTranslations.js";
14
+ import { migrate as qe } from "../config/migrator/index.js";
15
+ import { ModuleFolderDefaults as ee } from "../enums/defaults.js";
16
+ import { RIBBON_SELECTOR as Ke } from "../enums/onboarding.js";
17
+ import { ToasterTypeOptions as Ye } from "../enums/toaster.js";
18
+ import { useRecommendationExtensionStore as te, disposeStrategyPageReturnListeners as je } from "../extensions/Blocks/Recommendation/store/recommendation.js";
19
+ import { disposeUnsubscribeListeners as Je } from "../extensions/Blocks/Unsubscribe/block.js";
20
+ import { disposeDisplayConditionRequest as Qe } from "../extensions/DisplayConditions/bridge.js";
21
+ import Xe from "./organisms/AutoSaveController.vue.js";
22
+ import Ze from "./organisms/base/AuthErrorModal.vue.js";
23
+ import et from "./organisms/base/Toaster.vue.js";
24
+ import tt from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
25
+ import ot from "./organisms/header/HeaderWrapper.vue.js";
26
+ import nt from "./organisms/LoadingWrapper.vue.js";
27
+ import it from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
28
+ import rt from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
29
+ import at from "./organisms/validation/ValidationErrorDrawer.vue.js";
30
+ import { useStripoApi as st } from "../services/stripoApi.js";
31
+ import { useConfigStore as ct } from "../stores/config.js";
32
+ import { useDynamicContentStore as dt } 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 lt } from "../stores/onboarding.js";
36
+ import { usePreviewStore as mt } from "../stores/preview.js";
37
+ import { useSaveValidationStore as ut } from "../stores/save-validation.js";
38
+ import { useTemplateStore as pt } from "../stores/template.js";
39
+ import { useUnsubscribeStore as vt } from "../stores/unsubscribe.js";
40
+ import { readTrackFloor as ne } from "../utils/linkTrackingIds.js";
41
+ const to = /* @__PURE__ */ Re({
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(ie, { expose: re, emit: r }) {
49
+ const l = ie, a = He(), ae = s(
49
50
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
50
- ), X = a(
51
+ ), se = s(
51
52
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
52
- ), Y = a(
53
+ ), ce = s(
53
54
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
54
- ), Z = a(
55
+ ), de = s(
55
56
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
56
- ), ee = a(
57
+ ), le = s(
57
58
  () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
58
- ), D = W(), te = a(
59
+ ), R = w(), me = s(
59
60
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
60
- ), oe = a(
61
+ ), ue = s(
61
62
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
62
- ), ne = a(
63
+ ), pe = 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
+ ), ve = s(
66
+ () => import("./organisms/dynamic-content/InvalidDynamicContentCard.vue.js")
67
+ ), A = 200, h = w(), m = dt(), O = vt(), ye = oe(), o = ct();
68
+ l.ready && o.init(l.config);
69
+ const u = M(), fe = mt(), g = d(() => u.hasChanges), { isTestPartner: ge } = Be(), { isEnabled: be, loadRollout: U } = Ve(), { showToaster: _ } = Ge(), H = ze(), N = () => {
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 (u.isVersionHistoryOpen) {
72
+ console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), _({
73
+ type: Ye.Warning,
74
+ message: H("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 = R.value) == null ? void 0 : t.saveSilent();
79
+ }, P = (t) => {
80
+ u.loadingStatus = t;
78
81
  };
79
- Ce(), ke();
80
- const b = () => {
82
+ Ue(), Pe();
83
+ const x = xe(), C = () => {
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) || ee.SAVED_MODULES,
91
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || ee.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: B, preloadRuntime: V } = We(a), { runExclusive: W, beginMount: $, isCurrentMount: E } = _e();
94
+ let b = 0;
95
+ const { getDefaultTemplate: G } = st(), { cloneTimersOnSave: z, hasTimerBlocks: q } = $e(), Se = d(() => {
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
+ }), he = d(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Ce = d(() => o.externalDisplayConditions), Ee = d(
96
99
  () => o.isFeatureEnabled("legacyUnsubscribeConversion")
97
- ), ue = l(
98
- () => !!z().recommendationConfigs.strategyId
100
+ ), De = d(
101
+ () => !!te().recommendationConfigs.strategyId
99
102
  );
100
- Te({
103
+ Ne({
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: C() };
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 K = (t) => {
119
+ console.debug("dynamic-content:close", t), m.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
120
+ }, Y = () => {
118
121
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
122
+ }, j = (t) => {
123
+ m.setInvalidDynamicContent(t);
124
+ }, c = w(null), J = d(() => c.value ? m.getInvalidDynamicContent(c.value.value) : void 0);
125
+ let p = null;
126
+ const y = () => {
127
+ p && (clearTimeout(p), p = null);
128
+ }, D = () => {
129
+ y(), p = setTimeout(() => {
130
+ p = null, c.value = null;
131
+ }, A);
132
+ }, I = (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(), c.value = { value: e.entry.value, position: e.position });
136
+ }, S = () => {
137
+ y(), c.value = null;
138
+ };
139
+ F(J, (t) => {
140
+ !t && c.value && S();
141
+ });
142
+ const Ie = (t) => {
143
+ console.debug("dynamic-content:invalid-action", t), S(), r("dynamic-content:invalid-action", { value: t.value });
119
144
  };
120
- $(() => p.value, () => {
121
- i("on-change", p.value);
145
+ F(() => g.value, () => {
146
+ r("on-change", g.value);
122
147
  });
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);
148
+ const T = (t) => {
149
+ S();
150
+ const e = t, { attribute: n, position: f } = e.detail;
151
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", n, f);
126
152
  };
127
- let m = null;
128
- const h = () => {
153
+ let v = null;
154
+ const k = () => {
129
155
  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 () => {
156
+ const t = document.querySelector(Ke);
157
+ (e = h.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
158
+ }, L = async () => {
133
159
  var t;
134
- r.mark("host_ready");
160
+ a.mark("host_ready");
135
161
  try {
136
- o.initialized || o.init(c.config), d.templateId = o.templateId, r.setContext({
162
+ o.initialized || o.init(l.config), u.templateId = o.templateId, a.setContext({
137
163
  partnerName: o.partnerName,
138
164
  productType: o.productType,
139
165
  templateId: o.templateId,
140
166
  variationId: o.variationId
141
167
  });
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 = {
168
+ const e = o.template, n = (e == null ? void 0 : e.html) || "", f = (e == null ? void 0 : e.css) || "", Q = (e == null ? void 0 : e.preselectedDynamicContent) || [];
169
+ O.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
170
+ const Te = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, X = o.isFeatureEnabled("linkTrackingIds"), ke = {
145
171
  partnerName: o.partnerName,
146
172
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
147
173
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
148
- }, ye = {
174
+ }, Le = {
149
175
  itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
150
- }, V = (ve) => r.timed(
176
+ }, Z = (Me) => a.timed(
151
177
  "migration",
152
- () => Ue(ve, pe, fe, ye)
178
+ () => qe(Me, Te, ke, Le)
153
179
  );
154
- let n = {
155
- html: s && await V(s),
156
- css: u
180
+ let i = {
181
+ html: n && await Z(n),
182
+ css: f
157
183
  };
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,
184
+ i.html || (i = await a.timed("default_template", () => G()), i.html = await Z(i.html));
185
+ const we = X ? ne(i.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
186
+ q(i.html) && (i.html = await a.timed("timer_clone", () => z(i.html))), X && (u.trackIdSessionFloor = Math.max(we, ne(i.html)));
187
+ const Fe = {
188
+ preselectedDynamicContentList: Q,
163
189
  onReady: () => {
164
- console.debug("guido:ready"), i("ready");
190
+ console.debug("guido:ready"), r("ready");
165
191
  }
166
192
  };
167
- f = U(), await L(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
193
+ b = $(), await B(i, C(), Fe, i.html !== n), m.selectedDynamicContentList = Q;
168
194
  } catch (e) {
169
- console.error("Failed to initialize Stripo editor:", e), r.markFailed();
195
+ console.error("Failed to initialize Stripo editor:", e), a.markFailed();
170
196
  }
171
197
  };
172
- return he(async () => {
198
+ return Ae(async () => {
173
199
  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();
200
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), M().$reset(), pt().$reset(), ut().$reset(), oe().$reset(), m.setInvalidDynamicContent([]), lt().resetOnboarding("recommendationLegacyStrategyOnboarding"), U(), k();
201
+ const t = (e = h.value) == null ? void 0 : e.parentElement;
202
+ if (t && (v = new ResizeObserver(k), v.observe(t)), V(), document.addEventListener("dynamic-content:open", T), document.addEventListener("dynamic-content:invalid-hover", I), document.addEventListener("dynamic-content:invalid-leave", D), l.ready)
203
+ await L();
178
204
  else {
179
- const s = $(() => c.ready, (u) => {
180
- u && (s(), E());
205
+ const n = F(() => l.ready, (f) => {
206
+ f && (n(), L());
181
207
  });
182
208
  }
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();
209
+ }), Oe(() => {
210
+ if (Je(), je(), a.dispose(), x.dispose(), v == null || v.disconnect(), document.removeEventListener("dynamic-content:open", T), document.removeEventListener("dynamic-content:invalid-hover", I), document.removeEventListener("dynamic-content:invalid-leave", D), y(), E(b)) {
211
+ Qe();
187
212
  try {
188
- const t = C();
213
+ const t = M();
189
214
  t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
190
215
  } catch (t) {
191
216
  console.debug("Failed to close the editor readiness gate on unmount", t);
192
217
  }
193
218
  }
194
- O(async () => {
195
- if (v(f))
219
+ W(async () => {
220
+ if (E(b))
196
221
  try {
197
222
  window.UIEditor.removeEditor();
198
223
  } catch {
199
224
  console.debug("Failed to remove Stripo editor: No editor found");
200
225
  }
201
226
  }), o.reset();
202
- }), J({
227
+ }), re({
203
228
  dynamicContent: {
204
- insert: P,
205
- close: x
229
+ insert: K,
230
+ close: Y,
231
+ setInvalid: j
206
232
  },
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 };
233
+ hasChanges: g,
234
+ saveSilent: N,
235
+ setLoading: P
236
+ }), { __sfc: !0, openMetrics: a, PreviewContainer: ae, OnboardingWrapper: se, AssignStrategyDrawer: ce, RemoveStrategyModal: de, DisplayConditionsHost: le, autoSaveControllerRef: R, LegacyStrategyUpdatedModal: me, LegacyUnsubscribeConvertedModal: ue, AmbiguousDynamicContentModal: pe, InvalidDynamicContentCard: ve, INVALID_CARD_HIDE_DELAY: A, wrapperRef: h, dynamicContentStore: m, unsubscribeStore: O, moduleDynamicContentStore: ye, props: l, configStore: o, editorStore: u, previewStore: fe, hasChanges: g, isTestPartner: ge, isSaveValidationEnabled: be, loadRollout: U, showToaster: _, trans: H, saveSilent: N, setLoading: P, emit: r, invalidDynamicContentMarking: x, buildMetadata: C, initPlugin: B, preloadRuntime: V, runExclusive: W, beginMount: $, isCurrentMount: E, mountGeneration: b, getDefaultTemplate: G, cloneTimersOnSave: z, hasTimerBlocks: q, noHeader: Se, isRrsEnabled: he, isExternalDisplayConditionsEnabled: Ce, isLegacyUnsubscribeConversionEnabled: Ee, hasAssignedStrategy: De, insertDynamicContent: K, closeDynamicContent: Y, setInvalidDynamicContent: j, hoveredInvalidDynamicContent: c, hoveredInvalidEntry: J, invalidCardHideTimer: p, cancelInvalidCardHide: y, scheduleInvalidCardHide: D, handleInvalidDynamicContentHover: I, hideInvalidCard: S, handleInvalidDynamicContentAction: Ie, handleDynamicContentOpen: T, ribbonObserver: v, updateRibbonOffset: k, startEditor: L, AutoSaveController: Xe, AuthErrorModal: Ze, Toaster: et, FilterSelectionDrawer: tt, HeaderWrapper: ot, LoadingWrapper: nt, SaveAsTemplateDrawer: it, UnsubscribeWrapper: rt, ValidationErrorDrawer: at };
211
237
  }
212
238
  });
213
239
  export {
214
- Vt as default
240
+ to as default
215
241
  };
@@ -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
+ };
@@ -4,8 +4,8 @@ var r = function() {
4
4
  var a = this, e = a._self._c, t = a._self._setupProxy;
5
5
  return e(t.WpDrawer, { attrs: { id: "save-as-template-modal", "description-status": "", "description-text": t.trans("newsletter.save-template-description"), "footer-button-group-options": t.footerButtonGroupOptions, status: t.editorStore.isSaveAsTemplateDrawerOpen, "title-text": t.trans("products.save-template") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.saveTemplate } }, [e(t.InBasicTextInput, { staticClass: "mb-5 w-1", attrs: { id: "guido__template-name-input", name: "templateName", "character-counter-status": !1, "disabled-status": t.isSaving, "label-text": t.trans("products.template-name"), "max-character-length": 1e3, "placeholder-text": t.trans("newsletter.enter-template-name"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, "state-message": t.templateNameError, states: t.templateNameError ? "error" : "default", "tooltip-status": !1, value: t.saveAsTemplateStore.templateName }, on: { input: t.handleTemplateName } }), e(t.InMultiSelect, { staticClass: "template-category-dropdown mb-5 w-1", attrs: { id: "guido__template-category-dropdown", "create-option-status": "", "search-status": "", "button-status": !1, "character-limit-validation-text": t.trans("validation-v2.duration-value", {
6
6
  min: 1,
7
- max: 40
8
- }), "create-button-label": t.trans("products.create-new-category"), "disabled-status": t.isSaving, "label-text": t.trans("products.template-category"), "loading-state": t.isAddingOption, "max-character-limit": 40, "max-height": 350, options: t.saveAsTemplateStore.categories, "placeholder-text": t.trans("products.select-template-category"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, value: t.saveAsTemplateStore.selectedCategories }, on: { addOption: t.handleAddOption, change: t.handleCategoryChange, resetAllOptions: t.handleResetAllOptions, selectAllOptions: t.handleSelectAllOptions } })], 1);
7
+ max: 25
8
+ }), "create-button-label": t.trans("products.create-new-category"), "disabled-status": t.isSaving, "label-text": t.trans("products.template-category"), "loading-state": t.isAddingOption, "max-character-limit": 25, "max-height": 350, options: t.saveAsTemplateStore.categories, "placeholder-text": t.trans("products.select-template-category"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, value: t.saveAsTemplateStore.selectedCategories }, on: { addOption: t.handleAddOption, change: t.handleCategoryChange, resetAllOptions: t.handleResetAllOptions, selectAllOptions: t.handleSelectAllOptions } })], 1);
9
9
  }, l = [], n = /* @__PURE__ */ o(
10
10
  s,
11
11
  r,