@useinsider/guido 2.1.0-beta.a720424 → 2.1.0-beta.acbfaec

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 (54) hide show
  1. package/README.md +45 -0
  2. package/dist/@types/config/schemas.js +58 -54
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +71 -60
  5. package/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
  6. package/dist/composables/useActionsApi.js +15 -13
  7. package/dist/composables/useBlocksConfig.js +29 -20
  8. package/dist/config/migrator/itemsBlockMigrator.js +140 -123
  9. package/dist/enums/defaults.js +9 -4
  10. package/dist/extensions/Blocks/Items/block.js +19 -28
  11. package/dist/extensions/Blocks/Items/controls/button/link.js +19 -31
  12. package/dist/extensions/Blocks/Items/controls/cardComposition.js +124 -85
  13. package/dist/extensions/Blocks/Items/controls/image/link.js +19 -31
  14. package/dist/extensions/Blocks/Items/controls/name/trimming.js +28 -40
  15. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +35 -47
  16. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +49 -54
  17. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +42 -51
  18. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +23 -36
  19. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +45 -57
  20. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -60
  21. package/dist/extensions/Blocks/Items/controls/settingsControl.js +189 -196
  22. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +0 -2
  23. package/dist/extensions/Blocks/Items/extension.js +8 -9
  24. package/dist/extensions/Blocks/Items/settingsPanel.js +10 -15
  25. package/dist/extensions/Blocks/Items/template.js +181 -175
  26. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +65 -65
  27. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +3 -3
  28. package/dist/extensions/Blocks/common-control.js +91 -92
  29. package/dist/extensions/ModulesTabIcons/extension.js +16 -0
  30. package/dist/guido.css +1 -1
  31. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +163 -95
  32. package/dist/package.json.js +1 -1
  33. package/dist/src/@types/config/schemas.d.ts +8 -0
  34. package/dist/src/composables/useConfig.d.ts +4 -0
  35. package/dist/src/enums/defaults.d.ts +5 -0
  36. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -1
  37. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -1
  38. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +5 -5
  39. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -1
  40. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +0 -1
  41. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +0 -1
  42. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -1
  43. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +0 -1
  44. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +0 -1
  45. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -1
  46. package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +0 -5
  47. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +10 -12
  48. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +2 -1
  49. package/dist/src/extensions/Blocks/common-control.d.ts +4 -5
  50. package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
  51. package/dist/src/stores/config.d.ts +36 -0
  52. package/package.json +2 -2
  53. package/dist/extensions/Blocks/Items/store/items-block.js +0 -79
  54. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -45
package/README.md CHANGED
@@ -122,6 +122,8 @@ const config: GuidoConfigInput = {
122
122
  senderName?: string,
123
123
  subject?: string,
124
124
  },
125
+ savedModulesFolderName?: string, // Default: 'savedModules' → sent as guido_{partnerName}_{value}
126
+ defaultModulesFolderName?: string, // Default: 'defaultModules' → sent as guido_{value}
125
127
  },
126
128
 
127
129
  // Optional: UI settings
@@ -141,6 +143,11 @@ const config: GuidoConfigInput = {
141
143
  modulesDisabled?: boolean, // Default: false - Disable modules panel
142
144
  },
143
145
 
146
+ // Optional: Callbacks
147
+ callbacks?: {
148
+ externalValidation?: (data: SavedTemplateDetails) => Promise<boolean>, // Return false to cancel save
149
+ },
150
+
144
151
  // Optional: Block configuration
145
152
  blocks?: {
146
153
  excludeDefaults?: DefaultBlockType[],
@@ -251,6 +258,44 @@ const config: GuidoConfigInput = {
251
258
 
252
259
  ---
253
260
 
261
+ ## Module Folder Configuration
262
+
263
+ Customize the Stripo module folder names for saved and default modules:
264
+
265
+ ```typescript
266
+ const config: GuidoConfigInput = {
267
+ identity: { templateId: 'tpl-123', userId: 'user-456' },
268
+ partner: { name: 'acme' },
269
+ editor: {
270
+ // Custom folder for user-saved modules
271
+ // Sent to Stripo as: guido_acme_myCustomModules
272
+ savedModulesFolderName: 'myCustomModules',
273
+
274
+ // Custom folder for default/prebuilt modules
275
+ // Sent to Stripo as: guido_myPrebuilts
276
+ defaultModulesFolderName: 'myPrebuilts',
277
+ },
278
+ };
279
+ ```
280
+
281
+ ### Folder Naming Convention
282
+
283
+ | Config Option | Default Value | Stripo Folder Name |
284
+ |--------------|---------------|-------------------|
285
+ | `savedModulesFolderName` | `'savedModules'` | `guido_{partnerName}_{value}` |
286
+ | `defaultModulesFolderName` | `'defaultModules'` | `guido_{value}` |
287
+
288
+ **Examples with partner name `acme`:**
289
+
290
+ | Config Value | Result |
291
+ |--------------|--------|
292
+ | `savedModulesFolderName: 'savedModules'` (default) | `guido_acme_savedModules` |
293
+ | `savedModulesFolderName: 'v2_modules'` | `guido_acme_v2_modules` |
294
+ | `defaultModulesFolderName: 'defaultModules'` (default) | `guido_defaultModules` |
295
+ | `defaultModulesFolderName: 'prebuilts'` | `guido_prebuilts` |
296
+
297
+ ---
298
+
254
299
  ## HTML Compiler Rules
255
300
 
256
301
  Add custom rules to transform HTML during export:
@@ -1,4 +1,4 @@
1
- import { object as o, number as b, optional as e, string as t, pipe as u, picklist as n, custom as d, boolean as c, array as a, minLength as p, literal as r, variant as k } from "../../node_modules/valibot/dist/index.js";
1
+ import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, custom as b, boolean as a, array as c, minLength as d, literal as r, variant as k } from "../../node_modules/valibot/dist/index.js";
2
2
  const m = {
3
3
  /** Promotional/marketing emails */
4
4
  PROMOTIONAL: 1,
@@ -15,12 +15,12 @@ const m = {
15
15
  /** Unique identifier for the template being edited */
16
16
  templateId: u(
17
17
  t(),
18
- p(1, "templateId is required")
18
+ d(1, "templateId is required")
19
19
  ),
20
20
  /** Unique identifier for the user editing the template */
21
21
  userId: u(
22
22
  t(),
23
- p(1, "userId is required")
23
+ d(1, "userId is required")
24
24
  ),
25
25
  /** Optional variation ID for A/B testing */
26
26
  variationId: e(t())
@@ -28,7 +28,7 @@ const m = {
28
28
  /** Partner/organization name (required) */
29
29
  name: u(
30
30
  t(),
31
- p(1, "partner.name is required")
31
+ d(1, "partner.name is required")
32
32
  ),
33
33
  /** Product type identifier */
34
34
  productType: e(
@@ -60,21 +60,21 @@ const m = {
60
60
  value: t()
61
61
  })
62
62
  )
63
- }), R = o({
63
+ }), f = o({
64
64
  /** Initial HTML content */
65
65
  html: e(t(), ""),
66
66
  /** Initial CSS content */
67
67
  css: e(t(), ""),
68
68
  /** Preselected dynamic content items */
69
69
  preselectedDynamicContent: e(
70
- a(y),
70
+ c(y),
71
71
  []
72
72
  ),
73
73
  /** Selected unsubscribe page IDs */
74
- selectedUnsubscribePages: e(a(b()), []),
74
+ selectedUnsubscribePages: e(c(p()), []),
75
75
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
76
- forceRecreate: e(c(), !1)
77
- }), f = o({
76
+ forceRecreate: e(a(), !1)
77
+ }), R = o({
78
78
  /** Sender display name */
79
79
  senderName: e(t(), ""),
80
80
  /** Email subject line */
@@ -85,29 +85,33 @@ const m = {
85
85
  /** Path to translations object */
86
86
  translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
87
87
  /** Migration date for template compatibility */
88
- migrationDate: e(b(), 1759696858),
88
+ migrationDate: e(p(), 1759696858),
89
89
  /** Email header settings */
90
- emailHeader: e(f, { senderName: "", subject: "" })
90
+ emailHeader: e(R, { senderName: "", subject: "" }),
91
+ /** Custom folder name for user-saved modules (sent to Stripo as guido_{partnerName}_{savedModulesFolderName}) */
92
+ savedModulesFolderName: e(t(), "savedModules"),
93
+ /** Custom folder name for default/prebuilt modules (sent to Stripo as guido_{defaultModulesFolderName}) */
94
+ defaultModulesFolderName: e(t(), "defaultModules")
91
95
  }), I = o({
92
96
  /** Whether to show the header bar */
93
- showHeader: e(c(), !0),
97
+ showHeader: e(a(), !0),
94
98
  /** Custom label for back button (if shown) */
95
99
  backButtonLabel: e(t())
96
100
  }), T = o({
97
101
  /** Enable dynamic content insertion */
98
- dynamicContent: e(c(), !0),
102
+ dynamicContent: e(a(), !0),
99
103
  /** Enable save as template functionality */
100
- saveAsTemplate: e(c(), !0),
104
+ saveAsTemplate: e(a(), !0),
101
105
  /** Enable version history */
102
- versionHistory: e(c(), !0),
106
+ versionHistory: e(a(), !0),
103
107
  /** Enable test message sending */
104
- testMessage: e(c(), !0),
108
+ testMessage: e(a(), !0),
105
109
  /** Enable display conditions */
106
- displayConditions: e(c(), !0),
110
+ displayConditions: e(a(), !0),
107
111
  /** Enable unsubscribe block */
108
- unsubscribe: e(c(), !0),
112
+ unsubscribe: e(a(), !0),
109
113
  /** Disable modules panel in the editor */
110
- modulesDisabled: e(c(), !1)
114
+ modulesDisabled: e(a(), !1)
111
115
  }), A = n([
112
116
  "amp-accordion",
113
117
  "amp-carousel",
@@ -130,15 +134,15 @@ const m = {
130
134
  "unsubscribe-block",
131
135
  "coupon-block",
132
136
  "items-block"
133
- ]), O = o({
137
+ ]), N = o({
134
138
  /** Default blocks to exclude from the editor */
135
139
  excludeDefaults: e(
136
- a(A),
140
+ c(A),
137
141
  []
138
142
  ),
139
143
  /** Custom blocks to include in the editor */
140
144
  includeCustoms: e(
141
- a(g),
145
+ c(g),
142
146
  []
143
147
  )
144
148
  }), l = o({
@@ -147,8 +151,8 @@ const m = {
147
151
  /** Human-readable description */
148
152
  description: e(t()),
149
153
  /** Priority for rule ordering (lower = earlier) */
150
- priority: b()
151
- }), E = o({
154
+ priority: p()
155
+ }), M = o({
152
156
  ...l.entries,
153
157
  type: r("replace"),
154
158
  /** String to search for */
@@ -156,8 +160,8 @@ const m = {
156
160
  /** Replacement string */
157
161
  replacement: t(),
158
162
  /** Replace all occurrences (default: false) */
159
- replaceAll: e(c())
160
- }), N = o({
163
+ replaceAll: e(a())
164
+ }), O = o({
161
165
  ...l.entries,
162
166
  type: r("regex"),
163
167
  /** Regex pattern string */
@@ -166,36 +170,36 @@ const m = {
166
170
  replacement: t(),
167
171
  /** Regex flags (e.g., 'gi') */
168
172
  flags: e(t())
169
- }), L = o({
173
+ }), v = o({
170
174
  ...l.entries,
171
175
  type: r("remove"),
172
176
  /** Strings or patterns to remove */
173
- targets: a(t())
174
- }), v = o({
177
+ targets: c(t())
178
+ }), E = o({
175
179
  ...l.entries,
176
180
  type: r("custom"),
177
181
  /** Custom processor function */
178
- processor: d(
182
+ processor: b(
179
183
  (i) => typeof i == "function",
180
184
  "processor must be a function"
181
185
  )
182
- }), x = k("type", [
183
- E,
184
- N,
185
- L,
186
- v
187
- ]), B = o({
186
+ }), L = k("type", [
187
+ M,
188
+ O,
189
+ v,
190
+ E
191
+ ]), x = o({
188
192
  /** Custom compiler rules to apply */
189
- customRules: e(a(x), []),
193
+ customRules: e(c(L), []),
190
194
  /** Skip default compiler rules */
191
- ignoreDefaultRules: e(c(), !1)
192
- }), P = o({
195
+ ignoreDefaultRules: e(a(), !1)
196
+ }), B = o({
193
197
  /**
194
198
  * External validation handler called before save completes.
195
199
  * Return false to cancel the save operation.
196
200
  */
197
201
  externalValidation: e(
198
- d(
202
+ b(
199
203
  (i) => typeof i == "function",
200
204
  "externalValidation must be a function"
201
205
  )
@@ -208,7 +212,7 @@ const m = {
208
212
  partner: h,
209
213
  // Optional sections (with defaults)
210
214
  /** Template content and presets */
211
- template: e(R, {}),
215
+ template: e(f, {}),
212
216
  /** Editor settings */
213
217
  editor: e(C, {}),
214
218
  /** UI configuration */
@@ -216,32 +220,32 @@ const m = {
216
220
  /** Feature toggles */
217
221
  features: e(T, {}),
218
222
  /** Block configuration */
219
- blocks: e(O, {}),
223
+ blocks: e(N, {}),
220
224
  /** Compiler configuration */
221
- compiler: e(B, {}),
225
+ compiler: e(x, {}),
222
226
  /** Callbacks and event handlers */
223
- callbacks: e(P, {})
227
+ callbacks: e(B, {})
224
228
  });
225
229
  export {
226
- O as BlocksSchema,
227
- P as CallbacksSchema,
228
- x as CompilerRuleSchema,
229
- B as CompilerSchema,
230
+ N as BlocksSchema,
231
+ B as CallbacksSchema,
232
+ L as CompilerRuleSchema,
233
+ x as CompilerSchema,
230
234
  g as CustomBlockTypeSchema,
231
- v as CustomRuleSchema,
235
+ E as CustomRuleSchema,
232
236
  A as DefaultBlockTypeSchema,
233
237
  y as DynamicContentSchema,
234
238
  C as EditorSchema,
235
- f as EmailHeaderSchema,
239
+ R as EmailHeaderSchema,
236
240
  T as FeaturesSchema,
237
241
  D as GuidoConfigSchema,
238
242
  S as IdentitySchema,
239
243
  m as MessageType,
240
244
  h as PartnerSchema,
241
245
  s as ProductType,
242
- N as RegexRuleSchema,
243
- L as RemoveRuleSchema,
244
- E as ReplaceRuleSchema,
245
- R as TemplateSchema,
246
+ O as RegexRuleSchema,
247
+ v as RemoveRuleSchema,
248
+ M as ReplaceRuleSchema,
249
+ f as TemplateSchema,
246
250
  I as UISchema
247
251
  };
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "890b5336"
15
+ "a2167e62"
16
16
  );
17
17
  const v = s.exports;
18
18
  export {
@@ -1,54 +1,65 @@
1
- import { defineComponent as B, defineAsyncComponent as P, ref as N, computed as U, watch as R, onMounted as z, onUnmounted as K } from "vue";
2
- import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
3
- import { usePartner as j } from "../composables/usePartner.js";
4
- import { useStripo as q } from "../composables/useStripo.js";
5
- import { useTimerClone as J } from "../composables/useTimerClone.js";
6
- import { migrate as W } from "../config/migrator/index.js";
7
- import Q from "./organisms/base/Toaster.vue.js";
8
- import V from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
9
- import X from "./organisms/header/HeaderWrapper.vue.js";
10
- import Y from "./organisms/LoadingWrapper.vue.js";
11
- import Z from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
12
- import $ from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
13
- import { useStripoApi as ee } from "../services/stripoApi.js";
14
- import { useConfigStore as oe } from "../stores/config.js";
15
- import { useDynamicContentStore as te } from "../stores/dynamic-content.js";
16
- import { useEditorStore as ne } from "../stores/editor.js";
17
- import { usePreviewStore as re } from "../stores/preview.js";
18
- import { useUnsubscribeStore as se } from "../stores/unsubscribe.js";
19
- const Ee = /* @__PURE__ */ B({
1
+ import { defineComponent as B, defineAsyncComponent as U, ref as X, computed as L, watch as z, onMounted as K, onUnmounted as V } from "vue";
2
+ import { provideGuidoActions as j } from "../composables/useGuidoActions.js";
3
+ import { usePartner as q } from "../composables/usePartner.js";
4
+ import { useStripo as J } from "../composables/useStripo.js";
5
+ import { useTimerClone as Q } from "../composables/useTimerClone.js";
6
+ import { migrate as N } from "../config/migrator/index.js";
7
+ import { ModuleFolderDefaults as a } from "../enums/defaults.js";
8
+ import Y from "./organisms/base/Toaster.vue.js";
9
+ import Z from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
10
+ import ee from "./organisms/header/HeaderWrapper.vue.js";
11
+ import oe from "./organisms/LoadingWrapper.vue.js";
12
+ import te from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
13
+ import ne from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
14
+ import { useStripoApi as re } from "../services/stripoApi.js";
15
+ import { useConfigStore as se } from "../stores/config.js";
16
+ import { useDynamicContentStore as ce } from "../stores/dynamic-content.js";
17
+ import { useEditorStore as ae } from "../stores/editor.js";
18
+ import { usePreviewStore as ie } from "../stores/preview.js";
19
+ import { useUnsubscribeStore as de } from "../stores/unsubscribe.js";
20
+ const ke = /* @__PURE__ */ B({
20
21
  __name: "Guido",
21
22
  props: {
22
23
  config: null
23
24
  },
24
25
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
25
- setup(_, { expose: I, emit: t }) {
26
- const l = _, L = P(
26
+ setup(I, { expose: A, emit: t }) {
27
+ const v = I, W = U(
27
28
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
28
- ), A = P(
29
+ ), O = U(
29
30
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
30
- ), p = N(), c = te(), u = se(), n = oe();
31
- n.init(l.config);
32
- const i = ne(), F = re(), r = U(() => i.hasChanges), { isTestPartner: G } = j(), v = () => {
31
+ ), y = X(), i = ce(), f = de(), r = se();
32
+ r.init(v.config);
33
+ const d = ae(), $ = ie(), s = L(() => d.hasChanges), { isTestPartner: R } = q(), h = () => {
33
34
  var e;
34
- return (e = p.value) == null ? void 0 : e.handleSave(!0);
35
- }, { templateId: a, userId: y, partnerName: h, productType: b, username: f, template: o } = n, s = (o == null ? void 0 : o.html) || "", g = (o == null ? void 0 : o.css) || "", m = (o == null ? void 0 : o.preselectedDynamicContent) || [];
36
- i.templateId = a;
37
- const { initPlugin: S } = q({
38
- emailId: a,
39
- userId: y,
40
- username: f,
41
- partnerName: h,
42
- productType: b,
43
- preselectedDynamicContentList: m,
35
+ return (e = y.value) == null ? void 0 : e.handleSave(!0);
36
+ }, {
37
+ templateId: m,
38
+ userId: b,
39
+ partnerName: l,
40
+ productType: S,
41
+ username: g,
42
+ template: o,
43
+ editor: n
44
+ } = r, c = (o == null ? void 0 : o.html) || "", w = (o == null ? void 0 : o.css) || "", u = (o == null ? void 0 : o.preselectedDynamicContent) || [], D = (n == null ? void 0 : n.savedModulesFolderName) || a.SAVED_MODULES, E = (n == null ? void 0 : n.defaultModulesFolderName) || a.DEFAULT_MODULES;
45
+ d.templateId = m;
46
+ const { initPlugin: F } = J({
47
+ emailId: m,
48
+ userId: b,
49
+ username: g,
50
+ partnerName: l,
51
+ productType: S,
52
+ preselectedDynamicContentList: u,
53
+ savedModulesFolderName: `${a.PREFIX}_${l}_${D}`,
54
+ defaultModulesFolderName: `${a.PREFIX}_${E}`,
44
55
  onReady: () => {
45
56
  console.debug("guido:ready"), t("ready");
46
57
  }
47
- }), { getDefaultTemplate: w } = ee(), { cloneTimersOnSave: C, hasTimerBlocks: D } = J(), H = U(() => {
58
+ }), { getDefaultTemplate: C } = re(), { cloneTimersOnSave: _, hasTimerBlocks: M } = Q(), G = L(() => {
48
59
  var e;
49
- return !((e = n.ui) != null && e.showHeader);
60
+ return !((e = r.ui) != null && e.showHeader);
50
61
  });
51
- M({
62
+ j({
52
63
  onBack: () => {
53
64
  console.debug("guido:back"), t("back");
54
65
  },
@@ -62,49 +73,49 @@ const Ee = /* @__PURE__ */ B({
62
73
  console.debug("guido:test-email:click"), t("test-email:click");
63
74
  }
64
75
  });
65
- const E = (e) => {
66
- console.debug("dynamic-content:close", e), c.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
76
+ const T = (e) => {
77
+ console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
67
78
  }, k = () => {
68
79
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
69
80
  };
70
- R(() => r.value, () => {
71
- t("on-change", r.value);
81
+ z(() => s.value, () => {
82
+ t("on-change", s.value);
72
83
  });
73
- const d = (e) => {
74
- const T = e, { attribute: O, position: x } = T.detail;
75
- console.debug("dynamic-content:open", T.detail), t("dynamic-content:open", O, x);
84
+ const p = (e) => {
85
+ const P = e, { attribute: H, position: x } = P.detail;
86
+ console.debug("dynamic-content:open", P.detail), t("dynamic-content:open", H, x);
76
87
  };
77
- return z(async () => {
88
+ return K(async () => {
78
89
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
79
90
  try {
80
- u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
91
+ f.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
81
92
  let e = {
82
- html: s && await W(s),
83
- css: g
93
+ html: c && await N(c),
94
+ css: w
84
95
  };
85
- e.html || (e = await w(), e.html = await W(e.html)), D(e.html) && (e.html = await C(e.html)), await S(e), c.selectedDynamicContentList = m;
96
+ e.html || (e = await C(), e.html = await N(e.html)), M(e.html) && (e.html = await _(e.html)), await F(e), i.selectedDynamicContentList = u;
86
97
  } catch (e) {
87
98
  console.error("Failed to initialize Stripo editor:", e);
88
99
  }
89
- document.addEventListener("dynamic-content:open", d);
90
- }), K(() => {
91
- document.removeEventListener("dynamic-content:open", d);
100
+ document.addEventListener("dynamic-content:open", p);
101
+ }), V(() => {
102
+ document.removeEventListener("dynamic-content:open", p);
92
103
  try {
93
104
  window.UIEditor.removeEditor();
94
105
  } catch {
95
106
  console.debug("Failed to remove Stripo editor: No editor found");
96
107
  }
97
- n.reset();
98
- }), I({
108
+ r.reset();
109
+ }), A({
99
110
  dynamicContent: {
100
- insert: E,
111
+ insert: T,
101
112
  close: k
102
113
  },
103
- hasChanges: r,
104
- saveSilent: v
105
- }), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: p, dynamicContentStore: c, unsubscribeStore: u, props: l, configStore: n, editorStore: i, previewStore: F, hasChanges: r, isTestPartner: G, saveSilent: v, templateId: a, userId: y, partnerName: h, productType: b, username: f, templateConfig: o, html: s, css: g, preselectedDynamicContentList: m, emit: t, initPlugin: S, getDefaultTemplate: w, cloneTimersOnSave: C, hasTimerBlocks: D, noHeader: H, insertDynamicContent: E, closeDynamicContent: k, handleDynamicContentOpen: d, Toaster: Q, FilterSelectionDrawer: V, HeaderWrapper: X, LoadingWrapper: Y, SaveAsTemplateDrawer: Z, UnsubscribeWrapper: $ };
114
+ hasChanges: s,
115
+ saveSilent: h
116
+ }), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: O, headerWrapperRef: y, dynamicContentStore: i, unsubscribeStore: f, props: v, configStore: r, editorStore: d, previewStore: $, hasChanges: s, isTestPartner: R, saveSilent: h, templateId: m, userId: b, partnerName: l, productType: S, username: g, templateConfig: o, editorConfig: n, html: c, css: w, preselectedDynamicContentList: u, savedModulesFolderName: D, defaultModulesFolderName: E, emit: t, initPlugin: F, getDefaultTemplate: C, cloneTimersOnSave: _, hasTimerBlocks: M, noHeader: G, insertDynamicContent: T, closeDynamicContent: k, handleDynamicContentOpen: p, Toaster: Y, FilterSelectionDrawer: Z, HeaderWrapper: ee, LoadingWrapper: oe, SaveAsTemplateDrawer: te, UnsubscribeWrapper: ne };
106
117
  }
107
118
  });
108
119
  export {
109
- Ee as default
120
+ ke as default
110
121
  };
@@ -1,18 +1,18 @@
1
1
  import o from "./HeaderWrapper.vue2.js";
2
2
  /* empty css */
3
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var a = function() {
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
5
5
  var t = this, r = t._self._c, e = t._self._setupProxy;
6
- return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "header-wrapper w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot, { ref: "rightSlotRef" })], 1)]);
7
- }, n = [], _ = /* @__PURE__ */ s(
6
+ return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0", "data-testid": "guido-header" } }, [r("div", { staticClass: "header-wrapper w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot, { ref: "rightSlotRef" })], 1)]);
7
+ }, d = [], i = /* @__PURE__ */ a(
8
8
  o,
9
- a,
10
- n,
9
+ s,
10
+ d,
11
11
  !1,
12
12
  null,
13
- "5df46e7a"
13
+ "5c02dcc7"
14
14
  );
15
- const c = _.exports;
15
+ const p = i.exports;
16
16
  export {
17
- c as default
17
+ p as default
18
18
  };
@@ -1,6 +1,6 @@
1
1
  import { useToaster as w } from "./useToaster.js";
2
2
  const v = () => {
3
- const { handleError: l } = w(), r = (t = {}) => new Promise((e, a) => {
3
+ const { handleError: n } = w(), m = (t = {}) => new Promise((e, a) => {
4
4
  const o = { ...{
5
5
  minimize: !0,
6
6
  utmEntity: {
@@ -21,9 +21,9 @@ const v = () => {
21
21
  resetDataSavedFlag: !1,
22
22
  disableLineHeightsReplace: !0
23
23
  }, ...t }, s = {
24
- callback: (n, p, d, c, u) => {
25
- n ? a(n) : e({
26
- html: p,
24
+ callback: (l, r, d, c, u) => {
25
+ l ? a(l) : e({
26
+ html: r,
27
27
  ampHtml: d,
28
28
  ampErrors: c,
29
29
  displayConditions: u
@@ -34,15 +34,15 @@ const v = () => {
34
34
  window.StripoEditorApi.actionsApi.compileEmail(s);
35
35
  });
36
36
  return {
37
- getCompiledEmail: r,
37
+ getCompiledEmail: m,
38
38
  getTemplateData: () => new Promise((t) => {
39
- const e = ({ html: a, css: i, width: o, height: m, utmParams: s, syncModulesIds: n }) => t({
39
+ const e = ({ html: a, css: i, width: o, height: p, utmParams: s, syncModulesIds: l }) => t({
40
40
  html: a,
41
41
  css: i,
42
42
  width: o,
43
- height: m,
43
+ height: p,
44
44
  utmParams: s,
45
- syncModulesIds: n
45
+ syncModulesIds: l
46
46
  });
47
47
  window.StripoEditorApi.actionsApi.getTemplateData(e);
48
48
  }),
@@ -56,7 +56,7 @@ const v = () => {
56
56
  displayConditions: a,
57
57
  ampHtml: i = "",
58
58
  ampErrors: o = []
59
- } = await r({ minimize: !1, resetDataSavedFlag: !1, ...t });
59
+ } = await m({ minimize: !1, resetDataSavedFlag: !1, ...t });
60
60
  return {
61
61
  html: e,
62
62
  ampHtml: i,
@@ -64,7 +64,7 @@ const v = () => {
64
64
  displayConditions: a
65
65
  };
66
66
  } catch (e) {
67
- return l(e, "Error loading preview"), {
67
+ return n(e, "Error loading preview"), {
68
68
  html: "",
69
69
  ampHtml: "",
70
70
  ampErrors: [],
@@ -80,17 +80,19 @@ const v = () => {
80
80
  }
81
81
  try {
82
82
  window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
83
- i ? (l(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
83
+ i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
84
84
  });
85
85
  } catch (i) {
86
- l(i, "Failed to call updateTimerInClonedTemplate"), t(null);
86
+ n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
87
87
  }
88
88
  }),
89
89
  updateHtmlAndCss: (t, e) => {
90
90
  window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
91
91
  },
92
92
  editorSave: () => {
93
- window.StripoEditorApi.actionsApi.save();
93
+ window.StripoEditorApi.actionsApi.save((t) => {
94
+ t && n(t, "Failed to save template");
95
+ });
94
96
  }
95
97
  };
96
98
  };