@useinsider/guido 3.26.0-beta.df8736b → 3.26.0-beta.e0662fe

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
@@ -119,7 +119,8 @@ const config: GuidoConfigInput = {
119
119
  // { [partnerName]: [{ text, value, children }] } (architect is multi-partner).
120
120
  // Guido flattens the active (first) partner's leaf attributes and uses them to
121
121
  // repair label-form tokens (`{{ Phone Number }}` -> `{{phone_number}}`) in
122
- // dropped saved modules; an unresolvable token raises a single warning toaster
122
+ // dropped saved modules; a label shared by several attributes opens a picker
123
+ // modal (see "Saved-module token repair"); an unresolvable token raises a single warning toaster
123
124
  // (translation key `dynamic-content.unresolved-attributes-on-drop`, registered
124
125
  // host-side). Omit it and the repair is a silent no-op. Default: {}.
125
126
  dynamicContentList?: DynamicContentList,
@@ -691,18 +692,22 @@ const closeModal = () => {
691
692
 
692
693
  ### Saved-module token repair
693
694
 
694
- Legacy **saved modules** may serialize their merge-tag chips by display label
695
+ Legacy or hand-written **saved modules** may carry tokens by display label
695
696
  (`{{ Phone Number }}`) instead of the canonical token (`{{phone_number}}`), which the
696
697
  backend can't resolve. When such a module is dropped or copied into the editor, Guido
697
698
  repairs these automatically using the `template.dynamicContentList` catalog (see
698
699
  [Configuration](#configuration)):
699
700
 
700
- - **Label match** → canonical value: `{{ Phone Number }}` → `{{phone_number}}` (any author `| default:` / format tail is preserved).
701
- - Already-canonical values, Liquid nested tokens (`coupon.code`), recommendation-block variables (`123_0_price`), allowed system tokens, and `data-*` product tags are left untouched.
701
+ - **Off under `features.liquidSyntax`**: Liquid templates keep every token exactly as written — no rewrite, no modal, no toaster. The Items currency and legacy-unsubscribe repairs still run.
702
+ - **Label match with one attribute** → canonical value: `{{ Phone Number }}` → `{{phone_number}}` (any author `| default:` / format tail is preserved). A label matches a leaf's `text` or its `tag_text` (e.g. `Wishlist Item (8) Name`), case-insensitively.
703
+ - **Valid tokens are never rewritten**: an exact catalog value, an Items block variable, or an exact entry of `template.customFieldAttributes` (e.g. the host's long-form aliases `name`, `surname`), stays as written — so `{{name | downcase | capitalize}}` survives a drop.
704
+ - **Catalog attributes the module ends up using are registered** for Save's allow-list, the same way the picker registers them, so a repaired or chosen token does not fail Save as an invalid custom field.
705
+ - **Label match with several attributes** (e.g. a bare `Name` shared by a default attribute and a commerce field) is not guessed: the token is left in place and a modal asks the user to pick an attribute per label, showing each option as `category › label`. Applying the choice is one undo step; closing the modal keeps the tokens and shows the warning toaster below. Register these keys host-side: `email-editor.ambiguous-dynamic-content-title`, `email-editor.ambiguous-dynamic-content-message` and `email-editor.ambiguous-dynamic-content-apply` (Cancel reuses `action-builder.cancel`).
706
+ - Liquid nested tokens (`coupon.code`), recommendation-block variables (`123_0_price`), allowed system tokens, and `data-*` product tags are left untouched.
702
707
  - An **unresolvable** token is left in place and raises a single **warning toaster** (translation key `dynamic-content.unresolved-attributes-on-drop`; register the copy host-side).
703
708
 
704
709
  Pass `template.dynamicContentList` as a **partner-keyed** tree
705
- (`{ [partnerName]: DynamicContentNode[] }`, where a node is `{ text, value, children? }`).
710
+ (`{ [partnerName]: DynamicContentNode[] }`, where a node is `{ text, tag_text?, value, children? }`).
706
711
  Guido flattens the **active (first) partner's** leaf attributes. Products that manage
707
712
  multiple partners (e.g. architect) should key by partner and place the active partner
708
713
  first. Omit the prop and the repair is a safe no-op — nothing is rewritten and no
@@ -1,20 +1,20 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
- var s = function() {
4
+ var n = function() {
5
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(), 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) {
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) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, t = [], n = /* @__PURE__ */ i(
9
+ }, t = [], s = /* @__PURE__ */ i(
10
10
  o,
11
- s,
11
+ n,
12
12
  t,
13
13
  !1,
14
14
  null,
15
- "ed74fdf8"
15
+ "7610da98"
16
16
  );
17
- const v = n.exports;
17
+ const c = s.exports;
18
18
  export {
19
- v as default
19
+ c as default
20
20
  };
@@ -1,78 +1,81 @@
1
- import { defineComponent as ge, defineAsyncComponent as a, ref as W, computed as l, watch as G, onMounted as be, onUnmounted as ve } from "vue";
2
- import { useCortexBlueprintBridge as Se } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as he } from "../composables/useEditorLock.js";
4
- import { startEditorOpenMetrics as Ee } from "../composables/useEditorOpenMetrics.js";
5
- import { provideGuidoActions as Ce } from "../composables/useGuidoActions.js";
6
- import { useGuidoStateBridge as De } from "../composables/useGuidoStateBridge.js";
7
- import { usePartner as we } from "../composables/usePartner.js";
8
- import { useSaveValidationRollout as Te } from "../composables/useSaveValidationRollout.js";
9
- import { useStripo as ke } from "../composables/useStripo.js";
10
- import { useTimerClone as Fe } from "../composables/useTimerClone.js";
11
- import { useToaster as Ie } from "../composables/useToaster.js";
12
- import { useTranslations as Me } from "../composables/useTranslations.js";
13
- import { migrate as Re } from "../config/migrator/index.js";
14
- import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
15
- import { RIBBON_SELECTOR as Le } from "../enums/onboarding.js";
16
- import { ToasterTypeOptions as Ue } from "../enums/toaster.js";
17
- import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Oe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
- import { disposeUnsubscribeListeners as Ne } from "../extensions/Blocks/Unsubscribe/block.js";
19
- import { disposeDisplayConditionRequest as _e } from "../extensions/DisplayConditions/bridge.js";
20
- import Ae from "./organisms/AutoSaveController.vue.js";
21
- import Pe from "./organisms/base/AuthErrorModal.vue.js";
22
- import xe from "./organisms/base/Toaster.vue.js";
23
- import Be from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
24
- import He from "./organisms/header/HeaderWrapper.vue.js";
25
- import Ve from "./organisms/LoadingWrapper.vue.js";
26
- import We from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
27
- import Ge from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
28
- import $e from "./organisms/validation/ValidationErrorDrawer.vue.js";
29
- import { useStripoApi as ze } from "../services/stripoApi.js";
30
- import { useConfigStore as qe } from "../stores/config.js";
31
- import { useDynamicContentStore as Ke } from "../stores/dynamic-content.js";
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 Re } from "../composables/useTimerClone.js";
11
+ import { useToaster as Le } from "../composables/useToaster.js";
12
+ import { useTranslations as Ue } from "../composables/useTranslations.js";
13
+ import { migrate as Oe } 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
32
  import { useEditorStore as C } from "../stores/editor.js";
33
- import { usePreviewStore as je } from "../stores/preview.js";
34
- import { useSaveValidationStore as Je } from "../stores/save-validation.js";
35
- import { useTemplateStore as Qe } from "../stores/template.js";
36
- import { useUnsubscribeStore as Xe } from "../stores/unsubscribe.js";
37
- import { readTrackFloor as q } from "../utils/linkTrackingIds.js";
38
- const _t = /* @__PURE__ */ ge({
33
+ import { useModuleDynamicContentStore as q } from "../stores/module-dynamic-content.js";
34
+ import { usePreviewStore as Xe } from "../stores/preview.js";
35
+ import { useSaveValidationStore as Ye } from "../stores/save-validation.js";
36
+ import { useTemplateStore as Ze } from "../stores/template.js";
37
+ import { useUnsubscribeStore as et } from "../stores/unsubscribe.js";
38
+ import { readTrackFloor as K } from "../utils/linkTrackingIds.js";
39
+ const Bt = /* @__PURE__ */ Se({
39
40
  __name: "Guido",
40
41
  props: {
41
42
  config: null,
42
43
  ready: { type: Boolean, default: !0 }
43
44
  },
44
45
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
45
- setup(K, { expose: j, emit: s }) {
46
- const c = K, r = Ee(), J = a(
46
+ setup(j, { expose: J, emit: s }) {
47
+ const c = j, r = we(), Q = a(
47
48
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
48
- ), Q = a(
49
- () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
50
49
  ), X = a(
51
- () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
50
+ () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
52
51
  ), Y = a(
53
- () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
52
+ () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
54
53
  ), Z = a(
54
+ () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
55
+ ), ee = a(
55
56
  () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
56
- ), D = W(), ee = a(
57
+ ), D = W(), te = a(
57
58
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
58
- ), te = a(
59
+ ), oe = a(
59
60
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
60
- ), y = W(), g = Ke(), w = Xe(), o = qe();
61
+ ), ne = a(
62
+ () => import("./organisms/dynamic-content/AmbiguousDynamicContentModal.vue.js")
63
+ ), y = W(), g = Qe(), w = et(), re = q(), o = Je();
61
64
  c.ready && o.init(c.config);
62
- const d = C(), oe = je(), p = l(() => d.hasChanges), { isTestPartner: ne } = we(), { isEnabled: re, loadRollout: T } = Te(), { showToaster: k } = Ie(), F = Me(), I = () => {
65
+ const d = C(), se = Xe(), p = l(() => d.hasChanges), { isTestPartner: ie } = Fe(), { isEnabled: ae, loadRollout: T } = Me(), { showToaster: k } = Le(), F = Ue(), M = () => {
63
66
  var t;
64
67
  if (d.isVersionHistoryOpen) {
65
68
  console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
66
- type: Ue.Warning,
69
+ type: Ne.Warning,
67
70
  message: F("email-editor.save-blocked-outside-editor")
68
71
  });
69
72
  return;
70
73
  }
71
74
  return (t = D.value) == null ? void 0 : t.saveSilent();
72
- }, M = (t) => {
75
+ }, I = (t) => {
73
76
  d.loadingStatus = t;
74
77
  };
75
- Se(), De();
78
+ Ce(), ke();
76
79
  const b = () => {
77
80
  var t, e;
78
81
  return {
@@ -80,20 +83,20 @@ const _t = /* @__PURE__ */ ge({
80
83
  userId: o.userId,
81
84
  username: o.username,
82
85
  partnerName: o.partnerName,
83
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
84
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
86
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
87
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
85
88
  };
86
- }, { initPlugin: R, preloadRuntime: L } = ke(r), { runExclusive: U, beginMount: O, isCurrentMount: v } = he();
89
+ }, { initPlugin: R, preloadRuntime: L } = Ie(r), { runExclusive: U, beginMount: O, isCurrentMount: v } = De();
87
90
  let f = 0;
88
- const { getDefaultTemplate: N } = ze(), { cloneTimersOnSave: _, hasTimerBlocks: A } = Fe(), se = l(() => {
91
+ const { getDefaultTemplate: A } = je(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Re(), ce = l(() => {
89
92
  var t;
90
93
  return !((t = o.ui) != null && t.showHeader);
91
- }), ie = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ae = l(() => o.externalDisplayConditions), ce = l(
94
+ }), de = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), me = l(() => o.externalDisplayConditions), le = l(
92
95
  () => o.isFeatureEnabled("legacyUnsubscribeConversion")
93
- ), de = l(
96
+ ), ue = l(
94
97
  () => !!z().recommendationConfigs.strategyId
95
98
  );
96
- Ce({
99
+ Te({
97
100
  onBack: () => {
98
101
  console.debug("guido:back"), s("back");
99
102
  },
@@ -113,7 +116,7 @@ const _t = /* @__PURE__ */ ge({
113
116
  }, x = () => {
114
117
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
115
118
  };
116
- G(() => p.value, () => {
119
+ $(() => p.value, () => {
117
120
  s("on-change", p.value);
118
121
  });
119
122
  const S = (t) => {
@@ -123,7 +126,7 @@ const _t = /* @__PURE__ */ ge({
123
126
  let m = null;
124
127
  const h = () => {
125
128
  var e;
126
- const t = document.querySelector(Le);
129
+ const t = document.querySelector(Ae);
127
130
  (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
128
131
  }, E = async () => {
129
132
  var t;
@@ -137,49 +140,49 @@ const _t = /* @__PURE__ */ ge({
137
140
  });
138
141
  const e = o.template, i = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
139
142
  w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
140
- const me = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), le = {
143
+ const pe = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), fe = {
141
144
  partnerName: o.partnerName,
142
145
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
143
146
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
144
- }, ue = {
147
+ }, ye = {
145
148
  itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
146
- }, V = (ye) => r.timed(
149
+ }, V = (ve) => r.timed(
147
150
  "migration",
148
- () => Re(ye, me, le, ue)
151
+ () => Oe(ve, pe, fe, ye)
149
152
  );
150
153
  let n = {
151
154
  html: i && await V(i),
152
155
  css: u
153
156
  };
154
- n.html || (n = await r.timed("default_template", () => N()), n.html = await V(n.html));
155
- const pe = H ? q(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
156
- A(n.html) && (n.html = await r.timed("timer_clone", () => _(n.html))), H && (d.trackIdSessionFloor = Math.max(pe, q(n.html)));
157
- const fe = {
157
+ n.html || (n = await r.timed("default_template", () => A()), n.html = await V(n.html));
158
+ const ge = H ? K(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
159
+ _(n.html) && (n.html = await r.timed("timer_clone", () => N(n.html))), H && (d.trackIdSessionFloor = Math.max(ge, K(n.html)));
160
+ const be = {
158
161
  preselectedDynamicContentList: B,
159
162
  onReady: () => {
160
163
  console.debug("guido:ready"), s("ready");
161
164
  }
162
165
  };
163
- f = O(), await R(n, b(), fe, n.html !== i), g.selectedDynamicContentList = B;
166
+ f = O(), await R(n, b(), be, n.html !== i), g.selectedDynamicContentList = B;
164
167
  } catch (e) {
165
168
  console.error("Failed to initialize Stripo editor:", e), r.markFailed();
166
169
  }
167
170
  };
168
- return be(async () => {
171
+ return he(async () => {
169
172
  var e;
170
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), Qe().$reset(), Je().$reset(), T(), h();
173
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), Ze().$reset(), Ye().$reset(), q().$reset(), T(), h();
171
174
  const t = (e = y.value) == null ? void 0 : e.parentElement;
172
175
  if (t && (m = new ResizeObserver(h), m.observe(t)), L(), c.ready)
173
176
  await E();
174
177
  else {
175
- const i = G(() => c.ready, (u) => {
178
+ const i = $(() => c.ready, (u) => {
176
179
  u && (i(), E());
177
180
  });
178
181
  }
179
182
  document.addEventListener("dynamic-content:open", S);
180
- }), ve(() => {
181
- if (Ne(), Oe(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
182
- _e();
183
+ }), Ee(() => {
184
+ if (Pe(), _e(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
185
+ xe();
183
186
  try {
184
187
  const t = C();
185
188
  t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
@@ -195,17 +198,17 @@ const _t = /* @__PURE__ */ ge({
195
198
  console.debug("Failed to remove Stripo editor: No editor found");
196
199
  }
197
200
  }), o.reset();
198
- }), j({
201
+ }), J({
199
202
  dynamicContent: {
200
203
  insert: P,
201
204
  close: x
202
205
  },
203
206
  hasChanges: p,
204
- saveSilent: I,
205
- setLoading: M
206
- }), { __sfc: !0, openMetrics: r, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, DisplayConditionsHost: Z, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: ee, LegacyUnsubscribeConvertedModal: te, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, props: c, configStore: o, editorStore: d, previewStore: oe, hasChanges: p, isTestPartner: ne, isSaveValidationEnabled: re, loadRollout: T, showToaster: k, trans: F, saveSilent: I, setLoading: M, emit: s, buildMetadata: b, initPlugin: R, preloadRuntime: L, runExclusive: U, beginMount: O, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: A, noHeader: se, isRrsEnabled: ie, isExternalDisplayConditionsEnabled: ae, isLegacyUnsubscribeConversionEnabled: ce, hasAssignedStrategy: de, insertDynamicContent: P, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Ae, AuthErrorModal: Pe, Toaster: xe, FilterSelectionDrawer: Be, HeaderWrapper: He, LoadingWrapper: Ve, SaveAsTemplateDrawer: We, UnsubscribeWrapper: Ge, ValidationErrorDrawer: $e };
207
+ saveSilent: M,
208
+ setLoading: I
209
+ }), { __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: se, hasChanges: p, isTestPartner: ie, isSaveValidationEnabled: ae, loadRollout: T, showToaster: k, trans: F, saveSilent: M, setLoading: I, emit: s, buildMetadata: b, initPlugin: R, preloadRuntime: L, runExclusive: U, beginMount: O, 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 };
207
210
  }
208
211
  });
209
212
  export {
210
- _t as default
213
+ Bt as default
211
214
  };
@@ -0,0 +1,22 @@
1
+ import i from "./AmbiguousDynamicContentModal.vue2.js";
2
+ /* empty css */
3
+ import c from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var l = function() {
5
+ var e = this, o = e._self._c, t = e._self._setupProxy;
6
+ return t.current ? o(t.WpModal, { attrs: { id: "guido__ambiguous-dynamic-content-modal", size: "medium", "close-on-outside-click": !1, "footer-button-options": t.footerButtonOptions, title: t.trans("email-editor.ambiguous-dynamic-content-title") }, on: { close: t.cancel, "primary-action": t.apply } }, [o("div", { staticClass: "ambiguous-dynamic-content-modal__content" }, [o("p", { staticClass: "mb-3" }, [e._v(" " + e._s(t.trans("email-editor.ambiguous-dynamic-content-message")) + " ")]), e._l(t.rows, function(n, s) {
7
+ return o(t.InSelect, { key: n.label, staticClass: "mb-2", attrs: { id: `guido__ambiguous-dynamic-content-select-${s}`, "search-status": "", "button-status": !1, "label-text": `{{ ${n.label} }}`, options: n.options, value: n.selected }, on: { select: function(a) {
8
+ return t.select(n.label, a);
9
+ } } });
10
+ })], 2)]) : e._e();
11
+ }, r = [], u = /* @__PURE__ */ c(
12
+ i,
13
+ l,
14
+ r,
15
+ !1,
16
+ null,
17
+ "e3c06c66"
18
+ );
19
+ const f = u.exports;
20
+ export {
21
+ f as default
22
+ };
@@ -0,0 +1,54 @@
1
+ import { defineComponent as y, ref as b, computed as l, watch as _ } from "vue";
2
+ import g from "../../wrappers/WpModal.vue.js";
3
+ import { useAmbiguousDynamicContent as S } from "../../../composables/useAmbiguousDynamicContent.js";
4
+ import { useTranslations as x } from "../../../composables/useTranslations.js";
5
+ import { useEditorStore as C } from "../../../stores/editor.js";
6
+ import { useModuleDynamicContentStore as h } from "../../../stores/module-dynamic-content.js";
7
+ import { InSelect as B } from "@useinsider/design-system-vue";
8
+ const W = /* @__PURE__ */ y({
9
+ __name: "AmbiguousDynamicContentModal",
10
+ setup(T) {
11
+ const a = x(), r = C(), i = h(), { resolve: c, dismiss: u } = S(), o = b({}), t = l(() => r.isStripoInitialized ? i.current : null);
12
+ _(() => {
13
+ var e;
14
+ return (e = t.value) == null ? void 0 : e.id;
15
+ }, () => {
16
+ o.value = {};
17
+ });
18
+ const p = (e) => ({
19
+ text: [...e.path, e.tagText].join(" › "),
20
+ value: e.value
21
+ }), m = l(() => {
22
+ var e;
23
+ return (((e = t.value) == null ? void 0 : e.items) ?? []).map((n) => {
24
+ const v = n.candidates.map(p);
25
+ return {
26
+ label: n.label,
27
+ options: v,
28
+ selected: v.filter((f) => f.value === o.value[n.label])
29
+ };
30
+ });
31
+ }), s = l(() => m.value.every((e) => e.selected.length > 0)), d = l(() => ({
32
+ cancelOrBackButton: {
33
+ type: "secondary",
34
+ labelText: a("action-builder.cancel"),
35
+ styling: "ghost"
36
+ },
37
+ primaryButton: {
38
+ type: "primary",
39
+ labelText: a("email-editor.ambiguous-dynamic-content-apply"),
40
+ disabledStatus: !s.value
41
+ }
42
+ }));
43
+ return { __sfc: !0, trans: a, editorStore: r, store: i, resolve: c, dismiss: u, selections: o, current: t, toOption: p, rows: m, isComplete: s, footerButtonOptions: d, select: (e, { value: n }) => {
44
+ o.value = { ...o.value, [e]: n };
45
+ }, apply: () => {
46
+ t.value && s.value && c(t.value, o.value);
47
+ }, cancel: () => {
48
+ t.value && u(t.value.id);
49
+ }, WpModal: g, InSelect: B };
50
+ }
51
+ });
52
+ export {
53
+ W as default
54
+ };
@@ -0,0 +1,62 @@
1
+ import { useConfig as D } from "./useConfig.js";
2
+ import { UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY as M } from "./useModuleRepair.js";
3
+ import { useToaster as T } from "./useToaster.js";
4
+ import { useTranslations as A } from "./useTranslations.js";
5
+ import { ModuleDynamicContentAttribute as O } from "../enums/dynamic-content.js";
6
+ import { ToasterTypeOptions as R } from "../enums/toaster.js";
7
+ import { useDynamicContentStore as S } from "../stores/dynamic-content.js";
8
+ import { useModuleDynamicContentStore as _ } from "../stores/module-dynamic-content.js";
9
+ import { applyDynamicContentChoices as v } from "../utils/dynamicContentConverter.js";
10
+ import { stripPendingMarker as N } from "../utils/dynamicContentPendingMarker.js";
11
+ import { extractUsedDynamicContent as w } from "../utils/registerUsedDynamicContent.js";
12
+ import { getEditorApi as b, EDITOR_NOT_READY_MESSAGE as H } from "../utils/stripoEditorApi.js";
13
+ import { ModificationDescription as u } from "../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
14
+ const h = O.Pending, g = (r) => {
15
+ const { editorCopilotApi: e } = b();
16
+ if (!e)
17
+ throw new Error(H);
18
+ const c = e.getDocumentRootHtmlNode().querySelector(`[${h}="${r}"]`);
19
+ return { api: e, node: c };
20
+ }, z = () => {
21
+ const r = _(), e = S(), { isFeatureEnabled: c } = D(), { showToaster: E, handleError: d } = T(), C = A();
22
+ return { resolve: ({ id: n, items: o }, i) => {
23
+ try {
24
+ const { api: t, node: a } = g(n);
25
+ if (a) {
26
+ const l = /* @__PURE__ */ new Map();
27
+ o.forEach((s) => {
28
+ const m = i[s.label];
29
+ m && s.spellings.forEach((p) => l.set(p, m));
30
+ });
31
+ const f = N(
32
+ v(a.getOuterHTML(), l, c("liquidSyntax"))
33
+ ), y = t.getTemplateModifier();
34
+ y.modifyHtml(a).replaceWith(f), y.apply(new u("Resolved dynamic content")), e.registerDynamicContent(w(
35
+ f,
36
+ o.flatMap((s) => s.candidates.map(({ text: m, value: p }) => ({ text: m, value: p })))
37
+ ));
38
+ }
39
+ r.remove(n);
40
+ } catch (t) {
41
+ d(t, "Failed to apply the dynamic content choice");
42
+ }
43
+ }, dismiss: (n) => {
44
+ try {
45
+ const { api: o, node: i } = g(n);
46
+ if (i) {
47
+ const t = o.getTemplateModifier();
48
+ t.modifyHtml(i).removeAttribute(h), t.apply(new u("Cleared pending dynamic content").asHidden()), E({
49
+ type: R.Warning,
50
+ message: C(M)
51
+ });
52
+ }
53
+ } catch (o) {
54
+ d(o, "Failed to dismiss the dynamic content choice");
55
+ } finally {
56
+ r.remove(n);
57
+ }
58
+ } };
59
+ };
60
+ export {
61
+ z as useAmbiguousDynamicContent
62
+ };
@@ -1,8 +1,8 @@
1
1
  import { defaultHtmlCompilerRules as d } from "../config/compiler/htmlCompilerRules.js";
2
2
  import { itemsCompilerRules as f } from "../config/compiler/itemsCompilerRules.js";
3
3
  import { liquidCompilerRules as g } from "../config/compiler/liquidCompilerRules.js";
4
- import { outlookCompilerRules as R } from "../config/compiler/outlookCompilerRules.js";
5
- import { recommendationCompilerRules as v } from "../config/compiler/recommendationCompilerRules.js";
4
+ import { outlookCompilerRules as v } from "../config/compiler/outlookCompilerRules.js";
5
+ import { recommendationCompilerRules as R } from "../config/compiler/recommendationCompilerRules.js";
6
6
  import { socialCompilerRules as H } from "../config/compiler/socialCompilerRules.js";
7
7
  import { unsubscribeCompilerRules as b } from "../config/compiler/unsubscribeCompilerRules.js";
8
8
  import { createHtmlCompiler as n } from "../utils/htmlCompiler.js";
@@ -32,19 +32,20 @@ const x = /* @__PURE__ */ new Set([
32
32
  "liquid-coupon-code",
33
33
  // Editor-only attribute strip — AMP4EMAIL has no `contenteditable`, so leaving
34
34
  // it in narrows/breaks rendering. Pure attribute removal, emits nothing.
35
- "remove-contenteditable"
35
+ "remove-contenteditable",
36
+ "remove-dc-pending-marker"
36
37
  ]), I = () => {
37
- const { compiler: i, isFeatureEnabled: u, partner: a } = C(), c = p(() => {
38
+ const { compiler: i, isFeatureEnabled: a, partner: u } = C(), c = p(() => {
38
39
  var m, l;
39
40
  const e = ((m = i.value) == null ? void 0 : m.customRules) || [];
40
41
  return [
41
42
  ...!!((l = i.value) != null && l.ignoreDefaultRules) ? [] : d,
42
- ...v,
43
+ ...R,
43
44
  ...b,
44
45
  ...f,
45
- ...R,
46
+ ...v,
46
47
  ...H,
47
- ...u("liquidSyntax") ? g : [],
48
+ ...a("liquidSyntax") ? g : [],
48
49
  ...e.map((t, o) => ({
49
50
  ...t,
50
51
  priority: t.priority + 1e3 + o
@@ -53,7 +54,7 @@ const x = /* @__PURE__ */ new Set([
53
54
  ];
54
55
  }), r = p(() => {
55
56
  var t;
56
- const e = c.value, s = n(e), m = n(e.filter((o) => x.has(o.id))), l = (t = a.value) == null ? void 0 : t.fallbackFont;
57
+ const e = c.value, s = n(e), m = n(e.filter((o) => x.has(o.id))), l = (t = u.value) == null ? void 0 : t.fallbackFont;
57
58
  return {
58
59
  compileHtml: (o) => s.compile(o, void 0, l),
59
60
  compileAmpHtml: (o) => m.compile(o, void 0, l)
@@ -1,37 +1,61 @@
1
- import { useConfig as f } from "./useConfig.js";
2
- import { useToaster as d } from "./useToaster.js";
3
- import { useTranslations as C } from "./useTranslations.js";
4
- import { ToasterTypeOptions as T } from "../enums/toaster.js";
5
- import { useEditorStore as h } from "../stores/editor.js";
6
- import { buildDynamicContentLookup as v, convertModuleDynamicContent as D } from "../utils/dynamicContentConverter.js";
7
- import { flattenDynamicContentList as L } from "../utils/genericUtil.js";
8
- import { repairItemsCurrencyAttributes as M } from "../utils/itemsCurrencyRepair.js";
9
- import { convertLegacyUnsubscribeInModuleHtml as O } from "../utils/legacyUnsubscribeConversion.js";
10
- const E = "dynamic-content.unresolved-attributes-on-drop", S = () => {
11
- const { template: p, isFeatureEnabled: n } = f(), { showToaster: y } = d(), b = C();
12
- return { handleModuleAdd: (t, r) => {
13
- var c, i, l;
1
+ import { useConfig as A } from "./useConfig.js";
2
+ import { useToaster as v } from "./useToaster.js";
3
+ import { useTranslations as O } from "./useTranslations.js";
4
+ import { ModuleDynamicContentAttribute as E } from "../enums/dynamic-content.js";
5
+ import { ToasterTypeOptions as L } from "../enums/toaster.js";
6
+ import { itemsBlockDynamicVariables as S } from "../extensions/Blocks/Items/enums/productEnums.js";
7
+ import { useDynamicContentStore as U } from "../stores/dynamic-content.js";
8
+ import { useEditorStore as _ } from "../stores/editor.js";
9
+ import { useModuleDynamicContentStore as F } from "../stores/module-dynamic-content.js";
10
+ import { buildDynamicContentLookup as P, convertModuleDynamicContent as q } from "../utils/dynamicContentConverter.js";
11
+ import { stripPendingMarker as N } from "../utils/dynamicContentPendingMarker.js";
12
+ import { flattenDynamicContentCandidates as R } from "../utils/genericUtil.js";
13
+ import { repairItemsCurrencyAttributes as k } from "../utils/itemsCurrencyRepair.js";
14
+ import { convertLegacyUnsubscribeInModuleHtml as $ } from "../utils/legacyUnsubscribeConversion.js";
15
+ import { extractUsedDynamicContent as x } from "../utils/registerUsedDynamicContent.js";
16
+ const H = "dynamic-content.unresolved-attributes-on-drop", I = /^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/;
17
+ let M = 0;
18
+ const z = (o) => {
19
+ M += 1;
20
+ const r = `${Date.now().toString(36)}-${M}`;
21
+ return { html: o.replace(I, `$1 ${E.Pending}="${r}"`), id: r };
22
+ }, Y = (o, r) => {
23
+ try {
24
+ const n = x(o, r.map(({ text: c, value: a }) => ({ text: c, value: a })));
25
+ n.length > 0 && U().registerDynamicContent(n);
26
+ } catch (n) {
27
+ console.error("Failed to register module dynamic content:", n);
28
+ }
29
+ }, ne = () => {
30
+ const { template: o, isFeatureEnabled: r } = A(), { showToaster: n } = v(), c = O();
31
+ return { handleModuleAdd: (i, s) => {
32
+ var d, p, y, g;
14
33
  try {
15
- if ((t == null ? void 0 : t.action) !== "ADD" && (t == null ? void 0 : t.action) !== "COPY")
34
+ if ((i == null ? void 0 : i.action) !== "ADD" && (i == null ? void 0 : i.action) !== "COPY")
16
35
  return;
17
- const e = (c = r == null ? void 0 : r.getTargetNode) == null ? void 0 : c.call(r), s = (i = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : i.call(e);
18
- if (!e || typeof s != "string")
36
+ const e = (d = s == null ? void 0 : s.getTargetNode) == null ? void 0 : d.call(s), u = (p = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : p.call(e);
37
+ if (!e || typeof u != "string")
19
38
  return;
20
- let o = M(s, {
21
- convertToPriceFormat: n("itemsPriceFormatting")
22
- }), u = !1;
23
- n("legacyUnsubscribeConversion") && ({ html: o, converted: u } = O(o));
24
- const m = v(L((l = p.value) == null ? void 0 : l.dynamicContentList));
25
- let a = [];
26
- if (m.size > 0 && ({ html: o, unresolved: a } = D(o, m, n("liquidSyntax"))), o !== s && r.modifyHtml(e).replaceWith(o), u)
39
+ let t = N(k(u, {
40
+ convertToPriceFormat: r("itemsPriceFormatting")
41
+ })), f = !1;
42
+ r("legacyUnsubscribeConversion") && ({ html: t, converted: f } = $(t));
43
+ const b = r("liquidSyntax"), C = b ? [] : R((y = o.value) == null ? void 0 : y.dynamicContentList), D = P(C);
44
+ let h = [], l = [], m = null;
45
+ if (D.size > 0 && ({ html: t, unresolved: h, ambiguous: l } = q(
46
+ t,
47
+ D,
48
+ b,
49
+ [...((g = o.value) == null ? void 0 : g.customFieldAttributes) ?? [], ...S]
50
+ )), l.length > 0 && ({ html: t, id: m } = z(t)), t !== u && s.modifyHtml(e).replaceWith(t), Y(t, C), f)
27
51
  try {
28
- h().isLegacyUnsubscribeModalRequested = !0;
29
- } catch (g) {
30
- console.error("Failed to request the legacy unsubscribe modal:", g);
52
+ _().isLegacyUnsubscribeModalRequested = !0;
53
+ } catch (T) {
54
+ console.error("Failed to request the legacy unsubscribe modal:", T);
31
55
  }
32
- a.length > 0 && y({
33
- type: T.Warning,
34
- message: b(E)
56
+ m && F().enqueue({ id: m, items: l }), h.length > 0 && n({
57
+ type: L.Warning,
58
+ message: c(H)
35
59
  });
36
60
  } catch (e) {
37
61
  console.error("Failed to repair module on add:", e);
@@ -39,6 +63,6 @@ const E = "dynamic-content.unresolved-attributes-on-drop", S = () => {
39
63
  } };
40
64
  };
41
65
  export {
42
- E as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
43
- S as useModuleRepair
66
+ H as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
67
+ ne as useModuleRepair
44
68
  };
@@ -1,6 +1,7 @@
1
- import { stripFontTags as c } from "../../utils/stripFontTags.js";
2
- import { trimHrefWhitespace as l } from "../../utils/trimHrefWhitespace.js";
3
- const f = [
1
+ import { PENDING_MARKER_PATTERN as c } from "../../utils/dynamicContentPendingMarker.js";
2
+ import { stripFontTags as l } from "../../utils/stripFontTags.js";
3
+ import { trimHrefWhitespace as d } from "../../utils/trimHrefWhitespace.js";
4
+ const y = [
4
5
  {
5
6
  id: "fix-url-encoding-start",
6
7
  description: "Replace {%22 with %7B%22 to fix URL encoding",
@@ -59,14 +60,14 @@ const f = [
59
60
  id: "strip-font-tags",
60
61
  description: 'Unwrap browser-translate-injected <font dir="auto"> tags, keeping inner content; other <font> elements are left intact.',
61
62
  type: "custom",
62
- processor: (e) => c(e),
63
+ processor: (e) => l(e),
63
64
  priority: 15
64
65
  },
65
66
  {
66
67
  id: "trim-href-whitespace",
67
68
  description: "Trim leading/trailing whitespace and &nbsp; from every href value",
68
69
  type: "custom",
69
- processor: (e) => l(e),
70
+ processor: (e) => d(e),
70
71
  priority: 16
71
72
  },
72
73
  {
@@ -183,6 +184,15 @@ const f = [
183
184
  flags: "g",
184
185
  priority: 45
185
186
  },
187
+ {
188
+ id: "remove-dc-pending-marker",
189
+ description: "Strip the editor-only pending dynamic-content choice marker from compiled output",
190
+ type: "regex",
191
+ pattern: c,
192
+ replacement: "",
193
+ flags: "g",
194
+ priority: 46
195
+ },
186
196
  {
187
197
  id: "remove-script-tags",
188
198
  // SD-145051: parity with HB HtmlCleaner.removeUnsafeHtmlTags — strip <script> from
@@ -208,5 +218,5 @@ const f = [
208
218
  }
209
219
  ];
210
220
  export {
211
- f as defaultHtmlCompilerRules
221
+ y as defaultHtmlCompilerRules
212
222
  };
@@ -0,0 +1,4 @@
1
+ var n = /* @__PURE__ */ ((d) => (d.Pending = "data-guido-dc-pending", d))(n || {});
2
+ export {
3
+ n as ModuleDynamicContentAttribute
4
+ };
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-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-ed74fdf8]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-ed74fdf8]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-ed74fdf8]{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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{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-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .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-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.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}
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-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-7610da98]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-7610da98]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-7610da98]{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-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{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-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .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-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.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-e3c06c66]{padding-bottom:150px}
@@ -1,9 +1,9 @@
1
- const o = "3.26.0-beta.df8736b", s = { stripo: { version: "2.85.1" } }, t = {
1
+ const o = "3.26.0-beta.e0662fe", e = { stripo: { version: "2.83.1" } }, s = {
2
2
  version: o,
3
- guido: s
3
+ guido: e
4
4
  };
5
5
  export {
6
- t as default,
7
- s as guido,
6
+ s as default,
7
+ e as guido,
8
8
  o as version
9
9
  };
@@ -31,6 +31,13 @@ export type DynamicContentNode = {
31
31
  * flattens the active (first) partner's leaf attributes into a `DynamicContent[]`.
32
32
  */
33
33
  export type DynamicContentList = Record<string, DynamicContentNode[]>;
34
+ /** A leaf attribute with both backend labels and its category path (root → parent). */
35
+ export type DynamicContentCandidate = {
36
+ value: string;
37
+ text: string;
38
+ tagText: string;
39
+ path: string[];
40
+ };
34
41
  export type MergeTag = BaseDynamicContent & {
35
42
  label: string;
36
43
  selStart?: number;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { type PendingModuleDynamicContent } from '@@/Stores/module-dynamic-content';
2
+ /** Resolves or dismisses the labels a dropped module left pending (see `useModuleRepair`). */
3
+ export declare const useAmbiguousDynamicContent: () => {
4
+ resolve: ({ id, items }: PendingModuleDynamicContent, selections: Record<string, string>) => void;
5
+ dismiss: (id: string) => void;
6
+ };
@@ -0,0 +1,3 @@
1
+ export declare enum ModuleDynamicContentAttribute {
2
+ Pending = "data-guido-dc-pending"
3
+ }
@@ -0,0 +1,30 @@
1
+ import type { AmbiguousDynamicContent } from '@@/Utils/dynamicContentConverter';
2
+ export interface PendingModuleDynamicContent {
3
+ /** Value of the module root's pending marker attribute. */
4
+ id: string;
5
+ items: AmbiguousDynamicContent[];
6
+ }
7
+ interface ModuleDynamicContentState {
8
+ queue: PendingModuleDynamicContent[];
9
+ }
10
+ export declare const useModuleDynamicContentStore: import("pinia").StoreDefinition<"guidoModuleDynamicContent", ModuleDynamicContentState, {
11
+ current: (state: {
12
+ queue: {
13
+ id: string;
14
+ items: {
15
+ label: string;
16
+ spellings: string[];
17
+ candidates: {
18
+ value: string;
19
+ text: string;
20
+ tagText: string;
21
+ path: string[];
22
+ }[];
23
+ }[];
24
+ }[];
25
+ } & import("pinia").PiniaCustomStateProperties<ModuleDynamicContentState>) => PendingModuleDynamicContent | null;
26
+ }, {
27
+ enqueue(entry: PendingModuleDynamicContent): void;
28
+ remove(id: string): void;
29
+ }>;
30
+ export {};
@@ -1,27 +1,29 @@
1
- import type { DynamicContent } from '@@/Types/generic';
1
+ import type { DynamicContentCandidate } from '@@/Types/generic';
2
+ type DynamicContentLookup = Map<string, DynamicContentCandidate[]>;
3
+ export interface AmbiguousDynamicContent {
4
+ /** The label as the author wrote it (first occurrence). */
5
+ label: string;
6
+ /** Every exact token name that resolved to this label, so a choice never touches a valid token. */
7
+ spellings: string[];
8
+ candidates: DynamicContentCandidate[];
9
+ }
2
10
  export interface DynamicContentConversionResult {
3
11
  html: string;
4
12
  /** Distinct tokens that matched neither a known value nor a known label (reported to the user). */
5
13
  unresolved: string[];
14
+ /** Labels shared by several attributes; left untouched for the user to choose. */
15
+ ambiguous: AmbiguousDynamicContent[];
6
16
  }
7
17
  /**
8
- * Builds a label→item lookup from one or more dynamic-content lists, keyed by
9
- * normalized label (trimmed, lowercased). When lists overlap, a later list wins
10
- * for a shared key.
18
+ * Builds a label → candidates lookup keyed by both backend labels (`text`, `tag_text`),
19
+ * normalized (trimmed, lowercased). A label shared by several attributes keeps all of them.
11
20
  */
12
- export declare const buildDynamicContentLookup: (...lists: DynamicContent[][]) => Map<string, DynamicContent>;
21
+ export declare const buildDynamicContentLookup: (candidates: DynamicContentCandidate[]) => DynamicContentLookup;
13
22
  /**
14
- * Repairs dynamic-content tokens in a dropped module's HTML, using `lookup`
15
- * (label→item) built from the account's full dynamic-content list. Returns the
16
- * rewritten HTML plus the tokens it could not resolve.
17
- *
18
- * A token is rewritten to its canonical `{{value}}` form when its name matches a
19
- * display label (`{{ Phone Number }}` → `{{phone_number}}`). Left untouched: an
20
- * exact canonical value (already correct — this also stops a valid token being
21
- * rewritten just because it coincides with an unrelated label), Liquid nested
22
- * tokens (dotted, e.g. `coupon.code`), recommendation-block variables
23
- * (`123_0_attr`), allowed system tokens, and `data-*` product tags. The account
24
- * list is exhaustive, so any remaining token matching neither a value nor a label
25
- * is reported in `unresolved`; the text itself is always left in place.
23
+ * Rewrites label tokens with one candidate; exact values/`validTokens` stay. Several candidates
24
+ * → `ambiguous`, none → `unresolved`; reported text is never changed.
26
25
  */
27
- export declare const convertModuleDynamicContent: (html: string, lookup: Map<string, DynamicContent>, liquidSyntax: boolean) => DynamicContentConversionResult;
26
+ export declare const convertModuleDynamicContent: (html: string, lookup: DynamicContentLookup, liquidSyntax: boolean, validTokens?: string[]) => DynamicContentConversionResult;
27
+ /** Rewrites every token whose exact name the user resolved (`spelling → value`), keeping tails. */
28
+ export declare const applyDynamicContentChoices: (html: string, choices: Map<string, string>, liquidSyntax: boolean) => string;
29
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const PENDING_MARKER_PATTERN = "\\s+data-guido-dc-pending=\"[^\"]*\"";
2
+ export declare const stripPendingMarker: (html: string) => string;
@@ -1,15 +1,11 @@
1
- import type { DynamicContent, DynamicContentList, MergeTag } from '@@/Types/generic';
1
+ import type { DynamicContent, DynamicContentCandidate, DynamicContentList, MergeTag } from '@@/Types/generic';
2
2
  export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
3
3
  export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
4
4
  /**
5
- * Flattens the partner-keyed dynamic-content tree into a deduped flat list of the
6
- * ACTIVE partner's leaf attributes. A single editor session targets one partner,
7
- * so only the FIRST partner entry is used (the sole entry for a single-partner
8
- * host like email-fe; merging all partners would risk cross-partner label
9
- * collisions). A node carrying `children`/`select_items` is a category grouping:
10
- * recursed into but never collected itself — only real leaf attributes
11
- * (`text`/`tag_text` + `value`) become `{ text, value }` pairs.
5
+ * Flattens the ACTIVE (first) partner's tree into deduped leaf attributes with both labels and
6
+ * their category path; category nodes (`children`/`select_items`) are walked, never collected.
12
7
  */
8
+ export declare const flattenDynamicContentCandidates: (list: DynamicContentList | undefined | null) => DynamicContentCandidate[];
13
9
  export declare const flattenDynamicContentList: (list: DynamicContentList | undefined | null) => DynamicContent[];
14
10
  /**
15
11
  * Builds the editor merge-tag entries from the template's preselected list plus
@@ -1,9 +1,9 @@
1
- const s = "2.85.1", n = ["UIEditor.js", "zone.js", "styles-BWH3PMR4.css", "polyfills-FF3RLU5F.js", "main-OBP2Z7MC.js", "chunk-4XWYRHPW.js", "chunk-5FWAYXEU.js", "chunk-62K3AMOD.js", "chunk-6KRER6RV.js", "chunk-7NDQP2S2.js", "chunk-ECLEIO5F.js", "chunk-EGVZCU2I.js", "chunk-HAASEXSM.js", "chunk-HC6URDFK.js", "chunk-HHAM65V3.js", "chunk-IS2ESPY3.js", "chunk-OKMQ5PFC.js", "chunk-PLJHV7FP.js", "chunk-TXFBR64G.js", "chunk-Z3225DSC.js", "assets/css/uiEditor.css", "assets/i18n/en.json", "assets/icons/ui-editor-icons.sprite.svg", "assets/icons/ui-editor-icons.map.json", "assets/imageeditor/scripts.min.js", "assets/imageeditor/assets/icons/merged.svg"], c = {
1
+ const s = "2.83.1", n = ["UIEditor.js", "zone.js", "styles-BWH3PMR4.css", "polyfills-FF3RLU5F.js", "main-OTN2PYRT.js", "chunk-62K3AMOD.js", "chunk-6RGJBGUG.js", "chunk-6W43DTQG.js", "chunk-EC4WGEOZ.js", "chunk-GLBBUJ54.js", "chunk-GPJLJCMF.js", "chunk-MDCDEJUH.js", "chunk-P7HQTFJV.js", "chunk-PA4WGBC4.js", "chunk-QMDAV6OU.js", "chunk-R2F3ADM2.js", "chunk-YSKQ2TWF.js", "chunk-ZU5ASRKR.js", "assets/css/uiEditor.css", "assets/i18n/en.json", "assets/icons/ui-editor-icons.sprite.svg", "assets/icons/ui-editor-icons.map.json", "assets/imageeditor/scripts.min.js", "assets/imageeditor/assets/icons/merged.svg"], i = {
2
2
  version: s,
3
3
  files: n
4
4
  };
5
5
  export {
6
- c as default,
6
+ i as default,
7
7
  n as files,
8
8
  s as version
9
9
  };
@@ -0,0 +1,20 @@
1
+ import { defineStore as u } from "pinia";
2
+ const i = u("guidoModuleDynamicContent", {
3
+ state: () => ({
4
+ queue: []
5
+ }),
6
+ getters: {
7
+ current: (e) => e.queue[0] ?? null
8
+ },
9
+ actions: {
10
+ enqueue(e) {
11
+ this.queue = [...this.queue, e];
12
+ },
13
+ remove(e) {
14
+ this.queue = this.queue.filter((t) => t.id !== e);
15
+ }
16
+ }
17
+ });
18
+ export {
19
+ i as useModuleDynamicContentStore
20
+ };
@@ -1,31 +1,45 @@
1
- import { DATA_ATTRIBUTE_REGEX as A, DYNAMIC_CONTENT_TAG_REGEX as m, ALLOWED_DYNAMIC_SYSTEM_TOKENS as D } from "../enums/html-validator.js";
2
- import { dynamicContentToMergeTags as T } from "./genericUtil.js";
3
- const p = "guidoDataMask", M = "EndDataMask", f = /guidoDataMask(\d+)EndDataMask/g, h = /^\d+_\d+_.+$/, E = (o) => o.trim().toLowerCase(), I = (...o) => {
4
- const r = /* @__PURE__ */ new Map();
5
- return o.forEach((i) => {
6
- i.forEach((s) => {
7
- const a = E(s.text);
8
- a && r.set(a, s);
1
+ import { DATA_ATTRIBUTE_REGEX as A, DYNAMIC_CONTENT_TAG_REGEX as T, ALLOWED_DYNAMIC_SYSTEM_TOKENS as D } from "../enums/html-validator.js";
2
+ import { dynamicContentToMergeTags as f } from "./genericUtil.js";
3
+ const h = "guidoDataMask", v = "EndDataMask", M = /guidoDataMask(\d+)EndDataMask/g, C = /^\d+_\d+_.+$/, E = (e) => e.trim().toLowerCase(), _ = (e, n) => {
4
+ const t = [];
5
+ return e.replace(A, (a) => (t.push(a), `${h}${t.length - 1}${v}`)).replace(T, (a) => {
6
+ const c = a.slice(2, -2), l = c.indexOf("|"), i = l === -1 ? c : c.slice(0, l);
7
+ return n({ tag: a, inner: c, pipeIndex: l, namePart: i, name: i.trim() });
8
+ }).replace(M, (a, c) => t[Number(c)]);
9
+ }, g = (e, n, t) => e.pipeIndex !== -1 ? `{{${e.namePart.replace(e.name, () => n)}${e.inner.slice(e.pipeIndex)}}}` : f([{ text: e.name, value: n }], t)[0].value, x = (e) => {
10
+ const n = /* @__PURE__ */ new Map();
11
+ return e.forEach((t) => {
12
+ new Set([t.text, t.tagText].map(E)).forEach((r) => {
13
+ if (!r)
14
+ return;
15
+ let s = n.get(r);
16
+ s || (s = [], n.set(r, s)), s.some((a) => a.value === t.value) || s.push(t);
9
17
  });
10
- }), r;
11
- }, w = (o, r, i) => {
12
- const s = /* @__PURE__ */ new Set(), a = new Set([...r.values()].map((e) => e.value)), u = [];
13
- return { html: o.replace(A, (e) => (u.push(e), `${p}${u.length - 1}${M}`)).replace(m, (e) => {
14
- const n = e.slice(2, -2), c = n.indexOf("|"), l = c === -1 ? n : n.slice(0, c), t = l.trim();
15
- if (t === "" || D.includes(t) || t.includes(".") || h.test(t) || a.has(t))
16
- return e;
17
- const d = r.get(E(t));
18
- if (d) {
19
- if (c !== -1) {
20
- const _ = n.slice(c);
21
- return `{{${l.replace(t, () => d.value)}${_}}}`;
22
- }
23
- return T([d], i)[0].value;
18
+ }), n;
19
+ }, I = (e, n, t, r = []) => {
20
+ const s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set([
21
+ ...[...n.values()].flat().map((i) => i.value),
22
+ ...r
23
+ ]);
24
+ return { html: _(e, (i) => {
25
+ const { tag: m, name: o } = i;
26
+ if (o === "" || D.includes(o) || o.includes(".") || C.test(o) || c.has(o))
27
+ return m;
28
+ const p = E(o), u = n.get(p) ?? [];
29
+ if (u.length === 1)
30
+ return g(i, u[0].value, t);
31
+ if (u.length > 1) {
32
+ const d = a.get(p) ?? { label: o, spellings: [], candidates: u };
33
+ return d.spellings.includes(o) || d.spellings.push(o), a.set(p, d), m;
24
34
  }
25
- return s.add(t), e;
26
- }).replace(f, (e, n) => u[Number(n)]), unresolved: [...s] };
27
- };
35
+ return s.add(o), m;
36
+ }), unresolved: [...s], ambiguous: [...a.values()] };
37
+ }, R = (e, n, t) => _(e, (r) => {
38
+ const s = n.get(r.name);
39
+ return s ? g(r, s, t) : r.tag;
40
+ });
28
41
  export {
29
- I as buildDynamicContentLookup,
30
- w as convertModuleDynamicContent
42
+ R as applyDynamicContentChoices,
43
+ x as buildDynamicContentLookup,
44
+ I as convertModuleDynamicContent
31
45
  };
@@ -0,0 +1,6 @@
1
+ import { ModuleDynamicContentAttribute as n } from "../enums/dynamic-content.js";
2
+ const t = `\\s+${n.Pending}="[^"]*"`, o = (e) => e.replace(new RegExp(t, "g"), "");
3
+ export {
4
+ t as PENDING_MARKER_PATTERN,
5
+ o as stripPendingMarker
6
+ };
@@ -1,78 +1,78 @@
1
- import { formatToLiquidFilter as b, quoteArgument as y, liquidFilterToFormat as h } from "./liquidDynamicContent.js";
2
- const g = (t) => {
1
+ import { formatToLiquidFilter as y, liquidFilterToFormat as g, quoteArgument as m } from "./liquidDynamicContent.js";
2
+ const v = (t) => {
3
3
  if (!t.includes("="))
4
4
  return null;
5
5
  const [r, e] = t.split("=");
6
6
  return { key: r.trim(), value: e.trim() };
7
- }, c = "default:", f = (t) => {
8
- if (!t.startsWith(c))
7
+ }, u = "default:", i = (t) => {
8
+ if (!t.startsWith(u))
9
9
  return t;
10
- const r = t.slice(c.length).trim(), e = (l) => r.length >= 2 && r.startsWith(l) && r.endsWith(l);
10
+ const r = t.slice(u.length).trim(), e = (n) => r.length >= 2 && r.startsWith(n) && r.endsWith(n);
11
11
  return e('"') || e("'") ? r.slice(1, -1) : r;
12
- }, k = (t) => {
13
- const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [l] = e, s = {
12
+ }, $ = (t) => {
13
+ const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [n] = e, s = {
14
14
  text: t.label,
15
- value: l || ""
15
+ value: n || ""
16
16
  };
17
17
  if (e.length >= 2) {
18
- const [, a, n] = e;
19
- if (a.startsWith(c))
20
- s.fallback = f(a);
18
+ const [, a, o] = e;
19
+ if (a.startsWith(u))
20
+ s.fallback = i(a);
21
21
  else {
22
- const o = h(a) ?? g(a);
23
- o ? s.format = o : n || (s.fallback = a), n && (s.fallback = f(n));
22
+ const l = g(a) ?? v(a);
23
+ l ? s.format = l : o || (s.fallback = a), o && (s.fallback = i(o));
24
24
  }
25
25
  }
26
26
  return s;
27
+ }, h = (t) => {
28
+ const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : m(t);
29
+ return e === null ? null : `${u} ${e}`;
27
30
  }, p = (t) => {
28
- const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : y(t);
29
- return e === null ? null : `${c} ${e}`;
30
- }, v = (t) => {
31
- const r = t.format ? b(t.format) : null, e = t.fallback ? p(t.fallback) : null, l = [t.value, r, e].filter(Boolean);
31
+ const r = t.format ? y(t.format) : null, e = t.fallback ? h(t.fallback) : null, n = [t.value, r, e].filter(Boolean);
32
32
  return {
33
33
  label: [t.text, r, e && t.fallback].filter(Boolean).join(" | "),
34
- value: `{{ ${l.join(" | ")} }}`
34
+ value: `{{ ${n.join(" | ")} }}`
35
35
  };
36
- }, i = (t, r = !1) => t.map((e) => r ? v(e) : e.format ? {
36
+ }, b = (t, r = !1) => t.map((e) => r ? p(e) : e.format ? {
37
37
  label: `${e.text} | ${e.format.key}=${e.format.value}`,
38
38
  value: `{{${e.value}|${e.format.key}=${e.format.value}}}`
39
39
  } : {
40
40
  label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
41
41
  value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
42
- }), $ = (t) => {
43
- const r = [], e = /* @__PURE__ */ new Set(), l = (a) => {
44
- Array.isArray(a) && a.forEach((n) => {
45
- const o = [...n.children ?? [], ...n.select_items ?? []];
46
- if (o.length > 0) {
47
- l(o);
42
+ }), k = (t) => {
43
+ const r = [], e = /* @__PURE__ */ new Set(), n = (a, o) => {
44
+ Array.isArray(a) && a.forEach((l) => {
45
+ const f = [...l.children ?? [], ...l.select_items ?? []], c = l.text || l.tag_text;
46
+ if (f.length > 0) {
47
+ n(f, c ? [...o, c] : o);
48
48
  return;
49
49
  }
50
- const u = n.text || n.tag_text;
51
- u && n.value && !e.has(n.value) && (e.add(n.value), r.push({ text: u, value: n.value }));
50
+ c && l.value && !e.has(l.value) && (e.add(l.value), r.push({ value: l.value, text: c, tagText: l.tag_text || c, path: o }));
52
51
  });
53
52
  }, [s] = Object.values(t ?? {});
54
- return l(s), r;
55
- }, d = (t, r, e = !1) => {
56
- const l = new Set(t.map((a) => a.value)), s = r.filter((a) => l.has(a.value) ? !1 : (l.add(a.value), !0));
53
+ return n(s, []), r;
54
+ }, x = (t) => k(t).map(({ text: r, value: e }) => ({ text: r, value: e })), T = (t, r, e = !1) => {
55
+ const n = new Set(t.map((a) => a.value)), s = r.filter((a) => n.has(a.value) ? !1 : (n.add(a.value), !0));
57
56
  return [
58
- ...i(t, e),
59
- ...i(s, e)
57
+ ...b(t, e),
58
+ ...b(s, e)
60
59
  ];
61
60
  }, F = () => {
62
61
  var t;
63
62
  return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
64
- }, T = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", x = (t) => {
63
+ }, P = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", j = (t) => {
65
64
  if (t === null || typeof t != "object" || Array.isArray(t))
66
65
  return !1;
67
66
  const r = Object.getPrototypeOf(t);
68
67
  return r === Object.prototype || r === null;
69
68
  };
70
69
  export {
71
- T as asText,
72
- d as buildMergeTagEntries,
73
- i as dynamicContentToMergeTags,
74
- $ as flattenDynamicContentList,
70
+ P as asText,
71
+ T as buildMergeTagEntries,
72
+ b as dynamicContentToMergeTags,
73
+ k as flattenDynamicContentCandidates,
74
+ x as flattenDynamicContentList,
75
75
  F as getCsrfToken,
76
- x as isPlainObject,
77
- k as mergeTagToDynamicContent
76
+ j as isPlainObject,
77
+ $ as mergeTagToDynamicContent
78
78
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.26.0-beta.df8736b",
3
+ "version": "3.26.0-beta.e0662fe",
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",
@@ -128,7 +128,7 @@
128
128
  },
129
129
  "guido": {
130
130
  "stripo": {
131
- "version": "2.85.1"
131
+ "version": "2.83.1"
132
132
  }
133
133
  }
134
134
  }