@useinsider/guido 1.0.0-beta.02a8faf

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 (117) hide show
  1. package/README.md +217 -0
  2. package/dist/@types/events.d.ts +1 -0
  3. package/dist/@types/generic.d.ts +13 -0
  4. package/dist/App.vue.d.ts +3 -0
  5. package/dist/_virtual/_plugin-vue2_normalizer.js +10 -0
  6. package/dist/components/Guido.vue.d.ts +20 -0
  7. package/dist/components/Guido.vue.js +18 -0
  8. package/dist/components/Guido.vue2.js +43 -0
  9. package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +2 -0
  10. package/dist/components/organisms/header/HeaderWrapper.vue.js +17 -0
  11. package/dist/components/organisms/header/HeaderWrapper.vue2.js +14 -0
  12. package/dist/components/organisms/header/LeftSlot.vue.d.ts +2 -0
  13. package/dist/components/organisms/header/LeftSlot.vue.js +17 -0
  14. package/dist/components/organisms/header/LeftSlot.vue2.js +11 -0
  15. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +2 -0
  16. package/dist/components/organisms/header/MiddleSlot.vue.js +17 -0
  17. package/dist/components/organisms/header/MiddleSlot.vue2.js +20 -0
  18. package/dist/components/organisms/header/RightSlot.vue.d.ts +2 -0
  19. package/dist/components/organisms/header/RightSlot.vue.js +20 -0
  20. package/dist/components/organisms/header/RightSlot.vue2.js +24 -0
  21. package/dist/components/organisms/header/ViewOptions.vue.d.ts +2 -0
  22. package/dist/components/organisms/header/ViewOptions.vue.js +18 -0
  23. package/dist/components/organisms/header/ViewOptions.vue2.js +15 -0
  24. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +2 -0
  25. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +22 -0
  26. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +15 -0
  27. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +16 -0
  28. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +18 -0
  29. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +16 -0
  30. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +2 -0
  31. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +18 -0
  32. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +23 -0
  33. package/dist/composables/useActionsApi.d.ts +4 -0
  34. package/dist/composables/useActionsApi.js +36 -0
  35. package/dist/composables/useApiExample.d.ts +61 -0
  36. package/dist/composables/useCustomInterfaceAppearance.d.ts +3 -0
  37. package/dist/composables/useCustomInterfaceAppearance.js +13 -0
  38. package/dist/composables/useExport.d.ts +3 -0
  39. package/dist/composables/useExport.js +30 -0
  40. package/dist/composables/useHttp.d.ts +78 -0
  41. package/dist/composables/useHttp.js +84 -0
  42. package/dist/composables/usePartner.d.ts +4 -0
  43. package/dist/composables/usePartner.js +16 -0
  44. package/dist/composables/useStripo.d.ts +4 -0
  45. package/dist/composables/useStripo.js +74 -0
  46. package/dist/composables/useTemplates.d.ts +5 -0
  47. package/dist/composables/useTemplates.js +27 -0
  48. package/dist/composables/useToaster.d.ts +21 -0
  49. package/dist/composables/useToaster.js +37 -0
  50. package/dist/composables/useTranslations.d.ts +5 -0
  51. package/dist/composables/useTranslations.js +18 -0
  52. package/dist/composables/useVersionHistoryApi.d.ts +8 -0
  53. package/dist/composables/useVersionHistoryApi.js +53 -0
  54. package/dist/enums/defaults.d.ts +4 -0
  55. package/dist/enums/defaults.js +8 -0
  56. package/dist/guido.css +1 -0
  57. package/dist/guido.png +0 -0
  58. package/dist/library.d.ts +3 -0
  59. package/dist/library.js +4 -0
  60. package/dist/main.d.ts +1 -0
  61. package/dist/mock/api/auth.d.ts +2 -0
  62. package/dist/mock/api/custom-fonts.d.ts +2 -0
  63. package/dist/mock/browser.d.ts +1 -0
  64. package/dist/mock/handlers.d.ts +1 -0
  65. package/dist/mockServiceWorker.js +344 -0
  66. package/dist/node_modules/lodash-es/_Hash.js +20 -0
  67. package/dist/node_modules/lodash-es/_ListCache.js +20 -0
  68. package/dist/node_modules/lodash-es/_Map.js +6 -0
  69. package/dist/node_modules/lodash-es/_MapCache.js +20 -0
  70. package/dist/node_modules/lodash-es/_Symbol.js +5 -0
  71. package/dist/node_modules/lodash-es/_assocIndexOf.js +10 -0
  72. package/dist/node_modules/lodash-es/_baseGetTag.js +10 -0
  73. package/dist/node_modules/lodash-es/_baseIsNative.js +16 -0
  74. package/dist/node_modules/lodash-es/_coreJsData.js +5 -0
  75. package/dist/node_modules/lodash-es/_freeGlobal.js +4 -0
  76. package/dist/node_modules/lodash-es/_getMapData.js +8 -0
  77. package/dist/node_modules/lodash-es/_getNative.js +9 -0
  78. package/dist/node_modules/lodash-es/_getRawTag.js +15 -0
  79. package/dist/node_modules/lodash-es/_getValue.js +6 -0
  80. package/dist/node_modules/lodash-es/_hashClear.js +7 -0
  81. package/dist/node_modules/lodash-es/_hashDelete.js +7 -0
  82. package/dist/node_modules/lodash-es/_hashGet.js +13 -0
  83. package/dist/node_modules/lodash-es/_hashHas.js +9 -0
  84. package/dist/node_modules/lodash-es/_hashSet.js +9 -0
  85. package/dist/node_modules/lodash-es/_isKeyable.js +7 -0
  86. package/dist/node_modules/lodash-es/_isMasked.js +11 -0
  87. package/dist/node_modules/lodash-es/_listCacheClear.js +6 -0
  88. package/dist/node_modules/lodash-es/_listCacheDelete.js +12 -0
  89. package/dist/node_modules/lodash-es/_listCacheGet.js +8 -0
  90. package/dist/node_modules/lodash-es/_listCacheHas.js +7 -0
  91. package/dist/node_modules/lodash-es/_listCacheSet.js +8 -0
  92. package/dist/node_modules/lodash-es/_mapCacheClear.js +13 -0
  93. package/dist/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  94. package/dist/node_modules/lodash-es/_mapCacheGet.js +7 -0
  95. package/dist/node_modules/lodash-es/_mapCacheHas.js +7 -0
  96. package/dist/node_modules/lodash-es/_mapCacheSet.js +8 -0
  97. package/dist/node_modules/lodash-es/_nativeCreate.js +5 -0
  98. package/dist/node_modules/lodash-es/_objectToString.js +7 -0
  99. package/dist/node_modules/lodash-es/_root.js +5 -0
  100. package/dist/node_modules/lodash-es/_toSource.js +17 -0
  101. package/dist/node_modules/lodash-es/eq.js +6 -0
  102. package/dist/node_modules/lodash-es/isFunction.js +12 -0
  103. package/dist/node_modules/lodash-es/isObject.js +7 -0
  104. package/dist/node_modules/lodash-es/memoize.js +18 -0
  105. package/dist/services/stripoApi.d.ts +7 -0
  106. package/dist/services/stripoApi.js +29 -0
  107. package/dist/sprite.svg +3133 -0
  108. package/dist/static/editor.css.js +232 -0
  109. package/dist/static/templates/default/index.html.js +5 -0
  110. package/dist/static/templates/default/style.css.js +119 -0
  111. package/dist/stores/editor.d.ts +5 -0
  112. package/dist/stores/editor.js +11 -0
  113. package/dist/stores/version-history.d.ts +80 -0
  114. package/dist/stores/version-history.js +28 -0
  115. package/dist/utils/dateUtil.d.ts +1 -0
  116. package/dist/utils/dateUtil.js +16 -0
  117. package/package.json +80 -0
package/README.md ADDED
@@ -0,0 +1,217 @@
1
+ <p align="center">
2
+ <a href="https://www.youtube.com/shorts/Y0RwBeMezL4" target="_blank" rel="noopener noreferrer">
3
+ <img width="180" src="./public/guido.png" alt="Guido logo">
4
+ </a>
5
+ </p>
6
+
7
+
8
+ # @useinsider/guido
9
+
10
+ Guido is a Vue 2 + TypeScript wrapper for the Stripo Email Editor plugin. Easily embed the professional email editor in your Vue applications with a clean, customizable interface.
11
+
12
+ ## 📦 Install
13
+
14
+ ```bash
15
+ npm install @useinsider/guido
16
+ ```
17
+
18
+ ## 🚀 Usage
19
+
20
+ ### Basic Usage
21
+
22
+ ```html
23
+ <template>
24
+ <div>
25
+ <Guido
26
+ :email-id="emailId"
27
+ :user-id="userId"
28
+ :guido-config="guidoConfig"
29
+ />
30
+ </div>
31
+ </template>
32
+
33
+ <script lang="ts">
34
+ import { Guido } from '@useinsider/guido';
35
+
36
+ export default {
37
+ components: {
38
+ Guido
39
+ },
40
+ data() {
41
+ return {
42
+ emailId: 'abc123',
43
+ userId: '12345',
44
+ guidoConfig: {
45
+ translationsPath: 'window.trans.en'
46
+ }
47
+ };
48
+ }
49
+ };
50
+ </script>
51
+ ```
52
+
53
+ ## 📚 API
54
+
55
+ ### Guido Component Props
56
+
57
+ | Prop | Type | Required | Default | Description |
58
+ |------|------|----------|---------|-------------|
59
+ | `emailId` | `string` | ✅ | - | Unique identifier for the email draft |
60
+ | `userId` | `string` | ✅ | - | Unique identifier for the user draft |
61
+ | `username` | `string` | ⚪ | Guido User | User name |
62
+ | `partnerName` | `string` | ⚪ | Getting from URL host | Unique identifier for the partner draft |
63
+ | `productType` | `string` | ⚪ | Getting from URL path | Unique identifier for the product draft |
64
+ | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
65
+
66
+ ### GuidoConfig Interface
67
+
68
+ ```typescript
69
+ interface GuidoConfig {
70
+ translationsPath: string;
71
+ }
72
+ ```
73
+
74
+ | Property | Type | Default | Description |
75
+ |----------|------|---------|-------------|
76
+ | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
77
+
78
+ ### TypeScript Types
79
+
80
+ The library exports the following TypeScript types:
81
+
82
+ ```typescript
83
+ // Main component
84
+ import { Guido } from '@useinsider/guido';
85
+
86
+ // Types
87
+ import type { GuidoConfig } from '@useinsider/guido';
88
+ import type { StripoEventType } from '@useinsider/guido';
89
+ ```
90
+
91
+ ### StripoEventType
92
+
93
+ ```typescript
94
+ type StripoEventType =
95
+ | 'save'
96
+ | 'export'
97
+ | 'close'
98
+ | 'autosave'
99
+ | 'publish'
100
+ | 'export:requested'
101
+ | 'export:ready';
102
+ ```
103
+
104
+ ---
105
+
106
+ ## 🔧 Development
107
+
108
+ ### Prerequisites
109
+
110
+ - 🧄 `Bun` (strongly recommended)
111
+ or
112
+ - NodeJS 18+ & `npm`
113
+
114
+ ### Setup
115
+
116
+ ```bash
117
+ # Install dependencies
118
+ bun install
119
+
120
+ # Start development server
121
+ bun start
122
+
123
+ # Build for production
124
+ bun run build
125
+
126
+ # Type checking
127
+ bun run type-check
128
+
129
+ # Linting
130
+ bun run lint
131
+ ```
132
+
133
+ ### Environment Variables
134
+
135
+ Create a `.env` file with the following variables: (You can get env variables from your senior)
136
+
137
+ ```env
138
+ VITE_STRIPO_PLUGIN_ID=your_plugin_id
139
+ VITE_STRIPO_SECRET_KEY=your_secret_key
140
+ VITE_STRIPO_ROLE=your_role
141
+ ```
142
+
143
+ ### Project Structure
144
+
145
+ ```
146
+ src/
147
+ ├── components/ # Vue components
148
+ ├── composables/ # Vue composables & business logic
149
+ ├── services/ # API layer
150
+ ├── stores/ # State management
151
+ ├── @types/ # TypeScript definitions
152
+ ├── static/ # Static assets & templates
153
+ ├── utils/ # Utility functions
154
+ ├── enums/ # Constants & enums
155
+ ├── mock/ # Mock data for development
156
+ ├── plugins/ # Vue plugins
157
+ └── library.ts # Main export
158
+ ```
159
+
160
+ ## 🌐 i18n
161
+ Before running the project, it sends to request to inone.useinsider.com/translations and writes the JSON file into - [trans.json](src/mock/responses/trans.json).
162
+ It allows to use production or local translations on your code. 🚀
163
+ Example usage:
164
+ ```js
165
+ import { useTranslations } from '@@/Composables/useTranslations';
166
+
167
+ const trans = useTranslations();
168
+
169
+ // use everywhere like this:
170
+ trans('foo.bar')
171
+ ```
172
+
173
+ ## 📦 Build Output
174
+
175
+ The library builds to multiple formats:
176
+
177
+ - **ES Module**: `dist/library.js` (recommended)
178
+ - **CSS**: `dist/guido.css` (custom styles)
179
+
180
+ ### Package Exports
181
+
182
+ ```json
183
+ {
184
+ "exports": {
185
+ ".": {
186
+ "import": "./dist/library.js",
187
+ "types": "./dist/components/Guido.vue.d.ts",
188
+ "require": "./dist/components/Guido.vue.js"
189
+ },
190
+ "./style": "./dist/guido.css"
191
+ }
192
+ }
193
+ ```
194
+
195
+ ## 🤝 Contributing
196
+ - PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
197
+ - PR Labels should be filled.
198
+ - PR Assignee required.
199
+ - Tests should be covered.
200
+ - All required checks should be passed before sending review request.
201
+
202
+ ## 📄 License
203
+
204
+ ISC License
205
+
206
+ ---
207
+
208
+ ## 🔗 Related
209
+
210
+ - [Stripo Email Editor](https://stripo.email/) - The underlying email editor
211
+ - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
212
+
213
+ ## 🎯 TODO:
214
+ - [editor.css](src/static/editor.css) should be optimized with variables & `sass-loader`.
215
+ - Master Version Generator should be fixed.
216
+ - Playwright integration
217
+ - Commitlint & Precommit Hooks integration
@@ -0,0 +1 @@
1
+ export type StripoEventType = 'save' | 'export' | 'close' | 'autosave' | 'publish' | 'export:requested' | 'export:ready';
@@ -0,0 +1,13 @@
1
+ export type GuidoConfig = {
2
+ translationsPath: string;
3
+ };
4
+ export interface User {
5
+ id: number;
6
+ name: string;
7
+ email: string;
8
+ }
9
+ export interface ApiResponse<T> {
10
+ data: T;
11
+ message: string;
12
+ success: boolean;
13
+ }
@@ -0,0 +1,3 @@
1
+ import '../node_modules/@useinsider/design-system-vue/dist/design-system-vue.css';
2
+ 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<{}>>, {}>;
3
+ export default _default;
@@ -0,0 +1,10 @@
1
+ function u(n, o, i, a, d, t, f, l) {
2
+ var e = typeof n == "function" ? n.options : n;
3
+ return o && (e.render = o, e.staticRenderFns = i, e._compiled = !0), t && (e._scopeId = "data-v-" + t), {
4
+ exports: n,
5
+ options: e
6
+ };
7
+ }
8
+ export {
9
+ u as default
10
+ };
@@ -0,0 +1,20 @@
1
+ import type { GuidoConfig } from '@@/Types/generic';
2
+ type __VLS_Props = {
3
+ emailId: string;
4
+ userId: string;
5
+ partnerName?: string;
6
+ productType?: string;
7
+ username?: string;
8
+ guidoConfig: GuidoConfig;
9
+ };
10
+ 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>>>, {}>;
11
+ export default _default;
12
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
13
+ type __VLS_TypePropsToOption<T> = {
14
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
15
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
16
+ } : {
17
+ type: import('vue').PropType<T[K]>;
18
+ required: true;
19
+ };
20
+ };
@@ -0,0 +1,18 @@
1
+ import o from "./Guido.vue2.js";
2
+ /* empty css */
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
5
+ var e = this, r = e._self._c, t = e._self._setupProxy;
6
+ return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.HeaderWrapper), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
+ }, _ = [], a = /* @__PURE__ */ i(
8
+ o,
9
+ s,
10
+ _,
11
+ !1,
12
+ null,
13
+ "d4a5c957"
14
+ );
15
+ const f = a.exports;
16
+ export {
17
+ f as default
18
+ };
@@ -0,0 +1,43 @@
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({
8
+ __name: "Guido",
9
+ props: {
10
+ emailId: null,
11
+ userId: null,
12
+ partnerName: null,
13
+ productType: null,
14
+ username: null,
15
+ guidoConfig: null
16
+ },
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;
26
+ window.GuidoConfig = {
27
+ ...T,
28
+ ...a
29
+ };
30
+ const { initPlugin: l } = _({ emailId: n, userId: i, username: m, partnerName: u, productType: p }), { getDefaultTemplate: s } = y();
31
+ return c(async () => {
32
+ try {
33
+ const e = await s();
34
+ await l(e);
35
+ } catch (e) {
36
+ console.error("Failed to initialize Stripo editor:", e);
37
+ }
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 };
39
+ }
40
+ });
41
+ export {
42
+ h as default
43
+ };
@@ -0,0 +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<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import t from "./HeaderWrapper.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ var o = this, r = o._self._c, e = o._self._setupProxy;
5
+ return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot)], 1)]);
6
+ }, a = [], _ = /* @__PURE__ */ s(
7
+ t,
8
+ n,
9
+ a,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const d = _.exports;
15
+ export {
16
+ d as default
17
+ };
@@ -0,0 +1,14 @@
1
+ import { defineComponent as o } from "vue";
2
+ import { InContainer as r } from "@useinsider/design-system-vue";
3
+ import t from "./LeftSlot.vue.js";
4
+ import e from "./MiddleSlot.vue.js";
5
+ import m from "./RightSlot.vue.js";
6
+ const s = /* @__PURE__ */ o({
7
+ __name: "HeaderWrapper",
8
+ setup(p) {
9
+ return { __sfc: !0, InContainer: r, LeftSlot: t, MiddleSlot: e, RightSlot: m };
10
+ }
11
+ });
12
+ export {
13
+ s as default
14
+ };
@@ -0,0 +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<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import r from "./LeftSlot.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
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
+ r,
8
+ _,
9
+ s,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const i = a.exports;
15
+ export {
16
+ i as default
17
+ };
@@ -0,0 +1,11 @@
1
+ import { defineComponent as t } from "vue";
2
+ import { InButtonV2 as o } from "@useinsider/design-system-vue";
3
+ const _ = /* @__PURE__ */ t({
4
+ __name: "LeftSlot",
5
+ setup(e) {
6
+ return { __sfc: !0, InButtonV2: o };
7
+ }
8
+ });
9
+ export {
10
+ _ as default
11
+ };
@@ -0,0 +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<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import s from "./MiddleSlot.vue2.js";
2
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var e = this, o = e._self._c, t = e._self._setupProxy;
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
+ s,
8
+ i,
9
+ l,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const _ = r.exports;
15
+ export {
16
+ _ as default
17
+ };
@@ -0,0 +1,20 @@
1
+ import { defineComponent as r } from "vue";
2
+ import { useTranslations as s } from "../../../composables/useTranslations.js";
3
+ import { useEditorStore as n } from "../../../stores/editor.js";
4
+ import { InButtonV2 as e } from "@useinsider/design-system-vue";
5
+ import m from "./version-history/VersionHistory.vue.js";
6
+ const _ = /* @__PURE__ */ r({
7
+ __name: "MiddleSlot",
8
+ setup(p) {
9
+ const o = n(), t = s();
10
+ return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
11
+ id: `${i}-tooltip`,
12
+ dynamicPosition: !1,
13
+ staticPosition: "bottom center",
14
+ iconStatus: !1
15
+ }), InButtonV2: e, VersionHistory: m };
16
+ }
17
+ });
18
+ export {
19
+ _ as default
20
+ };
@@ -0,0 +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<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import o from "./RightSlot.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var s = this, e = s._self._c, t = s._self._setupProxy;
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(
10
+ o,
11
+ r,
12
+ n,
13
+ !1,
14
+ null,
15
+ "fefca98f"
16
+ );
17
+ const f = a.exports;
18
+ export {
19
+ f as default
20
+ };
@@ -0,0 +1,24 @@
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({
10
+ __name: "RightSlot",
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: () => {
14
+ if (t.isVersionHistoryOpen) {
15
+ r();
16
+ return;
17
+ }
18
+ o();
19
+ }, InButtonV2: u, VersionHistoryViewOptions: H, ViewOptions: c };
20
+ }
21
+ });
22
+ export {
23
+ E as default
24
+ };
@@ -0,0 +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<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import r from "./ViewOptions.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var t = this, o = t._self._c, e = t._self._setupProxy;
6
+ return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
+ }, i = [], _ = /* @__PURE__ */ s(
8
+ r,
9
+ n,
10
+ i,
11
+ !1,
12
+ null,
13
+ "0fff376c"
14
+ );
15
+ const l = _.exports;
16
+ export {
17
+ l as default
18
+ };
@@ -0,0 +1,15 @@
1
+ import { defineComponent as e } from "vue";
2
+ import { useEditorStore as t } from "../../../stores/editor.js";
3
+ import { InSegments as o } from "@useinsider/design-system-vue";
4
+ const u = /* @__PURE__ */ e({
5
+ __name: "ViewOptions",
6
+ setup(n) {
7
+ return { __sfc: !0, editorStore: t(), segmentList: [
8
+ { text: "", icon: "line-desktop", value: "desktop" },
9
+ { text: "", icon: "line-menu-mobileapp", value: "mobile" }
10
+ ], InSegments: o };
11
+ }
12
+ });
13
+ export {
14
+ u as default
15
+ };
@@ -0,0 +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<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import o from "./VersionHistory.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
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
+ 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(s) {
9
+ return t.previewVersion(t.versionHistoryStore.nextPatch.id);
10
+ } } })], 1), e(t.VersionHistoryItem, { attrs: { "text-align": "left", date: t.versionHistoryStore.nextPatch.date, description: t.versionHistoryStore.nextPatch.description } })], 1);
11
+ }, a = [], c = /* @__PURE__ */ i(
12
+ o,
13
+ n,
14
+ a,
15
+ !1,
16
+ null,
17
+ "187d41fa"
18
+ );
19
+ const p = c.exports;
20
+ export {
21
+ p as default
22
+ };
@@ -0,0 +1,15 @@
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
+ __name: "VersionHistory",
8
+ setup(m) {
9
+ const o = s(), { previewVersion: r } = e();
10
+ return { __sfc: !0, versionHistoryStore: o, previewVersion: r, InButtonV2: i, VersionHistoryItem: n };
11
+ }
12
+ });
13
+ export {
14
+ c as default
15
+ };
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ description: string;
3
+ date: number;
4
+ textAlign: string;
5
+ };
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>>>, {}>;
7
+ export default _default;
8
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+ type __VLS_TypePropsToOption<T> = {
10
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
11
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
+ } : {
13
+ type: import('vue').PropType<T[K]>;
14
+ required: true;
15
+ };
16
+ };
@@ -0,0 +1,18 @@
1
+ import e from "./VersionHistoryItem.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var i = function() {
5
+ var s = this, r = s._self._c, t = s._self._setupProxy;
6
+ return r("div", { staticClass: "version-history-item f-g-1" }, [t.props.description ? r("div", { staticClass: "d-f f-d-c", class: { "t-a-r": t.props.textAlign === "right" } }, [r("div", { staticClass: "t-o-e o-h w-s-n-w", domProps: { innerHTML: s._s(t.props.description) } }), r("div", { staticClass: "f-s-1" }, [s._v(" " + s._s(t.formatPatchDate(t.props.date)) + " ")])]) : s._e()]);
7
+ }, a = [], n = /* @__PURE__ */ o(
8
+ e,
9
+ i,
10
+ a,
11
+ !1,
12
+ null,
13
+ "0e2ff42d"
14
+ );
15
+ const d = n.exports;
16
+ export {
17
+ d as default
18
+ };
@@ -0,0 +1,16 @@
1
+ import { defineComponent as o } from "vue";
2
+ import { formatPatchDate as e } from "../../../../utils/dateUtil.js";
3
+ const s = /* @__PURE__ */ o({
4
+ __name: "VersionHistoryItem",
5
+ props: {
6
+ description: null,
7
+ date: null,
8
+ textAlign: null
9
+ },
10
+ setup(t) {
11
+ return { __sfc: !0, props: t, formatPatchDate: e };
12
+ }
13
+ });
14
+ export {
15
+ s as default
16
+ };
@@ -0,0 +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<{}>>, {}>;
2
+ export default _default;