@useinsider/guido 3.1.1-beta.6b60896 → 3.1.1-beta.71f5a8c

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 (57) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +69 -61
  3. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
  4. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
  5. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  6. package/dist/components/organisms/header/EditorActions.vue2.js +45 -35
  7. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  8. package/dist/components/organisms/header/RightSlot.vue2.js +16 -13
  9. package/dist/composables/useHtmlCompiler.js +23 -21
  10. package/dist/composables/usePreviewMode.js +20 -16
  11. package/dist/composables/useSave.js +23 -15
  12. package/dist/composables/useStripo.js +44 -41
  13. package/dist/composables/validators/useLiquidValidator.js +36 -0
  14. package/dist/config/compiler/liquidCompilerRules.js +15 -0
  15. package/dist/config/compiler/utils/recommendationCompilerUtils.js +53 -55
  16. package/dist/config/migrator/checkboxMigrator.js +5 -3
  17. package/dist/config/migrator/radioButtonMigrator.js +14 -12
  18. package/dist/enums/recommendation.js +2 -2
  19. package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
  20. package/dist/extensions/Blocks/Recommendation/block.js +1 -1
  21. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
  22. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
  23. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +95 -93
  24. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +75 -73
  25. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
  26. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
  27. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
  28. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
  29. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
  30. package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
  31. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
  32. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
  33. package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
  34. package/dist/guido.css +1 -1
  35. package/dist/src/@types/config/index.d.ts +1 -1
  36. package/dist/src/@types/config/schemas.d.ts +20 -0
  37. package/dist/src/@types/config/types.d.ts +3 -1
  38. package/dist/src/composables/useConfig.d.ts +8 -0
  39. package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
  40. package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
  41. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
  43. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  44. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
  45. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
  46. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  47. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  48. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
  49. package/dist/src/stores/config.d.ts +72 -0
  50. package/dist/src/stores/preview.d.ts +3 -0
  51. package/dist/src/utils/genericUtil.d.ts +1 -1
  52. package/dist/src/utils/htmlCompiler.d.ts +2 -1
  53. package/dist/stores/preview.js +4 -3
  54. package/dist/utils/genericUtil.js +42 -20
  55. package/dist/utils/htmlCompiler.js +48 -41
  56. package/dist/utils/templatePreparation.js +20 -20
  57. package/package.json +1 -1
package/README.md CHANGED
@@ -143,6 +143,7 @@ const config: GuidoConfigInput = {
143
143
  displayConditions?: boolean, // Default: true
144
144
  unsubscribe?: boolean, // Default: true
145
145
  modulesDisabled?: boolean, // Default: false - Disable modules panel
146
+ liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
146
147
  },
147
148
 
148
149
  // Optional: Callbacks
@@ -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 */
@@ -117,7 +124,7 @@ const m = {
117
124
  modulesDisabled: e(a(), !1),
118
125
  /** Enable Liquid template syntax */
119
126
  liquidSyntax: e(a(), !1)
120
- }), E = n([
127
+ }), g = n([
121
128
  "amp-accordion",
122
129
  "amp-carousel",
123
130
  "amp-form-controls",
@@ -131,7 +138,7 @@ const m = {
131
138
  "text-block",
132
139
  "timer-block",
133
140
  "video-block"
134
- ]), g = n([
141
+ ]), O = n([
135
142
  "dynamic-content",
136
143
  "checkbox-block",
137
144
  "radio-button-block",
@@ -139,66 +146,66 @@ const m = {
139
146
  "unsubscribe-block",
140
147
  "coupon-block",
141
148
  "items-block"
142
- ]), O = o({
149
+ ]), L = o({
143
150
  /** Default blocks to exclude from the editor */
144
151
  excludeDefaults: e(
145
- c(E),
152
+ c(g),
146
153
  []
147
154
  ),
148
155
  /** Custom blocks to include in the editor */
149
156
  includeCustoms: e(
150
- c(g),
157
+ c(O),
151
158
  []
152
159
  )
153
- }), l = o({
160
+ }), r = o({
154
161
  /** Unique identifier for the rule */
155
162
  id: t(),
156
163
  /** Human-readable description */
157
164
  description: e(t()),
158
165
  /** Priority for rule ordering (lower = earlier) */
159
166
  priority: p()
160
- }), L = o({
161
- ...l.entries,
162
- type: r("replace"),
167
+ }), M = o({
168
+ ...r.entries,
169
+ type: l("replace"),
163
170
  /** String to search for */
164
171
  search: t(),
165
172
  /** Replacement string */
166
173
  replacement: t(),
167
174
  /** Replace all occurrences (default: false) */
168
175
  replaceAll: e(a())
169
- }), M = o({
170
- ...l.entries,
171
- type: r("regex"),
176
+ }), N = o({
177
+ ...r.entries,
178
+ type: l("regex"),
172
179
  /** Regex pattern string */
173
180
  pattern: t(),
174
181
  /** Replacement string (supports $1, $2, etc.) */
175
182
  replacement: t(),
176
183
  /** Regex flags (e.g., 'gi') */
177
184
  flags: e(t())
178
- }), N = o({
179
- ...l.entries,
180
- type: r("remove"),
185
+ }), D = o({
186
+ ...r.entries,
187
+ type: l("remove"),
181
188
  /** Strings or patterns to remove */
182
189
  targets: c(t())
183
- }), D = o({
184
- ...l.entries,
185
- type: r("custom"),
190
+ }), v = o({
191
+ ...r.entries,
192
+ type: l("custom"),
186
193
  /** Custom processor function */
187
194
  processor: S(
188
195
  (i) => typeof i == "function",
189
196
  "processor must be a function"
190
197
  )
191
- }), v = k("type", [
192
- L,
198
+ }), x = k("type", [
193
199
  M,
194
200
  N,
195
- D
196
- ]), x = o({
201
+ D,
202
+ v
203
+ ]), U = o({
197
204
  /** Custom compiler rules to apply */
198
- customRules: e(c(v), []),
205
+ customRules: e(c(x), []),
199
206
  /** Skip default compiler rules */
200
207
  ignoreDefaultRules: e(a(), !1)
201
- }), U = o({
208
+ }), B = o({
202
209
  /**
203
210
  * External validation handler called before save completes.
204
211
  * Return false to cancel the save operation.
@@ -209,48 +216,49 @@ const m = {
209
216
  "externalValidation must be a function"
210
217
  )
211
218
  )
212
- }), F = o({
219
+ }), H = o({
213
220
  // Required sections
214
221
  /** Identity configuration (required) */
215
222
  identity: h,
216
223
  /** Partner configuration (required) */
217
- partner: y,
224
+ partner: f,
218
225
  // Optional sections (with defaults)
219
226
  /** Template content and presets */
220
- template: e(A, {}),
227
+ template: e(R, {}),
221
228
  /** Editor settings */
222
- editor: e(C, {}),
229
+ editor: e(T, {}),
223
230
  /** UI configuration */
224
- ui: e(T, {}),
231
+ ui: e(I, {}),
225
232
  /** Feature toggles */
226
- features: e(I, {}),
233
+ features: e(E, {}),
227
234
  /** Block configuration */
228
- blocks: e(O, {}),
235
+ blocks: e(L, {}),
229
236
  /** Compiler configuration */
230
- compiler: e(x, {}),
237
+ compiler: e(U, {}),
231
238
  /** Callbacks and event handlers */
232
- callbacks: e(U, {})
239
+ callbacks: e(B, {})
233
240
  });
234
241
  export {
235
- O as BlocksSchema,
236
- U as CallbacksSchema,
237
- v as CompilerRuleSchema,
238
- x as CompilerSchema,
239
- g as CustomBlockTypeSchema,
240
- D as CustomRuleSchema,
241
- E as DefaultBlockTypeSchema,
242
- f as DynamicContentSchema,
243
- C as EditorSchema,
244
- R as EmailHeaderSchema,
245
- I as FeaturesSchema,
246
- F as GuidoConfigSchema,
242
+ L as BlocksSchema,
243
+ B as CallbacksSchema,
244
+ x as CompilerRuleSchema,
245
+ U as CompilerSchema,
246
+ O as CustomBlockTypeSchema,
247
+ v as CustomRuleSchema,
248
+ g as DefaultBlockTypeSchema,
249
+ A as DynamicContentSchema,
250
+ T as EditorSchema,
251
+ C as EmailHeaderSchema,
252
+ y as FallbackFontSchema,
253
+ E as FeaturesSchema,
254
+ H as GuidoConfigSchema,
247
255
  h as IdentitySchema,
248
256
  m as MessageType,
249
- y as PartnerSchema,
257
+ f as PartnerSchema,
250
258
  s as ProductType,
251
- M as RegexRuleSchema,
252
- N as RemoveRuleSchema,
253
- L as ReplaceRuleSchema,
254
- A as TemplateSchema,
255
- T as UISchema
259
+ N as RegexRuleSchema,
260
+ D as RemoveRuleSchema,
261
+ M as ReplaceRuleSchema,
262
+ R as TemplateSchema,
263
+ I as UISchema
256
264
  };
@@ -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
  };
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var u = function() {
5
5
  var s, i, n, a;
6
6
  var o = this, e = o._self._c, t = o._self._setupProxy;
7
- return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.testEmailClick } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
7
+ return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
8
8
  return t.handleSave(!1);
9
9
  } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
10
10
  return t.executeSave(!1);
@@ -15,7 +15,7 @@ var u = function() {
15
15
  p,
16
16
  !1,
17
17
  null,
18
- "acff76a8"
18
+ "98f3d29b"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -1,51 +1,61 @@
1
- import { defineComponent as E, ref as n, computed as g } from "vue";
2
- import { useConfig as w } from "../../../composables/useConfig.js";
3
- import { useExport as C } from "../../../composables/useExport.js";
4
- import { useTestEmailClick as M } from "../../../composables/useGuidoActions.js";
5
- import { useSave as O } from "../../../composables/useSave.js";
6
- import { useTranslations as A } from "../../../composables/useTranslations.js";
7
- import { useVersionHistoryApi as k } from "../../../composables/useVersionHistoryApi.js";
8
- import { useEditorStore as B } from "../../../stores/editor.js";
9
- import { useTemplateStore as R } from "../../../stores/template.js";
10
- import { getTooltipOptions as b } from "../../../utils/tooltipUtils.js";
11
- import { InButtonV2 as D } from "@useinsider/design-system-vue";
12
- import { storeToRefs as I } from "pinia";
13
- import P from "./MigrationConfirmModal.vue.js";
14
- const Z = /* @__PURE__ */ E({
1
+ import { defineComponent as O, ref as n, computed as h } from "vue";
2
+ import { useActionsApi as q } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as b } from "../../../composables/useConfig.js";
4
+ import { useExport as k } from "../../../composables/useExport.js";
5
+ import { useTestEmailClick as B } from "../../../composables/useGuidoActions.js";
6
+ import { useHtmlCompiler as D } from "../../../composables/useHtmlCompiler.js";
7
+ import { useSave as F } from "../../../composables/useSave.js";
8
+ import { useTranslations as L } from "../../../composables/useTranslations.js";
9
+ import { useVersionHistoryApi as R } from "../../../composables/useVersionHistoryApi.js";
10
+ import { useLiquidValidator as z } from "../../../composables/validators/useLiquidValidator.js";
11
+ import { useEditorStore as I } from "../../../stores/editor.js";
12
+ import { useTemplateStore as P } from "../../../stores/template.js";
13
+ import { getTooltipOptions as j } from "../../../utils/tooltipUtils.js";
14
+ import { InButtonV2 as G } from "@useinsider/design-system-vue";
15
+ import { storeToRefs as J } from "pinia";
16
+ import K from "./MigrationConfirmModal.vue.js";
17
+ const ct = /* @__PURE__ */ O({
15
18
  __name: "EditorActions",
16
- setup(j, { expose: H }) {
17
- const { config: a } = w(), { exportHtml: m } = C(), { save: p } = O(), { openVersionHistory: l, closeVersionHistory: u } = k(), e = B(), c = R(), { hasMigrations: f } = I(c), r = A(), s = n(!1), i = n(!1), v = n(), S = M(), V = () => {
19
+ setup(N, { expose: x }) {
20
+ const { config: a, isFeatureEnabled: m } = b(), { exportHtml: l } = k(), { save: c } = F(), { openVersionHistory: p, closeVersionHistory: u } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations: H } = J(y), s = L(), i = n(!1), r = n(!1), S = n(), g = B(), T = () => {
18
21
  if (e.isVersionHistoryOpen) {
19
22
  u();
20
23
  return;
21
24
  }
22
- l();
23
- }, T = async () => {
24
- s.value = !0, await m(), s.value = !1;
25
+ p();
26
+ }, w = async () => {
27
+ i.value = !0, await l(), i.value = !1;
25
28
  }, _ = () => {
26
29
  e.isSaveAsTemplateDrawerOpen = !0;
27
- }, h = g(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), x = g(
30
+ }, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
28
31
  () => {
29
- var o, t;
30
- return ((t = (o = a.value) == null ? void 0 : o.features) == null ? void 0 : t.versionHistory) && !e.isPreviewModeOpen;
32
+ var t, o;
33
+ return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
31
34
  }
32
- ), d = async (o) => {
33
- i.value = !0, e.loadingStatus = !0;
34
- const t = await p(o);
35
- return i.value = !1, (o || !t) && (e.loadingStatus = !1), t;
36
- }, y = (o) => {
37
- var t;
38
- if (!o && f.value) {
39
- (t = v.value) == null || t.open();
35
+ ), V = async (t) => {
36
+ r.value = !0, e.loadingStatus = !0;
37
+ const o = await c(t);
38
+ return r.value = !1, (t || !o) && (e.loadingStatus = !1), o;
39
+ }, E = (t) => {
40
+ var o;
41
+ if (!t && H.value) {
42
+ (o = S.value) == null || o.open();
40
43
  return;
41
44
  }
42
- return d(o);
45
+ return V(t);
46
+ }, M = async () => {
47
+ if (m("liquidSyntax")) {
48
+ const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
49
+ if (!await v(o))
50
+ return;
51
+ }
52
+ g();
43
53
  };
44
- return H({
45
- handleSave: y
46
- }), { __sfc: !0, config: a, exportHtml: m, save: p, openVersionHistory: l, closeVersionHistory: u, editorStore: e, templateStore: c, hasMigrations: f, trans: r, isExporting: s, isSaving: i, migrationModalRef: v, testEmailClick: S, handleVersionHistory: V, handleExport: T, handleSaveAs: _, versionHistoryTooltipText: h, isVersionHistoryButtonVisible: x, executeSave: d, handleSave: y, getTooltipOptions: b, InButtonV2: D, MigrationConfirmModal: P };
54
+ return x({
55
+ handleSave: E
56
+ }), { __sfc: !0, config: a, isFeatureEnabled: m, exportHtml: l, save: c, openVersionHistory: p, closeVersionHistory: u, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations: H, trans: s, isExporting: i, isSaving: r, migrationModalRef: S, testEmailClick: g, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
47
57
  }
48
58
  });
49
59
  export {
50
- Z as default
60
+ ct as default
51
61
  };
@@ -1,17 +1,17 @@
1
- import o from "./RightSlot.vue2.js";
2
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
4
- var r = this, t = r._self._c, e = r._self._setupProxy;
5
- return t("div", { staticClass: "d-f" }, [e.editorStore.isVersionHistoryOpen ? t(e.RestoreButton) : t(e.EditorActions, { ref: "editorActionsRef" })], 1);
6
- }, i = [], _ = /* @__PURE__ */ s(
7
- o,
8
- n,
1
+ import i from "./RightSlot.vue2.js";
2
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var o = function() {
4
+ var s = this, e = s._self._c, t = s._self._setupProxy;
5
+ return e("div", { staticClass: "d-f a-i-c" }, [t.isLiquidEnabled && !t.editorStore.isVersionHistoryOpen ? e(t.InChips, { staticClass: "mr-3", attrs: { id: "guido__liquid-tag-chip", styles: "stroke", type: "default", value: "liquid-tags", "close-button": !1, "disabled-status": t.editorStore.loadingStatus, interactive: !1, text: t.trans("email-editor.liquid-tags-enabled") } }) : s._e(), t.editorStore.isVersionHistoryOpen ? e(t.RestoreButton) : e(t.EditorActions, { ref: "editorActionsRef" })], 1);
6
+ }, a = [], n = /* @__PURE__ */ r(
9
7
  i,
8
+ o,
9
+ a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const l = _.exports;
14
+ const u = n.exports;
15
15
  export {
16
- l as default
16
+ u as default
17
17
  };
@@ -1,19 +1,22 @@
1
- import { defineComponent as i, ref as s } from "vue";
2
- import { useEditorStore as m } from "../../../stores/editor.js";
3
- import f from "./EditorActions.vue.js";
4
- import a from "./version-history/RestoreButton.vue.js";
5
- const l = /* @__PURE__ */ i({
1
+ import { defineComponent as a, ref as f, computed as p } from "vue";
2
+ import { useConfig as u } from "../../../composables/useConfig.js";
3
+ import { useTranslations as d } from "../../../composables/useTranslations.js";
4
+ import { useEditorStore as c } from "../../../stores/editor.js";
5
+ import { InChips as l } from "@useinsider/design-system-vue";
6
+ import _ from "./EditorActions.vue.js";
7
+ import S from "./version-history/RestoreButton.vue.js";
8
+ const x = /* @__PURE__ */ a({
6
9
  __name: "RightSlot",
7
- setup(p, { expose: e }) {
8
- const r = m(), o = s(null);
9
- return e({
10
- handleSave: (n) => {
11
- var t;
12
- return (t = o.value) == null ? void 0 : t.handleSave(n);
10
+ setup(h, { expose: r }) {
11
+ const { isFeatureEnabled: o } = u(), n = d(), i = c(), t = f(null), s = p(() => o("liquidSyntax"));
12
+ return r({
13
+ handleSave: (m) => {
14
+ var e;
15
+ return (e = t.value) == null ? void 0 : e.handleSave(m);
13
16
  }
14
- }), { __sfc: !0, editorStore: r, editorActionsRef: o, EditorActions: f, RestoreButton: a };
17
+ }), { __sfc: !0, isFeatureEnabled: o, trans: n, editorStore: i, editorActionsRef: t, isLiquidEnabled: s, InChips: l, EditorActions: _, RestoreButton: S };
15
18
  }
16
19
  });
17
20
  export {
18
- l as default
21
+ x as default
19
22
  };
@@ -1,28 +1,30 @@
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,
14
- ...R,
15
- ...u,
16
- ...c,
1
+ import { defaultHtmlCompilerRules as c } from "../config/compiler/htmlCompilerRules.js";
2
+ import { itemsCompilerRules as f } from "../config/compiler/itemsCompilerRules.js";
3
+ import { liquidCompilerRules as R } from "../config/compiler/liquidCompilerRules.js";
4
+ import { outlookCompilerRules as C } from "../config/compiler/outlookCompilerRules.js";
5
+ import { recommendationCompilerRules as d } from "../config/compiler/recommendationCompilerRules.js";
6
+ import { socialCompilerRules as b } from "../config/compiler/socialCompilerRules.js";
7
+ import { unsubscribeCompilerRules as g } from "../config/compiler/unsubscribeCompilerRules.js";
8
+ import { createHtmlCompiler as H } from "../utils/htmlCompiler.js";
9
+ import { useConfig as v } from "./useConfig.js";
10
+ const w = () => {
11
+ var l, m, r;
12
+ const { compiler: e, isFeatureEnabled: t, partner: i } = v(), s = ((l = e.value) == null ? void 0 : l.customRules) || [], u = [
13
+ ...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] : c,
14
+ ...d,
15
+ ...g,
17
16
  ...f,
18
- ...r.map((o, s) => ({
17
+ ...C,
18
+ ...b,
19
+ ...t("liquidSyntax") ? R : [],
20
+ ...s.map((o, a) => ({
19
21
  ...o,
20
- priority: o.priority + 1e3 + s
22
+ priority: o.priority + 1e3 + a
21
23
  // Ensure additional rules run after default rules
22
24
  }))
23
- ], i = a(t);
24
- return { compileHtml: (o) => i.compile(o) };
25
+ ], p = H(u), n = (r = i.value) == null ? void 0 : r.fallbackFont;
26
+ return { compileHtml: (o) => p.compile(o, void 0, n) };
25
27
  };
26
28
  export {
27
- B as useHtmlCompiler
29
+ w as useHtmlCompiler
28
30
  };
@@ -1,31 +1,35 @@
1
- import { useEditorStore as n } from "../stores/editor.js";
2
- import { usePreviewStore as l } from "../stores/preview.js";
3
- import { useActionsApi as m } from "./useActionsApi.js";
4
- import { useCodeEditorApi as p } from "./useCodeEditorApi.js";
5
- const E = () => {
6
- const o = n(), e = l(), { closeCodeEditor: a } = p(), { getPreviewData: s } = m(), r = () => {
7
- o.isPreviewModeOpen = !1, e.$reset();
1
+ import { useEditorStore as d } from "../stores/editor.js";
2
+ import { usePreviewStore as n } from "../stores/preview.js";
3
+ import { useActionsApi as p } from "./useActionsApi.js";
4
+ import { useCodeEditorApi as c } from "./useCodeEditorApi.js";
5
+ import { useHtmlCompiler as u } from "./useHtmlCompiler.js";
6
+ const g = () => {
7
+ const t = d(), e = n(), { closeCodeEditor: i } = c(), { getPreviewData: a, getCompiledEmail: s } = p(), { compileHtml: m } = u(), r = () => {
8
+ t.isPreviewModeOpen = !1, e.$reset();
8
9
  };
9
10
  return {
10
11
  closePreviewMode: r,
11
12
  openPreviewMode: () => {
12
- o.isCodeEditorOpen && a(), o.isPreviewModeOpen = !0;
13
+ t.isCodeEditorOpen && i(), t.isPreviewModeOpen = !0;
13
14
  },
14
15
  loadPreviewData: async () => {
15
- if (!(o.loadingStatus || e.isLoaded)) {
16
- o.loadingStatus = !0;
16
+ if (!(t.loadingStatus || e.isLoaded)) {
17
+ t.loadingStatus = !0;
17
18
  try {
18
- const { html: t, ampHtml: i, ampErrors: d } = await s();
19
- e.templateHtml = t || "", e.ampHtml = i || "", e.ampErrors = d || [], e.setEmailFormat(i ? "AMP" : "html"), e.isLoaded = !0;
20
- } catch (t) {
21
- console.error("Failed to load preview data:", t), r();
19
+ const [o, l] = await Promise.all([
20
+ a(),
21
+ s({ minimize: !0, resetDataSavedFlag: !1 })
22
+ ]);
23
+ e.templateHtml = o.html || "", e.ampHtml = o.ampHtml || "", e.ampErrors = o.ampErrors || [], e.setEmailFormat(o.ampHtml ? "AMP" : "html"), e.emailSizeKB = m(l.html).estimatedSizeKB, e.isLoaded = !0;
24
+ } catch (o) {
25
+ console.error("Failed to load preview data:", o), r();
22
26
  } finally {
23
- o.loadingStatus = !1;
27
+ t.loadingStatus = !1;
24
28
  }
25
29
  }
26
30
  }
27
31
  };
28
32
  };
29
33
  export {
30
- E as usePreviewMode
34
+ g as usePreviewMode
31
35
  };