@useinsider/guido 3.1.1-beta.761c167 → 3.1.1-beta.7d6b01c

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 (35) hide show
  1. package/dist/@types/config/schemas.js +69 -61
  2. package/dist/components/Guido.vue.js +4 -4
  3. package/dist/components/Guido.vue2.js +91 -81
  4. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
  5. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
  6. package/dist/composables/useHtmlCompiler.js +20 -20
  7. package/dist/composables/usePreviewMode.js +20 -16
  8. package/dist/composables/useSave.js +15 -13
  9. package/dist/config/compiler/utils/recommendationCompilerUtils.js +34 -33
  10. package/dist/config/migrator/checkboxMigrator.js +5 -3
  11. package/dist/config/migrator/radioButtonMigrator.js +14 -12
  12. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +1 -1
  13. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +23 -21
  14. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +29 -25
  15. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
  16. package/dist/guido.css +1 -1
  17. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +218 -324
  18. package/dist/package.json.js +1 -1
  19. package/dist/services/recommendationApi.js +13 -11
  20. package/dist/src/@types/config/index.d.ts +1 -1
  21. package/dist/src/@types/config/schemas.d.ts +20 -0
  22. package/dist/src/@types/config/types.d.ts +3 -1
  23. package/dist/src/@types/generic.d.ts +0 -1
  24. package/dist/src/composables/useConfig.d.ts +8 -0
  25. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +1 -1
  26. package/dist/src/extensions/Blocks/Recommendation/utils/__tests__/filterUtil.test.d.ts +1 -0
  27. package/dist/src/stores/config.d.ts +72 -0
  28. package/dist/src/stores/preview.d.ts +3 -0
  29. package/dist/src/utils/htmlCompiler.d.ts +2 -1
  30. package/dist/static/styles/base.css.js +7 -2
  31. package/dist/stores/preview.js +4 -3
  32. package/dist/utils/htmlCompiler.js +48 -41
  33. package/dist/utils/templatePreparation.js +20 -20
  34. package/dist/utils/tooltipUtils.js +4 -5
  35. package/package.json +5 -4
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as b } from "../../enums/defaults.js";
2
- import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, minLength as d, custom as S, boolean as a, array as c, literal as r, variant as k } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, minLength as d, custom as S, boolean as a, array as c, literal as l, variant as k } from "../../node_modules/valibot/dist/index.js";
3
3
  const m = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -26,6 +26,11 @@ const m = {
26
26
  /** Optional variation ID for A/B testing */
27
27
  variationId: e(t())
28
28
  }), y = o({
29
+ /** Fallback font name (e.g., "Georgia") */
30
+ name: t(),
31
+ /** Fallback font family (e.g., "serif" or "sans-serif") */
32
+ family: t()
33
+ }), f = o({
29
34
  /** Partner/organization name (required) */
30
35
  name: u(
31
36
  t(),
@@ -46,8 +51,10 @@ const m = {
46
51
  m.PROMOTIONAL
47
52
  ),
48
53
  /** Display name for the current user */
49
- username: e(t(), "Guido User")
50
- }), f = o({
54
+ username: e(t(), "Guido User"),
55
+ /** Fallback font settings from partner settings — used to match backend size calculation */
56
+ fallbackFont: e(y)
57
+ }), A = o({
51
58
  /** Display text for the dynamic content */
52
59
  text: t(),
53
60
  /** Template variable value (e.g., {{username}}) */
@@ -61,14 +68,14 @@ const m = {
61
68
  value: t()
62
69
  })
63
70
  )
64
- }), A = o({
71
+ }), R = o({
65
72
  /** Initial HTML content */
66
73
  html: e(t(), ""),
67
74
  /** Initial CSS content */
68
75
  css: e(t(), ""),
69
76
  /** Preselected dynamic content items */
70
77
  preselectedDynamicContent: e(
71
- c(f),
78
+ c(A),
72
79
  []
73
80
  ),
74
81
  /** Valid custom field attribute names from the partner's categorized fields */
@@ -77,12 +84,12 @@ const m = {
77
84
  selectedUnsubscribePages: e(c(p()), []),
78
85
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
79
86
  forceRecreate: e(a(), !1)
80
- }), R = o({
87
+ }), C = o({
81
88
  /** Sender display name */
82
89
  senderName: e(t(), ""),
83
90
  /** Email subject line */
84
91
  subject: e(t(), "")
85
- }), C = o({
92
+ }), T = o({
86
93
  /** Locale for the editor UI */
87
94
  locale: e(t(), "en"),
88
95
  /** Path to translations object */
@@ -90,17 +97,17 @@ const m = {
90
97
  /** Migration date for template compatibility */
91
98
  migrationDate: e(p(), 1759696858),
92
99
  /** Email header settings */
93
- emailHeader: e(R, { senderName: "", subject: "" }),
100
+ emailHeader: e(C, { senderName: "", subject: "" }),
94
101
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
95
102
  savedModulesFolderName: e(t(), b.SAVED_MODULES),
96
103
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
97
104
  defaultModulesFolderName: e(t(), b.DEFAULT_MODULES)
98
- }), T = o({
105
+ }), I = o({
99
106
  /** Whether to show the header bar */
100
107
  showHeader: e(a(), !0),
101
108
  /** Custom label for back button (if shown) */
102
109
  backButtonLabel: e(t())
103
- }), I = o({
110
+ }), E = o({
104
111
  /** Enable dynamic content insertion */
105
112
  dynamicContent: e(a(), !0),
106
113
  /** Enable save as template functionality */
@@ -115,7 +122,7 @@ const m = {
115
122
  unsubscribe: e(a(), !0),
116
123
  /** Disable modules panel in the editor */
117
124
  modulesDisabled: e(a(), !1)
118
- }), E = n([
125
+ }), g = n([
119
126
  "amp-accordion",
120
127
  "amp-carousel",
121
128
  "amp-form-controls",
@@ -129,7 +136,7 @@ const m = {
129
136
  "text-block",
130
137
  "timer-block",
131
138
  "video-block"
132
- ]), g = n([
139
+ ]), O = n([
133
140
  "dynamic-content",
134
141
  "checkbox-block",
135
142
  "radio-button-block",
@@ -137,66 +144,66 @@ const m = {
137
144
  "unsubscribe-block",
138
145
  "coupon-block",
139
146
  "items-block"
140
- ]), O = o({
147
+ ]), L = o({
141
148
  /** Default blocks to exclude from the editor */
142
149
  excludeDefaults: e(
143
- c(E),
150
+ c(g),
144
151
  []
145
152
  ),
146
153
  /** Custom blocks to include in the editor */
147
154
  includeCustoms: e(
148
- c(g),
155
+ c(O),
149
156
  []
150
157
  )
151
- }), l = o({
158
+ }), r = o({
152
159
  /** Unique identifier for the rule */
153
160
  id: t(),
154
161
  /** Human-readable description */
155
162
  description: e(t()),
156
163
  /** Priority for rule ordering (lower = earlier) */
157
164
  priority: p()
158
- }), L = o({
159
- ...l.entries,
160
- type: r("replace"),
165
+ }), M = o({
166
+ ...r.entries,
167
+ type: l("replace"),
161
168
  /** String to search for */
162
169
  search: t(),
163
170
  /** Replacement string */
164
171
  replacement: t(),
165
172
  /** Replace all occurrences (default: false) */
166
173
  replaceAll: e(a())
167
- }), M = o({
168
- ...l.entries,
169
- type: r("regex"),
174
+ }), N = o({
175
+ ...r.entries,
176
+ type: l("regex"),
170
177
  /** Regex pattern string */
171
178
  pattern: t(),
172
179
  /** Replacement string (supports $1, $2, etc.) */
173
180
  replacement: t(),
174
181
  /** Regex flags (e.g., 'gi') */
175
182
  flags: e(t())
176
- }), N = o({
177
- ...l.entries,
178
- type: r("remove"),
183
+ }), D = o({
184
+ ...r.entries,
185
+ type: l("remove"),
179
186
  /** Strings or patterns to remove */
180
187
  targets: c(t())
181
- }), D = o({
182
- ...l.entries,
183
- type: r("custom"),
188
+ }), v = o({
189
+ ...r.entries,
190
+ type: l("custom"),
184
191
  /** Custom processor function */
185
192
  processor: S(
186
193
  (i) => typeof i == "function",
187
194
  "processor must be a function"
188
195
  )
189
- }), v = k("type", [
190
- L,
196
+ }), U = k("type", [
191
197
  M,
192
198
  N,
193
- D
194
- ]), U = o({
199
+ D,
200
+ v
201
+ ]), x = o({
195
202
  /** Custom compiler rules to apply */
196
- customRules: e(c(v), []),
203
+ customRules: e(c(U), []),
197
204
  /** Skip default compiler rules */
198
205
  ignoreDefaultRules: e(a(), !1)
199
- }), x = o({
206
+ }), B = o({
200
207
  /**
201
208
  * External validation handler called before save completes.
202
209
  * Return false to cancel the save operation.
@@ -207,48 +214,49 @@ const m = {
207
214
  "externalValidation must be a function"
208
215
  )
209
216
  )
210
- }), F = o({
217
+ }), H = o({
211
218
  // Required sections
212
219
  /** Identity configuration (required) */
213
220
  identity: h,
214
221
  /** Partner configuration (required) */
215
- partner: y,
222
+ partner: f,
216
223
  // Optional sections (with defaults)
217
224
  /** Template content and presets */
218
- template: e(A, {}),
225
+ template: e(R, {}),
219
226
  /** Editor settings */
220
- editor: e(C, {}),
227
+ editor: e(T, {}),
221
228
  /** UI configuration */
222
- ui: e(T, {}),
229
+ ui: e(I, {}),
223
230
  /** Feature toggles */
224
- features: e(I, {}),
231
+ features: e(E, {}),
225
232
  /** Block configuration */
226
- blocks: e(O, {}),
233
+ blocks: e(L, {}),
227
234
  /** Compiler configuration */
228
- compiler: e(U, {}),
235
+ compiler: e(x, {}),
229
236
  /** Callbacks and event handlers */
230
- callbacks: e(x, {})
237
+ callbacks: e(B, {})
231
238
  });
232
239
  export {
233
- O as BlocksSchema,
234
- x as CallbacksSchema,
235
- v as CompilerRuleSchema,
236
- U as CompilerSchema,
237
- g as CustomBlockTypeSchema,
238
- D as CustomRuleSchema,
239
- E as DefaultBlockTypeSchema,
240
- f as DynamicContentSchema,
241
- C as EditorSchema,
242
- R as EmailHeaderSchema,
243
- I as FeaturesSchema,
244
- F as GuidoConfigSchema,
240
+ L as BlocksSchema,
241
+ B as CallbacksSchema,
242
+ U as CompilerRuleSchema,
243
+ x as CompilerSchema,
244
+ O as CustomBlockTypeSchema,
245
+ v as CustomRuleSchema,
246
+ g as DefaultBlockTypeSchema,
247
+ A as DynamicContentSchema,
248
+ T as EditorSchema,
249
+ C as EmailHeaderSchema,
250
+ y as FallbackFontSchema,
251
+ E as FeaturesSchema,
252
+ H as GuidoConfigSchema,
245
253
  h as IdentitySchema,
246
254
  m as MessageType,
247
- y as PartnerSchema,
255
+ f as PartnerSchema,
248
256
  s as ProductType,
249
- M as RegexRuleSchema,
250
- N as RemoveRuleSchema,
251
- L as ReplaceRuleSchema,
252
- A as TemplateSchema,
253
- T as UISchema
257
+ N as RegexRuleSchema,
258
+ D as RemoveRuleSchema,
259
+ M as ReplaceRuleSchema,
260
+ R as TemplateSchema,
261
+ I as UISchema
254
262
  };
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
3
3
  import a from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
5
  var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
9
  }, n = [], s = /* @__PURE__ */ a(
@@ -12,9 +12,9 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "a26d7792"
15
+ "25780af6"
16
16
  );
17
- const v = s.exports;
17
+ const u = s.exports;
18
18
  export {
19
- v as default
19
+ u as default
20
20
  };
@@ -1,121 +1,131 @@
1
- import { defineComponent as K, defineAsyncComponent as _, ref as V, computed as P, watch as j, onMounted as q, onUnmounted as J } from "vue";
2
- import { provideGuidoActions as Q } from "../composables/useGuidoActions.js";
3
- import { usePartner as X } from "../composables/usePartner.js";
4
- import { useStripo as Y } from "../composables/useStripo.js";
5
- import { useTimerClone as Z } from "../composables/useTimerClone.js";
6
- import { migrate as A } from "../config/migrator/index.js";
7
- import { ModuleFolderDefaults as N } from "../enums/defaults.js";
8
- import $ from "./organisms/base/Toaster.vue.js";
9
- import ee from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
10
- import oe from "./organisms/header/HeaderWrapper.vue.js";
11
- import te from "./organisms/LoadingWrapper.vue.js";
12
- import ne from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
13
- import se from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
14
- import { useStripoApi as re } from "../services/stripoApi.js";
15
- import { useConfigStore as ce } from "../stores/config.js";
16
- import { useDynamicContentStore as ae } from "../stores/dynamic-content.js";
17
- import { useEditorStore as ie } from "../stores/editor.js";
18
- import { usePreviewStore as me } from "../stores/preview.js";
19
- import { useUnsubscribeStore as de } from "../stores/unsubscribe.js";
20
- const Me = /* @__PURE__ */ K({
1
+ import { defineComponent as j, defineAsyncComponent as R, ref as A, computed as I, watch as J, onMounted as Q, onUnmounted as X } from "vue";
2
+ import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
3
+ import { usePartner as Z } from "../composables/usePartner.js";
4
+ import { useStripo as ee } from "../composables/useStripo.js";
5
+ import { useTimerClone as te } from "../composables/useTimerClone.js";
6
+ import { migrate as W } from "../config/migrator/index.js";
7
+ import { ModuleFolderDefaults as B } from "../enums/defaults.js";
8
+ import { RIBBON_SELECTOR as oe } from "../enums/onboarding.js";
9
+ import ne from "./organisms/base/Toaster.vue.js";
10
+ import se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
11
+ import re from "./organisms/header/HeaderWrapper.vue.js";
12
+ import ce from "./organisms/LoadingWrapper.vue.js";
13
+ import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
14
+ import ie from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
15
+ import { useStripoApi as me } from "../services/stripoApi.js";
16
+ import { useConfigStore as de } from "../stores/config.js";
17
+ import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
18
+ import { useEditorStore as ue } from "../stores/editor.js";
19
+ import { usePreviewStore as pe } from "../stores/preview.js";
20
+ import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
21
+ const Re = /* @__PURE__ */ j({
21
22
  __name: "Guido",
22
23
  props: {
23
24
  config: null
24
25
  },
25
26
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
26
- setup(W, { expose: I, emit: t }) {
27
- const v = W, O = _(
27
+ setup(H, { expose: x, emit: s }) {
28
+ const b = H, G = R(
28
29
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
29
- ), G = _(
30
+ ), z = R(
30
31
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
31
- ), h = V(), i = ae(), y = de(), s = ce();
32
- s.init(v.config);
33
- const m = ie(), H = me(), c = P(() => m.hasChanges), { isTestPartner: x } = X(), f = () => {
32
+ ), S = A(), d = A(), l = le(), g = fe(), a = de();
33
+ a.init(b.config);
34
+ const u = ue(), q = pe(), i = I(() => u.hasChanges), { isTestPartner: K } = Z(), w = () => {
34
35
  var e;
35
- return (e = h.value) == null ? void 0 : e.handleSave(!0);
36
+ return (e = S.value) == null ? void 0 : e.handleSave(!0);
36
37
  }, {
37
- templateId: d,
38
- userId: b,
39
- partnerName: S,
40
- username: g,
41
- template: o,
42
- editor: n
43
- } = s, a = (o == null ? void 0 : o.html) || "", D = (o == null ? void 0 : o.css) || "", l = (o == null ? void 0 : o.preselectedDynamicContent) || [], w = (n == null ? void 0 : n.savedModulesFolderName) || N.SAVED_MODULES, E = (n == null ? void 0 : n.defaultModulesFolderName) || N.DEFAULT_MODULES;
44
- m.templateId = d;
45
- const u = {
46
- emailId: d,
47
- userId: b,
48
- username: g,
49
- partnerName: S,
50
- savedModulesFolderName: w,
51
- defaultModulesFolderName: E
52
- }, C = {
53
- preselectedDynamicContentList: l,
38
+ templateId: p,
39
+ userId: E,
40
+ partnerName: D,
41
+ username: C,
42
+ template: t,
43
+ editor: r
44
+ } = a, m = (t == null ? void 0 : t.html) || "", T = (t == null ? void 0 : t.css) || "", f = (t == null ? void 0 : t.preselectedDynamicContent) || [], k = (r == null ? void 0 : r.savedModulesFolderName) || B.SAVED_MODULES, F = (r == null ? void 0 : r.defaultModulesFolderName) || B.DEFAULT_MODULES;
45
+ u.templateId = p;
46
+ const v = {
47
+ emailId: p,
48
+ userId: E,
49
+ username: C,
50
+ partnerName: D,
51
+ savedModulesFolderName: k,
52
+ defaultModulesFolderName: F
53
+ }, L = {
54
+ preselectedDynamicContentList: f,
54
55
  onReady: () => {
55
- console.debug("guido:ready"), t("ready");
56
+ console.debug("guido:ready"), s("ready");
56
57
  }
57
- }, { initPlugin: T } = Y(u, C), { getDefaultTemplate: k } = re(), { cloneTimersOnSave: F, hasTimerBlocks: U } = Z(), B = P(() => {
58
+ }, { initPlugin: U } = ee(v, L), { getDefaultTemplate: _ } = me(), { cloneTimersOnSave: M, hasTimerBlocks: O } = te(), V = I(() => {
58
59
  var e;
59
- return !((e = s.ui) != null && e.showHeader);
60
+ return !((e = a.ui) != null && e.showHeader);
60
61
  });
61
- Q({
62
+ Y({
62
63
  onBack: () => {
63
- console.debug("guido:back"), t("back");
64
+ console.debug("guido:back"), s("back");
64
65
  },
65
66
  onSaveStart: () => {
66
- console.debug("guido:save:start"), t("save:start");
67
+ console.debug("guido:save:start"), s("save:start");
67
68
  },
68
69
  onSaveComplete: (e) => {
69
- const r = { ...e, metadata: u };
70
- console.debug("guido:save:complete", r), t("save:complete", r);
70
+ const n = { ...e, metadata: v };
71
+ console.debug("guido:save:complete", n), s("save:complete", n);
71
72
  },
72
73
  onTestEmailClick: () => {
73
- console.debug("guido:test-email:click"), t("test-email:click");
74
+ console.debug("guido:test-email:click"), s("test-email:click");
74
75
  }
75
76
  });
76
- const L = (e) => {
77
- console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
78
- }, M = () => {
77
+ const P = (e) => {
78
+ console.debug("dynamic-content:close", e), l.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
79
+ }, N = () => {
79
80
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
80
81
  };
81
- j(() => c.value, () => {
82
- t("on-change", c.value);
82
+ J(() => i.value, () => {
83
+ s("on-change", i.value);
83
84
  });
84
- const p = (e) => {
85
- const r = e, { attribute: R, position: z } = r.detail;
86
- console.debug("dynamic-content:open", r.detail), t("dynamic-content:open", R, z);
85
+ const y = (e) => {
86
+ const n = e, { attribute: o, position: $ } = n.detail;
87
+ console.debug("dynamic-content:open", n.detail), s("dynamic-content:open", o, $);
87
88
  };
88
- return q(async () => {
89
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
89
+ let c = null;
90
+ const h = () => {
91
+ var n;
92
+ const e = document.querySelector(oe);
93
+ (n = d.value) == null || n.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
94
+ };
95
+ return Q(async () => {
96
+ var n;
97
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h();
98
+ const e = (n = d.value) == null ? void 0 : n.parentElement;
99
+ e && (c = new ResizeObserver(h), c.observe(e));
90
100
  try {
91
- y.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
92
- let e = {
93
- html: a && await A(a),
94
- css: D
101
+ g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
102
+ let o = {
103
+ html: m && await W(m),
104
+ css: T
95
105
  };
96
- e.html || (e = await k(), e.html = await A(e.html)), U(e.html) && (e.html = await F(e.html)), await T(e), i.selectedDynamicContentList = l;
97
- } catch (e) {
98
- console.error("Failed to initialize Stripo editor:", e);
106
+ o.html || (o = await _(), o.html = await W(o.html)), O(o.html) && (o.html = await M(o.html)), await U(o), l.selectedDynamicContentList = f;
107
+ } catch (o) {
108
+ console.error("Failed to initialize Stripo editor:", o);
99
109
  }
100
- document.addEventListener("dynamic-content:open", p);
101
- }), J(() => {
102
- document.removeEventListener("dynamic-content:open", p);
110
+ document.addEventListener("dynamic-content:open", y);
111
+ }), X(() => {
112
+ c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", y);
103
113
  try {
104
114
  window.UIEditor.removeEditor();
105
115
  } catch {
106
116
  console.debug("Failed to remove Stripo editor: No editor found");
107
117
  }
108
- s.reset();
109
- }), I({
118
+ a.reset();
119
+ }), x({
110
120
  dynamicContent: {
111
- insert: L,
112
- close: M
121
+ insert: P,
122
+ close: N
113
123
  },
114
- hasChanges: c,
115
- saveSilent: f
116
- }), { __sfc: !0, PreviewContainer: O, OnboardingWrapper: G, headerWrapperRef: h, dynamicContentStore: i, unsubscribeStore: y, props: v, configStore: s, editorStore: m, previewStore: H, hasChanges: c, isTestPartner: x, saveSilent: f, templateId: d, userId: b, partnerName: S, username: g, templateConfig: o, editorConfig: n, html: a, css: D, preselectedDynamicContentList: l, savedModulesFolderName: w, defaultModulesFolderName: E, emit: t, metadata: u, options: C, initPlugin: T, getDefaultTemplate: k, cloneTimersOnSave: F, hasTimerBlocks: U, noHeader: B, insertDynamicContent: L, closeDynamicContent: M, handleDynamicContentOpen: p, Toaster: $, FilterSelectionDrawer: ee, HeaderWrapper: oe, LoadingWrapper: te, SaveAsTemplateDrawer: ne, UnsubscribeWrapper: se };
124
+ hasChanges: i,
125
+ saveSilent: w
126
+ }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: z, headerWrapperRef: S, wrapperRef: d, dynamicContentStore: l, unsubscribeStore: g, props: b, configStore: a, editorStore: u, previewStore: q, hasChanges: i, isTestPartner: K, saveSilent: w, templateId: p, userId: E, partnerName: D, username: C, templateConfig: t, editorConfig: r, html: m, css: T, preselectedDynamicContentList: f, savedModulesFolderName: k, defaultModulesFolderName: F, emit: s, metadata: v, options: L, initPlugin: U, getDefaultTemplate: _, cloneTimersOnSave: M, hasTimerBlocks: O, noHeader: V, insertDynamicContent: P, closeDynamicContent: N, handleDynamicContentOpen: y, ribbonObserver: c, updateRibbonOffset: h, Toaster: ne, FilterSelectionDrawer: se, HeaderWrapper: re, LoadingWrapper: ce, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ie };
117
127
  }
118
128
  });
119
129
  export {
120
- Me as default
130
+ Re as default
121
131
  };
@@ -1,16 +1,16 @@
1
1
  import s from "./EmailSizeIndicator.vue2.js";
2
2
  /* empty css */
3
- import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var o = function() {
5
- var e = this, i = e._self._c, t = e._self._setupProxy;
6
- return t.previewStore.previewHtml ? i("div", { staticClass: "d-f a-i-c j-c-c" }, [i(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), i(t.InTooltipV2, { attrs: { id: "email-size-tooltip", "icon-status": "", "static-position": "bottom center", "dynamic-position": !1, text: t.trans("email-editor.preview-design-size-tooltip") } })], 1) : e._e();
7
- }, a = [], n = /* @__PURE__ */ r(
3
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var i = this, e = i._self._c, t = i._self._setupProxy;
6
+ return e("div", { staticClass: "d-f a-i-c j-c-c" }, [t.previewStore.isLoaded ? [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltipV2, { attrs: { id: "email-size-tooltip", "icon-status": "", "static-position": "bottom center", "dynamic-position": !1, text: t.trans("email-editor.preview-design-size-tooltip") } })] : e(t.InSkeleton, { attrs: { sizing: { width: 200, height: 20 } } })], 2);
7
+ }, a = [], n = /* @__PURE__ */ o(
8
8
  s,
9
- o,
9
+ r,
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "079d2bf7"
13
+ "2cb418af"
14
14
  );
15
15
  const m = n.exports;
16
16
  export {
@@ -1,25 +1,17 @@
1
- import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
2
- import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
- import { usePreviewStore as _ } from "../../../../stores/preview.js";
4
- import { InTooltipV2 as v, InProgress as f } from "@useinsider/design-system-vue";
5
- const S = /* @__PURE__ */ c({
1
+ import { defineComponent as i, computed as t } from "vue";
2
+ import { useTranslations as m } from "../../../../composables/useTranslations.js";
3
+ import { usePreviewStore as a } from "../../../../stores/preview.js";
4
+ import { InTooltipV2 as p, InSkeleton as c, InProgress as _ } from "@useinsider/design-system-vue";
5
+ const z = /* @__PURE__ */ i({
6
6
  __name: "EmailSizeIndicator",
7
- setup(w) {
8
- const t = _(), o = 102, e = n(0), s = n({
9
- type: "success",
10
- value: 0
11
- }), a = l(() => `~${e.value} KB`), r = () => {
12
- const m = new Blob([t.previewHtml]).size;
13
- e.value = Math.round(m / 1024), s.value = {
14
- type: e.value < o ? "success" : "warning",
15
- value: Math.min(e.value, o)
16
- };
17
- }, i = p();
18
- return u(() => t.previewHtml, () => {
19
- r();
20
- }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltipV2: v };
7
+ setup(l) {
8
+ const e = a(), o = 102, r = t(() => `~${e.emailSizeKB} KB`), n = t(() => ({
9
+ type: e.emailSizeKB < o ? "success" : "warning",
10
+ value: Math.min(e.emailSizeKB, o)
11
+ })), s = m();
12
+ return { __sfc: !0, previewStore: e, MAX_EMAIL_SIZE_IN_KB: o, htmlSize: r, progress: n, trans: s, InProgress: _, InSkeleton: c, InTooltipV2: p };
21
13
  }
22
14
  });
23
15
  export {
24
- S as default
16
+ z as default
25
17
  };
@@ -1,28 +1,28 @@
1
- import { defaultHtmlCompilerRules as p } from "../config/compiler/htmlCompilerRules.js";
2
- import { itemsCompilerRules as u } from "../config/compiler/itemsCompilerRules.js";
3
- import { outlookCompilerRules as c } from "../config/compiler/outlookCompilerRules.js";
4
- import { recommendationCompilerRules as n } from "../config/compiler/recommendationCompilerRules.js";
5
- import { socialCompilerRules as f } from "../config/compiler/socialCompilerRules.js";
6
- import { unsubscribeCompilerRules as R } from "../config/compiler/unsubscribeCompilerRules.js";
7
- import { createHtmlCompiler as a } from "../utils/htmlCompiler.js";
8
- import { useConfig as C } from "./useConfig.js";
9
- const B = () => {
10
- var m, l;
11
- const { compiler: e } = C(), r = ((m = e.value) == null ? void 0 : m.customRules) || [], t = [
12
- ...!!((l = e.value) != null && l.ignoreDefaultRules) ? [] : p,
13
- ...n,
1
+ import { defaultHtmlCompilerRules as n } from "../config/compiler/htmlCompilerRules.js";
2
+ import { itemsCompilerRules as a } from "../config/compiler/itemsCompilerRules.js";
3
+ import { outlookCompilerRules as f } from "../config/compiler/outlookCompilerRules.js";
4
+ import { recommendationCompilerRules as R } from "../config/compiler/recommendationCompilerRules.js";
5
+ import { socialCompilerRules as C } from "../config/compiler/socialCompilerRules.js";
6
+ import { unsubscribeCompilerRules as g } from "../config/compiler/unsubscribeCompilerRules.js";
7
+ import { createHtmlCompiler as H } from "../utils/htmlCompiler.js";
8
+ import { useConfig as b } from "./useConfig.js";
9
+ const q = () => {
10
+ var l, m, r;
11
+ const { compiler: e, partner: t } = b(), i = ((l = e.value) == null ? void 0 : l.customRules) || [], s = [
12
+ ...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] : n,
14
13
  ...R,
15
- ...u,
16
- ...c,
14
+ ...g,
15
+ ...a,
17
16
  ...f,
18
- ...r.map((o, s) => ({
17
+ ...C,
18
+ ...i.map((o, c) => ({
19
19
  ...o,
20
- priority: o.priority + 1e3 + s
20
+ priority: o.priority + 1e3 + c
21
21
  // Ensure additional rules run after default rules
22
22
  }))
23
- ], i = a(t);
24
- return { compileHtml: (o) => i.compile(o) };
23
+ ], p = H(s), u = (r = t.value) == null ? void 0 : r.fallbackFont;
24
+ return { compileHtml: (o) => p.compile(o, void 0, u) };
25
25
  };
26
26
  export {
27
- B as useHtmlCompiler
27
+ q as useHtmlCompiler
28
28
  };