@useinsider/guido 1.0.0-beta.e096204 → 1.0.0-beta.e40480e

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 (68) hide show
  1. package/README.md +19 -208
  2. package/dist/@types/generic.d.ts +0 -3
  3. package/dist/components/Guido.vue.d.ts +0 -4
  4. package/dist/components/Guido.vue.js +1 -1
  5. package/dist/components/Guido.vue2.js +18 -30
  6. package/dist/components/organisms/header/LeftSlot.vue.d.ts +1 -1
  7. package/dist/components/organisms/header/LeftSlot.vue.js +8 -8
  8. package/dist/components/organisms/header/LeftSlot.vue2.js +3 -5
  9. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  10. package/dist/components/organisms/header/MiddleSlot.vue2.js +4 -6
  11. package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -1
  12. package/dist/components/organisms/header/RightSlot.vue.js +10 -7
  13. package/dist/components/organisms/header/RightSlot.vue2.js +14 -11
  14. package/dist/components/organisms/header/ViewOptions.vue.js +1 -1
  15. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +1 -13
  16. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +7 -7
  17. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +10 -13
  18. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
  19. package/dist/composables/useCustomInterfaceAppearance.js +9 -45
  20. package/dist/composables/useExport.d.ts +1 -1
  21. package/dist/composables/useExport.js +20 -35
  22. package/dist/composables/useStripo.d.ts +2 -2
  23. package/dist/composables/useStripo.js +56 -52
  24. package/dist/composables/useToaster.d.ts +0 -1
  25. package/dist/composables/useToaster.js +16 -24
  26. package/dist/enums/defaults.d.ts +0 -2
  27. package/dist/enums/defaults.js +3 -5
  28. package/dist/guido.css +1 -1
  29. package/dist/node_modules/pinia/dist/pinia.js +317 -0
  30. package/dist/node_modules/pinia/node_modules/vue-demi/lib/index.js +11 -0
  31. package/dist/static/editor.css.js +182 -0
  32. package/dist/stores/editor.js +1 -1
  33. package/dist/stores/version-history.js +1 -1
  34. package/package.json +5 -5
  35. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +0 -2
  36. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
  37. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
  38. package/dist/composables/useHtmlCompiler.d.ts +0 -4
  39. package/dist/composables/useHtmlCompiler.js +0 -16
  40. package/dist/composables/useHttp.js +0 -84
  41. package/dist/composables/usePartner.d.ts +0 -4
  42. package/dist/composables/usePartner.js +0 -16
  43. package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
  44. package/dist/config/compiler/htmlCompilerRules.js +0 -145
  45. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  46. package/dist/enums/displayConditions.d.ts +0 -2
  47. package/dist/enums/displayConditions.js +0 -80
  48. package/dist/mock/api/custom-fonts.d.ts +0 -2
  49. package/dist/services/stripoApi.d.ts +0 -7
  50. package/dist/services/stripoApi.js +0 -29
  51. package/dist/static/styles/base.css.js +0 -11
  52. package/dist/static/styles/components/alert-message.css.js +0 -39
  53. package/dist/static/styles/components/amp-block.css.js +0 -18
  54. package/dist/static/styles/components/base-input.css.js +0 -47
  55. package/dist/static/styles/components/button-group.css.js +0 -54
  56. package/dist/static/styles/components/button.css.js +0 -106
  57. package/dist/static/styles/components/combobox.css.js +0 -49
  58. package/dist/static/styles/components/counter.css.js +0 -42
  59. package/dist/static/styles/components/dropdown-menu.css.js +0 -52
  60. package/dist/static/styles/components/narrow-panel.css.js +0 -38
  61. package/dist/static/styles/components/switcher.css.js +0 -11
  62. package/dist/static/styles/components/tabs.css.js +0 -97
  63. package/dist/static/styles/components/tools.css.js +0 -23
  64. package/dist/static/styles/components/version-history.css.js +0 -30
  65. package/dist/static/styles/components/wide-panel.css.js +0 -135
  66. package/dist/static/styles/variables.css.js +0 -23
  67. package/dist/utils/htmlCompiler.d.ts +0 -12
  68. package/dist/utils/htmlCompiler.js +0 -70
package/README.md CHANGED
@@ -24,7 +24,6 @@ npm install @useinsider/guido
24
24
  <div>
25
25
  <Guido
26
26
  :email-id="emailId"
27
- :user-id="userId"
28
27
  :guido-config="guidoConfig"
29
28
  />
30
29
  </div>
@@ -40,11 +39,8 @@ export default {
40
39
  data() {
41
40
  return {
42
41
  emailId: 'abc123',
43
- userId: '12345',
44
42
  guidoConfig: {
45
43
  translationsPath: 'window.trans.en'
46
- htmlCompilerRules: [],
47
- ignoreDefaultHtmlCompilerRules: false,
48
44
  }
49
45
  };
50
46
  }
@@ -59,10 +55,6 @@ export default {
59
55
  | Prop | Type | Required | Default | Description |
60
56
  |------|------|----------|---------|-------------|
61
57
  | `emailId` | `string` | ✅ | - | Unique identifier for the email draft |
62
- | `userId` | `string` | ✅ | - | Unique identifier for the user draft |
63
- | `username` | `string` | ⚪ | Guido User | User name |
64
- | `partnerName` | `string` | ⚪ | Getting from URL host | Unique identifier for the partner draft |
65
- | `productType` | `string` | ⚪ | Getting from URL path | Unique identifier for the product draft |
66
58
  | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
67
59
 
68
60
  ### GuidoConfig Interface
@@ -70,16 +62,12 @@ export default {
70
62
  ```typescript
71
63
  interface GuidoConfig {
72
64
  translationsPath: string;
73
- htmlCompilerRules: CompilerRule[];
74
- ignoreDefaultHtmlCompilerRules: boolean;
75
65
  }
76
66
  ```
77
67
 
78
68
  | Property | Type | Default | Description |
79
69
  |----------|------|---------|-------------|
80
70
  | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
81
- | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
82
- | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
83
71
 
84
72
  ### TypeScript Types
85
73
 
@@ -107,185 +95,6 @@ type StripoEventType =
107
95
  | 'export:ready';
108
96
  ```
109
97
 
110
- ## 🔨 HTML Compiler Rules
111
-
112
- Guido includes a powerful HTML compiler system that allows you to transform HTML content with custom rules. You can define additional rules and optionally ignore the default rules.
113
-
114
- ### Rule Types
115
-
116
- There are 4 types of compiler rules:
117
-
118
- #### 1. Replace Rule
119
- Replace specific strings in HTML content.
120
-
121
- ```typescript
122
- {
123
- id: 'fix-encoding',
124
- description: 'Fix URL encoding issues',
125
- type: 'replace',
126
- search: '{%22', // String to find
127
- replacement: '%7B%22', // String to replace with
128
- replaceAll: true, // Replace all occurrences (default: true)
129
- priority: 10 // Execution priority (lower = earlier)
130
- }
131
- ```
132
-
133
- #### 2. Regex Rule
134
- Use regular expressions for complex pattern matching and replacement.
135
-
136
- ```typescript
137
- {
138
- id: 'remove-comments',
139
- description: 'Remove HTML comments',
140
- type: 'regex',
141
- pattern: '<!--.*?-->', // Regex pattern
142
- replacement: '', // Replacement string
143
- flags: 'g', // Regex flags (default: 'g')
144
- priority: 20
145
- }
146
- ```
147
-
148
- #### 3. Remove Rule
149
- Remove specific strings or patterns from HTML content.
150
-
151
- ```typescript
152
- {
153
- id: 'cleanup-scripts',
154
- description: 'Remove unwanted script tags',
155
- type: 'remove',
156
- targets: [ // Array of strings or RegExp objects
157
- '<script src="unwanted.js"></script>',
158
- /onclick="[^"]*"/g
159
- ],
160
- priority: 30
161
- }
162
- ```
163
-
164
- #### 4. Custom Rule
165
- Define complex transformation logic with a custom processor function.
166
-
167
- ```typescript
168
- {
169
- id: 'add-meta-tags',
170
- description: 'Add custom meta tags to head',
171
- type: 'custom',
172
- processor: (html: string): string => {
173
- // Custom transformation logic
174
- const metaTags = '<meta name="custom" content="value">';
175
- return html.replace('</head>', `${metaTags}</head>`);
176
- },
177
- priority: 40
178
- }
179
- ```
180
-
181
- ### Using HTML Compiler Rules
182
-
183
- #### Basic Usage with Custom Rules
184
-
185
- ```typescript
186
- const guidoConfig = {
187
- translationsPath: 'window.trans.en',
188
- htmlCompilerRules: [
189
- {
190
- id: 'replace-domain',
191
- description: 'Replace old domain with new one',
192
- type: 'replace',
193
- search: 'old-domain.com',
194
- replacement: 'new-domain.com',
195
- replaceAll: true,
196
- priority: 10
197
- },
198
- {
199
- id: 'remove-tracking',
200
- description: 'Remove tracking pixels',
201
- type: 'regex',
202
- pattern: '<img[^>]*tracking[^>]*>',
203
- replacement: '',
204
- flags: 'gi',
205
- priority: 20
206
- }
207
- ]
208
- };
209
- ```
210
-
211
- #### Ignoring Default Rules
212
-
213
- ```typescript
214
- const guidoConfig = {
215
- translationsPath: 'window.trans.en',
216
- ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
217
- htmlCompilerRules: [
218
- // Only your custom rules will be applied
219
- {
220
- id: 'custom-transformation',
221
- type: 'replace',
222
- search: 'old-text',
223
- replacement: 'new-text',
224
- priority: 1
225
- }
226
- ]
227
- };
228
- ```
229
-
230
- ### Rule Execution Order
231
-
232
- Rules are executed in priority order (lower numbers first). Rules with the same priority are executed in array order.
233
-
234
- - **Priority 1-99**: Reserved for critical transformations
235
- - **Priority 100-999**: Standard transformations
236
- - **Priority 1000+**: Additional custom rules (automatically assigned)
237
-
238
- ### Default Rules
239
-
240
- Guido includes several default rules for common email HTML optimizations:
241
-
242
- - **URL encoding fixes**: Fixes malformed URL encoding in dynamic content
243
- - **Template tag restoration**: Restores `{{}}` template tags that got URL encoded
244
- - **HTML entity decoding**: Converts `&lt;` and `&gt;` back to `<` and `>`
245
- - **Cleanup rules**: Removes unwanted iframe and style elements
246
- - **MSO conditions**: Manages Outlook-specific conditional comments
247
- - **Domain replacement**: Updates old image domains to current ones
248
-
249
- You can view all default rules in: `src/config/compiler/htmlCompilerRules.ts`
250
-
251
- ### CompilerRule Interface
252
-
253
- ```typescript
254
- type CompilerRuleType = 'replace' | 'regex' | 'remove' | 'custom';
255
-
256
- interface BaseCompilerRule {
257
- id: string;
258
- description?: string;
259
- priority: number;
260
- }
261
-
262
- interface ReplaceRule extends BaseCompilerRule {
263
- type: 'replace';
264
- search: string;
265
- replacement: string;
266
- replaceAll?: boolean; // Default: true
267
- }
268
-
269
- interface RegexRule extends BaseCompilerRule {
270
- type: 'regex';
271
- pattern: string;
272
- replacement: string;
273
- flags?: string; // Default: 'g'
274
- }
275
-
276
- interface RemoveRule extends BaseCompilerRule {
277
- type: 'remove';
278
- targets: (string | RegExp)[]; // Array of strings or RegExp objects
279
- }
280
-
281
- interface CustomRule extends BaseCompilerRule {
282
- type: 'custom';
283
- processor: (html: string) => string;
284
- }
285
-
286
- type CompilerRule = ReplaceRule | RegexRule | RemoveRule | CustomRule;
287
- ```
288
-
289
98
  ---
290
99
 
291
100
  ## 🔧 Development
@@ -329,17 +138,24 @@ VITE_STRIPO_ROLE=your_role
329
138
 
330
139
  ```
331
140
  src/
332
- ├── components/ # Vue components
333
- ├── composables/ # Vue composables & business logic
334
- ├── services/ # API layer
335
- ├── stores/ # State management
336
- ├── @types/ # TypeScript definitions
337
- ├── static/ # Static assets & templates
338
- ├── utils/ # Utility functions
339
- ├── enums/ # Constants & enums
340
- ├── mock/ # Mock data for development
341
- ├── plugins/ # Vue plugins
342
- └── library.ts # Main export
141
+ ├── components/
142
+ ├── Guido.vue # Main component
143
+ │ └── organisms/
144
+ │ └── header/ # Header components
145
+ │ └── version-history/ # Version History components
146
+ ...
147
+ ├── composables/
148
+ ├── useStripo.ts # Stripo integration
149
+ │ └── useTranslations.ts # Translation management
150
+ ├── @types/
151
+ │ ├── generic.ts # Generic types
152
+ │ ├── stripo.d.ts # Stripo-specific types
153
+ │ └── events.ts # Event types
154
+ ├── static/
155
+ │ ├── editor.css # Custom editor styles
156
+ │ └── templates/
157
+ │ └── default/ # Default email template
158
+ └── library.ts # Main export for library
343
159
  ```
344
160
 
345
161
  ## 🌐 i18n
@@ -396,12 +212,7 @@ ISC License
396
212
  - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
397
213
 
398
214
  ## 🎯 TODO:
399
- - CSS part should be optimized with variables & `sass-loader`.
215
+ - [editor.css](src/static/editor.css) should be optimized with variables & `sass-loader`.
400
216
  - Master Version Generator should be fixed.
401
217
  - Playwright integration
402
218
  - Commitlint & Precommit Hooks integration
403
- - We need to emit save event and we should return template config to it
404
- - Default template should be same with production
405
- - Open Guido with saved template
406
- - Get User ID, Email and Unique Template ID as dynamic from props
407
- - Get Pre-built display conditions from API
@@ -1,6 +1,3 @@
1
- import type { CompilerRule } from './html-compiler';
2
1
  export type GuidoConfig = {
3
2
  translationsPath: string;
4
- htmlCompilerRules?: CompilerRule[];
5
- ignoreDefaultHtmlCompilerRules?: boolean;
6
3
  };
@@ -1,10 +1,6 @@
1
1
  import type { GuidoConfig } from '@@/Types/generic';
2
2
  type __VLS_Props = {
3
3
  emailId: string;
4
- userId: string;
5
- partnerName?: string;
6
- productType?: string;
7
- username?: string;
8
4
  guidoConfig: GuidoConfig;
9
5
  };
10
6
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
@@ -10,7 +10,7 @@ var s = function() {
10
10
  _,
11
11
  !1,
12
12
  null,
13
- "8e229594"
13
+ "3da1d904"
14
14
  );
15
15
  const f = a.exports;
16
16
  export {
@@ -1,43 +1,31 @@
1
- import { defineComponent as f, onMounted as c } from "vue";
2
- import { usePartner as g } from "../composables/usePartner.js";
3
- import { useStripo as _ } from "../composables/useStripo.js";
4
- import { useTemplates as y } from "../composables/useTemplates.js";
5
- import { DefaultUsername as C, DefaultGuidoConfig as T } from "../enums/defaults.js";
6
- import w from "./organisms/header/HeaderWrapper.vue.js";
7
- const h = /* @__PURE__ */ f({
1
+ import { defineComponent as n, onMounted as a } from "vue";
2
+ import { useStripo as p } from "../composables/useStripo.js";
3
+ import { useTemplates as m } from "../composables/useTemplates.js";
4
+ import { DefaultGuidoConfig as u } from "../enums/defaults.js";
5
+ import l from "./organisms/header/HeaderWrapper.vue.js";
6
+ const _ = /* @__PURE__ */ n({
8
7
  __name: "Guido",
9
8
  props: {
10
9
  emailId: null,
11
- userId: null,
12
- partnerName: null,
13
- productType: null,
14
- username: null,
15
10
  guidoConfig: null
16
11
  },
17
- setup(d) {
18
- const o = d, { getPartnerName: r, getProductType: t } = g(), {
19
- emailId: n,
20
- userId: i,
21
- guidoConfig: a,
22
- partnerName: u = r(),
23
- productType: p = t(),
24
- username: m = C
25
- } = o;
12
+ setup(r) {
13
+ const o = r;
26
14
  window.GuidoConfig = {
27
- ...T,
28
- ...a
15
+ ...u,
16
+ ...o.guidoConfig
29
17
  };
30
- const { initPlugin: l } = _({ emailId: n, userId: i, username: m, partnerName: u, productType: p }), { getDefaultTemplate: s } = y();
31
- return c(async () => {
18
+ const { initPlugin: e } = p(o.emailId), { getDefaultTemplate: i } = m();
19
+ return a(async () => {
32
20
  try {
33
- const e = await s();
34
- await l(e);
35
- } catch (e) {
36
- console.error("Failed to initialize Stripo editor:", e);
21
+ const t = await i();
22
+ await e(t);
23
+ } catch (t) {
24
+ console.error("Failed to initialize Stripo editor:", t);
37
25
  }
38
- }), { __sfc: !0, props: o, getPartnerName: r, getProductType: t, emailId: n, userId: i, guidoConfig: a, partnerName: u, productType: p, username: m, initPlugin: l, getDefaultTemplate: s, HeaderWrapper: w };
26
+ }), { __sfc: !0, props: o, initPlugin: e, getDefaultTemplate: i, HeaderWrapper: l };
39
27
  }
40
28
  });
41
29
  export {
42
- h as default
30
+ _ as default
43
31
  };
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -1,17 +1,17 @@
1
1
  import r from "./LeftSlot.vue2.js";
2
2
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
4
- var t = this, e = t._self._c, s = t._self._setupProxy;
5
- return e("div", { staticClass: "d-f a-i-c" }, [e(s.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" } }), s.editorStore.isVersionHistoryOpen ? e(s.RestoreButton, { staticClass: "ml-3" }) : t._e()], 1);
6
- }, a = [], i = /* @__PURE__ */ o(
3
+ var _ = function() {
4
+ var t = this, e = t._self._c, n = t._self._setupProxy;
5
+ return e("div", [e(n.InButtonV2, { attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" } })], 1);
6
+ }, s = [], a = /* @__PURE__ */ o(
7
7
  r,
8
- n,
9
- a,
8
+ _,
9
+ s,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const f = i.exports;
14
+ const i = a.exports;
15
15
  export {
16
- f as default
16
+ i as default
17
17
  };
@@ -1,11 +1,9 @@
1
1
  import { defineComponent as t } from "vue";
2
- import { useEditorStore as o } from "../../../stores/editor.js";
3
- import { InButtonV2 as r } from "@useinsider/design-system-vue";
4
- import e from "./version-history/RestoreButton.vue.js";
2
+ import { InButtonV2 as o } from "@useinsider/design-system-vue";
5
3
  const _ = /* @__PURE__ */ t({
6
4
  __name: "LeftSlot",
7
- setup(m) {
8
- return { __sfc: !0, editorStore: o(), InButtonV2: r, RestoreButton: e };
5
+ setup(e) {
6
+ return { __sfc: !0, InButtonV2: o };
9
7
  }
10
8
  });
11
9
  export {
@@ -1,17 +1,17 @@
1
1
  import s from "./MiddleSlot.vue2.js";
2
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
2
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
4
  var e = this, o = e._self._c, t = e._self._setupProxy;
5
- return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.trans("newsletter.email-preview") } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
6
- }, l = [], r = /* @__PURE__ */ i(
5
+ return t.editorStore.isVersionHistoryOpen ? o(t.VersionHistory) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.trans("newsletter.email-preview") } })], 1);
6
+ }, l = [], r = /* @__PURE__ */ n(
7
7
  s,
8
- n,
8
+ i,
9
9
  l,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const p = r.exports;
14
+ const _ = r.exports;
15
15
  export {
16
- p as default
16
+ _ as default
17
17
  };
@@ -3,20 +3,18 @@ import { useTranslations as s } from "../../../composables/useTranslations.js";
3
3
  import { useEditorStore as n } from "../../../stores/editor.js";
4
4
  import { InButtonV2 as e } from "@useinsider/design-system-vue";
5
5
  import m from "./version-history/VersionHistory.vue.js";
6
- import p from "./version-history/ViewOptions.vue.js";
7
- import f from "./ViewOptions.vue.js";
8
- const y = /* @__PURE__ */ r({
6
+ const _ = /* @__PURE__ */ r({
9
7
  __name: "MiddleSlot",
10
- setup(a) {
8
+ setup(p) {
11
9
  const o = n(), t = s();
12
10
  return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
11
  id: `${i}-tooltip`,
14
12
  dynamicPosition: !1,
15
13
  staticPosition: "bottom center",
16
14
  iconStatus: !1
17
- }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
15
+ }), InButtonV2: e, VersionHistory: m };
18
16
  }
19
17
  });
20
18
  export {
21
- y as default
19
+ _ as default
22
20
  };
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -1,17 +1,20 @@
1
1
  import o from "./RightSlot.vue2.js";
2
+ /* empty css */
2
3
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
4
+ var r = function() {
4
5
  var s = this, e = s._self._c, t = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
6
- }, r = [], a = /* @__PURE__ */ i(
6
+ return e("div", { staticClass: "d-f header-right-slot" }, [e("div", { staticClass: "d-f" }, [t.editorStore.isVersionHistoryOpen ? e(t.VersionHistoryViewOptions) : e(t.ViewOptions)], 1), e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } })], 1), t.editorStore.isVersionHistoryOpen ? e(t.InButtonV2, { attrs: { id: "guido__restore-button", "label-text": "Restore" }, on: { click: function(d) {
7
+ return t.restoreVersion(t.versionHistoryStore.currentPatch.id);
8
+ } } }) : e(t.InButtonV2, { attrs: { id: "guido__save-button", "label-text": "Save" } })], 1);
9
+ }, n = [], a = /* @__PURE__ */ i(
7
10
  o,
8
- n,
9
11
  r,
12
+ n,
10
13
  !1,
11
14
  null,
12
- null
15
+ "fefca98f"
13
16
  );
14
- const c = a.exports;
17
+ const f = a.exports;
15
18
  export {
16
- c as default
19
+ f as default
17
20
  };
@@ -1,21 +1,24 @@
1
- import { defineComponent as s } from "vue";
2
- import { useExport as i } from "../../../composables/useExport.js";
3
- import { useVersionHistoryApi as n } from "../../../composables/useVersionHistoryApi.js";
4
- import { useEditorStore as p } from "../../../stores/editor.js";
5
- import { InButtonV2 as m } from "@useinsider/design-system-vue";
6
- const d = /* @__PURE__ */ s({
1
+ import { defineComponent as n } from "vue";
2
+ import { useExport as m } from "../../../composables/useExport.js";
3
+ import { useVersionHistoryApi as p } from "../../../composables/useVersionHistoryApi.js";
4
+ import { useEditorStore as f } from "../../../stores/editor.js";
5
+ import { useVersionHistoryStore as V } from "../../../stores/version-history.js";
6
+ import { InButtonV2 as u } from "@useinsider/design-system-vue";
7
+ import H from "./version-history/ViewOptions.vue.js";
8
+ import c from "./ViewOptions.vue.js";
9
+ const E = /* @__PURE__ */ n({
7
10
  __name: "RightSlot",
8
- setup(f) {
9
- const { exportHtml: e } = i(), { openVersionHistory: o, closeVersionHistory: r } = n(), t = p();
10
- return { __sfc: !0, exportHtml: e, openVersionHistory: o, closeVersionHistory: r, editorStore: t, handleVersionHistory: () => {
11
+ setup(y) {
12
+ const { exportHtml: e } = m(), { openVersionHistory: o, closeVersionHistory: r, restoreVersion: i } = p(), t = f(), s = V();
13
+ return { __sfc: !0, exportHtml: e, openVersionHistory: o, closeVersionHistory: r, restoreVersion: i, editorStore: t, versionHistoryStore: s, handleVersionHistory: () => {
11
14
  if (t.isVersionHistoryOpen) {
12
15
  r();
13
16
  return;
14
17
  }
15
18
  o();
16
- }, InButtonV2: m };
19
+ }, InButtonV2: u, VersionHistoryViewOptions: H, ViewOptions: c };
17
20
  }
18
21
  });
19
22
  export {
20
- d as default
23
+ E as default
21
24
  };
@@ -10,7 +10,7 @@ var n = function() {
10
10
  i,
11
11
  !1,
12
12
  null,
13
- "0fff376c"
13
+ "378010db"
14
14
  );
15
15
  const l = _.exports;
16
16
  export {
@@ -1,14 +1,2 @@
1
- type __VLS_Props = {
2
- itemStatus?: boolean;
3
- };
4
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
5
2
  export default _default;
6
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
7
- type __VLS_TypePropsToOption<T> = {
8
- [K in keyof T]-?: {} extends Pick<T, K> ? {
9
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
10
- } : {
11
- type: import('vue').PropType<T[K]>;
12
- required: true;
13
- };
14
- };
@@ -2,21 +2,21 @@ import o from "./VersionHistory.vue2.js";
2
2
  /* empty css */
3
3
  import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var n = function() {
5
- var s = this, e = s._self._c, t = s._self._setupProxy;
6
- return e("div", { staticClass: "version-history-wrapper d-f a-i-c f-g-1 mx-3" }, [t.itemStatus ? e(t.VersionHistoryItem, { attrs: { "text-align": "right", date: t.versionHistoryStore.previousPatch.date, description: t.versionHistoryStore.previousPatch.description } }) : s._e(), e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": !t.versionHistoryStore.hasPreviousPatch, "label-text-status": !1 }, on: { click: function(r) {
5
+ var r = this, e = r._self._c, t = r._self._setupProxy;
6
+ return e("div", { staticClass: "version-history-wrapper d-f a-i-c f-g-1 mx-2" }, [e(t.VersionHistoryItem, { attrs: { "text-align": "right", date: t.versionHistoryStore.previousPatch.date, description: t.versionHistoryStore.previousPatch.description } }), e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": !t.versionHistoryStore.hasPreviousPatch, "label-text-status": !1 }, on: { click: function(s) {
7
7
  return t.previewVersion(t.versionHistoryStore.previousPatch.id);
8
- } } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": !t.versionHistoryStore.hasNextPatch, "label-text-status": !1 }, on: { click: function(r) {
8
+ } } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": !t.versionHistoryStore.hasNextPatch, "label-text-status": !1 }, on: { click: function(s) {
9
9
  return t.previewVersion(t.versionHistoryStore.nextPatch.id);
10
- } } })], 1), t.itemStatus ? e(t.VersionHistoryItem, { attrs: { "text-align": "left", date: t.versionHistoryStore.nextPatch.date, description: t.versionHistoryStore.nextPatch.description } }) : s._e()], 1);
10
+ } } })], 1), e(t.VersionHistoryItem, { attrs: { "text-align": "left", date: t.versionHistoryStore.nextPatch.date, description: t.versionHistoryStore.nextPatch.description } })], 1);
11
11
  }, a = [], c = /* @__PURE__ */ i(
12
12
  o,
13
13
  n,
14
14
  a,
15
15
  !1,
16
16
  null,
17
- "52a77eec"
17
+ "187d41fa"
18
18
  );
19
- const _ = c.exports;
19
+ const p = c.exports;
20
20
  export {
21
- _ as default
21
+ p as default
22
22
  };
@@ -1,18 +1,15 @@
1
- import { defineComponent as i } from "vue";
2
- import { useVersionHistoryApi as n } from "../../../../composables/useVersionHistoryApi.js";
3
- import { useVersionHistoryStore as m } from "../../../../stores/version-history.js";
4
- import { InButtonV2 as p } from "@useinsider/design-system-vue";
5
- import f from "./VersionHistoryItem.vue.js";
6
- const _ = /* @__PURE__ */ i({
1
+ import { defineComponent as t } from "vue";
2
+ import { useVersionHistoryApi as e } from "../../../../composables/useVersionHistoryApi.js";
3
+ import { useVersionHistoryStore as s } from "../../../../stores/version-history.js";
4
+ import { InButtonV2 as i } from "@useinsider/design-system-vue";
5
+ import n from "./VersionHistoryItem.vue.js";
6
+ const c = /* @__PURE__ */ t({
7
7
  __name: "VersionHistory",
8
- props: {
9
- itemStatus: { type: Boolean }
10
- },
11
- setup(t) {
12
- const o = t, r = m(), { previewVersion: e } = n(), { itemStatus: s = !1 } = o;
13
- return { __sfc: !0, versionHistoryStore: r, previewVersion: e, props: o, itemStatus: s, InButtonV2: p, VersionHistoryItem: f };
8
+ setup(m) {
9
+ const o = s(), { previewVersion: r } = e();
10
+ return { __sfc: !0, versionHistoryStore: o, previewVersion: r, InButtonV2: i, VersionHistoryItem: n };
14
11
  }
15
12
  });
16
13
  export {
17
- _ as default
14
+ c as default
18
15
  };