@useinsider/guido 3.30.0-beta.232ea3c → 3.30.0-beta.25ed52c

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 (46) hide show
  1. package/README.md +52 -0
  2. package/dist/@types/config/schemas.js +40 -33
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +128 -113
  5. package/dist/components/organisms/dynamic-content/DynamicContentAooRuleConfig.vue.js +34 -0
  6. package/dist/components/organisms/dynamic-content/DynamicContentAooRuleConfig.vue2.js +76 -0
  7. package/dist/components/organisms/dynamic-content/DynamicContentCustomFormat.vue.js +21 -0
  8. package/dist/components/organisms/dynamic-content/DynamicContentCustomFormat.vue2.js +33 -0
  9. package/dist/components/organisms/dynamic-content/DynamicContentPicker.vue.js +42 -0
  10. package/dist/components/organisms/dynamic-content/DynamicContentPicker.vue2.js +216 -0
  11. package/dist/composables/useDynamicContentFormat.js +10 -0
  12. package/dist/composables/useDynamicContentPicker.js +36 -0
  13. package/dist/composables/useHtmlCompiler.js +15 -13
  14. package/dist/composables/useInfoBoxPosition.js +16 -0
  15. package/dist/composables/useStripo.js +59 -57
  16. package/dist/config/compiler/liquidCompilerRules.js +13 -5
  17. package/dist/config/migrator/itemsBlockMigrator.js +164 -161
  18. package/dist/enums/dynamic-content.js +180 -2
  19. package/dist/extensions/DynamicContent/dynamic-content.js +56 -33
  20. package/dist/guido.css +1 -1
  21. package/dist/package.json.js +1 -1
  22. package/dist/src/@types/config/schemas.d.ts +16 -0
  23. package/dist/src/@types/generic.d.ts +11 -0
  24. package/dist/src/components/organisms/dynamic-content/DynamicContentAooRuleConfig.vue.d.ts +48 -0
  25. package/dist/src/components/organisms/dynamic-content/DynamicContentCustomFormat.vue.d.ts +44 -0
  26. package/dist/src/components/organisms/dynamic-content/DynamicContentPicker.vue.d.ts +67 -0
  27. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
  28. package/dist/src/composables/useConfig.d.ts +6 -0
  29. package/dist/src/composables/useDynamicContentFormat.d.ts +5 -0
  30. package/dist/src/composables/useDynamicContentPicker.d.ts +35 -0
  31. package/dist/src/composables/useInfoBoxPosition.d.ts +24 -0
  32. package/dist/src/enums/dynamic-content.d.ts +21 -0
  33. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +11 -0
  34. package/dist/src/stores/config.d.ts +63 -0
  35. package/dist/src/utils/clipboardText.d.ts +1 -0
  36. package/dist/src/utils/dynamicContentPicker.d.ts +43 -0
  37. package/dist/src/utils/genericUtil.d.ts +7 -2
  38. package/dist/src/utils/linkTokenPaste.d.ts +3 -0
  39. package/dist/src/utils/liquidLinkQuotes.d.ts +4 -0
  40. package/dist/utils/clipboardText.js +31 -0
  41. package/dist/utils/dynamicContentPicker.js +88 -0
  42. package/dist/utils/genericUtil.js +53 -43
  43. package/dist/utils/linkTokenPaste.js +28 -0
  44. package/dist/utils/liquidLinkQuotes.js +10 -0
  45. package/dist/utils/pairProductVariables.js +98 -108
  46. package/package.json +1 -1
@@ -1,82 +1,85 @@
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 we, defineAsyncComponent as a, ref as G, computed as p, watch as z, onMounted as Fe, onUnmounted as Me } from "vue";
2
+ import { useCortexBlueprintBridge as Ie } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useDynamicContentPicker as Le } from "../composables/useDynamicContentPicker.js";
4
+ import { useEditorLock as Re } from "../composables/useEditorLock.js";
5
+ import { startEditorOpenMetrics as Oe } from "../composables/useEditorOpenMetrics.js";
6
+ import { provideGuidoActions as Pe } from "../composables/useGuidoActions.js";
7
+ import { useGuidoStateBridge as Ue } from "../composables/useGuidoStateBridge.js";
8
+ import { usePartner as Ae } from "../composables/usePartner.js";
9
+ import { useSaveValidationRollout as Ne } from "../composables/useSaveValidationRollout.js";
10
+ import { useStripo as _e } from "../composables/useStripo.js";
11
+ import { useTimerClone as He } from "../composables/useTimerClone.js";
12
+ import { useToaster as xe } from "../composables/useToaster.js";
13
+ import { useTranslations as Be } from "../composables/useTranslations.js";
14
+ import { migrate as Ve } from "../config/migrator/index.js";
15
+ import { ModuleFolderDefaults as q } from "../enums/defaults.js";
16
+ import { RIBBON_SELECTOR as We } from "../enums/onboarding.js";
17
+ import { ToasterTypeOptions as $e } from "../enums/toaster.js";
18
+ import { useRecommendationExtensionStore as K, disposeStrategyPageReturnListeners as Ge } from "../extensions/Blocks/Recommendation/store/recommendation.js";
19
+ import { disposeUnsubscribeListeners as ze } from "../extensions/Blocks/Unsubscribe/block.js";
20
+ import { disposeDisplayConditionRequest as qe } from "../extensions/DisplayConditions/bridge.js";
21
+ import Ke from "./organisms/AutoSaveController.vue.js";
22
+ import je from "./organisms/base/AuthErrorModal.vue.js";
23
+ import Je from "./organisms/base/Toaster.vue.js";
24
+ import Qe from "./organisms/dynamic-content/DynamicContentPicker.vue.js";
25
+ import Xe from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
26
+ import Ye from "./organisms/header/HeaderWrapper.vue.js";
27
+ import Ze from "./organisms/LoadingWrapper.vue.js";
28
+ import et from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
29
+ import tt from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
30
+ import ot from "./organisms/validation/ValidationErrorDrawer.vue.js";
31
+ import { useStripoApi as nt } from "../services/stripoApi.js";
32
+ import { useConfigStore as rt } from "../stores/config.js";
33
+ import { useDynamicContentStore as it } from "../stores/dynamic-content.js";
34
+ import { useEditorStore as D } from "../stores/editor.js";
35
+ import { useModuleDynamicContentStore as j } from "../stores/module-dynamic-content.js";
36
+ import { useOnboardingStore as st } from "../stores/onboarding.js";
37
+ import { usePreviewStore as at } from "../stores/preview.js";
38
+ import { useSaveValidationStore as ct } from "../stores/save-validation.js";
39
+ import { useTemplateStore as dt } from "../stores/template.js";
40
+ import { useUnsubscribeStore as mt } from "../stores/unsubscribe.js";
41
+ import { disposeLinkTokenPaste as lt } from "../utils/linkTokenPaste.js";
42
+ import { readTrackFloor as J } from "../utils/linkTrackingIds.js";
43
+ const eo = /* @__PURE__ */ we({
41
44
  __name: "Guido",
42
45
  props: {
43
46
  config: null,
44
47
  ready: { type: Boolean, default: !0 }
45
48
  },
46
49
  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(
50
+ setup(Q, { expose: X, emit: s }) {
51
+ const c = Q, r = Oe(), Y = a(
49
52
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
50
- ), X = a(
53
+ ), Z = a(
51
54
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
52
- ), Y = a(
55
+ ), ee = a(
53
56
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
54
- ), Z = a(
57
+ ), te = a(
55
58
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
56
- ), ee = a(
59
+ ), oe = a(
57
60
  () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
58
- ), D = W(), te = a(
61
+ ), T = G(), ne = a(
59
62
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
60
- ), oe = a(
63
+ ), re = a(
61
64
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
62
- ), ne = a(
65
+ ), ie = a(
63
66
  () => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
64
- ), y = W(), g = Qe(), w = tt(), re = q(), o = Je();
67
+ ), y = G(), g = it(), w = mt(), se = j(), o = rt();
65
68
  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 = () => {
69
+ const d = D(), ae = at(), u = p(() => d.hasChanges), { isTestPartner: ce } = Ae(), { isEnabled: de, loadRollout: F } = Ne(), { showToaster: M } = xe(), I = Be(), L = () => {
67
70
  var t;
68
71
  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")
72
+ console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), M({
73
+ type: $e.Warning,
74
+ message: I("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) => {
78
+ return (t = T.value) == null ? void 0 : t.saveSilent();
79
+ }, R = (t) => {
77
80
  d.loadingStatus = t;
78
81
  };
79
- Ce(), ke();
82
+ Ie(), Ue();
80
83
  const b = () => {
81
84
  var t, e;
82
85
  return {
@@ -84,52 +87,64 @@ const Vt = /* @__PURE__ */ Se({
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) || q.SAVED_MODULES,
91
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || q.DEFAULT_MODULES
89
92
  };
90
- }, { initPlugin: L, preloadRuntime: R } = Ie(r), { runExclusive: O, beginMount: U, isCurrentMount: v } = De();
93
+ }, { initPlugin: O, preloadRuntime: P } = _e(r), { runExclusive: U, beginMount: A, isCurrentMount: v } = Re();
91
94
  let f = 0;
92
- const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Le(), ce = l(() => {
95
+ const { getDefaultTemplate: N } = nt(), { cloneTimersOnSave: _, hasTimerBlocks: H } = He(), me = p(() => {
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
+ }), le = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), pe = p(() => o.externalDisplayConditions), ue = p(
96
99
  () => o.isFeatureEnabled("legacyUnsubscribeConversion")
97
- ), ue = l(
98
- () => !!z().recommendationConfigs.strategyId
100
+ ), fe = p(
101
+ () => !!K().recommendationConfigs.strategyId
99
102
  );
100
- Te({
103
+ Pe({
101
104
  onBack: () => {
102
- console.debug("guido:back"), i("back");
105
+ console.debug("guido:back"), s("back");
103
106
  },
104
107
  onSaveStart: () => {
105
- console.debug("guido:save:start"), i("save:start");
108
+ console.debug("guido:save:start"), s("save:start");
106
109
  },
107
110
  onSaveComplete: (t) => {
108
111
  const e = { ...t, metadata: b() };
109
- console.debug("guido:save:complete", e), i("save:complete", e);
112
+ console.debug("guido:save:complete", e), s("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"), s("test-email:click");
113
116
  }
114
117
  });
115
- const P = (t) => {
118
+ const S = (t) => {
116
119
  console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
117
- }, x = () => {
120
+ }, E = () => {
118
121
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
119
122
  };
120
- $(() => p.value, () => {
121
- i("on-change", p.value);
123
+ z(() => u.value, () => {
124
+ s("on-change", u.value);
122
125
  });
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);
126
+ const {
127
+ isPickerEnabled: x,
128
+ picker: ye,
129
+ pickerOptions: ge,
130
+ pickerAooScanContent: be,
131
+ openPicker: B,
132
+ pickerSaveHandler: ve,
133
+ pickerCloseHandler: Se
134
+ } = Le({ onInsert: S, onClose: E }), h = (t) => {
135
+ const e = t, { attribute: i, position: l } = e.detail;
136
+ if (console.debug("dynamic-content:open", e.detail), x.value) {
137
+ B(i, l);
138
+ return;
139
+ }
140
+ s("dynamic-content:open", i, l);
126
141
  };
127
142
  let m = null;
128
- const h = () => {
143
+ const C = () => {
129
144
  var e;
130
- const t = document.querySelector(Ae);
145
+ const t = document.querySelector(We);
131
146
  (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
132
- }, E = async () => {
147
+ }, k = async () => {
133
148
  var t;
134
149
  r.mark("host_ready");
135
150
  try {
@@ -139,59 +154,59 @@ const Vt = /* @__PURE__ */ Se({
139
154
  templateId: o.templateId,
140
155
  variationId: o.variationId
141
156
  });
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) || [];
157
+ const e = o.template, i = (e == null ? void 0 : e.html) || "", l = (e == null ? void 0 : e.css) || "", V = (e == null ? void 0 : e.preselectedDynamicContent) || [];
143
158
  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 = {
159
+ const Ee = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, W = o.isFeatureEnabled("linkTrackingIds"), he = {
145
160
  partnerName: o.partnerName,
146
161
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
147
162
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
148
- }, ye = {
163
+ }, Ce = {
149
164
  itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
150
- }, V = (ve) => r.timed(
165
+ }, $ = (Te) => r.timed(
151
166
  "migration",
152
- () => Ue(ve, pe, fe, ye)
167
+ () => Ve(Te, Ee, he, Ce)
153
168
  );
154
169
  let n = {
155
- html: s && await V(s),
156
- css: u
170
+ html: i && await $(i),
171
+ css: l
157
172
  };
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,
173
+ n.html || (n = await r.timed("default_template", () => N()), n.html = await $(n.html));
174
+ const ke = W ? J(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
175
+ H(n.html) && (n.html = await r.timed("timer_clone", () => _(n.html))), W && (d.trackIdSessionFloor = Math.max(ke, J(n.html)));
176
+ const De = {
177
+ preselectedDynamicContentList: V,
163
178
  onReady: () => {
164
- console.debug("guido:ready"), i("ready");
179
+ console.debug("guido:ready"), s("ready");
165
180
  }
166
181
  };
167
- f = U(), await L(n, b(), be, n.html !== s), g.selectedDynamicContentList = B;
182
+ f = A(), await O(n, b(), De, n.html !== i), g.selectedDynamicContentList = V;
168
183
  } catch (e) {
169
184
  console.error("Failed to initialize Stripo editor:", e), r.markFailed();
170
185
  }
171
186
  };
172
- return he(async () => {
187
+ return Fe(async () => {
173
188
  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();
189
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), K().$reset(), D().$reset(), dt().$reset(), ct().$reset(), j().$reset(), st().resetOnboarding("recommendationLegacyStrategyOnboarding"), F(), C();
175
190
  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();
191
+ if (t && (m = new ResizeObserver(C), m.observe(t)), P(), c.ready)
192
+ await k();
178
193
  else {
179
- const s = $(() => c.ready, (u) => {
180
- u && (s(), E());
194
+ const i = z(() => c.ready, (l) => {
195
+ l && (i(), k());
181
196
  });
182
197
  }
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();
198
+ document.addEventListener("dynamic-content:open", h);
199
+ }), Me(() => {
200
+ if (ze(), Ge(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", h), v(f)) {
201
+ qe(), lt();
187
202
  try {
188
- const t = C();
203
+ const t = D();
189
204
  t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
190
205
  } catch (t) {
191
206
  console.debug("Failed to close the editor readiness gate on unmount", t);
192
207
  }
193
208
  }
194
- O(async () => {
209
+ U(async () => {
195
210
  if (v(f))
196
211
  try {
197
212
  window.UIEditor.removeEditor();
@@ -199,17 +214,17 @@ const Vt = /* @__PURE__ */ Se({
199
214
  console.debug("Failed to remove Stripo editor: No editor found");
200
215
  }
201
216
  }), o.reset();
202
- }), J({
217
+ }), X({
203
218
  dynamicContent: {
204
- insert: P,
205
- close: x
219
+ insert: S,
220
+ close: E
206
221
  },
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 };
222
+ hasChanges: u,
223
+ saveSilent: L,
224
+ setLoading: R
225
+ }), { __sfc: !0, openMetrics: r, PreviewContainer: Y, OnboardingWrapper: Z, AssignStrategyDrawer: ee, RemoveStrategyModal: te, DisplayConditionsHost: oe, autoSaveControllerRef: T, LegacyStrategyUpdatedModal: ne, LegacyUnsubscribeConvertedModal: re, AmbiguousDynamicContentModal: ie, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, moduleDynamicContentStore: se, props: c, configStore: o, editorStore: d, previewStore: ae, hasChanges: u, isTestPartner: ce, isSaveValidationEnabled: de, loadRollout: F, showToaster: M, trans: I, saveSilent: L, setLoading: R, emit: s, buildMetadata: b, initPlugin: O, preloadRuntime: P, runExclusive: U, beginMount: A, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: H, noHeader: me, isRrsEnabled: le, isExternalDisplayConditionsEnabled: pe, isLegacyUnsubscribeConversionEnabled: ue, hasAssignedStrategy: fe, insertDynamicContent: S, closeDynamicContent: E, isPickerEnabled: x, picker: ye, pickerOptions: ge, pickerAooScanContent: be, openPicker: B, pickerSaveHandler: ve, pickerCloseHandler: Se, handleDynamicContentOpen: h, ribbonObserver: m, updateRibbonOffset: C, startEditor: k, AutoSaveController: Ke, AuthErrorModal: je, Toaster: Je, DynamicContentPicker: Qe, FilterSelectionDrawer: Xe, HeaderWrapper: Ye, LoadingWrapper: Ze, SaveAsTemplateDrawer: et, UnsubscribeWrapper: tt, ValidationErrorDrawer: ot };
211
226
  }
212
227
  });
213
228
  export {
214
- Vt as default
229
+ eo as default
215
230
  };
@@ -0,0 +1,34 @@
1
+ import l from "./DynamicContentAooRuleConfig.vue2.js";
2
+ /* empty css */
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var c = function() {
5
+ var s = this, o = s._self._c, e = s._self._setupProxy;
6
+ return o("div", [o(e.InSelect, { staticClass: "aoo-config-select", attrs: { id: "aoo-rule-select", "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-rule-label`), options: e.ruleOptions, "placeholder-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-rule-placeholder`), state: e.selectState(e.selectedRule), "state-message": e.selectStateMessage(e.selectedRule, `${e.ARRAY_OF_OBJECTS_LABEL_BASE}-rule-validation`), value: e.selectedRule }, on: { "hook:beforeDestroy": function(t) {
7
+ return e.emit("openList", "aoo-rule", !1);
8
+ }, openList: function(t) {
9
+ return e.emit("openList", "aoo-rule", t);
10
+ }, select: e.selectRuleHandler } }), e.activeRule ? o(e.InOnPageMessage, { staticClass: "mt-3", attrs: { size: "small", type: "default", text: e.infoText }, scopedSlots: s._u([{ key: "extraMessage", fn: function() {
11
+ return [o("ul", { staticClass: "ml-6 pl-3 f-s-1 f-w-400 mt-0 mb-0" }, s._l(e.filtersDescription, function(t, a) {
12
+ return o("li", { key: a, staticClass: "l-h-1" }, [o("span", { staticClass: "t-c-55" }, [s._v(s._s(e.getFilterText(t)))])]);
13
+ }), 0)];
14
+ }, proxy: !0 }], null, !1, 2503373205) }) : s._e(), e.activeRule ? o(e.InSelect, { staticClass: "aoo-config-select mt-3", attrs: { id: "aoo-object-select", "dynamic-position": "", "floating-strategy": "fixed", "button-status": !1, "label-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-label`), options: e.objectOptions, "placeholder-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-placeholder`), state: e.selectState(e.selectedObject), "state-message": e.selectStateMessage(e.selectedObject, `${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-validation`), value: e.selectedObject }, on: { "hook:beforeDestroy": function(t) {
15
+ return e.emit("openList", "aoo-object", !1);
16
+ }, openList: function(t) {
17
+ return e.emit("openList", "aoo-object", t);
18
+ }, select: e.selectObjectHandler } }) : s._e(), e.selectedObject.length ? o(e.InSelect, { staticClass: "aoo-config-select mt-3", attrs: { id: "aoo-object-key-select", "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-key-label`), options: e.keyOptions, "placeholder-text": e.trans(`${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-key-placeholder`), state: e.selectState(e.selectedKey), "state-message": e.selectStateMessage(e.selectedKey, `${e.ARRAY_OF_OBJECTS_LABEL_BASE}-object-key-validation`), value: e.selectedKey }, on: { "hook:beforeDestroy": function(t) {
19
+ return e.emit("openList", "aoo-object-key", !1);
20
+ }, openList: function(t) {
21
+ return e.emit("openList", "aoo-object-key", t);
22
+ }, select: e.selectKeyHandler } }) : s._e()], 1);
23
+ }, i = [], r = /* @__PURE__ */ n(
24
+ l,
25
+ c,
26
+ i,
27
+ !1,
28
+ null,
29
+ "6073170a"
30
+ );
31
+ const d = r.exports;
32
+ export {
33
+ d as default
34
+ };
@@ -0,0 +1,76 @@
1
+ import { defineComponent as V, ref as _, computed as r, watch as k } from "vue";
2
+ import { useTranslations as K } from "../../../composables/useTranslations.js";
3
+ import { ARRAY_OF_OBJECTS_LABEL_BASE as E, AOO_INFO_TEXT_KEY as h, AOO_INFO_TEXT_TEMPLATE as M } from "../../../enums/dynamic-content.js";
4
+ import { applyAooDisabledState as X } from "../../../utils/dynamicContentPicker.js";
5
+ import { escapeHtml as O } from "../../../utils/htmlEscape.js";
6
+ import { InSelect as j, InOnPageMessage as N } from "@useinsider/design-system-vue";
7
+ const Q = /* @__PURE__ */ V({
8
+ __name: "DynamicContentAooRuleConfig",
9
+ props: {
10
+ categories: { default: () => [] },
11
+ usedPatterns: { default: () => [] },
12
+ initialValue: { default: null },
13
+ validationActive: { type: Boolean, default: !1 }
14
+ },
15
+ emits: ["openList", "select", "clear"],
16
+ setup(x, { emit: f }) {
17
+ const a = x, T = { desc: "descending", asc: "ascending" }, m = K(), p = _([]), c = _([]), s = _([]), y = r(() => X(
18
+ a.categories,
19
+ a.usedPatterns,
20
+ m(`${E}-disabled-tooltip`)
21
+ )), o = r(() => p.value[0] || null), A = r(() => {
22
+ const e = m(h);
23
+ return !e || e === h ? M : e;
24
+ }), R = r(() => {
25
+ var v;
26
+ const { key: e = "", order: t = "", limit: n = "", operator: l = "" } = ((v = o.value) == null ? void 0 : v.rules) || {}, i = {
27
+ key: O(String(e)),
28
+ order: T[String(t)] || "",
29
+ limit: O(String(n)),
30
+ operator: O(String(l))
31
+ };
32
+ return Object.entries(i).reduce((d, [g, P]) => d.replace(`{${g}}`, P), A.value);
33
+ }), D = r(() => {
34
+ var e;
35
+ return ((e = o.value) == null ? void 0 : e.filtersDescription) || [];
36
+ }), F = r(() => {
37
+ var e;
38
+ return (((e = o.value) == null ? void 0 : e.select_items) || []).map((t) => ({ text: t.text, value: t.value }));
39
+ }), $ = r(() => {
40
+ var n, l;
41
+ const e = (n = c.value[0]) == null ? void 0 : n.value, t = (((l = o.value) == null ? void 0 : l.select_items) || []).find((i) => i.value === e);
42
+ return (t == null ? void 0 : t.children) || [];
43
+ }), b = (e) => a.validationActive && !e.length ? "error" : "default", B = (e, t) => a.validationActive && !e.length ? m(t) : "", C = (e) => {
44
+ const { parameter: t = "", operator: n = "", value: l = "" } = e || {};
45
+ return `${t} ${n} ${l}`;
46
+ }, u = () => {
47
+ const [e] = s.value;
48
+ e && o.value ? f("select", { leaf: e, rule: o.value }) : f("clear");
49
+ }, H = (e) => {
50
+ p.value = [e], c.value = [], s.value = [], u();
51
+ }, I = (e) => {
52
+ c.value = [e], s.value = [], u();
53
+ }, L = (e) => {
54
+ s.value = [e], u();
55
+ }, S = (e) => {
56
+ a.categories.some((t) => (t.children || []).some((n) => {
57
+ var v;
58
+ const l = (n.select_items || []).find(
59
+ (d) => (d.children || []).some((g) => g.value === e)
60
+ ), i = (v = l == null ? void 0 : l.children) == null ? void 0 : v.find((d) => d.value === e);
61
+ return !l || !i ? !1 : (p.value = [n], c.value = [{ text: l.text, value: l.value }], s.value = [i], u(), !0);
62
+ }));
63
+ };
64
+ return k(
65
+ () => [a.initialValue, a.categories],
66
+ () => {
67
+ var e;
68
+ (e = a.initialValue) != null && e.value && a.categories.length && !s.value.length && S(a.initialValue.value);
69
+ },
70
+ { immediate: !0 }
71
+ ), { __sfc: !0, ORDER_TEXTS: T, props: a, emit: f, trans: m, selectedRule: p, selectedObject: c, selectedKey: s, ruleOptions: y, activeRule: o, infoTemplate: A, infoText: R, filtersDescription: D, objectOptions: F, keyOptions: $, selectState: b, selectStateMessage: B, getFilterText: C, emitSelection: u, selectRuleHandler: H, selectObjectHandler: I, selectKeyHandler: L, restoreFromToken: S, ARRAY_OF_OBJECTS_LABEL_BASE: E, InOnPageMessage: N, InSelect: j };
72
+ }
73
+ });
74
+ export {
75
+ Q as default
76
+ };
@@ -0,0 +1,21 @@
1
+ import r from "./DynamicContentCustomFormat.vue2.js";
2
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ var e = this, o = e._self._c, t = e._self._setupProxy;
5
+ return o("div", [o(t.InCheckBoxV2, { attrs: { id: `dynamic-content-custom-format-checkbox-${t.props.formatType}`, checked: t.isCustomFormatEnabled, "label-text": t.props.checkboxLabelText }, on: { click: t.handleCheckboxClick } }), t.isCustomFormatEnabled ? o(t.InSelect, { staticClass: "mt-3", attrs: { id: `dynamic-content-custom-format-input-${t.props.formatType}`, "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": t.props.selectLabelText, options: t.props.formatOptions, "placeholder-text": t.props.selectPlaceholderText, state: t.errorMessage ? "error" : "default", "state-message": t.errorMessage, value: t.customFormatInput }, on: { "hook:beforeDestroy": function(s) {
6
+ return t.emit("openList", "custom-format", !1);
7
+ }, openList: function(s) {
8
+ return t.emit("openList", "custom-format", s);
9
+ }, select: t.handleSelect } }) : e._e()], 1);
10
+ }, c = [], l = /* @__PURE__ */ a(
11
+ r,
12
+ n,
13
+ c,
14
+ !1,
15
+ null,
16
+ null
17
+ );
18
+ const u = l.exports;
19
+ export {
20
+ u as default
21
+ };
@@ -0,0 +1,33 @@
1
+ import { defineComponent as x, ref as n, computed as b } from "vue";
2
+ import { useTranslations as h } from "../../../composables/useTranslations.js";
3
+ import { getIndefiniteArticle as T } from "../../../utils/dynamicContentPicker.js";
4
+ import { InSelect as C, InCheckBoxV2 as S } from "@useinsider/design-system-vue";
5
+ const y = /* @__PURE__ */ x({
6
+ __name: "DynamicContentCustomFormat",
7
+ props: {
8
+ checkboxLabelText: null,
9
+ selectLabelText: null,
10
+ selectPlaceholderText: null,
11
+ formatType: null,
12
+ formatOptions: { default: () => [] }
13
+ },
14
+ emits: ["openList", "select", "updateStatus"],
15
+ setup(f, { expose: m, emit: s }) {
16
+ const o = f, u = h(), t = n([]), l = n(!1), a = n(!1), p = b(() => !a.value || !l.value || t.value.length ? "" : u("validations.select-a-field-to-continue", {
17
+ article: T(o.selectLabelText),
18
+ field: o.selectLabelText
19
+ })), d = (e) => {
20
+ s("updateStatus", e), l.value = e, e || (t.value = [], a.value = !1);
21
+ }, v = (e) => {
22
+ t.value = [e], s("select", { key: o.formatType, value: e.value });
23
+ }, r = () => (a.value = !0, !l.value || t.value.length > 0), c = () => {
24
+ a.value = !1, t.value = [], l.value = !1;
25
+ }, i = (e) => {
26
+ t.value = [e], l.value = !0, s("updateStatus", !0);
27
+ };
28
+ return m({ resetState: c, setFormat: i, validate: r }), { __sfc: !0, props: o, emit: s, trans: u, customFormatInput: t, isCustomFormatEnabled: l, isSubmitted: a, errorMessage: p, handleCheckboxClick: d, handleSelect: v, validate: r, resetState: c, setFormat: i, InCheckBoxV2: S, InSelect: C };
29
+ }
30
+ });
31
+ export {
32
+ y as default
33
+ };
@@ -0,0 +1,42 @@
1
+ import o from "./DynamicContentPicker.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var l = function() {
5
+ var a = this, n = a._self._c, t = a._self._setupProxy;
6
+ return t.props.visible ? n("div", { ref: "layerRef", staticClass: "dynamic-content-layer", attrs: { tabindex: "-1" }, on: { click: function(e) {
7
+ return e.target !== e.currentTarget ? null : t.layerClickHandler.apply(null, arguments);
8
+ }, mousedown: t.layerMousedownHandler, touchmove: function(e) {
9
+ if (e.target !== e.currentTarget) return null;
10
+ e.preventDefault();
11
+ }, wheel: function(e) {
12
+ if (e.target !== e.currentTarget) return null;
13
+ e.preventDefault();
14
+ } } }, [n("div", { ref: "boxRef", staticClass: "dynamic-content-layer__box", class: { "dynamic-content-layer__box--scrollable": !t.isSettingsStep }, style: t.positionStyle, on: { "!click": function(e) {
15
+ return t.clickCaptureHandler.apply(null, arguments);
16
+ } } }, [n(t.InInfoBox, { staticClass: "dynamic-content-layer__card", attrs: { id: "dynamic-content-modal", "button-options": t.buttonOptions, "description-status": t.isSettingsStep, "description-text": t.descriptionText, "title-text": t.titleText }, on: { click: t.buttonClickHandler } }, [t.isSettingsStep ? n("div", { key: "settings-step", staticClass: "mt-3" }, [t.hasSelectedDynamicContent ? n(t.InBasicTextInput, { attrs: { id: "dynamic-content-fallback-input", "tooltip-status": "", "character-counter-status": !1, "label-text": t.trans("newsletter.email-subject-fall-back-label"), name: t.trans("newsletter.email-subject-fall-back-label"), "placeholder-text": t.trans("newsletter.email-subject-fall-back-placeholder"), "tooltip-text": t.trans("newsletter.email-subject-fall-back-tooltip") }, model: { value: t.state.dynamicContentFallbackInput, callback: function(e) {
17
+ a.$set(t.state, "dynamicContentFallbackInput", e);
18
+ }, expression: "state.dynamicContentFallbackInput" } }) : a._e()], 1) : n("div", { key: "attribute-step", staticClass: "mt-3" }, [n(t.InSelect, { staticClass: "dynamic-content-input", attrs: { "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": t.trans("dynamic-content.dynamic-contents-label"), options: t.formattedDynamicContentOptions, "placeholder-text": t.trans("dynamic-content.dynamic-contents-placeholder"), state: t.errors.dynamicContentInput ? "error" : "default", "state-message": t.errors.dynamicContentInput, value: t.state.dynamicContentInput }, on: { "hook:beforeDestroy": function(e) {
19
+ return t.openListHandler("attribute", !1);
20
+ }, openList: function(e) {
21
+ return t.openListHandler("attribute", e);
22
+ }, select: t.selectDynamicContentHandler } }), t.isAooSelected ? n(t.DynamicContentAooRuleConfig, { staticClass: "mt-3", attrs: { categories: t.props.aooOptions, "initial-value": t.props.initialData, "used-patterns": t.usedAooPatterns, "validation-active": !!t.errors.aooLeafInput }, on: { clear: t.clearAooLeafHandler, openList: t.openListHandler, select: t.selectAooLeafHandler } }) : a._e(), t.isLookupSelected ? n(t.InSelect, { staticClass: "dynamic-content-input mt-3", attrs: { id: "dynamic-content-lookup-column-input", "dynamic-position": "", "search-status": "", "floating-strategy": "fixed", "button-status": !1, "label-text": t.lookupBindingLabel, options: t.lookupColumnOptions, "placeholder-text": t.lookupColumnPlaceholder, state: t.errors.lookupColumnInput ? "error" : "default", "state-message": t.errors.lookupColumnInput, value: t.state.lookupColumnInput }, on: { "hook:beforeDestroy": function(e) {
23
+ return t.openListHandler("lookup-column", !1);
24
+ }, openList: function(e) {
25
+ return t.openListHandler("lookup-column", e);
26
+ }, select: t.selectLookupColumnHandler } }) : a._e(), t.hasCustomFormat ? n(t.DynamicContentCustomFormat, { ref: "customFormatRef", staticClass: "mt-3", attrs: { "checkbox-label-text": t.customFormatConfig.checkboxLabel, "format-options": t.customFormatConfig.options, "format-type": t.customFormatConfig.type, "select-label-text": t.customFormatConfig.selectLabel, "select-placeholder-text": t.customFormatConfig.selectPlaceholder }, on: { openList: t.openListHandler, select: function(e) {
27
+ t.state.customFormat = e;
28
+ }, updateStatus: function(e) {
29
+ t.state.isCustomFormatEnabled = e;
30
+ } } }) : a._e()], 1)])], 1)]) : a._e();
31
+ }, r = [], i = /* @__PURE__ */ s(
32
+ o,
33
+ l,
34
+ r,
35
+ !1,
36
+ null,
37
+ "687d286f"
38
+ );
39
+ const d = i.exports;
40
+ export {
41
+ d as default
42
+ };