@useinsider/guido 3.20.1-beta.2c8da49 → 3.20.1-beta.2d09f29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/composables/useActionsApi.js +64 -80
  2. package/dist/composables/useFullStoryBridge.js +10 -9
  3. package/dist/composables/useGuidoStateBridge.js +3 -3
  4. package/dist/composables/useLegacyStrategyConversion.js +16 -16
  5. package/dist/composables/useStripo.js +10 -11
  6. package/dist/config/migrator/fullStoryScriptMigrator.js +5 -0
  7. package/dist/config/migrator/index.js +11 -10
  8. package/dist/extensions/Blocks/Items/block.js +42 -43
  9. package/dist/extensions/Blocks/Recommendation/block.js +29 -33
  10. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +83 -78
  11. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +2 -1
  12. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +12 -2
  13. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +86 -104
  14. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +263 -348
  15. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +50 -48
  16. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +21 -16
  17. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +40 -44
  18. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +19 -14
  19. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +102 -104
  20. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +23 -18
  21. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +286 -312
  22. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +20 -24
  23. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +7 -6
  24. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +8 -8
  25. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +151 -113
  26. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +205 -219
  27. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +1 -1
  28. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +40 -111
  29. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +35 -31
  30. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +192 -271
  31. package/dist/package.json.js +1 -1
  32. package/dist/src/composables/useActionsApi.d.ts +1 -5
  33. package/dist/src/config/migrator/fullStoryScriptMigrator.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +0 -1
  35. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +0 -8
  36. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +0 -40
  37. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +0 -1
  38. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  39. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +0 -1
  40. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +0 -11
  41. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +6 -3
  42. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +0 -7
  43. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +0 -2
  44. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +5 -5
  45. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +12 -21
  46. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +3 -6
  47. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +5 -6
  48. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +3 -6
  49. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -21
  50. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +13 -19
  51. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +0 -7
  52. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +0 -7
  53. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +0 -7
  54. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +0 -7
  55. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +0 -7
  56. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +8 -10
  57. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +5 -9
  58. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +0 -7
  59. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -8
  60. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +11 -18
  61. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +0 -1
  62. package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -22
  63. package/dist/src/stores/editor.d.ts +1 -3
  64. package/dist/src/utils/fullStoryScripts.d.ts +6 -0
  65. package/dist/static/styles/components/button.css.js +0 -5
  66. package/dist/stores/editor.js +0 -5
  67. package/dist/utils/fullStoryScripts.js +8 -0
  68. package/package.json +3 -3
  69. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +0 -28
  70. package/dist/extensions/Blocks/Recommendation/utils/currencySettings.js +0 -25
  71. package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +0 -17
  72. package/dist/src/extensions/Blocks/Recommendation/utils/currencySettings.d.ts +0 -6
@@ -1,41 +1,25 @@
1
- import { flushPendingNodeConfigWrites as P } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
2
- import { useEditorStore as H } from "../stores/editor.js";
3
- import { filterAmpErrors as _ } from "../utils/ampErrorFilter.js";
4
- import { getEditorApi as c } from "../utils/stripoEditorApi.js";
5
- import { watch as F } from "vue";
6
- import { useToaster as M } from "./useToaster.js";
7
- const O = 1e4, C = 3e4, L = 1e3, T = (i, n, r) => new Promise((s, l) => {
8
- const p = setTimeout(
9
- () => l(new Error(`${i} did not report completion within ${n}ms`)),
10
- n
11
- ), f = (d) => (S) => {
12
- clearTimeout(p), d(S);
13
- }, g = f(l);
1
+ import { filterAmpErrors as v } from "../utils/ampErrorFilter.js";
2
+ import { stripFullStoryScripts as h } from "../utils/fullStoryScripts.js";
3
+ import { getEditorApi as r } from "../utils/stripoEditorApi.js";
4
+ import { useToaster as D } from "./useToaster.js";
5
+ const H = 1e4, T = 3e4, m = (n, l, A) => new Promise((C, p) => {
6
+ const f = setTimeout(
7
+ () => p(new Error(`${n} did not report completion within ${l}ms`)),
8
+ l
9
+ ), c = (t) => (e) => {
10
+ clearTimeout(f), t(e);
11
+ }, d = c(p);
14
12
  try {
15
- r(f(s), g);
16
- } catch (d) {
17
- g(d);
13
+ A(c(C), d);
14
+ } catch (t) {
15
+ d(t);
18
16
  }
19
- });
20
- let A = Promise.resolve();
21
- const h = () => {
22
- const i = H(), n = i.changeSeq + P();
23
- return i.changeSeq >= n || (A = new Promise((r) => {
24
- let s = () => {
25
- };
26
- const l = setTimeout(() => {
27
- s(), r();
28
- }, L);
29
- s = F(() => i.changeSeq, (p) => {
30
- p >= n && (clearTimeout(l), s(), r());
31
- });
32
- })), A;
33
- }, z = () => {
34
- const { handleError: i } = M(), n = (t) => T(
17
+ }), _ = () => {
18
+ const { handleError: n } = D(), l = (t = {}) => m(
35
19
  "compileEmail",
36
- C,
37
- (e, o) => {
38
- const m = { ...{
20
+ T,
21
+ (e, i) => {
22
+ const o = { ...{
39
23
  minimize: !0,
40
24
  utmEntity: {
41
25
  utmSource: "",
@@ -54,56 +38,56 @@ const h = () => {
54
38
  forceAmp: !1,
55
39
  resetDataSavedFlag: !1,
56
40
  disableLineHeightsReplace: !0
57
- }, ...t }, E = {
58
- callback: (u, y, v, D, I) => {
59
- u ? o(u) : e({
60
- html: y,
61
- ampHtml: v,
62
- ampErrors: _(D ?? []),
63
- displayConditions: I
41
+ }, ...t }, u = {
42
+ callback: (s, g, w, S, y) => {
43
+ s ? i(s) : e({
44
+ html: g,
45
+ ampHtml: w,
46
+ ampErrors: v(S ?? []),
47
+ displayConditions: y
64
48
  });
65
49
  },
66
- ...m
50
+ ...o
67
51
  };
68
- c().actionsApi.compileEmail(E);
69
- }
70
- ), r = async (t = {}) => (await h(), n(t)), s = () => T(
71
- "getTemplateData",
72
- C,
73
- (t) => {
74
- const e = ({ html: o, css: a, width: m, height: w, utmParams: E, syncModulesIds: u }) => t({
75
- html: o,
76
- css: a,
77
- width: m,
78
- height: w,
79
- utmParams: E,
80
- syncModulesIds: u
81
- });
82
- c().actionsApi.getTemplateData(e);
52
+ r().actionsApi.compileEmail(u);
83
53
  }
84
54
  );
85
55
  return {
86
- getCompiledEmail: r,
87
- getTemplateData: async ({ flushPendingEdits: t = !0 } = {}) => (t && await h(), s()),
56
+ getCompiledEmail: l,
57
+ getTemplateData: () => m(
58
+ "getTemplateData",
59
+ T,
60
+ (t) => {
61
+ const e = ({ html: i, css: a, width: o, height: E, utmParams: u, syncModulesIds: s }) => t({
62
+ html: h(i),
63
+ css: a,
64
+ width: o,
65
+ height: E,
66
+ utmParams: u,
67
+ syncModulesIds: s
68
+ });
69
+ r().actionsApi.getTemplateData(e);
70
+ }
71
+ ),
88
72
  activateCustomViewStyles: (t = !0) => {
89
- c().actionsApi.activateCustomViewStyles(t);
73
+ r().actionsApi.activateCustomViewStyles(t);
90
74
  },
91
75
  getPreviewData: async (t) => {
92
76
  try {
93
77
  const {
94
78
  html: e,
95
- displayConditions: o,
79
+ displayConditions: i,
96
80
  ampHtml: a = "",
97
- ampErrors: m = []
98
- } = await r({ minimize: !1, resetDataSavedFlag: !1, ...t });
81
+ ampErrors: o = []
82
+ } = await l({ minimize: !1, resetDataSavedFlag: !1, ...t });
99
83
  return {
100
84
  html: e,
101
85
  ampHtml: a,
102
- ampErrors: m,
103
- displayConditions: o
86
+ ampErrors: o,
87
+ displayConditions: i
104
88
  };
105
89
  } catch (e) {
106
- return i(e, "Error loading preview"), {
90
+ return n(e, "Error loading preview"), {
107
91
  html: "",
108
92
  ampHtml: "",
109
93
  ampErrors: [],
@@ -112,32 +96,32 @@ const h = () => {
112
96
  }
113
97
  },
114
98
  updateTimerInClonedTemplate: () => new Promise((t) => {
115
- var e, o;
116
- if (typeof ((o = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : o.updateTimerInClonedTemplate) != "function") {
99
+ var e, i;
100
+ if (typeof ((i = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : i.updateTimerInClonedTemplate) != "function") {
117
101
  t(null);
118
102
  return;
119
103
  }
120
104
  try {
121
- window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, m) => {
122
- a ? (i(a, "Failed to update timer in cloned template"), t(null)) : t(m || null);
105
+ window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, o) => {
106
+ a ? (n(a, "Failed to update timer in cloned template"), t(null)) : t(o || null);
123
107
  });
124
108
  } catch (a) {
125
- i(a, "Failed to call updateTimerInClonedTemplate"), t(null);
109
+ n(a, "Failed to call updateTimerInClonedTemplate"), t(null);
126
110
  }
127
111
  }),
128
112
  updateHtmlAndCss: (t, e) => {
129
- const { actionsApi: o } = c();
130
- return T("updateHtmlAndCss", O, (a) => {
131
- o.updateHtmlAndCss(t, e, () => a());
113
+ const { actionsApi: i } = r();
114
+ return m("updateHtmlAndCss", H, (a) => {
115
+ i.updateHtmlAndCss(t, e, () => a());
132
116
  });
133
117
  },
134
- editorSave: () => T(
118
+ editorSave: () => m(
135
119
  "save",
136
- C,
120
+ T,
137
121
  (t) => {
138
- c().actionsApi.save((e) => {
122
+ r().actionsApi.save((e) => {
139
123
  if (e) {
140
- i(e, "Failed to save template"), t(!1);
124
+ n(e, "Failed to save template"), t(!1);
141
125
  return;
142
126
  }
143
127
  t(!0);
@@ -147,5 +131,5 @@ const h = () => {
147
131
  };
148
132
  };
149
133
  export {
150
- z as useActionsApi
134
+ _ as useActionsApi
151
135
  };
@@ -1,14 +1,15 @@
1
- const c = "https://email-static.useinsider.com/guido/guido-fs.js", u = () => ({ injectFullStory: () => {
2
- var n;
3
- const s = window;
4
- if (typeof s._fs_org != "string" || !s._fs_org)
1
+ import { FULLSTORY_BRIDGE_SCRIPT_URL as s } from "../utils/fullStoryScripts.js";
2
+ const l = () => ({ injectFullStory: () => {
3
+ var c;
4
+ const n = window;
5
+ if (typeof n._fs_org != "string" || !n._fs_org)
5
6
  return;
6
- const r = document.querySelector("ui-editor"), o = (n = r == null ? void 0 : r.shadowRoot) == null ? void 0 : n.querySelector("iframe"), e = o == null ? void 0 : o.contentDocument;
7
- if (!e || e.querySelector('script[data-fullstory-bridge="true"]'))
7
+ const e = document.querySelector("ui-editor"), o = (c = e == null ? void 0 : e.shadowRoot) == null ? void 0 : c.querySelector("iframe"), r = o == null ? void 0 : o.contentDocument;
8
+ if (!r || r.querySelector('script[data-fullstory-bridge="true"]'))
8
9
  return;
9
- const t = e.createElement("script");
10
- t.src = c, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", e.head.appendChild(t);
10
+ const t = r.createElement("script");
11
+ t.src = s, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", r.head.appendChild(t);
11
12
  } });
12
13
  export {
13
- u as useFullStoryBridge
14
+ l as useFullStoryBridge
14
15
  };
@@ -5,7 +5,7 @@ import { useEditorStore as w } from "../stores/editor.js";
5
5
  import { useGuidoEmailEditorStore as y } from "../stores/guido-email-editor.js";
6
6
  import { watch as c, onUnmounted as z } from "vue";
7
7
  const B = 500, G = () => {
8
- const i = w(), d = y(), l = T(), { getTemplateData: u } = v(), { runExclusive: m, isEditorBusy: p } = C();
8
+ const i = w(), u = y(), d = T(), { getTemplateData: l } = v(), { runExclusive: m, isEditorBusy: p } = C();
9
9
  let o = null, n = !1;
10
10
  const r = () => {
11
11
  o && (clearTimeout(o), o = null);
@@ -21,10 +21,10 @@ const B = 500, G = () => {
21
21
  return;
22
22
  }
23
23
  try {
24
- const { html: E, css: I } = await m(() => u({ flushPendingEdits: !1 })), b = ((s = (t = l.config) == null ? void 0 : t.identity) == null ? void 0 : s.templateId) ?? "";
24
+ const { html: E, css: I } = await m(l), b = ((s = (t = d.config) == null ? void 0 : t.identity) == null ? void 0 : s.templateId) ?? "";
25
25
  if (n)
26
26
  return;
27
- d.$patch({
27
+ u.$patch({
28
28
  html: E ?? "",
29
29
  css: I ?? "",
30
30
  templateId: b,
@@ -1,34 +1,34 @@
1
- import { useRecommendation as S } from "./useRecommendation.js";
1
+ import { useRecommendation as C } from "./useRecommendation.js";
2
2
  import { useToaster as I } from "./useToaster.js";
3
3
  import { useTranslations as v } from "./useTranslations.js";
4
4
  import { ToasterTypeOptions as g } from "../enums/toaster.js";
5
5
  import "../extensions/Blocks/Recommendation/constants/selectors.js";
6
6
  import { CURRENT_CONFIG_VERSION as L } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
7
- import { useRecommendationExtensionStore as R } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
- import { resolveMigrationTarget as b, buildLegacyMigrationPayload as k } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
7
+ import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
+ import { resolveMigrationTarget as k, buildLegacyMigrationPayload as R } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
9
9
  import { commitBlockChangeOutsidePanel as T } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
10
10
  import { useConfigStore as h } from "../stores/config.js";
11
11
  const F = () => {
12
- const e = R(), o = h(), { buildCampaignUrl: m } = S(), { showToaster: c } = I(), a = v();
12
+ const e = b(), r = h(), { buildCampaignUrl: m } = C(), { showToaster: c } = I(), a = v();
13
13
  return { convertLegacyStrategy: async () => {
14
14
  const t = e.currentRecommendationId;
15
15
  if (t === null || !e.isLegacyStrategyBlock || e.legacyConversionLoading)
16
16
  return "";
17
- const { strategy: d, productIds: y, size: l, strategyId: p, nodeConfigVersion: u } = e.recommendationConfigs, f = { strategyId: p, size: l, nodeConfigVersion: u }, s = b({
18
- campaignId: o.campaignId,
19
- templateLibraryId: o.templateLibraryId
20
- }), C = k({
17
+ const { strategy: d, productIds: y, size: l, strategyId: p, nodeConfigVersion: u } = e.recommendationConfigs, f = { strategyId: p, size: l, nodeConfigVersion: u }, s = k({
18
+ campaignId: r.campaignId,
19
+ templateLibraryId: r.templateLibraryId
20
+ }), S = R({
21
21
  blockId: t,
22
22
  url: m(String(t)),
23
- campaignId: o.campaignId,
24
- variationId: o.variationId,
23
+ campaignId: r.campaignId,
24
+ variationId: r.variationId,
25
25
  strategy: d,
26
26
  productIds: y,
27
27
  target: s
28
28
  });
29
- let r;
29
+ let o;
30
30
  try {
31
- r = await e.convertLegacyStrategy(C, s);
31
+ o = await e.convertLegacyStrategy(S, s);
32
32
  } catch (i) {
33
33
  return console.error("[useLegacyStrategyConversion] migration failed", i), c({
34
34
  type: g.Error,
@@ -40,7 +40,7 @@ const F = () => {
40
40
  }), "";
41
41
  }
42
42
  try {
43
- await e.fetchRecommendationProductsForBlock(t);
43
+ await e.fetchStrategyProductsForBlock(t);
44
44
  } catch (i) {
45
45
  console.error("[useLegacyStrategyConversion] product refetch failed", i);
46
46
  }
@@ -48,16 +48,16 @@ const F = () => {
48
48
  return n ? T(
49
49
  t,
50
50
  {
51
- strategyId: r,
51
+ strategyId: o,
52
52
  size: n.recommendationConfigs.size,
53
53
  configVersion: L
54
54
  },
55
55
  n.recommendationProducts,
56
56
  "Converted legacy recommendation strategy"
57
- ) ? (e.currentRecommendationId === t && e.openLegacyStrategyUpdatedModal(), r) : (console.error("[useLegacyStrategyConversion] node write failed", t), e.revertLegacyConversion(t, f), c({
57
+ ) ? (e.currentRecommendationId === t && e.openLegacyStrategyUpdatedModal(), o) : (console.error("[useLegacyStrategyConversion] node write failed", t), e.revertLegacyConversion(t, f), c({
58
58
  type: g.Error,
59
59
  message: a("email-editor.legacy-strategy-update-failed")
60
- }), "") : r;
60
+ }), "") : o;
61
61
  } };
62
62
  };
63
63
  export {
@@ -1,5 +1,5 @@
1
- import { useActionsApi as O } from "./useActionsApi.js";
2
- import { useBlocksConfig as q } from "./useBlocksConfig.js";
1
+ import { useActionsApi as L } from "./useActionsApi.js";
2
+ import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
3
  import { useConfig as H } from "./useConfig.js";
4
4
  import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
5
5
  import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
@@ -17,7 +17,7 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
17
17
  import Z from "../package.json.js";
18
18
  let n = null;
19
19
  const he = () => {
20
- const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = q(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
20
+ const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
21
21
  var d;
22
22
  if (document.getElementById("UiEditorScript")) {
23
23
  r();
@@ -31,13 +31,13 @@ const he = () => {
31
31
  n = null;
32
32
  }), n), D = async (r, s, o, a = [], i = !1) => {
33
33
  var y, E, h, C;
34
- const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), x = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
34
+ const e = k(), { html: d, css: R } = r, { baseBlocks: g, extensions: P } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
35
35
  w().importCss(), await window.UIEditor.initEditor(
36
36
  document.querySelector("#guido-editor"),
37
37
  {
38
38
  metadata: s,
39
39
  html: d,
40
- css: P,
40
+ css: R,
41
41
  forceRecreate: I,
42
42
  locale: "en",
43
43
  undoButtonSelector: "#guido__undo-button",
@@ -60,10 +60,9 @@ const he = () => {
60
60
  keepModuleStylesEnabled: !0,
61
61
  displayTitle: !1,
62
62
  displayUTM: !1,
63
- copyPasteEnabled: !1,
64
63
  selectElementAfterDrop: !0,
65
64
  sameFontSizeForOutlook: !0,
66
- allowedScriptSourceDomains: x,
65
+ allowedScriptSourceDomains: q,
67
66
  ...g ? { baseBlocks: g } : {},
68
67
  editorFonts: {
69
68
  showDefaultStandardFonts: !0,
@@ -89,8 +88,8 @@ const he = () => {
89
88
  },
90
89
  onTemplateLoaded() {
91
90
  try {
92
- const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = O(), { injectFullStory: L } = N();
93
- w().importCss(), t(), L(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
91
+ const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = L(), { injectFullStory: x } = N();
92
+ w().importCss(), t(), x(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
94
93
  e.hasChanges = !1;
95
94
  }, 1e3);
96
95
  } catch (t) {
@@ -107,7 +106,7 @@ const he = () => {
107
106
  e.isVersionHistoryOpen = t;
108
107
  },
109
108
  onDataChanged() {
110
- e.markChanged();
109
+ e.hasChanges = !0, e.changeSeq += 1;
111
110
  },
112
111
  onEvent: F,
113
112
  onModuleAdd: A,
@@ -121,7 +120,7 @@ const he = () => {
121
120
  ".in-modal-v2-wrapper",
122
121
  ".in-toasts-wrapper"
123
122
  ],
124
- extensions: R,
123
+ extensions: P,
125
124
  localePatch: J
126
125
  }
127
126
  );
@@ -0,0 +1,5 @@
1
+ import { stripFullStoryScripts as t } from "../../utils/fullStoryScripts.js";
2
+ const i = (r) => t(r);
3
+ export {
4
+ i as migrateFullStoryScripts
5
+ };
@@ -1,16 +1,17 @@
1
1
  import { migrateCheckbox as i } from "./checkboxMigrator.js";
2
2
  import { migrateCouponBlock as e } from "./couponBlockMigrator.js";
3
- import { migrateItemsBlock as a } from "./itemsBlockMigrator.js";
4
- import { migrateProductNameLink as n } from "./productNameLinkMigrator.js";
5
- import { migrateRadioButton as c } from "./radioButtonMigrator.js";
6
- import { migrateRecommendation as g } from "./recommendationMigrator.js";
3
+ import { migrateFullStoryScripts as a } from "./fullStoryScriptMigrator.js";
4
+ import { migrateItemsBlock as n } from "./itemsBlockMigrator.js";
5
+ import { migrateProductNameLink as c } from "./productNameLinkMigrator.js";
6
+ import { migrateRadioButton as g } from "./radioButtonMigrator.js";
7
+ import { migrateRecommendation as p } from "./recommendationMigrator.js";
7
8
  import { migrateRecommendationPartnerScope as f } from "./recommendationPartnerMigrator.js";
8
- import { migrateRecommendationTitle as p } from "./recommendationTitleMigrator.js";
9
- import { migrateSocialIcons as d } from "./socialIconMigrator.js";
10
- import { migrateUnsubscribe as l } from "./unsubscribeMigrator.js";
11
- const h = async (r, t = {}, o) => {
12
- let m = r;
13
- return m = i(m), m = c(m), m = await l(m), m = e(m), m = g(m, t), o && (m = f(m, o)), m = p(m), m = a(m), m = n(m), m = d(m), m;
9
+ import { migrateRecommendationTitle as l } from "./recommendationTitleMigrator.js";
10
+ import { migrateSocialIcons as s } from "./socialIconMigrator.js";
11
+ import { migrateUnsubscribe as d } from "./unsubscribeMigrator.js";
12
+ const h = async (o, t = {}, r) => {
13
+ let m = o;
14
+ return m = i(m), m = g(m), m = await d(m), m = e(m), m = p(m, t), r && (m = f(m, r)), m = l(m), m = n(m), m = c(m), m = s(m), m = a(m), m;
14
15
  };
15
16
  export {
16
17
  h as migrate
@@ -1,6 +1,6 @@
1
1
  var k = Object.defineProperty;
2
- var S = (d, l, t) => l in d ? k(d, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[l] = t;
3
- var g = (d, l, t) => S(d, typeof l != "symbol" ? l + "" : l, t);
2
+ var S = (d, l, e) => l in d ? k(d, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[l] = e;
3
+ var g = (d, l, e) => S(d, typeof l != "symbol" ? l + "" : l, e);
4
4
  import { BlockId as D } from "../../../enums/block.js";
5
5
  import { useOnboardingStore as T } from "../../../stores/onboarding.js";
6
6
  import { getMigrationBannerHtml as N } from "../../../utils/migrationBannerHtml.js";
@@ -58,15 +58,15 @@ class $ extends H {
58
58
  canBeSavedAsModule() {
59
59
  return !0;
60
60
  }
61
- onCreated(t) {
62
- const e = this.api.getDocumentModifier(), c = this.api.getDocumentRootCssNode();
63
- c.querySelector('[product-attr="imageSrc"] img') || e.modifyCss(c).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
64
- const r = _(t);
61
+ onCreated(e) {
62
+ const t = this.api.getDocumentModifier(), c = this.api.getDocumentRootCssNode();
63
+ c.querySelector('[product-attr="imageSrc"] img') || t.modifyCss(c).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
64
+ const r = _(e);
65
65
  if (!r)
66
66
  return;
67
- const o = r.getNodeConfig(), n = o && Object.keys(o).length > 0, i = C(t);
67
+ const o = r.getNodeConfig(), s = o && Object.keys(o).length > 0, i = C(e);
68
68
  if (i != null && i.initialized) {
69
- if (!n) {
69
+ if (!s) {
70
70
  const a = this.api.getDocumentModifier();
71
71
  a.modifyHtml(r).setNodeConfig(i), this._stampProductTdDomAttributes(r, i, a), this._healCollapsedWidths(r, a), this._shouldReconcileCurrency(i) && this._reconcileCurrencyDomAttributes(r, i, a), a.apply(new u("Migrate legacy config to nodeConfig")), this._markCurrencyHealed(i.blockInstanceId);
72
72
  return;
@@ -76,9 +76,9 @@ class $ extends H {
76
76
  I.modifyHtml(r).setNodeConfig(a), this._stampProductTdDomAttributes(r, a, I, !0), I.apply(new u("Initialize Items block with default configuration")), T().startOnboarding("itemsOnboarding");
77
77
  return;
78
78
  }
79
- const s = this._resolveInstanceId(i.blockInstanceId), f = this.api.getDocumentModifier();
79
+ const n = this._resolveInstanceId(i.blockInstanceId), f = this.api.getDocumentModifier();
80
80
  let h = !1;
81
- s !== i.blockInstanceId && (f.modifyHtml(r).setNodeConfig({ ...i, blockInstanceId: s }), h = !0), !this._currencyHealed.has(s) && this._reconcileCurrencyDomAttributes(r, i, f) && (h = !0), this._healCollapsedWidths(r, f) && (h = !0), h && f.apply(new u("Assign Items block instance ID and reconcile currency")), this._markCurrencyHealed(s);
81
+ n !== i.blockInstanceId && (f.modifyHtml(r).setNodeConfig({ ...i, blockInstanceId: n }), h = !0), !this._currencyHealed.has(n) && this._reconcileCurrencyDomAttributes(r, i, f) && (h = !0), this._healCollapsedWidths(r, f) && (h = !0), h && f.apply(new u("Assign Items block instance ID and reconcile currency")), this._markCurrencyHealed(n);
82
82
  }
83
83
  /**
84
84
  * Re-seeds nodeConfig from the persisted esd-ext-config when a saved module
@@ -86,24 +86,24 @@ class $ extends H {
86
86
  * into nodeConfig, so without this a reused module would reset to defaults.
87
87
  * Guarded to the nodeConfig-empty case so it runs once and never loops.
88
88
  */
89
- onDocumentChanged(t) {
90
- const e = _(t);
91
- if (!e)
89
+ onDocumentChanged(e) {
90
+ const t = _(e);
91
+ if (!t)
92
92
  return;
93
- const c = e.getNodeConfig();
93
+ const c = t.getNodeConfig();
94
94
  if (c && Object.keys(c).length > 0) {
95
- const i = C(t);
95
+ const i = C(e);
96
96
  if (i != null && i.initialized && this._shouldReconcileCurrency(i)) {
97
- const s = this.api.getDocumentModifier();
98
- this._reconcileCurrencyDomAttributes(e, i, s) && s.apply(new u(V)), this._markCurrencyHealed(i.blockInstanceId);
97
+ const n = this.api.getDocumentModifier();
98
+ this._reconcileCurrencyDomAttributes(t, i, n) && n.apply(new u(V)), this._markCurrencyHealed(i.blockInstanceId);
99
99
  }
100
100
  return;
101
101
  }
102
- const o = C(t);
102
+ const o = C(e);
103
103
  if (!(o != null && o.initialized))
104
104
  return;
105
- const n = this.api.getDocumentModifier();
106
- n.modifyHtml(e).setNodeConfig(o), this._stampProductTdDomAttributes(e, o, n), this._healCollapsedWidths(e, n), this._shouldReconcileCurrency(o) && this._reconcileCurrencyDomAttributes(e, o, n), n.apply(new u("Recover Items block config from saved module")), this._markCurrencyHealed(o.blockInstanceId);
105
+ const s = this.api.getDocumentModifier();
106
+ s.modifyHtml(t).setNodeConfig(o), this._stampProductTdDomAttributes(t, o, s), this._healCollapsedWidths(t, s), this._shouldReconcileCurrency(o) && this._reconcileCurrencyDomAttributes(t, o, s), s.apply(new u("Recover Items block config from saved module")), this._markCurrencyHealed(o.blockInstanceId);
107
107
  }
108
108
  /**
109
109
  * Bakes the compiler-read DOM attributes (`data-type`, `data-number`, `data-nodup`) onto the
@@ -113,21 +113,20 @@ class $ extends H {
113
113
  * restored before export. The name `<a>` carries no data-type/data-number of its own and
114
114
  * relies on this td-level fallback in pairProductVariables.
115
115
  */
116
- _stampProductTdDomAttributes(t, e, c, r = !1) {
117
- const o = B(e.itemsSelectValue, e.type), n = (i, s) => {
118
- r && t.getAttribute(i) || c.modifyHtml(t).setAttribute(i, s);
116
+ _stampProductTdDomAttributes(e, t, c, r = !1) {
117
+ const o = B(t.itemsSelectValue, t.type), s = (i, n) => {
118
+ r && e.getAttribute(i) || c.modifyHtml(e).setAttribute(i, n);
119
119
  };
120
- n("data-type", e.type), n("data-number", o), n("data-nodup", String(e.priceHideDiscount));
120
+ s("data-type", t.type), s("data-number", o), s("data-nodup", String(t.priceHideDiscount));
121
121
  }
122
122
  /**
123
123
  * Repairs a saved module's collapsed card into the state the load migrator produces. Acts only
124
124
  * on a zero width, so Stripo's non-zero drop-time width never triggers it and a healed block no-ops.
125
125
  */
126
- _healCollapsedWidths(t, e) {
127
- const r = t.querySelectorAll(M).filter((o) => m(o.getAttribute("width")) || m(o.getStyle("width")));
128
- return !m(t.getAttribute("width")) && !r.length ? !1 : (t.hasClass("esd-container-frame") && e.modifyHtml(t).removeClass("esd-container-frame"), t.getAttribute("width") !== null && e.modifyHtml(t).removeAttribute("width"), r.forEach((o) => {
129
- const n = o.getAttribute("width");
130
- (n === null || m(n)) && e.modifyHtml(o).setAttribute("width", "100%"), m(o.getStyle("width")) && e.modifyHtml(o).setStyle("width", "100%");
126
+ _healCollapsedWidths(e, t) {
127
+ const r = e.querySelectorAll(M).filter((o) => m(o.getAttribute("width")) || m(o.getStyle("width")));
128
+ return !m(e.getAttribute("width")) && !r.length ? !1 : (e.hasClass("esd-container-frame") && t.modifyHtml(e).removeClass("esd-container-frame"), e.getAttribute("width") !== null && t.modifyHtml(e).removeAttribute("width"), r.forEach((o) => {
129
+ m(o.getAttribute("width")) && t.modifyHtml(o).setAttribute("width", "100%"), m(o.getStyle("width")) && t.modifyHtml(o).setStyle("width", "100%");
131
130
  }), !0);
132
131
  }
133
132
  /**
@@ -138,12 +137,12 @@ class $ extends H {
138
137
  * the symbol write alone is skipped for the 'USD' sentinel — so we must NOT gate the whole pass
139
138
  * on symbol customization here, or a default-symbol block with a toggled location never heals.
140
139
  */
141
- _shouldReconcileCurrency(t) {
142
- return !t.blockInstanceId || !this._currencyHealed.has(t.blockInstanceId);
140
+ _shouldReconcileCurrency(e) {
141
+ return !e.blockInstanceId || !this._currencyHealed.has(e.blockInstanceId);
143
142
  }
144
143
  /** Marks a block instance's currency as reconciled so it is not healed again (undo-safe). */
145
- _markCurrencyHealed(t) {
146
- t && this._currencyHealed.add(t);
144
+ _markCurrencyHealed(e) {
145
+ e && this._currencyHealed.add(e);
147
146
  }
148
147
  /**
149
148
  * Resolves the id for a just-created block to one that is unique per live instance.
@@ -152,13 +151,13 @@ class $ extends H {
152
151
  * currency heal guard and settings-panel switch detection. Mint a fresh id on absence
153
152
  * or collision, otherwise keep the existing one. Registers the result as claimed.
154
153
  */
155
- _resolveInstanceId(t) {
156
- let e = t;
157
- if (!e || this._seenInstanceIds.has(e))
154
+ _resolveInstanceId(e) {
155
+ let t = e;
156
+ if (!t || this._seenInstanceIds.has(t))
158
157
  do
159
- e = P();
160
- while (this._seenInstanceIds.has(e));
161
- return this._seenInstanceIds.add(e), e;
158
+ t = P();
159
+ while (this._seenInstanceIds.has(t));
160
+ return this._seenInstanceIds.add(t), t;
162
161
  }
163
162
  /**
164
163
  * Stamps the export-read currency attrs onto every price `<p>` from config, so a template whose
@@ -171,11 +170,11 @@ class $ extends H {
171
170
  * Returns true only when an attr actually changed, so the caller can skip an empty apply that
172
171
  * would otherwise re-trigger onDocumentChanged and loop.
173
172
  */
174
- _reconcileCurrencyDomAttributes(t, e, c) {
175
- const { position: r, symbol: o } = w(e), n = t.querySelectorAll(`.${E.PRICE} p`);
173
+ _reconcileCurrencyDomAttributes(e, t, c) {
174
+ const { position: r, symbol: o } = w(t), s = e.querySelectorAll(`.${E.PRICE} p`);
176
175
  let i = !1;
177
- return n.forEach((s) => {
178
- r !== void 0 && s.getAttribute(y.POSITION) !== r && (c.modifyHtml(s).setAttribute(y.POSITION, r), i = !0), o !== void 0 && s.getAttribute(y.SYMBOL) !== o && (c.modifyHtml(s).setAttribute(y.SYMBOL, o), i = !0);
176
+ return s.forEach((n) => {
177
+ r !== void 0 && n.getAttribute(y.POSITION) !== r && (c.modifyHtml(n).setAttribute(y.POSITION, r), i = !0), o !== void 0 && n.getAttribute(y.SYMBOL) !== o && (c.modifyHtml(n).setAttribute(y.SYMBOL, o), i = !0);
179
178
  }), i;
180
179
  }
181
180
  }