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

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 (124) hide show
  1. package/README.md +12 -35
  2. package/dist/components/Guido.vue.d.ts +0 -4
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +18 -30
  5. package/dist/components/organisms/{header/HeaderWrapper.vue.js → top-bar/Header.vue.js} +7 -7
  6. package/dist/components/organisms/top-bar/Header.vue2.js +14 -0
  7. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.js +17 -0
  8. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue2.js +11 -0
  9. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.js +17 -0
  10. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue2.js +17 -0
  11. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.js +18 -0
  12. package/dist/components/organisms/top-bar/HeaderRightSlot.vue2.js +12 -0
  13. package/dist/components/organisms/{header/ViewOptions.vue.js → top-bar/HeaderViewOptions.vue.js} +5 -5
  14. package/dist/components/organisms/{header/ViewOptions.vue2.js → top-bar/HeaderViewOptions.vue2.js} +3 -3
  15. package/dist/composables/useCustomInterfaceAppearance.js +9 -43
  16. package/dist/composables/useStripo.d.ts +2 -2
  17. package/dist/composables/useStripo.js +55 -73
  18. package/dist/composables/useToaster.d.ts +0 -1
  19. package/dist/composables/useTranslations.d.ts +3 -1
  20. package/dist/enums/defaults.d.ts +0 -2
  21. package/dist/enums/defaults.js +3 -5
  22. package/dist/guido.css +1 -1
  23. package/dist/node_modules/pinia/dist/pinia.js +110 -113
  24. package/dist/static/editor.css.js +182 -0
  25. package/dist/stores/counter.d.ts +12 -0
  26. package/dist/stores/editor.d.ts +4 -3
  27. package/dist/stores/editor.js +0 -1
  28. package/package.json +1 -1
  29. package/dist/components/organisms/header/HeaderWrapper.vue2.js +0 -14
  30. package/dist/components/organisms/header/LeftSlot.vue.js +0 -17
  31. package/dist/components/organisms/header/LeftSlot.vue2.js +0 -13
  32. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +0 -2
  33. package/dist/components/organisms/header/MiddleSlot.vue.js +0 -17
  34. package/dist/components/organisms/header/MiddleSlot.vue2.js +0 -22
  35. package/dist/components/organisms/header/RightSlot.vue.js +0 -17
  36. package/dist/components/organisms/header/RightSlot.vue2.js +0 -21
  37. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
  38. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
  39. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +0 -14
  40. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +0 -22
  41. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +0 -18
  42. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -16
  43. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +0 -18
  44. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +0 -16
  45. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +0 -2
  46. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +0 -18
  47. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +0 -23
  48. package/dist/composables/useActionsApi.d.ts +0 -4
  49. package/dist/composables/useActionsApi.js +0 -36
  50. package/dist/composables/useExport.d.ts +0 -3
  51. package/dist/composables/useExport.js +0 -30
  52. package/dist/composables/useHttp.js +0 -84
  53. package/dist/composables/usePartner.d.ts +0 -4
  54. package/dist/composables/usePartner.js +0 -16
  55. package/dist/composables/useToaster.js +0 -37
  56. package/dist/composables/useTranslations.js +0 -18
  57. package/dist/composables/useVersionHistoryApi.d.ts +0 -8
  58. package/dist/composables/useVersionHistoryApi.js +0 -53
  59. package/dist/enums/displayConditions.d.ts +0 -2
  60. package/dist/enums/displayConditions.js +0 -80
  61. package/dist/mock/api/custom-fonts.d.ts +0 -2
  62. package/dist/node_modules/lodash-es/_Hash.js +0 -20
  63. package/dist/node_modules/lodash-es/_ListCache.js +0 -20
  64. package/dist/node_modules/lodash-es/_Map.js +0 -6
  65. package/dist/node_modules/lodash-es/_MapCache.js +0 -20
  66. package/dist/node_modules/lodash-es/_Symbol.js +0 -5
  67. package/dist/node_modules/lodash-es/_assocIndexOf.js +0 -10
  68. package/dist/node_modules/lodash-es/_baseGetTag.js +0 -10
  69. package/dist/node_modules/lodash-es/_baseIsNative.js +0 -16
  70. package/dist/node_modules/lodash-es/_coreJsData.js +0 -5
  71. package/dist/node_modules/lodash-es/_freeGlobal.js +0 -4
  72. package/dist/node_modules/lodash-es/_getMapData.js +0 -8
  73. package/dist/node_modules/lodash-es/_getNative.js +0 -9
  74. package/dist/node_modules/lodash-es/_getRawTag.js +0 -15
  75. package/dist/node_modules/lodash-es/_getValue.js +0 -6
  76. package/dist/node_modules/lodash-es/_hashClear.js +0 -7
  77. package/dist/node_modules/lodash-es/_hashDelete.js +0 -7
  78. package/dist/node_modules/lodash-es/_hashGet.js +0 -13
  79. package/dist/node_modules/lodash-es/_hashHas.js +0 -9
  80. package/dist/node_modules/lodash-es/_hashSet.js +0 -9
  81. package/dist/node_modules/lodash-es/_isKeyable.js +0 -7
  82. package/dist/node_modules/lodash-es/_isMasked.js +0 -11
  83. package/dist/node_modules/lodash-es/_listCacheClear.js +0 -6
  84. package/dist/node_modules/lodash-es/_listCacheDelete.js +0 -12
  85. package/dist/node_modules/lodash-es/_listCacheGet.js +0 -8
  86. package/dist/node_modules/lodash-es/_listCacheHas.js +0 -7
  87. package/dist/node_modules/lodash-es/_listCacheSet.js +0 -8
  88. package/dist/node_modules/lodash-es/_mapCacheClear.js +0 -13
  89. package/dist/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  90. package/dist/node_modules/lodash-es/_mapCacheGet.js +0 -7
  91. package/dist/node_modules/lodash-es/_mapCacheHas.js +0 -7
  92. package/dist/node_modules/lodash-es/_mapCacheSet.js +0 -8
  93. package/dist/node_modules/lodash-es/_nativeCreate.js +0 -5
  94. package/dist/node_modules/lodash-es/_objectToString.js +0 -7
  95. package/dist/node_modules/lodash-es/_root.js +0 -5
  96. package/dist/node_modules/lodash-es/_toSource.js +0 -17
  97. package/dist/node_modules/lodash-es/eq.js +0 -6
  98. package/dist/node_modules/lodash-es/isFunction.js +0 -12
  99. package/dist/node_modules/lodash-es/isObject.js +0 -7
  100. package/dist/node_modules/lodash-es/memoize.js +0 -18
  101. package/dist/static/styles/base.css.js +0 -11
  102. package/dist/static/styles/components/alert-message.css.js +0 -39
  103. package/dist/static/styles/components/amp-block.css.js +0 -18
  104. package/dist/static/styles/components/base-input.css.js +0 -47
  105. package/dist/static/styles/components/button-group.css.js +0 -54
  106. package/dist/static/styles/components/button.css.js +0 -106
  107. package/dist/static/styles/components/combobox.css.js +0 -49
  108. package/dist/static/styles/components/counter.css.js +0 -42
  109. package/dist/static/styles/components/dropdown-menu.css.js +0 -44
  110. package/dist/static/styles/components/narrow-panel.css.js +0 -38
  111. package/dist/static/styles/components/switcher.css.js +0 -11
  112. package/dist/static/styles/components/tabs.css.js +0 -97
  113. package/dist/static/styles/components/tools.css.js +0 -23
  114. package/dist/static/styles/components/wide-panel.css.js +0 -135
  115. package/dist/static/styles/variables.css.js +0 -23
  116. package/dist/stores/version-history.d.ts +0 -80
  117. package/dist/stores/version-history.js +0 -28
  118. package/dist/utils/dateUtil.d.ts +0 -1
  119. package/dist/utils/dateUtil.js +0 -16
  120. /package/dist/components/organisms/{header/HeaderWrapper.vue.d.ts → top-bar/Header.vue.d.ts} +0 -0
  121. /package/dist/components/organisms/{header/RightSlot.vue.d.ts → top-bar/HeaderLeftSlot.vue.d.ts} +0 -0
  122. /package/dist/components/organisms/{header/ViewOptions.vue.d.ts → top-bar/HeaderMiddleSlot.vue.d.ts} +0 -0
  123. /package/dist/components/organisms/{header/LeftSlot.vue.d.ts → top-bar/HeaderRightSlot.vue.d.ts} +0 -0
  124. /package/dist/components/organisms/{header/version-history/RestoreButton.vue.d.ts → top-bar/HeaderViewOptions.vue.d.ts} +0 -0
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,7 +39,6 @@ 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
44
  }
@@ -57,10 +55,6 @@ export default {
57
55
  | Prop | Type | Required | Default | Description |
58
56
  |------|------|----------|---------|-------------|
59
57
  | `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
58
  | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
65
59
 
66
60
  ### GuidoConfig Interface
@@ -145,37 +139,24 @@ VITE_STRIPO_ROLE=your_role
145
139
  ```
146
140
  src/
147
141
  ├── components/
148
- │ ├── Guido.vue # Main component
142
+ │ ├── Guido.vue # Main component
149
143
  │ └── organisms/
150
- │ └── header/ # Header components
151
- │ └── version-history/ # Version History components
144
+ │ └── top-bar/ # Header components
152
145
  ...
153
146
  ├── composables/
154
- │ ├── useStripo.ts # Stripo integration
155
- │ └── useTranslations.ts # Translation management
147
+ │ ├── useStripo.ts # Stripo integration
148
+ │ └── useTranslations.ts # Translation management
156
149
  ├── @types/
157
- │ ├── generic.ts # Generic types
158
- │ ├── stripo.d.ts # Stripo-specific types
159
- │ └── events.ts # Event types
150
+ │ ├── generic.ts # Generic types
151
+ │ ├── stripo.d.ts # Stripo-specific types
152
+ │ └── events.ts # Event types
160
153
  ├── static/
161
- │ ├── editor.css # Custom editor styles
154
+ │ ├── editor.css # Custom editor styles
162
155
  │ └── templates/
163
- │ └── default/ # Default email template
164
- └── library.ts # Main export for library
156
+ │ └── default/ # Default email template
157
+ └── library.ts # Main export for library
165
158
  ```
166
159
 
167
- ## 🌐 i18n
168
- 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).
169
- It allows to use production or local translations on your code. 🚀
170
- Example usage:
171
- ```js
172
- import { useTranslations } from '@@/Composables/useTranslations';
173
-
174
- const trans = useTranslations();
175
-
176
- // use everywhere like this:
177
- trans('foo.bar')
178
- ```
179
160
 
180
161
  ## 📦 Build Output
181
162
 
@@ -199,6 +180,7 @@ The library builds to multiple formats:
199
180
  }
200
181
  ```
201
182
 
183
+
202
184
  ## 🤝 Contributing
203
185
  - PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
204
186
  - PR Labels should be filled.
@@ -218,12 +200,7 @@ ISC License
218
200
  - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
219
201
 
220
202
  ## 🎯 TODO:
221
- - CSS part should be optimized with variables & `sass-loader`.
203
+ - [editor.css](src/static/editor.css) should be optimized with variables & `sass-loader`.
222
204
  - Master Version Generator should be fixed.
223
205
  - Playwright integration
224
206
  - Commitlint & Precommit Hooks integration
225
- - We need to emit save event and we should return template config to it
226
- - Default template should be same with production
227
- - Open Guido with saved template
228
- - Get User ID, Email and Unique Template ID as dynamic from props
229
- - Get Pre-built display conditions from API
@@ -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>>>, {}>;
@@ -3,16 +3,16 @@ import o from "./Guido.vue2.js";
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
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);
6
+ return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.Header), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
7
  }, _ = [], a = /* @__PURE__ */ i(
8
8
  o,
9
9
  s,
10
10
  _,
11
11
  !1,
12
12
  null,
13
- "8e229594"
13
+ "ef4897b1"
14
14
  );
15
- const f = a.exports;
15
+ const p = a.exports;
16
16
  export {
17
- f as default
17
+ p as default
18
18
  };
@@ -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 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({
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: i } = m(o.emailId), { getDefaultTemplate: e } = p();
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 e();
22
+ await i(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: i, getDefaultTemplate: e, Header: l };
39
27
  }
40
28
  });
41
29
  export {
42
- h as default
30
+ _ as default
43
31
  };
@@ -1,17 +1,17 @@
1
- import t from "./HeaderWrapper.vue2.js";
1
+ import t from "./Header.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
3
+ var a = 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.LeftSlot), r(e.MiddleSlot), r(e.RightSlot)], 1)]);
6
- }, a = [], _ = /* @__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.HeaderLeftSlot), r(e.HeaderMiddleSlot), r(e.HeaderRightSlot)], 1)]);
6
+ }, n = [], _ = /* @__PURE__ */ s(
7
7
  t,
8
- n,
9
8
  a,
9
+ n,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const d = _.exports;
14
+ const c = _.exports;
15
15
  export {
16
- d as default
16
+ c as default
17
17
  };
@@ -0,0 +1,14 @@
1
+ import { defineComponent as e } from "vue";
2
+ import { InContainer as r } from "@useinsider/design-system-vue";
3
+ import o from "./HeaderLeftSlot.vue.js";
4
+ import t from "./HeaderMiddleSlot.vue.js";
5
+ import m from "./HeaderRightSlot.vue.js";
6
+ const _ = /* @__PURE__ */ e({
7
+ __name: "Header",
8
+ setup(f) {
9
+ return { __sfc: !0, InContainer: r, HeaderLeftSlot: o, HeaderMiddleSlot: t, HeaderRightSlot: m };
10
+ }
11
+ });
12
+ export {
13
+ _ as default
14
+ };
@@ -0,0 +1,17 @@
1
+ import n from "./HeaderLeftSlot.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var _ = function() {
4
+ var t = this, e = t._self._c, r = t._self._setupProxy;
5
+ return e("div", [e(r.InButtonV2, { attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" } })], 1);
6
+ }, a = [], s = /* @__PURE__ */ o(
7
+ n,
8
+ _,
9
+ a,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const i = s.exports;
15
+ export {
16
+ i as default
17
+ };
@@ -0,0 +1,11 @@
1
+ import { defineComponent as t } from "vue";
2
+ import { InButtonV2 as e } from "@useinsider/design-system-vue";
3
+ const _ = /* @__PURE__ */ t({
4
+ __name: "HeaderLeftSlot",
5
+ setup(o) {
6
+ return { __sfc: !0, InButtonV2: e };
7
+ }
8
+ });
9
+ export {
10
+ _ as default
11
+ };
@@ -0,0 +1,17 @@
1
+ import n from "./HeaderMiddleSlot.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var e = this, o = e._self._c, t = e._self._setupProxy;
5
+ return 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", "tooltip-text": "Email Preview", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button") } })], 1);
6
+ }, l = [], r = /* @__PURE__ */ s(
7
+ n,
8
+ i,
9
+ l,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const _ = r.exports;
15
+ export {
16
+ _ as default
17
+ };
@@ -0,0 +1,17 @@
1
+ import { defineComponent as o } from "vue";
2
+ import { useEditorStore as e } from "../../../stores/editor.js";
3
+ import { InButtonV2 as i } from "@useinsider/design-system-vue";
4
+ const d = /* @__PURE__ */ o({
5
+ __name: "HeaderMiddleSlot",
6
+ setup(r) {
7
+ return { __sfc: !0, editorStore: e(), getTooltipOptions: (t) => ({
8
+ id: `${t}-tooltip`,
9
+ dynamicPosition: !1,
10
+ staticPosition: "bottom center",
11
+ iconStatus: !1
12
+ }), InButtonV2: i };
13
+ }
14
+ });
15
+ export {
16
+ d as default
17
+ };
@@ -0,0 +1,18 @@
1
+ import o from "./HeaderRightSlot.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var s = this, t = s._self._c, e = s._self._setupProxy;
6
+ return t("div", { staticClass: "d-f header-right-slot" }, [t("div", { staticClass: "d-f" }, [t(e.HeaderViewOptions)], 1), t("div", { staticClass: "d-f" }, [t(e.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1 } }), t(e.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "label-text-status": !1 } }), t(e.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "label-text-status": !1 } }), t(e.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "label-text-status": !1 } })], 1), t(e.InButtonV2, { attrs: { id: "guido__save-button", "label-text": "Save" } })], 1);
7
+ }, i = [], r = /* @__PURE__ */ a(
8
+ o,
9
+ n,
10
+ i,
11
+ !1,
12
+ null,
13
+ "94ef50f1"
14
+ );
15
+ const c = r.exports;
16
+ export {
17
+ c as default
18
+ };
@@ -0,0 +1,12 @@
1
+ import { defineComponent as t } from "vue";
2
+ import { InButtonV2 as e } from "@useinsider/design-system-vue";
3
+ import o from "./HeaderViewOptions.vue.js";
4
+ const i = /* @__PURE__ */ t({
5
+ __name: "HeaderRightSlot",
6
+ setup(r) {
7
+ return { __sfc: !0, InButtonV2: e, HeaderViewOptions: o };
8
+ }
9
+ });
10
+ export {
11
+ i as default
12
+ };
@@ -1,5 +1,5 @@
1
- import r from "./ViewOptions.vue2.js";
2
- /* empty css */
1
+ import r from "./HeaderViewOptions.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
- "0fff376c"
13
+ "f67c82be"
14
14
  );
15
- const l = _.exports;
15
+ const f = _.exports;
16
16
  export {
17
- l as default
17
+ f 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 u = /* @__PURE__ */ e({
5
- __name: "ViewOptions",
4
+ const a = /* @__PURE__ */ e({
5
+ __name: "HeaderViewOptions",
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 u = /* @__PURE__ */ e({
11
11
  }
12
12
  });
13
13
  export {
14
- u as default
14
+ a as default
15
15
  };
@@ -1,47 +1,13 @@
1
- import S from "../static/styles/base.css.js";
2
- import e from "../static/styles/components/alert-message.css.js";
3
- import m from "../static/styles/components/amp-block.css.js";
4
- import i from "../static/styles/components/base-input.css.js";
5
- import p from "../static/styles/components/button-group.css.js";
6
- import n from "../static/styles/components/button.css.js";
7
- import s from "../static/styles/components/combobox.css.js";
8
- import C from "../static/styles/components/counter.css.js";
9
- import f from "../static/styles/components/dropdown-menu.css.js";
10
- import a from "../static/styles/components/narrow-panel.css.js";
11
- import u from "../static/styles/components/switcher.css.js";
12
- import c from "../static/styles/components/tabs.css.js";
13
- import d from "../static/styles/components/tools.css.js";
14
- import l from "../static/styles/components/wide-panel.css.js";
15
- import h from "../static/styles/variables.css.js";
16
- const w = [
17
- h,
18
- // Must be on top
19
- S,
20
- // Must be on top
21
- e,
22
- m,
23
- i,
24
- p,
25
- n,
26
- s,
27
- C,
28
- f,
29
- a,
30
- u,
31
- c,
32
- d,
33
- l
34
- ].join(`
35
-
36
- `), N = () => ({ importCss: () => {
37
- const o = new CSSStyleSheet();
38
- o.replaceSync(w);
39
- const r = document.querySelector("ui-editor");
40
- if (!r)
1
+ import r from "../static/editor.css.js";
2
+ const c = () => ({ importCss: () => {
3
+ const e = new CSSStyleSheet();
4
+ e.replaceSync(r);
5
+ const t = document.querySelector("ui-editor");
6
+ if (!t)
41
7
  return;
42
- const t = r.shadowRoot;
43
- t && (t.adoptedStyleSheets = [o]);
8
+ const o = t.shadowRoot;
9
+ o && (o.adoptedStyleSheets = [e]);
44
10
  } });
45
11
  export {
46
- N as useCustomInterfaceAppearance
12
+ c as useCustomInterfaceAppearance
47
13
  };
@@ -1,4 +1,4 @@
1
- import type { Metadata, Template } from '@@/Types/stripo';
2
- export declare const useStripo: (metadata: Metadata) => {
1
+ import type { Template } from '@@/Types/stripo';
2
+ export declare const useStripo: (emailId: string) => {
3
3
  initPlugin: (template: Template) => Promise<void>;
4
4
  };
@@ -1,99 +1,81 @@
1
- import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
2
- import { useHttp as y } from "./useHttp.js";
3
- import { useToaster as E } from "./useToaster.js";
4
- import { displayConditions as h } from "../enums/displayConditions.js";
5
- import { useEditorStore as w } from "../stores/editor.js";
6
- const I = (c) => {
7
- const { get: a, post: u } = y(), { handleError: i } = E(), l = async () => {
8
- try {
9
- return (await u("/v2/stripo/get-user-token", {
10
- pluginId: void 0,
11
- secretKey: void 0,
12
- role: void 0,
13
- userId: c.emailId
14
- })).data.token;
15
- } catch (t) {
16
- return i(t, "Failed to fetch token"), "";
17
- }
18
- }, p = async () => {
19
- try {
20
- return ((await a("/stripo/get-partner-custom-fonts")).data || []).map((n) => ({
21
- ...n,
22
- active: !0
23
- }));
24
- } catch (t) {
25
- return i(t, "Failed to fetch custom fonts"), [];
26
- }
27
- }, m = (t, r = []) => {
28
- const n = w(), { html: e, css: s } = t;
1
+ import { useCustomInterfaceAppearance as u } from "./useCustomInterfaceAppearance.js";
2
+ import { useEditorStore as l } from "../stores/editor.js";
3
+ const g = (s) => {
4
+ const c = () => {
5
+ const t = new Headers();
6
+ t.append("Content-Type", "application/json");
7
+ const r = JSON.stringify({
8
+ pluginId: void 0,
9
+ secretKey: void 0,
10
+ role: void 0,
11
+ userId: s
12
+ });
13
+ return fetch("/v2/stripo/get-token", {
14
+ method: "POST",
15
+ headers: t,
16
+ body: r,
17
+ redirect: "follow"
18
+ }).then((o) => o.json());
19
+ }, d = (t) => {
20
+ const r = l(), n = t.html, o = t.css;
29
21
  window.UIEditor.initEditor(
30
22
  document.querySelector("#guido-editor"),
31
23
  {
32
- metadata: c,
33
- html: e,
34
- css: s,
24
+ metadata: {
25
+ emailId: s,
26
+ userId: "1",
27
+ username: "Plugin Demo User"
28
+ },
29
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
30
+ html: n,
31
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
32
+ css: o,
35
33
  locale: "en",
36
34
  undoButtonSelector: "#guido__undo-button",
37
35
  redoButtonSelector: "#guido__redo-button",
38
36
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
39
37
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
38
+ versionHistoryButtonSelector: "#guido__history-button",
40
39
  codeEditorButtonSelector: "#guido__code-button",
41
- conditionsEnabled: !0,
42
- customConditionsEnabled: !0,
43
- conditionCategories: h,
44
- messageSettingsEnabled: !1,
45
- editorFonts: {
46
- showDefaultStandardFonts: !0,
47
- showDefaultNotStandardFonts: !0,
48
- customFonts: r
49
- },
50
- async onTokenRefreshRequest(o) {
40
+ async onTokenRefreshRequest(e) {
51
41
  try {
52
- const d = await l();
53
- o(d);
54
- } catch (d) {
55
- i(d, "Failed to refresh token");
42
+ const i = await c();
43
+ e(i.token);
44
+ } catch (i) {
45
+ console.error("Failed to refresh token:", i);
56
46
  }
57
47
  },
58
48
  onTemplateLoaded() {
59
49
  try {
60
- const { importCss: o } = f();
61
- o();
62
- } catch (o) {
63
- i(o, "Failed to load custom interface appearance");
50
+ const { importCss: e } = u();
51
+ e();
52
+ } catch (e) {
53
+ console.error("Failed to load custom interface appearance:", e);
64
54
  }
65
55
  },
66
- onCodeEditorVisibilityChanged(o) {
67
- n.isCodeEditorOpen = o;
68
- },
69
- onEditorVisualModeChanged(o) {
70
- n.editorVisualMode = o.toLowerCase();
56
+ onCodeEditorVisibilityChanged(e) {
57
+ r.isCodeEditorOpen = e;
71
58
  },
72
- onVersionHistoryVisibilityChanged(o) {
73
- n.isVersionHistoryOpen = o;
59
+ onEditorVisualModeChanged(e) {
60
+ r.editorVisualMode = e.toLowerCase();
74
61
  }
75
62
  }
76
63
  );
77
- }, g = (t) => new Promise((r, n) => {
64
+ };
65
+ return { initPlugin: (t) => new Promise((r, n) => {
78
66
  if (document.getElementById("UiEditorScript")) {
79
- t(), r();
67
+ d(t), r();
80
68
  return;
81
69
  }
82
- const e = document.createElement("script");
83
- e.id = "UiEditorScript", e.type = "module", e.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", e.onload = () => {
84
- t(), r();
85
- }, e.onerror = () => {
86
- const s = new Error("Failed to load Stripo UIEditor script");
87
- n(s);
88
- }, document.body.appendChild(e);
89
- });
90
- return { initPlugin: async (t) => {
91
- await g(async () => {
92
- const r = await p();
93
- m(t, r);
94
- });
95
- } };
70
+ const o = document.createElement("script");
71
+ o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
72
+ d(t), r();
73
+ }, o.onerror = () => {
74
+ const e = new Error("Failed to load Stripo UIEditor script");
75
+ n(e);
76
+ }, document.body.appendChild(o);
77
+ }) };
96
78
  };
97
79
  export {
98
- I as useStripo
80
+ g as useStripo
99
81
  };
@@ -17,5 +17,4 @@ export declare const useToaster: () => {
17
17
  } | undefined)[]>;
18
18
  showToaster: (options?: ToasterOptions) => void;
19
19
  hideToaster: () => void;
20
- handleError: (error: unknown, context: string) => void;
21
20
  };
@@ -1,5 +1,7 @@
1
1
  interface TranslationValues {
2
2
  [key: string]: string | number | boolean;
3
3
  }
4
- export declare const useTranslations: () => ((key: string, params?: TranslationValues) => string) & import("lodash").MemoizedFunction;
4
+ export declare const useTranslations: () => {
5
+ trans: ((key: string, params?: TranslationValues) => string) & import("lodash").MemoizedFunction;
6
+ };
5
7
  export {};
@@ -1,4 +1,2 @@
1
1
  import type { GuidoConfig } from '@@/Types/generic';
2
2
  export declare const DefaultGuidoConfig: GuidoConfig;
3
- export declare const DefaultProductType = "newsletter";
4
- export declare const DefaultUsername = "Guido User";
@@ -1,8 +1,6 @@
1
- const t = {
1
+ const n = {
2
2
  translationsPath: "window.trans.en"
3
- }, e = "newsletter", n = "Guido User";
3
+ };
4
4
  export {
5
- t as DefaultGuidoConfig,
6
- e as DefaultProductType,
7
- n as DefaultUsername
5
+ n as DefaultGuidoConfig
8
6
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .version-history-item[data-v-0e2ff42d]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-8e229594],.guido-editor__container[data-v-8e229594]{width:100%;height:calc(100vh - 75px)}
1
+ [data-v-f67c82be] .guido__view-option-selection-desktop svg,[data-v-f67c82be] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}.header-right-slot[data-v-94ef50f1]{gap:16px}.guido-editor__wrapper[data-v-ef4897b1],.guido-editor__container[data-v-ef4897b1]{width:100%;height:100vh}