@useinsider/guido 1.0.0-beta.ae2520e → 1.0.0-beta.afdfab7

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 (143) hide show
  1. package/README.md +35 -19
  2. package/dist/components/Guido.vue.d.ts +4 -0
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +34 -18
  5. package/dist/components/organisms/base/ModalWrapper.vue.d.ts +72 -0
  6. package/dist/components/organisms/base/ModalWrapper.vue.js +19 -0
  7. package/dist/components/organisms/base/ModalWrapper.vue2.js +43 -0
  8. package/dist/components/organisms/{top-bar/Header.vue.js → header/HeaderWrapper.vue.js} +7 -7
  9. package/dist/components/organisms/header/HeaderWrapper.vue2.js +14 -0
  10. package/dist/components/organisms/header/LeftSlot.vue.js +17 -0
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +13 -0
  12. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +2 -0
  13. package/dist/components/organisms/header/MiddleSlot.vue.js +17 -0
  14. package/dist/components/organisms/header/MiddleSlot.vue2.js +22 -0
  15. package/dist/components/organisms/header/RightSlot.vue.js +17 -0
  16. package/dist/components/organisms/header/RightSlot.vue2.js +21 -0
  17. package/dist/components/organisms/{top-bar/HeaderViewOptions.vue.js → header/ViewOptions.vue.js} +5 -5
  18. package/dist/components/organisms/{top-bar/HeaderViewOptions.vue2.js → header/ViewOptions.vue2.js} +3 -3
  19. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +19 -0
  20. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +14 -0
  21. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +14 -0
  22. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +22 -0
  23. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +18 -0
  24. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +16 -0
  25. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +18 -0
  26. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +16 -0
  27. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +2 -0
  28. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +18 -0
  29. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +23 -0
  30. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +16 -0
  31. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +22 -0
  32. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +86 -0
  33. package/dist/composables/useActionsApi.d.ts +4 -0
  34. package/dist/composables/useActionsApi.js +36 -0
  35. package/dist/composables/useCustomInterfaceAppearance.js +45 -9
  36. package/dist/composables/useExport.d.ts +3 -0
  37. package/dist/composables/useExport.js +30 -0
  38. package/dist/composables/useHttp.js +84 -0
  39. package/dist/composables/usePartner.d.ts +4 -0
  40. package/dist/composables/usePartner.js +16 -0
  41. package/dist/composables/useSaveAsTemplate.d.ts +17 -0
  42. package/dist/composables/useSaveAsTemplate.js +44 -0
  43. package/dist/composables/useStripo.d.ts +2 -2
  44. package/dist/composables/useStripo.js +53 -55
  45. package/dist/composables/useTemplateCategories.d.ts +35 -0
  46. package/dist/composables/useTemplateCategories.js +78 -0
  47. package/dist/composables/useTemplateNameValidation.d.ts +13 -0
  48. package/dist/composables/useTemplateNameValidation.js +57 -0
  49. package/dist/composables/useToaster.d.ts +1 -0
  50. package/dist/composables/useToaster.js +37 -0
  51. package/dist/composables/useTranslations.d.ts +1 -3
  52. package/dist/composables/useTranslations.js +18 -0
  53. package/dist/composables/useVersionHistoryApi.d.ts +8 -0
  54. package/dist/composables/useVersionHistoryApi.js +53 -0
  55. package/dist/enums/defaults.d.ts +2 -0
  56. package/dist/enums/defaults.js +5 -3
  57. package/dist/enums/displayConditions.d.ts +2 -0
  58. package/dist/enums/displayConditions.js +80 -0
  59. package/dist/guido.css +1 -1
  60. package/dist/mock/api/custom-fonts.d.ts +2 -0
  61. package/dist/mock/api/template-library.d.ts +2 -0
  62. package/dist/node_modules/lodash-es/_Hash.js +20 -0
  63. package/dist/node_modules/lodash-es/_ListCache.js +20 -0
  64. package/dist/node_modules/lodash-es/_Map.js +6 -0
  65. package/dist/node_modules/lodash-es/_MapCache.js +20 -0
  66. package/dist/node_modules/lodash-es/_Symbol.js +5 -0
  67. package/dist/node_modules/lodash-es/_assocIndexOf.js +10 -0
  68. package/dist/node_modules/lodash-es/_baseGetTag.js +10 -0
  69. package/dist/node_modules/lodash-es/_baseIsNative.js +16 -0
  70. package/dist/node_modules/lodash-es/_coreJsData.js +5 -0
  71. package/dist/node_modules/lodash-es/_freeGlobal.js +4 -0
  72. package/dist/node_modules/lodash-es/_getMapData.js +8 -0
  73. package/dist/node_modules/lodash-es/_getNative.js +9 -0
  74. package/dist/node_modules/lodash-es/_getRawTag.js +15 -0
  75. package/dist/node_modules/lodash-es/_getValue.js +6 -0
  76. package/dist/node_modules/lodash-es/_hashClear.js +7 -0
  77. package/dist/node_modules/lodash-es/_hashDelete.js +7 -0
  78. package/dist/node_modules/lodash-es/_hashGet.js +13 -0
  79. package/dist/node_modules/lodash-es/_hashHas.js +9 -0
  80. package/dist/node_modules/lodash-es/_hashSet.js +9 -0
  81. package/dist/node_modules/lodash-es/_isKeyable.js +7 -0
  82. package/dist/node_modules/lodash-es/_isMasked.js +11 -0
  83. package/dist/node_modules/lodash-es/_listCacheClear.js +6 -0
  84. package/dist/node_modules/lodash-es/_listCacheDelete.js +12 -0
  85. package/dist/node_modules/lodash-es/_listCacheGet.js +8 -0
  86. package/dist/node_modules/lodash-es/_listCacheHas.js +7 -0
  87. package/dist/node_modules/lodash-es/_listCacheSet.js +8 -0
  88. package/dist/node_modules/lodash-es/_mapCacheClear.js +13 -0
  89. package/dist/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  90. package/dist/node_modules/lodash-es/_mapCacheGet.js +7 -0
  91. package/dist/node_modules/lodash-es/_mapCacheHas.js +7 -0
  92. package/dist/node_modules/lodash-es/_mapCacheSet.js +8 -0
  93. package/dist/node_modules/lodash-es/_nativeCreate.js +5 -0
  94. package/dist/node_modules/lodash-es/_objectToString.js +7 -0
  95. package/dist/node_modules/lodash-es/_root.js +5 -0
  96. package/dist/node_modules/lodash-es/_toSource.js +17 -0
  97. package/dist/node_modules/lodash-es/eq.js +6 -0
  98. package/dist/node_modules/lodash-es/isFunction.js +12 -0
  99. package/dist/node_modules/lodash-es/isObject.js +7 -0
  100. package/dist/node_modules/lodash-es/memoize.js +18 -0
  101. package/dist/services/stripoApi.d.ts +7 -0
  102. package/dist/services/stripoApi.js +29 -0
  103. package/dist/static/styles/base.css.js +11 -0
  104. package/dist/static/styles/components/alert-message.css.js +39 -0
  105. package/dist/static/styles/components/amp-block.css.js +18 -0
  106. package/dist/static/styles/components/base-input.css.js +47 -0
  107. package/dist/static/styles/components/button-group.css.js +54 -0
  108. package/dist/static/styles/components/button.css.js +106 -0
  109. package/dist/static/styles/components/combobox.css.js +49 -0
  110. package/dist/static/styles/components/counter.css.js +42 -0
  111. package/dist/static/styles/components/dropdown-menu.css.js +52 -0
  112. package/dist/static/styles/components/narrow-panel.css.js +38 -0
  113. package/dist/static/styles/components/switcher.css.js +11 -0
  114. package/dist/static/styles/components/tabs.css.js +97 -0
  115. package/dist/static/styles/components/tools.css.js +23 -0
  116. package/dist/static/styles/components/version-history.css.js +30 -0
  117. package/dist/static/styles/components/wide-panel.css.js +135 -0
  118. package/dist/static/styles/variables.css.js +23 -0
  119. package/dist/stores/editor.d.ts +4 -4
  120. package/dist/stores/editor.js +4 -2
  121. package/dist/stores/version-history.d.ts +80 -0
  122. package/dist/stores/version-history.js +28 -0
  123. package/dist/utils/base64.d.ts +1 -0
  124. package/dist/utils/base64.js +14 -0
  125. package/dist/utils/dateUtil.d.ts +1 -0
  126. package/dist/utils/dateUtil.js +16 -0
  127. package/package.json +1 -1
  128. package/dist/components/organisms/top-bar/Header.vue2.js +0 -14
  129. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.js +0 -17
  130. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue2.js +0 -11
  131. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.js +0 -17
  132. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue2.js +0 -17
  133. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.js +0 -18
  134. package/dist/components/organisms/top-bar/HeaderRightSlot.vue2.js +0 -12
  135. package/dist/node_modules/pinia/dist/pinia.js +0 -314
  136. package/dist/node_modules/pinia/node_modules/vue-demi/lib/index.js +0 -11
  137. package/dist/static/editor.css.js +0 -182
  138. package/dist/stores/counter.d.ts +0 -12
  139. /package/dist/components/organisms/{top-bar/Header.vue.d.ts → header/HeaderWrapper.vue.d.ts} +0 -0
  140. /package/dist/components/organisms/{top-bar/HeaderRightSlot.vue.d.ts → header/LeftSlot.vue.d.ts} +0 -0
  141. /package/dist/components/organisms/{top-bar/HeaderLeftSlot.vue.d.ts → header/RightSlot.vue.d.ts} +0 -0
  142. /package/dist/components/organisms/{top-bar/HeaderMiddleSlot.vue.d.ts → header/ViewOptions.vue.d.ts} +0 -0
  143. /package/dist/components/organisms/{top-bar/HeaderViewOptions.vue.d.ts → header/version-history/RestoreButton.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -24,6 +24,7 @@ npm install @useinsider/guido
24
24
  <div>
25
25
  <Guido
26
26
  :email-id="emailId"
27
+ :user-id="userId"
27
28
  :guido-config="guidoConfig"
28
29
  />
29
30
  </div>
@@ -39,6 +40,7 @@ export default {
39
40
  data() {
40
41
  return {
41
42
  emailId: 'abc123',
43
+ userId: '12345',
42
44
  guidoConfig: {
43
45
  translationsPath: 'window.trans.en'
44
46
  }
@@ -55,6 +57,10 @@ export default {
55
57
  | Prop | Type | Required | Default | Description |
56
58
  |------|------|----------|---------|-------------|
57
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 |
58
64
  | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
59
65
 
60
66
  ### GuidoConfig Interface
@@ -138,25 +144,31 @@ VITE_STRIPO_ROLE=your_role
138
144
 
139
145
  ```
140
146
  src/
141
- ├── components/
142
- ├── Guido.vue # Main component
143
- │ └── organisms/
144
- │ └── top-bar/ # Header components
145
- ...
146
- ├── composables/
147
- ├── useStripo.ts # Stripo integration
148
- │ └── useTranslations.ts # Translation management
149
- ├── @types/
150
- ├── generic.ts # Generic types
151
- │ ├── stripo.d.ts # Stripo-specific types
152
- │ └── events.ts # Event types
153
- ├── static/
154
- │ ├── editor.css # Custom editor styles
155
- │ └── templates/
156
- │ └── default/ # Default email template
157
- └── library.ts # Main export for library
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
158
  ```
159
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
+ ```
160
172
 
161
173
  ## 📦 Build Output
162
174
 
@@ -180,7 +192,6 @@ The library builds to multiple formats:
180
192
  }
181
193
  ```
182
194
 
183
-
184
195
  ## 🤝 Contributing
185
196
  - PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
186
197
  - PR Labels should be filled.
@@ -200,7 +211,12 @@ ISC License
200
211
  - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
201
212
 
202
213
  ## 🎯 TODO:
203
- - [editor.css](src/static/editor.css) should be optimized with variables & `sass-loader`.
214
+ - CSS part should be optimized with variables & `sass-loader`.
204
215
  - Master Version Generator should be fixed.
205
216
  - Playwright integration
206
217
  - Commitlint & Precommit Hooks integration
218
+ - We need to emit save event and we should return template config to it
219
+ - Default template should be same with production
220
+ - Open Guido with saved template
221
+ - Get User ID, Email and Unique Template ID as dynamic from props
222
+ - Get Pre-built display conditions from API
@@ -1,6 +1,10 @@
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;
4
8
  guidoConfig: GuidoConfig;
5
9
  };
6
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>>>, {}>;
@@ -1,18 +1,18 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import i from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import a from "../_virtual/_plugin-vue2_normalizer.js";
4
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.Header), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
- }, _ = [], a = /* @__PURE__ */ i(
5
+ var t = this, e = t._self._c, r = t._self._setupProxy;
6
+ return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), e("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.SaveTemplateModal, { attrs: { "is-open": r.editorStore.isSaveTemplateModalOpen }, on: { close: r.handleCloseSaveTemplateModal } })], 1);
7
+ }, i = [], n = /* @__PURE__ */ a(
8
8
  o,
9
9
  s,
10
- _,
10
+ i,
11
11
  !1,
12
12
  null,
13
- "ef4897b1"
13
+ "69c35c60"
14
14
  );
15
- const p = a.exports;
15
+ const c = n.exports;
16
16
  export {
17
- p as default
17
+ c as default
18
18
  };
@@ -1,31 +1,47 @@
1
- import { defineComponent as n, onMounted as a } from "vue";
2
- import { useStripo as m } from "../composables/useStripo.js";
3
- import { useTemplates as p } from "../composables/useTemplates.js";
4
- import { DefaultGuidoConfig as u } from "../enums/defaults.js";
5
- import l from "./organisms/top-bar/Header.vue.js";
6
- const _ = /* @__PURE__ */ n({
1
+ import { defineComponent as g, onMounted as T } from "vue";
2
+ import { usePartner as S } from "../composables/usePartner.js";
3
+ import { useStripo as C } from "../composables/useStripo.js";
4
+ import { useTemplates as _ } from "../composables/useTemplates.js";
5
+ import { DefaultUsername as y, DefaultGuidoConfig as w } from "../enums/defaults.js";
6
+ import I from "./organisms/header/HeaderWrapper.vue.js";
7
+ import M from "./organisms/save-template/SaveTemplateModal.vue.js";
8
+ import { useEditorStore as P } from "../stores/editor.js";
9
+ const F = /* @__PURE__ */ g({
7
10
  __name: "Guido",
8
11
  props: {
9
12
  emailId: null,
13
+ userId: null,
14
+ partnerName: null,
15
+ productType: null,
16
+ username: null,
10
17
  guidoConfig: null
11
18
  },
12
- setup(r) {
13
- const o = r;
19
+ setup(f) {
20
+ const o = f, { getPartnerName: t, getProductType: r } = S(), {
21
+ emailId: a,
22
+ userId: n,
23
+ guidoConfig: i,
24
+ partnerName: l = t(),
25
+ productType: m = r(),
26
+ username: p = y
27
+ } = o;
14
28
  window.GuidoConfig = {
15
- ...u,
16
- ...o.guidoConfig
29
+ ...w,
30
+ ...i
17
31
  };
18
- const { initPlugin: i } = m(o.emailId), { getDefaultTemplate: e } = p();
19
- return a(async () => {
32
+ const { initPlugin: u } = C({ emailId: a, userId: n, username: p, partnerName: l, productType: m }), { getDefaultTemplate: s } = _(), d = P(), c = () => {
33
+ d.isSaveTemplateModalOpen = !1;
34
+ };
35
+ return T(async () => {
20
36
  try {
21
- const t = await e();
22
- await i(t);
23
- } catch (t) {
24
- console.error("Failed to initialize Stripo editor:", t);
37
+ const e = await s();
38
+ await u(e);
39
+ } catch (e) {
40
+ console.error("Failed to initialize Stripo editor:", e);
25
41
  }
26
- }), { __sfc: !0, props: o, initPlugin: i, getDefaultTemplate: e, Header: l };
42
+ }), { __sfc: !0, props: o, getPartnerName: t, getProductType: r, emailId: a, userId: n, guidoConfig: i, partnerName: l, productType: m, username: p, initPlugin: u, getDefaultTemplate: s, editorStore: d, handleCloseSaveTemplateModal: c, HeaderWrapper: I, SaveTemplateModal: M };
27
43
  }
28
44
  });
29
45
  export {
30
- _ as default
46
+ F as default
31
47
  };
@@ -0,0 +1,72 @@
1
+ interface ModalWrapperProps {
2
+ isOpen: boolean;
3
+ title: string;
4
+ description?: string;
5
+ size?: 'small' | 'medium' | 'large';
6
+ primaryButtonText?: string;
7
+ primaryButtonDisabled?: boolean;
8
+ primaryButtonLoading?: boolean;
9
+ cancelButtonText?: string;
10
+ showCancelButton?: boolean;
11
+ className?: string;
12
+ }
13
+ declare var __VLS_12: {};
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_12) => any;
16
+ };
17
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ModalWrapperProps>, {
18
+ description: string;
19
+ size: string;
20
+ primaryButtonText: string;
21
+ primaryButtonDisabled: boolean;
22
+ primaryButtonLoading: boolean;
23
+ cancelButtonText: string;
24
+ showCancelButton: boolean;
25
+ className: string;
26
+ }>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
27
+ close: () => void;
28
+ save: () => void;
29
+ cancel: () => void;
30
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ModalWrapperProps>, {
31
+ description: string;
32
+ size: string;
33
+ primaryButtonText: string;
34
+ primaryButtonDisabled: boolean;
35
+ primaryButtonLoading: boolean;
36
+ cancelButtonText: string;
37
+ showCancelButton: boolean;
38
+ className: string;
39
+ }>>>, {
40
+ className: string;
41
+ size: "small" | "medium" | "large";
42
+ description: string;
43
+ primaryButtonText: string;
44
+ primaryButtonDisabled: boolean;
45
+ primaryButtonLoading: boolean;
46
+ cancelButtonText: string;
47
+ showCancelButton: boolean;
48
+ }>;
49
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
50
+ export default _default;
51
+ type __VLS_WithDefaults<P, D> = {
52
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
53
+ default: D[K];
54
+ }> : P[K];
55
+ };
56
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
57
+ type __VLS_TypePropsToOption<T> = {
58
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
59
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
60
+ } : {
61
+ type: import('vue').PropType<T[K]>;
62
+ required: true;
63
+ };
64
+ };
65
+ type __VLS_WithSlots<T, S> = T & {
66
+ new (): {
67
+ $scopedSlots: S;
68
+ };
69
+ };
70
+ type __VLS_PrettifyLocal<T> = {
71
+ [K in keyof T]: T[K];
72
+ } & {};
@@ -0,0 +1,19 @@
1
+ import r from "./ModalWrapper.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var s = function() {
4
+ var t = this, n = t._self._c, e = t._self._setupProxy;
5
+ return n(e.InDrawer, { attrs: { id: "modal-wrapper", "description-text": t.description, "footer-button-group-options": e.drawerFooterOptions, size: t.size, status: t.isOpen, "title-text": t.title }, on: { cancelOrBackButtonEvent: e.handleCancel, onCloseEvent: e.handleClose, primaryButtonEvent: e.handleSave }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
6
+ return [n("div", { staticClass: "modal-content-wrapper", class: t.className }, [t._t("default")], 2)];
7
+ }, proxy: !0 }], null, !0) });
8
+ }, a = [], l = /* @__PURE__ */ o(
9
+ r,
10
+ s,
11
+ a,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const u = l.exports;
17
+ export {
18
+ u as default
19
+ };
@@ -0,0 +1,43 @@
1
+ import { defineComponent as o, computed as l } from "vue";
2
+ import { InDrawer as s } from "@useinsider/design-system-vue";
3
+ const i = /* @__PURE__ */ o({
4
+ __name: "ModalWrapper",
5
+ props: {
6
+ isOpen: { type: Boolean },
7
+ title: null,
8
+ description: { default: "" },
9
+ size: { default: "small" },
10
+ primaryButtonText: { default: "" },
11
+ primaryButtonDisabled: { type: Boolean, default: !1 },
12
+ primaryButtonLoading: { type: Boolean, default: !1 },
13
+ cancelButtonText: { default: "" },
14
+ showCancelButton: { type: Boolean, default: !0 },
15
+ className: { default: "" }
16
+ },
17
+ emits: ["close", "save", "cancel"],
18
+ setup(a, { emit: t }) {
19
+ const e = a, n = l(() => ({
20
+ primaryButton: {
21
+ styling: "solid",
22
+ type: "primary",
23
+ labelText: e.primaryButtonText,
24
+ disabled: e.primaryButtonDisabled || e.primaryButtonLoading
25
+ },
26
+ cancelOrBackButton: e.showCancelButton ? {
27
+ type: "secondary",
28
+ styling: "ghost",
29
+ labelText: e.cancelButtonText
30
+ } : void 0
31
+ }));
32
+ return { __sfc: !0, props: e, emit: t, drawerFooterOptions: n, handleClose: () => {
33
+ t("close");
34
+ }, handleSave: () => {
35
+ t("save");
36
+ }, handleCancel: () => {
37
+ t("cancel");
38
+ }, InDrawer: s };
39
+ }
40
+ });
41
+ export {
42
+ i as default
43
+ };
@@ -1,17 +1,17 @@
1
- import t from "./Header.vue2.js";
1
+ import t from "./HeaderWrapper.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var a = function() {
3
+ var n = function() {
4
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.HeaderLeftSlot), r(e.HeaderMiddleSlot), r(e.HeaderRightSlot)], 1)]);
6
- }, n = [], _ = /* @__PURE__ */ s(
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
7
  t,
8
- a,
9
8
  n,
9
+ a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const c = _.exports;
14
+ const d = _.exports;
15
15
  export {
16
- c as default
16
+ d as default
17
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,17 @@
1
+ import r from "./LeftSlot.vue2.js";
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(
7
+ r,
8
+ n,
9
+ a,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const f = i.exports;
15
+ export {
16
+ f as default
17
+ };
@@ -0,0 +1,13 @@
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";
5
+ const _ = /* @__PURE__ */ t({
6
+ __name: "LeftSlot",
7
+ setup(m) {
8
+ return { __sfc: !0, editorStore: o(), InButtonV2: r, RestoreButton: e };
9
+ }
10
+ });
11
+ export {
12
+ _ as default
13
+ };
@@ -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 i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
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", "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(
7
+ s,
8
+ n,
9
+ l,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const p = r.exports;
15
+ export {
16
+ p as default
17
+ };
@@ -0,0 +1,22 @@
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
+ import p from "./version-history/ViewOptions.vue.js";
7
+ import f from "./ViewOptions.vue.js";
8
+ const y = /* @__PURE__ */ r({
9
+ __name: "MiddleSlot",
10
+ setup(a) {
11
+ const o = n(), t = s();
12
+ return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
+ id: `${i}-tooltip`,
14
+ dynamicPosition: !1,
15
+ staticPosition: "bottom center",
16
+ iconStatus: !1
17
+ }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
18
+ }
19
+ });
20
+ export {
21
+ y as default
22
+ };
@@ -0,0 +1,17 @@
1
+ import o from "./RightSlot.vue2.js";
2
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ 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(
7
+ o,
8
+ n,
9
+ r,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = a.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,21 @@
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({
7
+ __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
+ if (t.isVersionHistoryOpen) {
12
+ r();
13
+ return;
14
+ }
15
+ o();
16
+ }, InButtonV2: m };
17
+ }
18
+ });
19
+ export {
20
+ d as default
21
+ };
@@ -1,5 +1,5 @@
1
- import r from "./HeaderViewOptions.vue2.js";
2
- /* empty css */
1
+ import r from "./ViewOptions.vue2.js";
2
+ /* empty css */
3
3
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var n = function() {
5
5
  var t = this, o = t._self._c, e = t._self._setupProxy;
@@ -10,9 +10,9 @@ var n = function() {
10
10
  i,
11
11
  !1,
12
12
  null,
13
- "f67c82be"
13
+ "0fff376c"
14
14
  );
15
- const f = _.exports;
15
+ const l = _.exports;
16
16
  export {
17
- f as default
17
+ l as default
18
18
  };
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as e } from "vue";
2
2
  import { useEditorStore as t } from "../../../stores/editor.js";
3
3
  import { InSegments as o } from "@useinsider/design-system-vue";
4
- const a = /* @__PURE__ */ e({
5
- __name: "HeaderViewOptions",
4
+ const u = /* @__PURE__ */ e({
5
+ __name: "ViewOptions",
6
6
  setup(n) {
7
7
  return { __sfc: !0, editorStore: t(), segmentList: [
8
8
  { text: "", icon: "line-desktop", value: "desktop" },
@@ -11,5 +11,5 @@ const a = /* @__PURE__ */ e({
11
11
  }
12
12
  });
13
13
  export {
14
- a as default
14
+ u as default
15
15
  };
@@ -0,0 +1,19 @@
1
+ import n from "./RestoreButton.vue2.js";
2
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var s = function() {
4
+ var e = this, r = e._self._c, t = e._self._setupProxy;
5
+ return r(t.InButtonV2, { attrs: { id: "guido__restore-button", "label-text": "Restore", type: "subtle-primary" }, on: { click: function(a) {
6
+ return t.restoreVersion(t.versionHistoryStore.currentPatch.id);
7
+ } } });
8
+ }, _ = [], i = /* @__PURE__ */ o(
9
+ n,
10
+ s,
11
+ _,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const f = i.exports;
17
+ export {
18
+ f as default
19
+ };
@@ -0,0 +1,14 @@
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 n } from "@useinsider/design-system-vue";
5
+ const _ = /* @__PURE__ */ t({
6
+ __name: "RestoreButton",
7
+ setup(i) {
8
+ const { restoreVersion: o } = e(), r = s();
9
+ return { __sfc: !0, restoreVersion: o, versionHistoryStore: r, InButtonV2: n };
10
+ }
11
+ });
12
+ export {
13
+ _ as default
14
+ };
@@ -0,0 +1,14 @@
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>>>, {}>;
5
+ 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
+ };
@@ -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 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) {
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) {
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);
11
+ }, a = [], c = /* @__PURE__ */ i(
12
+ o,
13
+ n,
14
+ a,
15
+ !1,
16
+ null,
17
+ "52a77eec"
18
+ );
19
+ const _ = c.exports;
20
+ export {
21
+ _ as default
22
+ };
@@ -0,0 +1,18 @@
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({
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 };
14
+ }
15
+ });
16
+ export {
17
+ _ as default
18
+ };