@useinsider/guido 3.11.0-beta.17c184c → 3.11.0-beta.181af4d

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 (46) hide show
  1. package/dist/@types/config/schemas.js +101 -112
  2. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  3. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +21 -0
  4. package/dist/components/organisms/header/EditorActions.vue.js +11 -11
  5. package/dist/components/organisms/header/EditorActions.vue2.js +34 -50
  6. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  7. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +39 -0
  8. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  9. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  10. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  11. package/dist/components/organisms/header/RightSlot.vue2.js +15 -15
  12. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  13. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  14. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
  15. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  16. package/dist/composables/useAccessibilityApi.js +31 -0
  17. package/dist/config/i18n/en/labels.json.js +17 -0
  18. package/dist/enums/unsubscribe.js +31 -35
  19. package/dist/guido.css +1 -1
  20. package/dist/node_modules/@vueuse/core/index.js +102 -0
  21. package/dist/node_modules/@vueuse/shared/index.js +40 -28
  22. package/dist/src/@types/config/defaults.d.ts +1 -5
  23. package/dist/src/@types/config/index.d.ts +3 -3
  24. package/dist/src/@types/config/schemas.d.ts +4 -21
  25. package/dist/src/@types/config/types.d.ts +1 -5
  26. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  27. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  28. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  29. package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
  30. package/dist/src/composables/useActionsApi.d.ts +2 -2
  31. package/dist/src/composables/useConfig.d.ts +2 -3
  32. package/dist/src/enums/unsubscribe.d.ts +2 -2
  33. package/dist/src/library.d.ts +1 -1
  34. package/dist/src/stores/config.d.ts +19 -192
  35. package/dist/src/stores/editor.d.ts +105 -0
  36. package/dist/src/stores/version-history.d.ts +1 -1
  37. package/dist/src/utils/environmentUtil.d.ts +2 -5
  38. package/dist/src/utils/timeUtil.d.ts +10 -0
  39. package/dist/stores/config.js +20 -27
  40. package/dist/stores/editor.js +5 -1
  41. package/dist/utils/environmentUtil.js +2 -8
  42. package/dist/utils/timeUtil.js +6 -17
  43. package/package.json +1 -1
  44. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  45. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  46. /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
2
- import { object as o, number as c, optional as e, string as t, picklist as i, pipe as l, minLength as m, custom as h, boolean as a, array as n, record as y, literal as u, looseObject as k, variant as g, union as f, unknown as s } from "../../node_modules/valibot/dist/index.js";
3
- const b = {
2
+ import { object as a, number as s, optional as e, string as t, picklist as i, pipe as p, minLength as b, custom as y, boolean as o, array as c, record as h, literal as l, looseObject as k, variant as g, union as f, unknown as n } from "../../node_modules/valibot/dist/index.js";
3
+ const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
6
6
  /** Transactional/system emails */
@@ -12,29 +12,29 @@ const b = {
12
12
  ARCHITECT: 49,
13
13
  /** Unsubscribe page builder */
14
14
  UNSUBSCRIBE_PAGES: 97
15
- }, R = o({
15
+ }, R = a({
16
16
  /** Unique identifier for the template being edited */
17
- templateId: l(
17
+ templateId: p(
18
18
  t(),
19
- m(1, "templateId is required")
19
+ b(1, "templateId is required")
20
20
  ),
21
21
  /** Unique identifier for the user editing the template */
22
- userId: l(
22
+ userId: p(
23
23
  t(),
24
- m(1, "userId is required")
24
+ b(1, "userId is required")
25
25
  ),
26
26
  /** Optional variation ID for A/B testing */
27
27
  variationId: e(t())
28
- }), T = o({
28
+ }), T = a({
29
29
  /** Fallback font name (e.g., "Georgia") */
30
30
  name: t(),
31
31
  /** Fallback font family (e.g., "serif" or "sans-serif") */
32
32
  family: t()
33
- }), C = o({
33
+ }), C = a({
34
34
  /** Partner/organization name (required) */
35
- name: l(
35
+ name: p(
36
36
  t(),
37
- m(1, "partner.name is required")
37
+ b(1, "partner.name is required")
38
38
  ),
39
39
  /** Product type identifier */
40
40
  productType: e(
@@ -47,14 +47,14 @@ const b = {
47
47
  ),
48
48
  /** Message type (promotional or transactional) */
49
49
  messageType: e(
50
- i([b.PROMOTIONAL, b.TRANSACTIONAL]),
51
- b.PROMOTIONAL
50
+ i([d.PROMOTIONAL, d.TRANSACTIONAL]),
51
+ d.PROMOTIONAL
52
52
  ),
53
53
  /** Display name for the current user */
54
54
  username: e(t(), "Guido User"),
55
55
  /** Fallback font settings from partner settings — used to match backend size calculation */
56
56
  fallbackFont: e(T)
57
- }), A = o({
57
+ }), A = a({
58
58
  /** Display text for the dynamic content */
59
59
  text: t(),
60
60
  /** Template variable value (e.g., {{username}}) */
@@ -63,57 +63,57 @@ const b = {
63
63
  fallback: e(t()),
64
64
  /** Optional formatting options */
65
65
  format: e(
66
- o({
66
+ a({
67
67
  key: t(),
68
68
  value: t()
69
69
  })
70
70
  )
71
71
  }), I = k({
72
72
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
73
- id: e(c()),
73
+ id: e(s()),
74
74
  /** Decimal places for price display (legacy data may use string or number) */
75
- decimalCount: e(f([t(), c()])),
75
+ decimalCount: e(f([t(), s()])),
76
76
  /** Pinned product IDs (empty array when filter-driven) */
77
- productIds: e(n(s())),
77
+ productIds: e(c(n())),
78
78
  /** Whether the block requested live products at send time */
79
- sendProductRequestFlag: e(a()),
79
+ sendProductRequestFlag: e(o()),
80
80
  /** Whether to randomize product order */
81
- shuffleProducts: e(a()),
81
+ shuffleProducts: e(o()),
82
82
  /** Filter rules driving product selection */
83
- filters: e(n(s())),
83
+ filters: e(c(n())),
84
84
  /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
85
85
  currency: e(t()),
86
86
  /** Currency display settings (separators, alignment, decimals) */
87
- currencySettings: e(s()),
87
+ currencySettings: e(n()),
88
88
  /** Locale (e.g. 'nl_NL') */
89
89
  language: e(t()),
90
90
  /** Recommendation strategy key (e.g. 'newArrivals') */
91
91
  strategy: e(t()),
92
92
  /** Snapshot of products as rendered by the legacy block */
93
- recommendedProducts: e(n(s())),
93
+ recommendedProducts: e(c(n())),
94
94
  /** Number of product cards per row */
95
- cardsInRow: e(c()),
95
+ cardsInRow: e(s()),
96
96
  /** Mobile-only padding (right) */
97
- mobileRightPadding: e(c()),
97
+ mobileRightPadding: e(s()),
98
98
  /** Mobile-only padding (left) */
99
- mobileLeftPadding: e(c()),
99
+ mobileLeftPadding: e(s()),
100
100
  /** Disable responsive scaling */
101
- unresponsive: e(a()),
101
+ unresponsive: e(o()),
102
102
  /** Layout orientation ('vertical' | 'horizontal') */
103
103
  orientation: e(t()),
104
104
  /** Whether long text is trimmed */
105
- textTrimming: e(a()),
105
+ textTrimming: e(o()),
106
106
  /** Block type marker used by some legacy variants */
107
107
  blockType: e(t()),
108
108
  /** Size variant marker (legacy data may use string or number) */
109
- size: e(f([t(), c()])),
109
+ size: e(f([t(), s()])),
110
110
  /** Vertical responsiveness flag (legacy size=1 variants) */
111
- verticalResponsiveness: e(a()),
111
+ verticalResponsiveness: e(o()),
112
112
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
113
- isPriceMovedToNextLine: e(a()),
113
+ isPriceMovedToNextLine: e(o()),
114
114
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
115
- isPriceDeletedForZeroSale: e(a())
116
- }), v = o({
115
+ isPriceDeletedForZeroSale: e(o())
116
+ }), L = a({
117
117
  /**
118
118
  * Legacy recommendation block configs keyed by block ID.
119
119
  * Pass this when loading a template authored with the v1
@@ -121,70 +121,72 @@ const b = {
121
121
  * strategy, currency, locale, and layout data.
122
122
  */
123
123
  recommendationConfigs: e(
124
- y(t(), I),
124
+ h(t(), I),
125
125
  {}
126
126
  )
127
- }), E = o({
127
+ }), P = a({
128
128
  /** Initial HTML content */
129
129
  html: e(t(), ""),
130
130
  /** Initial CSS content */
131
131
  css: e(t(), ""),
132
132
  /** Preselected dynamic content items */
133
133
  preselectedDynamicContent: e(
134
- n(A),
134
+ c(A),
135
135
  []
136
136
  ),
137
137
  /** Valid custom field attribute names from the partner's categorized fields */
138
- customFieldAttributes: e(n(t()), []),
138
+ customFieldAttributes: e(c(t()), []),
139
139
  /** Selected unsubscribe page IDs */
140
- selectedUnsubscribePages: e(n(c()), []),
140
+ selectedUnsubscribePages: e(c(s()), []),
141
141
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
142
- forceRecreate: e(a(), !1),
142
+ forceRecreate: e(o(), !1),
143
143
  /** Migration-only inputs (legacy block configs) */
144
- migration: e(v, {})
145
- }), L = o({
144
+ migration: e(L, {})
145
+ }), v = a({
146
146
  /** Sender display name */
147
147
  senderName: e(t(), ""),
148
148
  /** Email subject line */
149
149
  subject: e(t(), "")
150
- }), P = o({
150
+ }), E = a({
151
151
  /** Locale for the editor UI */
152
152
  locale: e(t(), "en"),
153
153
  /** Path to translations object */
154
154
  translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
155
155
  /** Migration date for template compatibility */
156
- migrationDate: e(c(), 1759696858),
156
+ migrationDate: e(s(), 1759696858),
157
157
  /** Email header settings */
158
- emailHeader: e(L, { senderName: "", subject: "" }),
158
+ emailHeader: e(v, { senderName: "", subject: "" }),
159
159
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
160
160
  savedModulesFolderName: e(t(), S.SAVED_MODULES),
161
161
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
162
162
  defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
163
- }), M = o({
163
+ }), M = a({
164
164
  /** Whether to show the header bar */
165
- showHeader: e(a(), !0),
165
+ showHeader: e(o(), !0),
166
166
  /** Custom label for back button (if shown) */
167
167
  backButtonLabel: e(t())
168
- }), O = o({
168
+ }), O = a({
169
169
  /** Enable dynamic content insertion */
170
- dynamicContent: e(a(), !0),
170
+ dynamicContent: e(o(), !0),
171
171
  /** Enable save as template functionality */
172
- saveAsTemplate: e(a(), !0),
172
+ saveAsTemplate: e(o(), !0),
173
173
  /** Enable version history */
174
- versionHistory: e(a(), !0),
174
+ versionHistory: e(o(), !0),
175
175
  /** Enable test message sending */
176
- testMessage: e(a(), !0),
176
+ testMessage: e(o(), !0),
177
177
  /** Enable display conditions */
178
- displayConditions: e(a(), !0),
178
+ displayConditions: e(o(), !0),
179
179
  /** Enable unsubscribe block */
180
- unsubscribe: e(a(), !0),
180
+ unsubscribe: e(o(), !0),
181
181
  /** Disable modules panel in the editor */
182
- modulesDisabled: e(a(), !1),
182
+ modulesDisabled: e(o(), !1),
183
183
  /** Enable Liquid template syntax */
184
- liquidSyntax: e(a(), !1),
184
+ liquidSyntax: e(o(), !1),
185
185
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
186
- autosave: e(a(), !1)
187
- }), x = i([
186
+ autosave: e(o(), !1),
187
+ /** Enable the Stripo Accessibility Checker control in the editor toolbar. */
188
+ accessibilityTesting: e(o(), !1)
189
+ }), N = i([
188
190
  "amp-accordion",
189
191
  "amp-carousel",
190
192
  "amp-form-controls",
@@ -198,7 +200,7 @@ const b = {
198
200
  "text-block",
199
201
  "timer-block",
200
202
  "video-block"
201
- ]), N = i([
203
+ ]), D = i([
202
204
  "dynamic-content",
203
205
  "checkbox-block",
204
206
  "radio-button-block",
@@ -206,53 +208,53 @@ const b = {
206
208
  "unsubscribe-block",
207
209
  "coupon-block",
208
210
  "items-block"
209
- ]), D = o({
211
+ ]), x = a({
210
212
  /** Default blocks to exclude from the editor */
211
213
  excludeDefaults: e(
212
- n(x),
214
+ c(N),
213
215
  []
214
216
  ),
215
217
  /** Custom blocks to include in the editor */
216
218
  includeCustoms: e(
217
- n(N),
219
+ c(D),
218
220
  []
219
221
  )
220
- }), d = o({
222
+ }), m = a({
221
223
  /** Unique identifier for the rule */
222
224
  id: t(),
223
225
  /** Human-readable description */
224
226
  description: e(t()),
225
227
  /** Priority for rule ordering (lower = earlier) */
226
- priority: c()
227
- }), F = o({
228
- ...d.entries,
229
- type: u("replace"),
228
+ priority: s()
229
+ }), F = a({
230
+ ...m.entries,
231
+ type: l("replace"),
230
232
  /** String to search for */
231
233
  search: t(),
232
234
  /** Replacement string */
233
235
  replacement: t(),
234
236
  /** Replace all occurrences (default: false) */
235
- replaceAll: e(a())
236
- }), U = o({
237
- ...d.entries,
238
- type: u("regex"),
237
+ replaceAll: e(o())
238
+ }), U = a({
239
+ ...m.entries,
240
+ type: l("regex"),
239
241
  /** Regex pattern string */
240
242
  pattern: t(),
241
243
  /** Replacement string (supports $1, $2, etc.) */
242
244
  replacement: t(),
243
245
  /** Regex flags (e.g., 'gi') */
244
246
  flags: e(t())
245
- }), B = o({
246
- ...d.entries,
247
- type: u("remove"),
247
+ }), B = a({
248
+ ...m.entries,
249
+ type: l("remove"),
248
250
  /** Strings or patterns to remove */
249
- targets: n(t())
250
- }), w = o({
251
- ...d.entries,
252
- type: u("custom"),
251
+ targets: c(t())
252
+ }), w = a({
253
+ ...m.entries,
254
+ type: l("custom"),
253
255
  /** Custom processor function */
254
- processor: h(
255
- (p) => typeof p == "function",
256
+ processor: y(
257
+ (u) => typeof u == "function",
256
258
  "processor must be a function"
257
259
  )
258
260
  }), H = g("type", [
@@ -260,33 +262,23 @@ const b = {
260
262
  U,
261
263
  B,
262
264
  w
263
- ]), j = o({
265
+ ]), j = a({
264
266
  /** Custom compiler rules to apply */
265
- customRules: e(n(H), []),
267
+ customRules: e(c(H), []),
266
268
  /** Skip default compiler rules */
267
- ignoreDefaultRules: e(a(), !1)
268
- }), q = o({
269
+ ignoreDefaultRules: e(o(), !1)
270
+ }), q = a({
269
271
  /**
270
272
  * External validation handler called before save completes.
271
273
  * Return false to cancel the save operation.
272
274
  */
273
275
  externalValidation: e(
274
- h(
275
- (p) => typeof p == "function",
276
+ y(
277
+ (u) => typeof u == "function",
276
278
  "externalValidation must be a function"
277
279
  )
278
280
  )
279
- }), G = o({
280
- /**
281
- * Environment prefix for runtime-built hosts (unsubscribe / preference-center
282
- * links compile to `https://mail.<prefix>.com/...`). When omitted, the prefix
283
- * is derived from the hostname with a safe production fallback (SD-145225).
284
- */
285
- prefix: e(l(
286
- t(),
287
- m(1, "environment.prefix cannot be empty")
288
- ))
289
- }), z = o({
281
+ }), V = a({
290
282
  // Required sections
291
283
  /** Identity configuration (required) */
292
284
  identity: R,
@@ -294,46 +286,43 @@ const b = {
294
286
  partner: C,
295
287
  // Optional sections (with defaults)
296
288
  /** Template content and presets */
297
- template: e(E, {}),
289
+ template: e(P, {}),
298
290
  /** Editor settings */
299
- editor: e(P, {}),
291
+ editor: e(E, {}),
300
292
  /** UI configuration */
301
293
  ui: e(M, {}),
302
294
  /** Feature toggles */
303
295
  features: e(O, {}),
304
296
  /** Block configuration */
305
- blocks: e(D, {}),
297
+ blocks: e(x, {}),
306
298
  /** Compiler configuration */
307
299
  compiler: e(j, {}),
308
300
  /** Callbacks and event handlers */
309
- callbacks: e(q, {}),
310
- /** Deployment environment context */
311
- environment: e(G, {})
301
+ callbacks: e(q, {})
312
302
  });
313
303
  export {
314
- D as BlocksSchema,
304
+ x as BlocksSchema,
315
305
  q as CallbacksSchema,
316
306
  H as CompilerRuleSchema,
317
307
  j as CompilerSchema,
318
- N as CustomBlockTypeSchema,
308
+ D as CustomBlockTypeSchema,
319
309
  w as CustomRuleSchema,
320
- x as DefaultBlockTypeSchema,
310
+ N as DefaultBlockTypeSchema,
321
311
  A as DynamicContentSchema,
322
- P as EditorSchema,
323
- L as EmailHeaderSchema,
324
- G as EnvironmentSchema,
312
+ E as EditorSchema,
313
+ v as EmailHeaderSchema,
325
314
  T as FallbackFontSchema,
326
315
  O as FeaturesSchema,
327
- z as GuidoConfigSchema,
316
+ V as GuidoConfigSchema,
328
317
  R as IdentitySchema,
329
318
  I as LegacyRecommendationConfigSchema,
330
- b as MessageType,
319
+ d as MessageType,
331
320
  C as PartnerSchema,
332
321
  r as ProductType,
333
322
  U as RegexRuleSchema,
334
323
  B as RemoveRuleSchema,
335
324
  F as ReplaceRuleSchema,
336
- v as TemplateMigrationSchema,
337
- E as TemplateSchema,
325
+ L as TemplateMigrationSchema,
326
+ P as TemplateSchema,
338
327
  M as UISchema
339
328
  };
@@ -0,0 +1,17 @@
1
+ import e from "./AutoSaveStatus.vue2.js";
2
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ var s = this, t = s._self._c, a = s._self._setupProxy;
5
+ return a.isFeatureEnabled("autosave") ? t("div", { staticClass: "d-f a-i-c mr-3 auto-save-status" }, [a.autosaveStore.status === a.AUTOSAVE_STATUS.SAVING ? t("span", { staticClass: "d-f a-i-c f-s-1" }, [t(a.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), t("span", { staticClass: "ml-1 t-c-53" }, [s._v(s._s(a.trans("newsletter.saving")))])], 1) : a.savedLabel ? t("span", { staticClass: "f-s-1 t-c-53" }, [s._v(s._s(a.savedLabel))]) : s._e()]) : s._e();
6
+ }, _ = [], o = /* @__PURE__ */ r(
7
+ e,
8
+ n,
9
+ _,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const u = o.exports;
15
+ export {
16
+ u as default
17
+ };
@@ -0,0 +1,21 @@
1
+ import { defineComponent as i, computed as u } from "vue";
2
+ import { useConfig as d } from "../../../composables/useConfig.js";
3
+ import { useTranslations as p } from "../../../composables/useTranslations.js";
4
+ import { useAutosaveStore as f, AUTOSAVE_STATUS as o } from "../../../stores/autosave.js";
5
+ import { autoSaveTimestamp as S } from "../../../utils/timeUtil.js";
6
+ import { InLoading as c } from "@useinsider/design-system-vue";
7
+ const g = /* @__PURE__ */ i({
8
+ __name: "AutoSaveStatus",
9
+ setup(v) {
10
+ const { isFeatureEnabled: a } = d(), t = f(), e = p(), s = u(() => {
11
+ if (t.status !== o.SAVED || !t.lastSavedAt)
12
+ return "";
13
+ const { isToday: r, time: m, date: n } = S(t.lastSavedAt);
14
+ return r ? e("email-editor.autosaved-at-today", { time: m }) : e("email-editor.autosaved-at-date", { date: n });
15
+ });
16
+ return { __sfc: !0, isFeatureEnabled: a, autosaveStore: t, trans: e, savedLabel: s, AUTOSAVE_STATUS: o, InLoading: c };
17
+ }
18
+ });
19
+ export {
20
+ g as default
21
+ };
@@ -1,21 +1,21 @@
1
- import l from "./EditorActions.vue2.js";
1
+ import r from "./EditorActions.vue2.js";
2
2
  /* empty css */
3
- import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var u = function() {
5
- var s, i, n, a;
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.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) {
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var l = function() {
5
+ var i, s;
6
+ var e = this, o = e._self._c, t = e._self._setupProxy;
7
+ return o("div", { staticClass: "d-f a-i-c editor-actions" }, [(s = (i = t.config) == null ? void 0 : i.features) != null && s.testMessage && !t.editorStore.isPreviewModeOpen ? o(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 } }) : e._e(), t.editorStore.isPreviewModeOpen ? e._e() : o(t.EditorActionsMenu), t.editorStore.isPreviewModeOpen ? e._e() : o(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(n) {
8
8
  return t.handleSave(!1);
9
- } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
9
+ } } }), o(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(n) {
10
10
  return t.executeSave(!1);
11
11
  } } })], 1);
12
- }, p = [], c = /* @__PURE__ */ d(
12
+ }, d = [], c = /* @__PURE__ */ a(
13
+ r,
13
14
  l,
14
- u,
15
- p,
15
+ d,
16
16
  !1,
17
17
  null,
18
- "6e711fd7"
18
+ "d51fb931"
19
19
  );
20
20
  const v = c.exports;
21
21
  export {
@@ -1,66 +1,50 @@
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 ut = /* @__PURE__ */ O({
1
+ import { defineComponent as C, ref as g } from "vue";
2
+ import { useActionsApi as y } from "../../../composables/useActionsApi.js";
3
+ import { useConfig as T } from "../../../composables/useConfig.js";
4
+ import { useTestEmailClick as M } from "../../../composables/useGuidoActions.js";
5
+ import { useHtmlCompiler as h } from "../../../composables/useHtmlCompiler.js";
6
+ import { useSave as x } from "../../../composables/useSave.js";
7
+ import { useTranslations as A } from "../../../composables/useTranslations.js";
8
+ import { useLiquidValidator as V } from "../../../composables/validators/useLiquidValidator.js";
9
+ import { useEditorStore as q } from "../../../stores/editor.js";
10
+ import { useTemplateStore as w } from "../../../stores/template.js";
11
+ import { getTooltipOptions as H } from "../../../utils/tooltipUtils.js";
12
+ import { InButtonV2 as k } from "@useinsider/design-system-vue";
13
+ import { storeToRefs as F } from "pinia";
14
+ import L from "./EditorActionsMenu.vue.js";
15
+ import R from "./MigrationConfirmModal.vue.js";
16
+ const Z = /* @__PURE__ */ C({
18
17
  __name: "EditorActions",
19
- setup(N, { expose: x }) {
20
- const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations: g } = J(y), s = L(), i = n(!1), r = n(!1), S = n(), H = B(), T = () => {
21
- if (e.isVersionHistoryOpen) {
22
- p();
23
- return;
24
- }
25
- c();
26
- }, w = async () => {
27
- i.value = !0, await m(), i.value = !1;
28
- }, _ = () => {
29
- e.isSaveAsTemplateDrawerOpen = !0;
30
- }, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
31
- () => {
32
- var t, o;
33
- return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
34
- }
35
- ), V = async (t) => {
36
- r.value = !0, t || (e.loadingStatus = !0);
37
- const o = await u(t);
38
- return r.value = !1, !t && !o && (e.loadingStatus = !1), o;
39
- }, E = (t) => {
18
+ setup(b, { expose: v }) {
19
+ const { config: S, isFeatureEnabled: a } = T(), { save: r } = x(), { getCompiledEmail: s } = y(), { compileHtml: n } = h(), { validateLiquidSyntax: m } = V(), e = q(), l = w(), { hasMigrations: f } = F(l), E = A(), i = g(!1), u = g(), c = M(), p = async (t) => {
20
+ i.value = !0, t || (e.loadingStatus = !0);
21
+ const o = await r(t);
22
+ return i.value = !1, !t && !o && (e.loadingStatus = !1), o;
23
+ }, d = (t) => {
40
24
  var o;
41
- if (!t && g.value) {
42
- (o = S.value) == null || o.open();
25
+ if (!t && f.value) {
26
+ (o = u.value) == null || o.open();
43
27
  return;
44
28
  }
45
- return V(t);
46
- }, M = async () => {
47
- if (l("liquidSyntax")) {
29
+ return p(t);
30
+ }, _ = async () => {
31
+ if (a("liquidSyntax")) {
48
32
  e.loadingStatus = !0;
49
33
  try {
50
- const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
51
- if (!await v(o))
34
+ const { html: t } = await s({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = n(t);
35
+ if (!await m(o))
52
36
  return;
53
37
  } finally {
54
38
  e.loadingStatus = !1;
55
39
  }
56
40
  }
57
- H();
41
+ c();
58
42
  };
59
- return x({
60
- handleSave: E
61
- }), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations: g, trans: s, isExporting: i, isSaving: r, migrationModalRef: S, testEmailClick: H, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
43
+ return v({
44
+ handleSave: d
45
+ }), { __sfc: !0, config: S, isFeatureEnabled: a, save: r, getCompiledEmail: s, compileHtml: n, validateLiquidSyntax: m, editorStore: e, templateStore: l, hasMigrations: f, trans: E, isSaving: i, migrationModalRef: u, testEmailClick: c, executeSave: p, handleSave: d, handleTestEmail: _, getTooltipOptions: H, InButtonV2: k, EditorActionsMenu: L, MigrationConfirmModal: R };
62
46
  }
63
47
  });
64
48
  export {
65
- ut as default
49
+ Z as default
66
50
  };
@@ -0,0 +1,20 @@
1
+ import i from "./EditorActionsMenu.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var s = this, e = s._self._c, t = s._self._setupProxy;
6
+ return e("div", { ref: "root", staticClass: "editor-actions-menu p-r" }, [e(t.InButtonV2, { attrs: { id: "guido__kebab-button", "data-testid": "Editor Actions Menu", "left-icon": "line-more-vertical", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.loadingStatus, "label-text-status": !1, "selected-status": t.isOpen, "tooltip-options": t.getTooltipOptions("guido__kebab-button"), "tooltip-text": t.trans("email-editor.more-actions") }, on: { click: function(l) {
7
+ t.isOpen = !t.isOpen;
8
+ } } }), t.isOpen ? e("div", { staticClass: "editor-actions-menu__panel p-a" }, [t.isAutosaveVisible ? [e("p", { staticClass: "editor-actions-menu__section f-s-1 t-c-55" }, [s._v(" " + s._s(t.trans("email-editor.preferences")) + " ")]), e("div", { staticClass: "editor-actions-menu__row editor-actions-menu__row_static d-f a-i-c j-c-s-b" }, [e("span", { staticClass: "f-s-2" }, [s._v(s._s(t.trans("email-editor.auto-save")))]), e(t.InToggle, { attrs: { id: "guido__kebab-autosave-toggle", name: "guido-kebab-autosave-toggle", checked: t.autosaveStore.isOn, disable: t.editorStore.loadingStatus }, on: { click: t.toggleAutosave } })], 1), e("div", { staticClass: "editor-actions-menu__divider" })] : s._e(), e("p", { staticClass: "editor-actions-menu__section f-s-1 t-c-55" }, [s._v(" " + s._s(t.trans("email-editor.actions")) + " ")]), t.isVersionHistoryVisible ? e("button", { staticClass: "editor-actions-menu__row d-f a-i-c", attrs: { id: "guido__kebab-version-history", type: "button", disabled: t.editorStore.isVersionHistoryButtonDisabled }, on: { click: t.handleVersionHistory } }, [e(t.InIcons, { staticClass: "mr-2", attrs: { name: "line-architect-version-history", size: "16" } }), e("span", { staticClass: "f-s-2" }, [s._v(s._s(t.trans("newsletter.version-history")))])], 1) : s._e(), t.isAccessibilityVisible ? e("button", { staticClass: "editor-actions-menu__row d-f a-i-c", attrs: { id: "guido__kebab-accessibility", type: "button", disabled: t.editorStore.loadingStatus }, on: { click: t.handleAccessibility } }, [e(t.InIcons, { staticClass: "mr-2", attrs: { name: "line-menu-access-area", size: "16" } }), e("span", { staticClass: "f-s-2" }, [s._v(s._s(t.trans("email-editor.accessibility-test")))])], 1) : s._e(), t.isSaveAsVisible ? e("button", { staticClass: "editor-actions-menu__row d-f a-i-c", attrs: { id: "guido__kebab-save-as", type: "button", disabled: t.editorStore.isSaveAsButtonDisabled }, on: { click: t.handleSaveAs } }, [e(t.InIcons, { staticClass: "mr-2", attrs: { name: "line-newsletter-save-as-template", size: "16" } }), e("span", { staticClass: "f-s-2" }, [s._v(s._s(t.trans("newsletter.save-templates")))])], 1) : s._e(), e("button", { staticClass: "editor-actions-menu__row d-f a-i-c", attrs: { id: "guido__kebab-export", type: "button", disabled: t.isExporting || t.editorStore.isExportButtonDisabled }, on: { click: t.handleExport } }, [e(t.InIcons, { staticClass: "mr-2", attrs: { name: "line-export", size: "16" } }), e("span", { staticClass: "f-s-2" }, [s._v(s._s(t.trans("newsletter.export")))])], 1)], 2) : s._e()], 1);
9
+ }, n = [], r = /* @__PURE__ */ a(
10
+ i,
11
+ o,
12
+ n,
13
+ !1,
14
+ null,
15
+ "287a74e3"
16
+ );
17
+ const b = r.exports;
18
+ export {
19
+ b as default
20
+ };