@useinsider/guido 3.27.0-beta.c63ada9 → 3.27.0-beta.ee85b86

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.
@@ -1,44 +1,75 @@
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 h } from "./useConfig.js";
2
+ import { useToaster as v } from "./useToaster.js";
3
+ import { useTranslations as M } from "./useTranslations.js";
4
+ import { ModuleDynamicContentAttribute as T } from "../enums/dynamic-content.js";
5
+ import { ToasterTypeOptions as A } from "../enums/toaster.js";
6
+ import { itemsBlockDynamicVariables as O } from "../extensions/Blocks/Items/enums/productEnums.js";
7
+ import { useDynamicContentStore as E } from "../stores/dynamic-content.js";
8
+ import { useEditorStore as L } from "../stores/editor.js";
9
+ import { useModuleDynamicContentStore as U } from "../stores/module-dynamic-content.js";
10
+ import { buildDynamicContentLookup as _, convertModuleDynamicContent as F } from "../utils/dynamicContentConverter.js";
11
+ import { stripPendingMarker as P } from "../utils/dynamicContentPendingMarker.js";
12
+ import { flattenDynamicContentCandidates as S } from "../utils/genericUtil.js";
13
+ import { repairItemsCurrencyAttributes as N } from "../utils/itemsCurrencyRepair.js";
14
+ import { convertLegacyUnsubscribeInModuleHtml as R } from "../utils/legacyUnsubscribeConversion.js";
15
+ import { extractUsedDynamicContent as k } from "../utils/registerUsedDynamicContent.js";
16
+ const q = "dynamic-content.unresolved-attributes-on-drop", H = /^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/;
17
+ let y = 0;
18
+ const $ = (s) => {
19
+ y += 1;
20
+ const o = `${Date.now().toString(36)}-${y}`;
21
+ return { html: s.replace(H, `$1 ${T.Pending}="${o}"`), id: o };
22
+ }, I = (s, o) => {
23
+ try {
24
+ const i = k(s, o.map(({ text: a, value: m }) => ({ text: a, value: m })));
25
+ i.length > 0 && E().registerDynamicContent(i);
26
+ } catch (i) {
27
+ console.error("Failed to register module dynamic content:", i);
28
+ }
29
+ }, re = () => {
30
+ const { template: s, isFeatureEnabled: o } = h(), { showToaster: i } = v(), a = M(), m = (r) => {
31
+ var u, e;
32
+ const t = o("liquidSyntax") ? [] : S((u = s.value) == null ? void 0 : u.dynamicContentList), c = _(t);
33
+ return c.size === 0 ? { html: r, unresolved: [], ambiguous: [], candidates: t } : {
34
+ ...F(
35
+ r,
36
+ c,
37
+ [...((e = s.value) == null ? void 0 : e.customFieldAttributes) ?? [], ...O]
38
+ ),
39
+ candidates: t
40
+ };
41
+ };
42
+ return { handleModuleAdd: (r, t) => {
43
+ var c, u;
14
44
  try {
15
- if ((t == null ? void 0 : t.action) !== "ADD" && (t == null ? void 0 : t.action) !== "COPY")
45
+ if ((r == null ? void 0 : r.action) !== "ADD" && (r == null ? void 0 : r.action) !== "COPY")
16
46
  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")
47
+ const e = (c = t == null ? void 0 : t.getTargetNode) == null ? void 0 : c.call(t), l = (u = e == null ? void 0 : e.getOuterHTML) == null ? void 0 : u.call(e);
48
+ if (!e || typeof l != "string")
19
49
  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)
50
+ let n = P(N(l, {
51
+ convertToPriceFormat: o("itemsPriceFormatting")
52
+ })), p = !1;
53
+ o("legacyUnsubscribeConversion") && ({ html: n, converted: p } = R(n));
54
+ const { html: f, unresolved: b, ambiguous: g, candidates: C } = m(n);
55
+ let d = null;
56
+ if (n = f, g.length > 0 && ({ html: n, id: d } = $(n)), n !== l && t.modifyHtml(e).replaceWith(n), I(n, C), p)
27
57
  try {
28
- h().isLegacyUnsubscribeModalRequested = !0;
29
- } catch (g) {
30
- console.error("Failed to request the legacy unsubscribe modal:", g);
58
+ L().isLegacyUnsubscribeModalRequested = !0;
59
+ } catch (D) {
60
+ console.error("Failed to request the legacy unsubscribe modal:", D);
31
61
  }
32
- a.length > 0 && y({
33
- type: T.Warning,
34
- message: b(E)
62
+ d && U().enqueue({ id: d, items: g }), b.length > 0 && i({
63
+ type: A.Warning,
64
+ message: a(q)
35
65
  });
36
66
  } catch (e) {
37
67
  console.error("Failed to repair module on add:", e);
38
68
  }
39
- } };
69
+ }, convertDynamicContent: m };
40
70
  };
41
71
  export {
42
- E as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
43
- S as useModuleRepair
72
+ q as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
73
+ I as registerUsedAttributes,
74
+ re as useModuleRepair
44
75
  };
@@ -1,51 +1,52 @@
1
- import { useActionsApi as N } from "./useActionsApi.js";
2
- import { useBlocksConfig as j } from "./useBlocksConfig.js";
3
- import { useConfig as z } from "./useConfig.js";
1
+ import { useActionsApi as j } from "./useActionsApi.js";
2
+ import { useAmbiguousDynamicContent as z } from "./useAmbiguousDynamicContent.js";
3
+ import { useBlocksConfig as $ } from "./useBlocksConfig.js";
4
+ import { useConfig as G } from "./useConfig.js";
4
5
  import { useCustomInterfaceAppearance as v } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as $ } from "./useFullStoryBridge.js";
6
- import { useModuleRepair as G } from "./useModuleRepair.js";
7
- import { useStripoEventHandler as X } from "./useStripoEventHandler.js";
8
- import { useStripoNotifications as J } from "./useStripoNotifications.js";
9
- import { useToaster as K } from "./useToaster.js";
10
- import { localePatch as Q } from "../config/i18n/index.js";
6
+ import { useFullStoryBridge as X } from "./useFullStoryBridge.js";
7
+ import { useModuleRepair as J } from "./useModuleRepair.js";
8
+ import { useStripoEventHandler as K } from "./useStripoEventHandler.js";
9
+ import { useStripoNotifications as Q } from "./useStripoNotifications.js";
10
+ import { useToaster as W } from "./useToaster.js";
11
+ import { localePatch as Y } from "../config/i18n/index.js";
11
12
  import { en as B } from "../config/i18n/en/index.js";
12
- import { ToasterTypeOptions as W } from "../enums/toaster.js";
13
- import { useStripoApi as Y } from "../services/stripoApi.js";
14
- import Z from "../static/styles/customEditorStyle.css.js";
13
+ import { ToasterTypeOptions as Z } from "../enums/toaster.js";
14
+ import { useStripoApi as ee } from "../services/stripoApi.js";
15
+ import te from "../static/styles/customEditorStyle.css.js";
15
16
  import { useEditorStore as T } from "../stores/editor.js";
16
- import { buildMergeTagEntries as ee, flattenDynamicContentList as te } from "../utils/genericUtil.js";
17
- import { getStripoRuntimeBaseUrl as oe } from "../utils/stripoRuntime.js";
17
+ import { buildMergeTagEntries as oe, flattenDynamicContentList as re } from "../utils/genericUtil.js";
18
+ import { getStripoRuntimeBaseUrl as ie } from "../utils/stripoRuntime.js";
18
19
  let d = null, F = !1;
19
- const ke = (t) => {
20
- const { features: u, template: m, isFeatureEnabled: p } = z(), { handleError: f, showToaster: A } = K(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: U } = Y(), { handleEvent: V } = X(), { handleModuleAdd: D } = G(), { getStripoBlocksConfig: I } = j(), { getStripoNotifications: L } = J(), g = () => d || (d = new Promise((n, a) => {
20
+ const ve = (t) => {
21
+ const { features: u, template: m, isFeatureEnabled: p } = G(), { handleError: f, showToaster: A } = W(), { getToken: P, getCustomFonts: R, getSyncModulesStatus: D } = ee(), { handleEvent: U } = K(), { handleModuleAdd: V } = J(), { restorePending: I } = z(), { getStripoBlocksConfig: L } = $(), { getStripoNotifications: q } = Q(), g = () => d || (d = new Promise((n, s) => {
21
22
  if (document.getElementById("UiEditorScript")) {
22
23
  n();
23
24
  return;
24
25
  }
25
- const i = oe();
26
+ const i = ie();
26
27
  if (!i) {
27
- a(
28
+ s(
28
29
  new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
29
30
  );
30
31
  return;
31
32
  }
32
- const s = `${i}UIEditor.js`, e = document.createElement("script");
33
- e.id = "UiEditorScript", e.type = "module", e.src = s, e.onload = () => {
33
+ const a = `${i}UIEditor.js`, e = document.createElement("script");
34
+ e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
34
35
  F = !0, n();
35
36
  }, e.onerror = () => {
36
- e.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
37
+ e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
37
38
  }, document.body.appendChild(e);
38
39
  }), d.catch(() => {
39
40
  d = null;
40
- }), d), q = async (n, a, i, s = [], e = !1, c = !1) => {
41
+ }), d), x = async (n, s, i, a = [], e = !1, c = !1) => {
41
42
  var w, k, b, _;
42
- const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions: x } = await I();
43
+ const o = T(), { html: S, css: y } = n, { baseBlocks: E, extensions: O } = await L();
43
44
  t.mark("blocks_config_ready");
44
- const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0, O = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), H = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
45
+ const h = ((w = u.value) == null ? void 0 : w.displayConditions) ?? !0, H = ((k = u.value) == null ? void 0 : k.modulesDisabled) ?? !1, C = c || (((b = m.value) == null ? void 0 : b.forceRecreate) ?? !1), M = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
45
46
  t.setTemplate({ html: S, css: y, forceRecreate: C }), v().importCss(), t.mark("init_editor"), await window.UIEditor.initEditor(
46
47
  document.querySelector("#guido-editor"),
47
48
  {
48
- metadata: a,
49
+ metadata: s,
49
50
  html: S,
50
51
  css: y,
51
52
  forceRecreate: C,
@@ -58,11 +59,11 @@ const ke = (t) => {
58
59
  customAppearanceMergetags: !p("liquidSyntax"),
59
60
  customAppearanceMergetagsBorderColor: "#f1f3fe",
60
61
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
61
- customViewStyles: Z,
62
+ customViewStyles: te,
62
63
  conditionsEnabled: h,
63
64
  customConditionsEnabled: h,
64
65
  enableXSSSecurity: !0,
65
- modulesDisabled: O,
66
+ modulesDisabled: H,
66
67
  syncModulesEnabled: e,
67
68
  messageSettingsEnabled: !0,
68
69
  displayGmailAnnotations: !0,
@@ -73,18 +74,18 @@ const ke = (t) => {
73
74
  copyPasteEnabled: !1,
74
75
  selectElementAfterDrop: !0,
75
76
  sameFontSizeForOutlook: !0,
76
- allowedScriptSourceDomains: H,
77
+ allowedScriptSourceDomains: M,
77
78
  ...E ? { baseBlocks: E } : {},
78
79
  editorFonts: {
79
80
  showDefaultStandardFonts: !0,
80
81
  showDefaultNotStandardFonts: !0,
81
- customFonts: s
82
+ customFonts: a
82
83
  },
83
84
  mergeTags: [
84
85
  {
85
- entries: ee(
86
+ entries: oe(
86
87
  i.preselectedDynamicContentList,
87
- te((_ = m.value) == null ? void 0 : _.dynamicContentList),
88
+ re((_ = m.value) == null ? void 0 : _.dynamicContentList),
88
89
  p("liquidSyntax")
89
90
  )
90
91
  }
@@ -100,8 +101,8 @@ const ke = (t) => {
100
101
  },
101
102
  onTemplateLoaded() {
102
103
  try {
103
- const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = N(), { injectFullStory: M } = $();
104
- v().importCss(), r(), M(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
104
+ const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = j(), { injectFullStory: N } = X();
105
+ v().importCss(), r(), N(), I(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
105
106
  o.hasChanges = !1;
106
107
  }, 1e3), t.markReady();
107
108
  } catch (r) {
@@ -120,9 +121,9 @@ const ke = (t) => {
120
121
  onDataChanged() {
121
122
  o.hasChanges = !0, o.changeSeq += 1;
122
123
  },
123
- onEvent: V,
124
- onModuleAdd: D,
125
- notifications: L(),
124
+ onEvent: U,
125
+ onModuleAdd: V,
126
+ notifications: q(),
126
127
  // Stripo deselects the block on any click outside the canvas, so every surface
127
128
  // that belongs to the block's own flow has to be listed here (SD-153273).
128
129
  ignoreClickOutsideSelectors: [
@@ -132,23 +133,23 @@ const ke = (t) => {
132
133
  ".in-modal-v2-wrapper",
133
134
  ".in-toasts-wrapper"
134
135
  ],
135
- extensions: x,
136
- localePatch: Q
136
+ extensions: O,
137
+ localePatch: Y
137
138
  }
138
139
  );
139
140
  };
140
- return { initPlugin: async (n, a, i, s = !1) => {
141
+ return { initPlugin: async (n, s, i, a = !1) => {
141
142
  const e = T();
142
143
  try {
143
144
  t.mark("plugin_start"), t.setScriptPreloaded(F), await g(), t.mark("script_ready");
144
145
  const [c, o] = await Promise.all([
145
146
  R(),
146
- U()
147
+ D()
147
148
  ]);
148
- t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await q(n, a, i, c, o, s);
149
+ t.mark("fonts_sync_ready"), e.syncModulesEnabled = o, await x(n, s, i, c, o, a);
149
150
  } catch {
150
151
  e.loadingStatus = !1, A({
151
- type: W.Error,
152
+ type: Z.Error,
152
153
  message: B["An error has occurred. Please report the error code to support."],
153
154
  actionButton: {
154
155
  text: B["Reload page"],
@@ -162,5 +163,5 @@ const ke = (t) => {
162
163
  } };
163
164
  };
164
165
  export {
165
- ke as useStripo
166
+ ve as useStripo
166
167
  };
@@ -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-8fc59697]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-8fc59697]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-8fc59697]{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-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-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-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{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-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-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-2643213c]{padding-bottom:150px}
@@ -1,9 +1,9 @@
1
- const o = "3.27.0-beta.c63ada9", s = { stripo: { version: "2.83.1" } }, a = {
1
+ const o = "3.27.0-beta.ee85b86", e = { stripo: { version: "2.83.1" } }, s = {
2
2
  version: o,
3
- guido: s
3
+ guido: e
4
4
  };
5
5
  export {
6
- a 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,7 @@
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
+ restorePending: () => void;
7
+ };
@@ -1,9 +1,15 @@
1
+ import type { DynamicContentCandidate } from '@@/Types/generic';
1
2
  import type { ModuleAddData, ModuleModifier } from '@@/Types/stripo';
3
+ import { type DynamicContentConversionResult } from '@@/Utils/dynamicContentConverter';
2
4
  export declare const UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY = "dynamic-content.unresolved-attributes-on-drop";
5
+ export declare const registerUsedAttributes: (html: string, candidates: DynamicContentCandidate[]) => void;
3
6
  /**
4
7
  * Repairs dropped/copied saved modules (items currency, linkless legacy unsubscribe → text block,
5
8
  * dynamic-content labels → tokens) in one write-back; wired via Stripo's `onModuleAdd` (see `useStripo`).
6
9
  */
7
10
  export declare const useModuleRepair: () => {
8
11
  handleModuleAdd: (data: ModuleAddData, modifier: ModuleModifier) => void;
12
+ convertDynamicContent: (html: string) => DynamicContentConversionResult & {
13
+ candidates: DynamicContentCandidate[];
14
+ };
9
15
  };
@@ -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, 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>) => 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
@@ -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
+ };