@useinsider/guido 3.11.0-beta.181af4d → 3.11.0-beta.1fde696

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 (49) hide show
  1. package/dist/@types/config/schemas.js +59 -52
  2. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  3. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  4. package/dist/components/organisms/header/EditorActions.vue.js +11 -11
  5. package/dist/components/organisms/header/EditorActions.vue2.js +50 -34
  6. package/dist/components/organisms/header/HeaderWrapper.vue.js +3 -3
  7. package/dist/components/organisms/header/HeaderWrapper.vue2.js +0 -2
  8. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  9. package/dist/components/organisms/header/MiddleSlot.vue2.js +7 -8
  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/version-history/VersionHistory.vue.js +1 -1
  13. package/dist/composables/useModuleDynamicContentRepair.js +36 -0
  14. package/dist/composables/useStripo.js +62 -59
  15. package/dist/config/i18n/en/labels.json.js +0 -17
  16. package/dist/guido.css +1 -1
  17. package/dist/node_modules/@vueuse/shared/index.js +28 -40
  18. package/dist/src/@types/config/schemas.d.ts +36 -4
  19. package/dist/src/composables/useActionsApi.d.ts +2 -2
  20. package/dist/src/composables/useConfig.d.ts +18 -2
  21. package/dist/src/composables/useHtmlValidator.test.d.ts +1 -0
  22. package/dist/src/composables/useModuleDynamicContentRepair.d.ts +18 -0
  23. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +1 -0
  24. package/dist/src/stores/config.d.ts +162 -18
  25. package/dist/src/stores/editor.d.ts +0 -105
  26. package/dist/src/stores/version-history.d.ts +1 -1
  27. package/dist/src/utils/dynamicContentConverter.d.ts +31 -0
  28. package/dist/src/utils/genericUtil.d.ts +7 -0
  29. package/dist/src/utils/timeUtil.d.ts +0 -10
  30. package/dist/stores/editor.js +1 -5
  31. package/dist/utils/dynamicContentConverter.js +33 -0
  32. package/dist/utils/genericUtil.js +26 -19
  33. package/dist/utils/timeUtil.js +17 -6
  34. package/package.json +1 -5
  35. package/dist/components/organisms/header/AutoSaveStatus.vue.js +0 -17
  36. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +0 -21
  37. package/dist/components/organisms/header/EditorActionsMenu.vue.js +0 -20
  38. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +0 -39
  39. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +0 -18
  40. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +0 -37
  41. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +0 -24
  42. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +0 -48
  43. package/dist/composables/useAccessibilityApi.js +0 -31
  44. package/dist/node_modules/@vueuse/core/index.js +0 -102
  45. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +0 -2
  46. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +0 -2
  47. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +0 -2
  48. package/dist/src/composables/useAccessibilityApi.d.ts +0 -15
  49. /package/dist/src/components/organisms/header/{AutoSaveStatus.vue.d.ts → AutoSaveToggle.vue.d.ts} +0 -0
@@ -1,13 +1,9 @@
1
- import type { ColorVisionDeficiency } from '@@/Types/api/accessibility-api';
2
1
  export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEditor", {
3
2
  loadingStatus: boolean;
4
3
  isCodeEditorOpen: boolean;
5
4
  isSaveAsTemplateDrawerOpen: boolean;
6
5
  isVersionHistoryOpen: boolean;
7
6
  isPreviewModeOpen: boolean;
8
- isAccessibilityTestingOpen: boolean;
9
- imagesHidden: boolean;
10
- colorVisionDeficiency: ColorVisionDeficiency;
11
7
  editorVisualMode: string;
12
8
  hasChanges: boolean;
13
9
  isStripoInitialized: boolean;
@@ -20,9 +16,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
20
16
  isSaveAsTemplateDrawerOpen: boolean;
21
17
  isVersionHistoryOpen: boolean;
22
18
  isPreviewModeOpen: boolean;
23
- isAccessibilityTestingOpen: boolean;
24
- imagesHidden: boolean;
25
- colorVisionDeficiency: ColorVisionDeficiency;
26
19
  editorVisualMode: string;
27
20
  hasChanges: boolean;
28
21
  isStripoInitialized: boolean;
@@ -34,38 +27,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
34
27
  isSaveAsTemplateDrawerOpen: boolean;
35
28
  isVersionHistoryOpen: boolean;
36
29
  isPreviewModeOpen: boolean;
37
- isAccessibilityTestingOpen: boolean;
38
- imagesHidden: boolean;
39
- colorVisionDeficiency: ColorVisionDeficiency;
40
- editorVisualMode: string;
41
- hasChanges: boolean;
42
- isStripoInitialized: boolean;
43
- templateId: string;
44
- syncModulesEnabled: boolean;
45
- }>) => boolean;
46
- isAccessibilityModeActive: (state: {
47
- loadingStatus: boolean;
48
- isCodeEditorOpen: boolean;
49
- isSaveAsTemplateDrawerOpen: boolean;
50
- isVersionHistoryOpen: boolean;
51
- isPreviewModeOpen: boolean;
52
- isAccessibilityTestingOpen: boolean;
53
- imagesHidden: boolean;
54
- colorVisionDeficiency: ColorVisionDeficiency;
55
- editorVisualMode: string;
56
- hasChanges: boolean;
57
- isStripoInitialized: boolean;
58
- templateId: string;
59
- syncModulesEnabled: boolean;
60
- } & import("pinia").PiniaCustomStateProperties<{
61
- loadingStatus: boolean;
62
- isCodeEditorOpen: boolean;
63
- isSaveAsTemplateDrawerOpen: boolean;
64
- isVersionHistoryOpen: boolean;
65
- isPreviewModeOpen: boolean;
66
- isAccessibilityTestingOpen: boolean;
67
- imagesHidden: boolean;
68
- colorVisionDeficiency: ColorVisionDeficiency;
69
30
  editorVisualMode: string;
70
31
  hasChanges: boolean;
71
32
  isStripoInitialized: boolean;
@@ -78,9 +39,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
78
39
  isSaveAsTemplateDrawerOpen: boolean;
79
40
  isVersionHistoryOpen: boolean;
80
41
  isPreviewModeOpen: boolean;
81
- isAccessibilityTestingOpen: boolean;
82
- imagesHidden: boolean;
83
- colorVisionDeficiency: ColorVisionDeficiency;
84
42
  editorVisualMode: string;
85
43
  hasChanges: boolean;
86
44
  isStripoInitialized: boolean;
@@ -92,9 +50,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
92
50
  isSaveAsTemplateDrawerOpen: boolean;
93
51
  isVersionHistoryOpen: boolean;
94
52
  isPreviewModeOpen: boolean;
95
- isAccessibilityTestingOpen: boolean;
96
- imagesHidden: boolean;
97
- colorVisionDeficiency: ColorVisionDeficiency;
98
53
  editorVisualMode: string;
99
54
  hasChanges: boolean;
100
55
  isStripoInitialized: boolean;
@@ -107,9 +62,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
107
62
  isSaveAsTemplateDrawerOpen: boolean;
108
63
  isVersionHistoryOpen: boolean;
109
64
  isPreviewModeOpen: boolean;
110
- isAccessibilityTestingOpen: boolean;
111
- imagesHidden: boolean;
112
- colorVisionDeficiency: ColorVisionDeficiency;
113
65
  editorVisualMode: string;
114
66
  hasChanges: boolean;
115
67
  isStripoInitialized: boolean;
@@ -121,9 +73,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
121
73
  isSaveAsTemplateDrawerOpen: boolean;
122
74
  isVersionHistoryOpen: boolean;
123
75
  isPreviewModeOpen: boolean;
124
- isAccessibilityTestingOpen: boolean;
125
- imagesHidden: boolean;
126
- colorVisionDeficiency: ColorVisionDeficiency;
127
76
  editorVisualMode: string;
128
77
  hasChanges: boolean;
129
78
  isStripoInitialized: boolean;
@@ -136,9 +85,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
136
85
  isSaveAsTemplateDrawerOpen: boolean;
137
86
  isVersionHistoryOpen: boolean;
138
87
  isPreviewModeOpen: boolean;
139
- isAccessibilityTestingOpen: boolean;
140
- imagesHidden: boolean;
141
- colorVisionDeficiency: ColorVisionDeficiency;
142
88
  editorVisualMode: string;
143
89
  hasChanges: boolean;
144
90
  isStripoInitialized: boolean;
@@ -150,9 +96,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
150
96
  isSaveAsTemplateDrawerOpen: boolean;
151
97
  isVersionHistoryOpen: boolean;
152
98
  isPreviewModeOpen: boolean;
153
- isAccessibilityTestingOpen: boolean;
154
- imagesHidden: boolean;
155
- colorVisionDeficiency: ColorVisionDeficiency;
156
99
  editorVisualMode: string;
157
100
  hasChanges: boolean;
158
101
  isStripoInitialized: boolean;
@@ -165,9 +108,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
165
108
  isSaveAsTemplateDrawerOpen: boolean;
166
109
  isVersionHistoryOpen: boolean;
167
110
  isPreviewModeOpen: boolean;
168
- isAccessibilityTestingOpen: boolean;
169
- imagesHidden: boolean;
170
- colorVisionDeficiency: ColorVisionDeficiency;
171
111
  editorVisualMode: string;
172
112
  hasChanges: boolean;
173
113
  isStripoInitialized: boolean;
@@ -179,9 +119,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
179
119
  isSaveAsTemplateDrawerOpen: boolean;
180
120
  isVersionHistoryOpen: boolean;
181
121
  isPreviewModeOpen: boolean;
182
- isAccessibilityTestingOpen: boolean;
183
- imagesHidden: boolean;
184
- colorVisionDeficiency: ColorVisionDeficiency;
185
122
  editorVisualMode: string;
186
123
  hasChanges: boolean;
187
124
  isStripoInitialized: boolean;
@@ -194,9 +131,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
194
131
  isSaveAsTemplateDrawerOpen: boolean;
195
132
  isVersionHistoryOpen: boolean;
196
133
  isPreviewModeOpen: boolean;
197
- isAccessibilityTestingOpen: boolean;
198
- imagesHidden: boolean;
199
- colorVisionDeficiency: ColorVisionDeficiency;
200
134
  editorVisualMode: string;
201
135
  hasChanges: boolean;
202
136
  isStripoInitialized: boolean;
@@ -208,9 +142,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
208
142
  isSaveAsTemplateDrawerOpen: boolean;
209
143
  isVersionHistoryOpen: boolean;
210
144
  isPreviewModeOpen: boolean;
211
- isAccessibilityTestingOpen: boolean;
212
- imagesHidden: boolean;
213
- colorVisionDeficiency: ColorVisionDeficiency;
214
145
  editorVisualMode: string;
215
146
  hasChanges: boolean;
216
147
  isStripoInitialized: boolean;
@@ -223,9 +154,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
223
154
  isSaveAsTemplateDrawerOpen: boolean;
224
155
  isVersionHistoryOpen: boolean;
225
156
  isPreviewModeOpen: boolean;
226
- isAccessibilityTestingOpen: boolean;
227
- imagesHidden: boolean;
228
- colorVisionDeficiency: ColorVisionDeficiency;
229
157
  editorVisualMode: string;
230
158
  hasChanges: boolean;
231
159
  isStripoInitialized: boolean;
@@ -237,9 +165,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
237
165
  isSaveAsTemplateDrawerOpen: boolean;
238
166
  isVersionHistoryOpen: boolean;
239
167
  isPreviewModeOpen: boolean;
240
- isAccessibilityTestingOpen: boolean;
241
- imagesHidden: boolean;
242
- colorVisionDeficiency: ColorVisionDeficiency;
243
168
  editorVisualMode: string;
244
169
  hasChanges: boolean;
245
170
  isStripoInitialized: boolean;
@@ -252,9 +177,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
252
177
  isSaveAsTemplateDrawerOpen: boolean;
253
178
  isVersionHistoryOpen: boolean;
254
179
  isPreviewModeOpen: boolean;
255
- isAccessibilityTestingOpen: boolean;
256
- imagesHidden: boolean;
257
- colorVisionDeficiency: ColorVisionDeficiency;
258
180
  editorVisualMode: string;
259
181
  hasChanges: boolean;
260
182
  isStripoInitialized: boolean;
@@ -266,9 +188,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
266
188
  isSaveAsTemplateDrawerOpen: boolean;
267
189
  isVersionHistoryOpen: boolean;
268
190
  isPreviewModeOpen: boolean;
269
- isAccessibilityTestingOpen: boolean;
270
- imagesHidden: boolean;
271
- colorVisionDeficiency: ColorVisionDeficiency;
272
191
  editorVisualMode: string;
273
192
  hasChanges: boolean;
274
193
  isStripoInitialized: boolean;
@@ -281,9 +200,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
281
200
  isSaveAsTemplateDrawerOpen: boolean;
282
201
  isVersionHistoryOpen: boolean;
283
202
  isPreviewModeOpen: boolean;
284
- isAccessibilityTestingOpen: boolean;
285
- imagesHidden: boolean;
286
- colorVisionDeficiency: ColorVisionDeficiency;
287
203
  editorVisualMode: string;
288
204
  hasChanges: boolean;
289
205
  isStripoInitialized: boolean;
@@ -295,9 +211,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
295
211
  isSaveAsTemplateDrawerOpen: boolean;
296
212
  isVersionHistoryOpen: boolean;
297
213
  isPreviewModeOpen: boolean;
298
- isAccessibilityTestingOpen: boolean;
299
- imagesHidden: boolean;
300
- colorVisionDeficiency: ColorVisionDeficiency;
301
214
  editorVisualMode: string;
302
215
  hasChanges: boolean;
303
216
  isStripoInitialized: boolean;
@@ -310,9 +223,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
310
223
  isSaveAsTemplateDrawerOpen: boolean;
311
224
  isVersionHistoryOpen: boolean;
312
225
  isPreviewModeOpen: boolean;
313
- isAccessibilityTestingOpen: boolean;
314
- imagesHidden: boolean;
315
- colorVisionDeficiency: ColorVisionDeficiency;
316
226
  editorVisualMode: string;
317
227
  hasChanges: boolean;
318
228
  isStripoInitialized: boolean;
@@ -324,9 +234,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
324
234
  isSaveAsTemplateDrawerOpen: boolean;
325
235
  isVersionHistoryOpen: boolean;
326
236
  isPreviewModeOpen: boolean;
327
- isAccessibilityTestingOpen: boolean;
328
- imagesHidden: boolean;
329
- colorVisionDeficiency: ColorVisionDeficiency;
330
237
  editorVisualMode: string;
331
238
  hasChanges: boolean;
332
239
  isStripoInitialized: boolean;
@@ -339,9 +246,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
339
246
  isSaveAsTemplateDrawerOpen: boolean;
340
247
  isVersionHistoryOpen: boolean;
341
248
  isPreviewModeOpen: boolean;
342
- isAccessibilityTestingOpen: boolean;
343
- imagesHidden: boolean;
344
- colorVisionDeficiency: ColorVisionDeficiency;
345
249
  editorVisualMode: string;
346
250
  hasChanges: boolean;
347
251
  isStripoInitialized: boolean;
@@ -353,9 +257,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
353
257
  isSaveAsTemplateDrawerOpen: boolean;
354
258
  isVersionHistoryOpen: boolean;
355
259
  isPreviewModeOpen: boolean;
356
- isAccessibilityTestingOpen: boolean;
357
- imagesHidden: boolean;
358
- colorVisionDeficiency: ColorVisionDeficiency;
359
260
  editorVisualMode: string;
360
261
  hasChanges: boolean;
361
262
  isStripoInitialized: boolean;
@@ -368,9 +269,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
368
269
  isSaveAsTemplateDrawerOpen: boolean;
369
270
  isVersionHistoryOpen: boolean;
370
271
  isPreviewModeOpen: boolean;
371
- isAccessibilityTestingOpen: boolean;
372
- imagesHidden: boolean;
373
- colorVisionDeficiency: ColorVisionDeficiency;
374
272
  editorVisualMode: string;
375
273
  hasChanges: boolean;
376
274
  isStripoInitialized: boolean;
@@ -382,9 +280,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"guidoEdito
382
280
  isSaveAsTemplateDrawerOpen: boolean;
383
281
  isVersionHistoryOpen: boolean;
384
282
  isPreviewModeOpen: boolean;
385
- isAccessibilityTestingOpen: boolean;
386
- imagesHidden: boolean;
387
- colorVisionDeficiency: ColorVisionDeficiency;
388
283
  editorVisualMode: string;
389
284
  hasChanges: boolean;
390
285
  isStripoInitialized: boolean;
@@ -1,4 +1,4 @@
1
- import type { VersionHistoryState } from '@@/Types/api/version-history-api';
1
+ import type { VersionHistoryState } from '@@/Types/version-history-api';
2
2
  export interface StoreState extends VersionHistoryState {
3
3
  editorVisualMode: 'desktop' | 'mobile';
4
4
  }
@@ -0,0 +1,31 @@
1
+ import type { DynamicContent } from '@@/Types/generic';
2
+ export interface DynamicContentConversionResult {
3
+ html: string;
4
+ /** Distinct label-form tokens that had no match in the lookup (left unchanged). */
5
+ unresolved: string[];
6
+ }
7
+ /**
8
+ * Builds a label→item lookup from one or more dynamic-content lists, keyed by
9
+ * normalized label (trimmed, lowercased). When lists overlap, a later list wins
10
+ * for a shared key.
11
+ */
12
+ export declare const buildDynamicContentLookup: (...lists: DynamicContent[][]) => Map<string, DynamicContent>;
13
+ /**
14
+ * Rewrites label-form dynamic-content tokens in a dropped module's HTML into
15
+ * their canonical `{{token}}` form, using `lookup` (label→item).
16
+ *
17
+ * Legacy saved modules can serialize merge-tag chips by their display label —
18
+ * both multi-word (`{{ Phone Number }}`) and single-word (`{{Email}}`) — which
19
+ * the backend can't resolve (its attribute match is case-sensitive). Every tag's
20
+ * name is looked up case-insensitively and a match is rewritten to its canonical
21
+ * token — but a name that is ALREADY a clean identifier is only rewritten when
22
+ * the match is the same attribute in a different case (e.g. `{{Email}}` →
23
+ * `{{email}}`); if the matched value differs by more than case, the name merely
24
+ * coincides with an unrelated display label, so it is left as-is rather than
25
+ * silently corrupted into a different attribute. A name with no match is left as
26
+ * well, and reported in `unresolved` ONLY when it is not already a clean
27
+ * identifier — a clean identifier is treated as a valid token we simply weren't
28
+ * given, so it never triggers a false warning. Allowed system tokens and `data-*`
29
+ * attribute values (backend-resolved product tags) are never touched.
30
+ */
31
+ export declare const convertModuleDynamicContent: (html: string, lookup: Map<string, DynamicContent>, liquidSyntax: boolean) => DynamicContentConversionResult;
@@ -1,6 +1,13 @@
1
1
  import type { DynamicContent, MergeTag } from '@@/Types/generic';
2
2
  export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
3
3
  export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
4
+ /**
5
+ * Builds the editor merge-tag entries from the template's preselected list plus
6
+ * the account's full available list, deduped by token value (preselected wins so
7
+ * its fallback/format is kept). Registering the full list lets every recognized
8
+ * token — including ones repaired on module drop — render as a chip.
9
+ */
10
+ export declare const buildMergeTagEntries: (preselected: DynamicContent[], available: DynamicContent[], liquidSyntax?: boolean) => MergeTag[];
4
11
  export declare const getCsrfToken: () => string;
5
12
  /**
6
13
  * URL Parameter utilities
@@ -6,13 +6,3 @@
6
6
  * @example formatLocalTime(date, true) -> 12:20:02 (UTC+3 Istanbul)
7
7
  */
8
8
  export declare const formatLocalTime: (date: Date, useTimezone?: boolean) => string;
9
- /**
10
- * Auto-save timestamp parts for the header status label. The component picks the
11
- * copy: same day -> "Autosaved at {time}, Today"; earlier -> "Autosaved at {date}".
12
- * @example autoSaveTimestamp(date) -> { isToday: true, time: '20:01', date: '16.07.2026' }
13
- */
14
- export declare const autoSaveTimestamp: (date: Date, now?: Date) => {
15
- isToday: boolean;
16
- time: string;
17
- date: string;
18
- };
@@ -6,9 +6,6 @@ const o = e("guidoEditor", {
6
6
  isSaveAsTemplateDrawerOpen: !1,
7
7
  isVersionHistoryOpen: !1,
8
8
  isPreviewModeOpen: !1,
9
- isAccessibilityTestingOpen: !1,
10
- imagesHidden: !1,
11
- colorVisionDeficiency: "",
12
9
  editorVisualMode: "desktop",
13
10
  hasChanges: !1,
14
11
  isStripoInitialized: !1,
@@ -17,8 +14,7 @@ const o = e("guidoEditor", {
17
14
  }),
18
15
  getters: {
19
16
  // Middle Slot
20
- isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isAccessibilityTestingOpen,
21
- isAccessibilityModeActive: (i) => i.isAccessibilityTestingOpen,
17
+ isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen,
22
18
  isUndoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
23
19
  isRedoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
24
20
  isCodeEditorButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
@@ -0,0 +1,33 @@
1
+ import { DATA_ATTRIBUTE_REGEX as _, DYNAMIC_CONTENT_TAG_REGEX as D, ALLOWED_DYNAMIC_SYSTEM_TOKENS as m, VALID_DYNAMIC_VARIABLE_REGEX as A } from "../enums/html-validator.js";
2
+ import { dynamicContentToMergeTags as M } from "./genericUtil.js";
3
+ const T = "guidoDataMask", p = "EndDataMask", f = /guidoDataMask(\d+)EndDataMask/g, u = (r) => r.trim().toLowerCase(), S = (...r) => {
4
+ const a = /* @__PURE__ */ new Map();
5
+ return r.forEach((d) => {
6
+ d.forEach((s) => {
7
+ const n = u(s.text);
8
+ n && a.set(n, s);
9
+ });
10
+ }), a;
11
+ }, L = (r, a, d) => {
12
+ const s = /* @__PURE__ */ new Set(), n = [];
13
+ return { html: r.replace(_, (t) => (n.push(t), `${T}${n.length - 1}${p}`)).replace(D, (t) => {
14
+ const o = t.slice(2, -2), c = o.indexOf("|"), l = c === -1 ? o : o.slice(0, c), e = l.trim();
15
+ if (e === "" || m.includes(e))
16
+ return t;
17
+ const i = a.get(u(e));
18
+ if (i) {
19
+ if (A.test(e) && u(i.value) !== u(e))
20
+ return t;
21
+ if (c !== -1) {
22
+ const E = o.slice(c);
23
+ return `{{${l.replace(e, () => i.value)}${E}}}`;
24
+ }
25
+ return M([i], d)[0].value;
26
+ }
27
+ return A.test(e) || s.add(e), t;
28
+ }).replace(f, (t, o) => n[Number(o)]), unresolved: [...s] };
29
+ };
30
+ export {
31
+ S as buildDynamicContentLookup,
32
+ L as convertModuleDynamicContent
33
+ };
@@ -1,47 +1,54 @@
1
- const s = (e) => {
2
- const a = e.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [n] = a, c = {
3
- text: e.label,
1
+ const u = (t) => {
2
+ const a = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [n] = a, e = {
3
+ text: t.label,
4
4
  value: n || ""
5
5
  };
6
6
  if (a.length >= 2) {
7
- const [, l, r] = a;
7
+ const [, l, f] = a;
8
8
  if (l.startsWith("default:")) {
9
- let t = l.slice(8).trim();
10
- t.startsWith('"') && t.endsWith('"') && (t = t.slice(1, -1)), c.fallback = t;
9
+ let r = l.slice(8).trim();
10
+ r.startsWith('"') && r.endsWith('"') && (r = r.slice(1, -1)), e.fallback = r;
11
11
  } else {
12
- const t = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
13
- t ? c.format = t : r || (c.fallback = l), r && (c.fallback = r);
12
+ const r = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
13
+ r ? e.format = r : f || (e.fallback = l), f && (e.fallback = f);
14
14
  }
15
15
  }
16
- return c;
17
- }, u = (e, f = !1) => e.map((a) => {
16
+ return e;
17
+ }, s = (t, c = !1) => t.map((a) => {
18
18
  if (a.format)
19
19
  return {
20
20
  label: `${a.text} | ${a.format.key}=${a.format.value}`,
21
21
  value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
22
22
  };
23
- if (f) {
23
+ if (c) {
24
24
  if (!a.fallback)
25
25
  return {
26
26
  label: a.text,
27
27
  value: `{{ ${a.value} }}`
28
28
  };
29
- const c = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
29
+ const e = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
30
30
  return {
31
31
  label: `${a.text} | ${a.fallback}`,
32
- value: `{{ ${a.value} | default: ${c} }}`
32
+ value: `{{ ${a.value} | default: ${e} }}`
33
33
  };
34
34
  }
35
35
  return {
36
36
  label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
37
37
  value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
38
38
  };
39
- }), o = () => {
40
- var e;
41
- return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
39
+ }), o = (t, c, a = !1) => {
40
+ const n = new Set(t.map((l) => l.value)), e = c.filter((l) => n.has(l.value) ? !1 : (n.add(l.value), !0));
41
+ return [
42
+ ...s(t, a),
43
+ ...s(e, a)
44
+ ];
45
+ }, b = () => {
46
+ var t;
47
+ return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
42
48
  };
43
49
  export {
44
- u as dynamicContentToMergeTags,
45
- o as getCsrfToken,
46
- s as mergeTagToDynamicContent
50
+ o as buildMergeTagEntries,
51
+ s as dynamicContentToMergeTags,
52
+ b as getCsrfToken,
53
+ u as mergeTagToDynamicContent
47
54
  };
@@ -1,8 +1,19 @@
1
- const g = (t) => String(t).padStart(2, "0"), a = (t, e) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate(), o = (t, e = /* @__PURE__ */ new Date()) => ({
2
- isToday: a(t, e),
3
- time: `${g(t.getHours())}:${g(t.getMinutes())}`,
4
- date: `${g(t.getDate())}.${g(t.getMonth() + 1)}.${t.getFullYear()}`
5
- });
1
+ const r = (t) => {
2
+ const e = -t.getTimezoneOffset(), o = e >= 0 ? "+" : "-", n = Math.abs(e), s = Math.floor(n / 60), i = n % 60;
3
+ return i === 0 ? `UTC${o}${s}` : `UTC${o}${s}:${String(i).padStart(2, "0")}`;
4
+ }, a = () => {
5
+ var e;
6
+ const { timeZone: t } = new Intl.DateTimeFormat().resolvedOptions();
7
+ return ((e = t.split("/").pop()) == null ? void 0 : e.replace(/_/g, " ")) ?? t;
8
+ }, c = (t, e = !1) => {
9
+ const o = t.toLocaleTimeString([], {
10
+ hour: "2-digit",
11
+ hour12: !1,
12
+ minute: "2-digit",
13
+ second: "2-digit"
14
+ });
15
+ return e ? `${o} (${r(t)} ${a()})` : o;
16
+ };
6
17
  export {
7
- o as autoSaveTimestamp
18
+ c as formatLocalTime
8
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.11.0-beta.181af4d",
3
+ "version": "3.11.0-beta.1fde696",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -34,8 +34,6 @@
34
34
  "test:visual-update": "npx playwright test --update-snapshots --reporter html",
35
35
  "test:e2e:coverage": "E2E_COVERAGE=true playwright test",
36
36
  "coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
37
- "test:mutation": "stryker run",
38
- "test:mutation:since": "CHANGED=$(git diff --name-only --diff-filter=AMR origin/develop...HEAD -- 'src/**/*.ts' ':(glob)src/components/organisms/onboarding/**/*.vue' ':(glob)src/components/organisms/header/**/*.vue' ':(glob)src/components/organisms/unsubscribe/**/*.vue' ':(glob)src/components/organisms/save-as-template/**/*.vue' ':(glob)src/components/organisms/email-preview/**/*.vue' ':(glob)src/components/wrappers/**/*.vue' 'src/components/Guido.vue' ':(exclude)src/**/*.test.ts' ':(exclude)src/**/index.ts' ':(exclude)src/@types/**' ':(exclude)src/enums/**' ':(exclude)src/mock/**' ':(exclude)src/**/_Boilerplate/**' | paste -sd, -); if [ -n \"$CHANGED\" ]; then stryker run --incremental --mutate \"$CHANGED\"; else echo \"No changed mutatable src files vs origin/develop\"; fi",
39
37
  "prepare": "husky",
40
38
  "preinstall": "rm -rf ./node_modules/.vite"
41
39
  },
@@ -59,8 +57,6 @@
59
57
  "@eslint/eslintrc": "3.3.0",
60
58
  "@eslint/js": "8.57.1",
61
59
  "@playwright/test": "1.57.0",
62
- "@stryker-mutator/core": "9.6.1",
63
- "@stryker-mutator/vitest-runner": "9.6.1",
64
60
  "@stylistic/eslint-plugin": "3.1.0",
65
61
  "@stylistic/eslint-plugin-migrate": "3.1.0",
66
62
  "@types/eslint": "8.56.12",
@@ -1,17 +0,0 @@
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
- };
@@ -1,21 +0,0 @@
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,20 +0,0 @@
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
- };
@@ -1,39 +0,0 @@
1
- import { defineComponent as O, ref as c, computed as t } from "vue";
2
- import { useAccessibilityApi as x } from "../../../composables/useAccessibilityApi.js";
3
- import { useConfig as h } from "../../../composables/useConfig.js";
4
- import { useExport as I } from "../../../composables/useExport.js";
5
- import { useTranslations as B } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as C } from "../../../composables/useVersionHistoryApi.js";
7
- import { useAutosaveStore as w } from "../../../stores/autosave.js";
8
- import { useEditorStore as M } from "../../../stores/editor.js";
9
- import { getTooltipOptions as k } from "../../../utils/tooltipUtils.js";
10
- import { InToggle as D, InIcons as F, InButtonV2 as j } from "@useinsider/design-system-vue";
11
- import { onClickOutside as q } from "../../../node_modules/@vueuse/core/index.js";
12
- const Y = /* @__PURE__ */ O({
13
- __name: "EditorActionsMenu",
14
- setup(z) {
15
- const { config: i, isFeatureEnabled: n } = h(), { exportHtml: l } = I(), { openVersionHistory: p, closeVersionHistory: u } = C(), { toggleAccessibilityTestingMode: m } = x(), r = M(), f = w(), d = B(), v = c(!1), a = c(!1), A = c(null), y = t(() => n("autosave")), g = t(() => {
16
- var o, e;
17
- return !!((e = (o = i.value) == null ? void 0 : o.features) != null && e.versionHistory);
18
- }), V = t(() => n("accessibilityTesting")), b = t(() => {
19
- var o, e;
20
- return !!((e = (o = i.value) == null ? void 0 : o.features) != null && e.saveAsTemplate);
21
- }), s = () => {
22
- v.value = !1;
23
- }, H = () => {
24
- r.isVersionHistoryOpen ? u() : p(), s();
25
- }, _ = () => {
26
- m(), s();
27
- }, S = () => {
28
- r.isSaveAsTemplateDrawerOpen = !0, s();
29
- }, T = async () => {
30
- a.value = !0, await l(), a.value = !1, s();
31
- }, E = (o) => {
32
- f.isOn = o;
33
- };
34
- return q(A, s), { __sfc: !0, config: i, isFeatureEnabled: n, exportHtml: l, openVersionHistory: p, closeVersionHistory: u, toggleAccessibilityTestingMode: m, editorStore: r, autosaveStore: f, trans: d, isOpen: v, isExporting: a, root: A, isAutosaveVisible: y, isVersionHistoryVisible: g, isAccessibilityVisible: V, isSaveAsVisible: b, close: s, handleVersionHistory: H, handleAccessibility: _, handleSaveAs: S, handleExport: T, toggleAutosave: E, getTooltipOptions: k, InButtonV2: j, InIcons: F, InToggle: D };
35
- }
36
- });
37
- export {
38
- Y as default
39
- };
@@ -1,18 +0,0 @@
1
- import o from "./AccessibilityToolbar.vue2.js";
2
- /* empty css */
3
- import s from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var a = function() {
5
- var i = this, e = i._self._c, t = i._self._setupProxy;
6
- return e("div", { staticClass: "d-f a-i-c accessibility-toolbar" }, [e(t.InButtonV2, { attrs: { id: "guido__a11y-no-images", "data-testid": "Accessibility No Images", "left-icon": "line-image", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.loadingStatus, "label-text-status": !1, "selected-status": t.editorStore.imagesHidden, "tooltip-options": t.getTooltipOptions("guido__a11y-no-images"), "tooltip-text": t.imagesTooltip }, on: { click: t.toggleImages } }), e(t.InButtonV2, { attrs: { id: "guido__a11y-code", "data-testid": "Accessibility Code Editor", "left-icon": "line-code", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.loadingStatus, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__a11y-code"), "tooltip-text": t.trans("newsletter.html-editor") }, on: { click: t.toggleCodeEditor } }), e("div", { staticClass: "accessibility-toolbar__divider" }), e(t.ColorVisionSelect), e(t.InSegments, { staticClass: "ml-2", attrs: { id: "guido__a11y-view-selection", "with-icon": "", "segment-list": t.segmentList, selected: t.editorStore.editorVisualMode }, on: { click: t.handleView } })], 1);
7
- }, l = [], d = /* @__PURE__ */ s(
8
- o,
9
- a,
10
- l,
11
- !1,
12
- null,
13
- "e222d603"
14
- );
15
- const g = d.exports;
16
- export {
17
- g as default
18
- };