@useinsider/guido 1.0.0-beta.9e097de → 1.0.0-beta.9fd1b14

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.
package/README.md CHANGED
@@ -27,15 +27,10 @@ npm install @useinsider/guido
27
27
  <div>
28
28
  <Guido
29
29
  ref="guidoEditor"
30
- :template-id="templateId"
30
+ :email-id="emailId"
31
31
  :user-id="userId"
32
32
  :guido-config="guidoConfig"
33
- :html="initialHtml"
34
- :css="initialCss"
35
33
  @dynamic-content:open="handleDynamicContentOpen"
36
- @back="handleBack"
37
- @save:start="handleSaveStart"
38
- @save:complete="handleSaveComplete"
39
34
  />
40
35
  </div>
41
36
  </template>
@@ -49,55 +44,36 @@ export default {
49
44
  },
50
45
  data() {
51
46
  return {
52
- templateId: 'template-123',
53
- userId: 'user-456',
54
- initialHtml: '<p>Initial HTML content</p>',
55
- initialCss: 'p { color: #333; }',
47
+ emailId: 'abc123',
48
+ userId: '12345',
56
49
  guidoConfig: {
57
50
  translationsPath: 'window.trans.en',
58
51
  htmlCompilerRules: [],
59
52
  ignoreDefaultHtmlCompilerRules: false,
60
- },
53
+ }
61
54
  dynamicContentModalVisible: false
62
55
  };
63
56
  },
64
57
 
65
58
  methods: {
66
- handleDynamicContentOpen(detail) {
67
- console.log('Dynamic content requested:', detail);
59
+ handleDynamicContentOpen() {
68
60
  this.dynamicContentModalVisible = true;
69
- },
70
-
71
- handleBack() {
72
- console.log('User clicked back button');
73
- // Handle navigation back
74
- },
75
-
76
- handleSaveStart() {
77
- console.log('Save process started');
78
- // Show loading indicator
79
- },
80
-
81
- handleSaveComplete(template) {
82
- console.log('Save completed:', template);
83
- // Handle saved template data
84
- },
85
-
61
+ }
86
62
  // ⚠️ Your own Dynamic Content Modal should have this id: #guido-dynamic-content-modal
87
63
  handleDynamicContentInsert() {
88
- this.$refs.guidoEditor?.dynamicContent.insert({
89
- text: 'Display Text',
90
- value: 'actual-value',
91
- fallback: 'Fallback Text'
64
+ this.$ref.guidoEditor?.dynamicContent.insert({
65
+ text: 'Text',
66
+ value: 'Value',
67
+ fallback: 'Fallback'
92
68
  });
93
69
 
94
70
  this.dynamicContentModalVisible = false;
95
71
  },
96
-
97
72
  // ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
98
73
  handleDynamicContentClose() {
99
- this.$refs.guidoEditor?.dynamicContent.close();
74
+ this.$ref.guidoEditor?.dynamicContent.close();
100
75
  }
76
+
101
77
  }
102
78
  };
103
79
  </script>
@@ -109,23 +85,12 @@ export default {
109
85
 
110
86
  | Prop | Type | Required | Default | Description |
111
87
  |------|------|----------|---------|-------------|
112
- | `templateId` | `string` | ✅ | - | Unique identifier for the email template |
113
- | `userId` | `string` | ✅ | - | Unique identifier for the user |
88
+ | `emailId` | `string` | ✅ | - | Unique identifier for the email draft |
89
+ | `userId` | `string` | ✅ | - | Unique identifier for the user draft |
90
+ | `username` | `string` | ⚪ | Guido User | User name |
91
+ | `partnerName` | `string` | ⚪ | Getting from URL host | Unique identifier for the partner draft |
92
+ | `productType` | `string` | ⚪ | Getting from URL path | Unique identifier for the product draft |
114
93
  | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
115
- | `partnerName` | `string` | ⚪ | From URL host | Partner identifier |
116
- | `productType` | `string` | ⚪ | From URL path | Product type identifier |
117
- | `username` | `string` | ⚪ | `'Guido User'` | Display name for the user |
118
- | `html` | `string` | ⚪ | `''` | Initial HTML content for the template |
119
- | `css` | `string` | ⚪ | `''` | Initial CSS styles for the template |
120
-
121
- ### Guido Component Events
122
-
123
- | Event | Payload | Description |
124
- |-------|---------|-------------|
125
- | `dynamic-content:open` | `DynamicContent \| null` | Fired when user requests to insert dynamic content |
126
- | `back` | - | Fired when user clicks the back button |
127
- | `save:start` | - | Fired when the save process begins |
128
- | `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
129
94
 
130
95
  ### Guido Exposed Methods
131
96
  ```typescript
@@ -412,87 +377,6 @@ src/
412
377
  └── library.ts # Main export
413
378
  ```
414
379
 
415
- ## 🔌 Provide/Inject Utilities
416
-
417
- Guido includes type-safe utilities for Vue's provide/inject system to facilitate dependency injection between components.
418
-
419
- ### useProvideInject
420
-
421
- The `useProvideInject` composable provides two helper functions for type-safe dependency injection:
422
-
423
- #### Basic Usage
424
-
425
- ```typescript
426
- // Parent component
427
- import { provideValue } from '@useinsider/guido';
428
- import { InjectionKey } from 'vue';
429
-
430
- // Define a typed injection key
431
- const MyServiceKey: InjectionKey<MyService> = Symbol('MyService');
432
-
433
- // Provide the value
434
- const myService = new MyService();
435
- provideValue(MyServiceKey, myService);
436
-
437
- // Child component
438
- import { useInjectedValue } from '@useinsider/guido';
439
-
440
- // Inject the value with type safety
441
- const myService = useInjectedValue(MyServiceKey);
442
- ```
443
-
444
- #### With Default Value
445
-
446
- ```typescript
447
- // Inject with a fallback value
448
- const myService = useInjectedValue(MyServiceKey, new DefaultService());
449
- ```
450
-
451
- #### Error Handling
452
-
453
- The `useInjectedValue` function will throw a descriptive error if no provider is found and no default value is provided:
454
-
455
- ```typescript
456
- // This will throw an error if no provider exists
457
- try {
458
- const myService = useInjectedValue(MyServiceKey);
459
- } catch (error) {
460
- console.error('No provider found for MyService');
461
- }
462
- ```
463
-
464
- ### API Reference
465
-
466
- #### `provideValue`
467
-
468
- ```typescript
469
- provideValue<T>(key: InjectionKey<T>, value: T): void
470
- ```
471
-
472
- Provides a value using Vue's provide system with type safety.
473
-
474
- | Parameter | Type | Description |
475
- |-----------|------|-------------|
476
- | `key` | `InjectionKey<T>` | The typed injection key |
477
- | `value` | `T` | The value to provide |
478
-
479
- #### `useInjectedValue`
480
-
481
- ```typescript
482
- useInjectedValue<T>(key: InjectionKey<T>, defaultValue?: T): T
483
- ```
484
-
485
- Injects a value using Vue's inject system with type safety and error handling.
486
-
487
- | Parameter | Type | Required | Description |
488
- |-----------|------|----------|-------------|
489
- | `key` | `InjectionKey<T>` | ✅ | The typed injection key |
490
- | `defaultValue` | `T` | ⚪ | Optional fallback value |
491
-
492
- **Returns:** `T` - The injected value
493
-
494
- **Throws:** `Error` - When no provider is found and no default value is provided
495
-
496
380
  ## 🌐 i18n
497
381
  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).
498
382
  It allows to use production or local translations on your code. 🚀
@@ -579,4 +463,8 @@ ISC License
579
463
  - Master Version Generator should be fixed.
580
464
  - Playwright integration
581
465
  - Commitlint & Precommit Hooks integration
466
+ - We need to emit save event and we should return template config to it
467
+ - Default template should be same with production
468
+ - Open Guido with saved template
469
+ - Get User ID, Email and Unique Template ID as dynamic from props
582
470
  - Get Pre-built display conditions from API
@@ -12,11 +12,6 @@ export type DynamicContent = {
12
12
  export interface TooltipOptions {
13
13
  id: string;
14
14
  dynamicPosition: boolean;
15
- staticPosition: 'top center' | 'top left' | 'top right' | 'bottom center' | 'bottom left' | 'bottom right' | 'right center' | 'right top' | 'right bottom' | 'left center' | 'left top' | 'left bottom';
15
+ staticPosition: string;
16
16
  iconStatus: boolean;
17
- offset?: {
18
- x: number;
19
- y: number;
20
- };
21
- preventXss?: boolean;
22
17
  }
@@ -1,13 +1,10 @@
1
1
  import type { DynamicContent, GuidoConfig } from '@@/Types/generic';
2
- import type { Template } from '@@/Types/stripo';
3
2
  type __VLS_Props = {
4
- templateId: string;
3
+ emailId: string;
5
4
  userId: string;
6
5
  partnerName?: string;
7
6
  productType?: string;
8
7
  username?: string;
9
- html?: string;
10
- css?: string;
11
8
  guidoConfig: GuidoConfig;
12
9
  };
13
10
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
@@ -17,9 +14,6 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
17
14
  };
18
15
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
19
16
  "dynamic-content:open": (detail: DynamicContent | null) => void;
20
- back: () => void;
21
- "save:start": () => void;
22
- "save:complete": (template: Omit<Template, "forceRecreate">) => void;
23
17
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
24
18
  export default _default;
25
19
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -10,7 +10,7 @@ var s = function() {
10
10
  _,
11
11
  !1,
12
12
  null,
13
- "89bedf08"
13
+ "89423288"
14
14
  );
15
15
  const f = a.exports;
16
16
  export {
@@ -1,51 +1,34 @@
1
- import { defineComponent as h, onMounted as w } from "vue";
2
- import { provideGuidoActions as D } from "../composables/useGuidoActions.js";
3
- import { usePartner as E } from "../composables/usePartner.js";
4
- import { useStripo as S } from "../composables/useStripo.js";
5
- import { DefaultUsername as _, DefaultGuidoConfig as G } from "../enums/defaults.js";
6
- import I from "./organisms/header/HeaderWrapper.vue.js";
7
- import { useStripoApi as k } from "../services/stripoApi.js";
8
- const B = /* @__PURE__ */ h({
1
+ import { defineComponent as v, onMounted as w } from "vue";
2
+ import { usePartner as h } from "../composables/usePartner.js";
3
+ import { useStripo as D } from "../composables/useStripo.js";
4
+ import { useTemplates as E } from "../composables/useTemplates.js";
5
+ import { DefaultUsername as _, DefaultGuidoConfig as b } from "../enums/defaults.js";
6
+ import T from "./organisms/header/HeaderWrapper.vue.js";
7
+ const W = /* @__PURE__ */ v({
9
8
  __name: "Guido",
10
9
  props: {
11
- templateId: null,
10
+ emailId: null,
12
11
  userId: null,
13
12
  partnerName: null,
14
13
  productType: null,
15
14
  username: null,
16
- html: null,
17
- css: null,
18
15
  guidoConfig: null
19
16
  },
20
- emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
21
- setup(C, { expose: b, emit: t }) {
22
- const o = C, { getPartnerName: n, getProductType: a } = E(), {
23
- templateId: c,
24
- userId: s,
25
- guidoConfig: i,
26
- html: r = "",
27
- css: l = "",
28
- partnerName: d = n(),
29
- productType: u = a(),
30
- username: m = _
31
- } = o;
17
+ emits: ["dynamic-content:open"],
18
+ setup(g, { expose: C, emit: n }) {
19
+ const t = g, { getPartnerName: o, getProductType: c } = h(), {
20
+ emailId: i,
21
+ userId: a,
22
+ guidoConfig: r,
23
+ partnerName: s = o(),
24
+ productType: d = c(),
25
+ username: u = _
26
+ } = t;
32
27
  window.GuidoConfig = {
33
- ...G,
34
- ...i
28
+ ...b,
29
+ ...r
35
30
  };
36
- const { initPlugin: p } = S({ emailId: c, userId: s, username: m, partnerName: d, productType: u }), { getDefaultTemplate: g } = k();
37
- D({
38
- onBack: () => {
39
- console.debug("guido:back"), t("back");
40
- },
41
- onSaveStart: () => {
42
- console.debug("guido:save:start"), t("save:start");
43
- },
44
- onSaveComplete: (e) => {
45
- console.debug("guido:save:complete", e), t("save:complete", e);
46
- }
47
- });
48
- const f = (e) => {
31
+ const { initPlugin: m } = D({ emailId: i, userId: a, username: u, partnerName: s, productType: d }), { getDefaultTemplate: l } = E(), p = (e) => {
49
32
  console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
50
33
  }, y = () => {
51
34
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
@@ -53,28 +36,23 @@ const B = /* @__PURE__ */ h({
53
36
  return w(async () => {
54
37
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
55
38
  try {
56
- let e = {
57
- html: r,
58
- css: l,
59
- forceRecreate: !0
60
- // TODO: It should be false for old templates. We will communicate with Stripo
61
- };
62
- e.html || (e = await g()), await p(e);
39
+ const e = await l();
40
+ await m(e);
63
41
  } catch (e) {
64
42
  console.error("Failed to initialize Stripo editor:", e);
65
43
  }
66
44
  document.addEventListener("dynamic-content:open", (e) => {
67
- const v = e;
68
- console.debug("dynamic-content:open", v.detail), t("dynamic-content:open", v.detail);
45
+ const f = e;
46
+ console.debug("dynamic-content:open", f.detail), n("dynamic-content:open", f.detail);
69
47
  });
70
- }), b({
48
+ }), C({
71
49
  dynamicContent: {
72
- insert: f,
50
+ insert: p,
73
51
  close: y
74
52
  }
75
- }), { __sfc: !0, props: o, getPartnerName: n, getProductType: a, templateId: c, userId: s, guidoConfig: i, html: r, css: l, partnerName: d, productType: u, username: m, emit: t, initPlugin: p, getDefaultTemplate: g, insertDynamicContent: f, closeDynamicContent: y, HeaderWrapper: I };
53
+ }), { __sfc: !0, props: t, getPartnerName: o, getProductType: c, emailId: i, userId: a, guidoConfig: r, partnerName: s, productType: d, username: u, emit: n, initPlugin: m, getDefaultTemplate: l, insertDynamicContent: p, closeDynamicContent: y, HeaderWrapper: T };
76
54
  }
77
55
  });
78
56
  export {
79
- B as default
57
+ W as default
80
58
  };
@@ -1,11 +1,11 @@
1
- import n from "./LeftSlot.vue2.js";
1
+ import r from "./LeftSlot.vue2.js";
2
2
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var r = function() {
4
- var e = this, s = e._self._c, t = e._self._setupProxy;
5
- return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" }, on: { click: t.handleBack } }), t.editorStore.isVersionHistoryOpen ? s(t.RestoreButton, { staticClass: "ml-3" }) : e._e()], 1);
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
6
  }, a = [], i = /* @__PURE__ */ o(
7
- n,
8
7
  r,
8
+ n,
9
9
  a,
10
10
  !1,
11
11
  null,
@@ -1,15 +1,13 @@
1
- import { defineComponent as r } from "vue";
2
- import { useBack as e } from "../../../composables/useGuidoActions.js";
3
- import { useEditorStore as m } from "../../../stores/editor.js";
4
- import { InButtonV2 as n } from "@useinsider/design-system-vue";
5
- import s from "./version-history/RestoreButton.vue.js";
6
- const c = /* @__PURE__ */ r({
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({
7
6
  __name: "LeftSlot",
8
- setup(f) {
9
- const o = m(), t = e();
10
- return { __sfc: !0, editorStore: o, handleBack: t, InButtonV2: n, RestoreButton: s };
7
+ setup(m) {
8
+ return { __sfc: !0, editorStore: o(), InButtonV2: r, RestoreButton: e };
11
9
  }
12
10
  });
13
11
  export {
14
- c as default
12
+ _ as default
15
13
  };
@@ -1,18 +1,18 @@
1
1
  import { defineComponent as s, computed as t } from "vue";
2
- import { useTranslations as n } from "../../../composables/useTranslations.js";
3
- import { useEditorStore as p } from "../../../stores/editor.js";
4
- import { getTooltipOptions as m } from "../../../utils/tooltipUtils.js";
5
- import { InButtonV2 as l } from "@useinsider/design-system-vue";
2
+ import { getTooltipOptions as n } from "../../../utils/tooltipUtils.js";
3
+ import { InButtonV2 as p } from "@useinsider/design-system-vue";
4
+ import { useTranslations as m } from "../../../composables/useTranslations.js";
5
+ import { useEditorStore as l } from "../../../stores/editor.js";
6
6
  import d from "./version-history/VersionHistory.vue.js";
7
7
  import w from "./version-history/ViewOptions.vue.js";
8
8
  import c from "./ViewOptions.vue.js";
9
9
  const M = /* @__PURE__ */ s({
10
10
  __name: "MiddleSlot",
11
11
  setup(f) {
12
- const e = p(), o = n(), r = t(() => e.isCodeEditorOpen ? o("newsletter.close-html-editor") : o("newsletter.html-editor")), i = t(() => e.isPreviewModeOpen ? o("newsletter.close-email-preview") : o("newsletter.email-preview"));
12
+ const e = l(), o = m(), r = t(() => e.isCodeEditorOpen ? o("newsletter.close-html-editor") : o("newsletter.html-editor")), i = t(() => e.isPreviewModeOpen ? o("newsletter.close-email-preview") : o("newsletter.email-preview"));
13
13
  return { __sfc: !0, editorStore: e, trans: o, codeEditorTooltipText: r, previewTooltipText: i, handlePreview: () => {
14
14
  e.isPreviewModeOpen = !e.isPreviewModeOpen;
15
- }, getTooltipOptions: m, InButtonV2: l, VersionHistory: d, VersionHistoryViewOptions: w, ViewOptions: c };
15
+ }, getTooltipOptions: n, InButtonV2: p, VersionHistory: d, VersionHistoryViewOptions: w, ViewOptions: c };
16
16
  }
17
17
  });
18
18
  export {
@@ -1,8 +1,8 @@
1
1
  import s from "./RightSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var o = this, e = o._self._c, t = o._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, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, 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, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, 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, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") } }), 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, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleSave } })], 1);
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__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }), o(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.exportHtml } }), o(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, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") } }), o(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, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), o(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
6
6
  }, r = [], l = /* @__PURE__ */ i(
7
7
  s,
8
8
  n,
@@ -11,7 +11,7 @@ var n = function() {
11
11
  null,
12
12
  null
13
13
  );
14
- const u = l.exports;
14
+ const d = l.exports;
15
15
  export {
16
- u as default
16
+ d as default
17
17
  };
@@ -1,37 +1,23 @@
1
- import { defineComponent as l, computed as f } from "vue";
2
- import { useActionsApi as u } from "../../../composables/useActionsApi.js";
3
- import { useExport as d } from "../../../composables/useExport.js";
4
- import { useSaveStart as y, useSaveComplete as v } from "../../../composables/useGuidoActions.js";
5
- import { useTranslations as h } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as S } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as H } from "../../../stores/editor.js";
8
- import { getTooltipOptions as _ } from "../../../utils/tooltipUtils.js";
9
- import { InButtonV2 as V } from "@useinsider/design-system-vue";
10
- const R = /* @__PURE__ */ l({
1
+ import { defineComponent as p, computed as m } from "vue";
2
+ import { getTooltipOptions as c } from "../../../utils/tooltipUtils.js";
3
+ import { InButtonV2 as f } from "@useinsider/design-system-vue";
4
+ import { useExport as l } from "../../../composables/useExport.js";
5
+ import { useTranslations as u } from "../../../composables/useTranslations.js";
6
+ import { useVersionHistoryApi as y } from "../../../composables/useVersionHistoryApi.js";
7
+ import { useEditorStore as a } from "../../../stores/editor.js";
8
+ const O = /* @__PURE__ */ p({
11
9
  __name: "RightSlot",
12
- setup(g) {
13
- const { exportHtml: p } = d(), { getCompiledEmail: r } = u(), s = y(), i = v(), { openVersionHistory: n, closeVersionHistory: m } = S(), o = H(), t = h(), a = () => {
10
+ setup(H) {
11
+ const { exportHtml: e } = l(), { openVersionHistory: r, closeVersionHistory: s } = y(), o = a(), t = u(), i = () => {
14
12
  if (o.isVersionHistoryOpen) {
15
- m();
13
+ s();
16
14
  return;
17
15
  }
18
- n();
19
- }, c = f(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history"));
20
- return { __sfc: !0, exportHtml: p, getCompiledEmail: r, saveStart: s, saveComplete: i, openVersionHistory: n, closeVersionHistory: m, editorStore: o, trans: t, handleVersionHistory: a, versionHistoryTooltipText: c, handleSave: async () => {
21
- s();
22
- try {
23
- const { html: e } = await r();
24
- i({
25
- html: e || "",
26
- css: ""
27
- // CSS is embedded in HTML from Stripo
28
- });
29
- } catch (e) {
30
- console.error("Failed to get template data for save:", e);
31
- }
32
- }, getTooltipOptions: _, InButtonV2: V };
16
+ r();
17
+ }, n = m(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history"));
18
+ return { __sfc: !0, exportHtml: e, openVersionHistory: r, closeVersionHistory: s, editorStore: o, trans: t, handleVersionHistory: i, versionHistoryTooltipText: n, getTooltipOptions: c, InButtonV2: f };
33
19
  }
34
20
  });
35
21
  export {
36
- R as default
22
+ O as default
37
23
  };
@@ -10,9 +10,9 @@ var n = function() {
10
10
  i,
11
11
  !1,
12
12
  null,
13
- "d82f51a1"
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,30 +1,15 @@
1
- import { defineComponent as n } from "vue";
2
- import { useTranslations as p } from "../../../composables/useTranslations.js";
3
- import { useEditorStore as s } from "../../../stores/editor.js";
4
- import { getTooltipOptions as o } from "../../../utils/tooltipUtils.js";
5
- import { InSegments as r } from "@useinsider/design-system-vue";
6
- const f = /* @__PURE__ */ n({
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({
7
5
  __name: "ViewOptions",
8
- setup(m) {
9
- const e = s(), t = p(), i = [
10
- {
11
- text: "",
12
- icon: "line-desktop",
13
- value: "desktop",
14
- tooltipText: t("newsletter.desktop"),
15
- tooltipOptions: o("guido__view-option-desktop")
16
- },
17
- {
18
- text: "",
19
- icon: "line-menu-mobileapp",
20
- value: "mobile",
21
- tooltipText: t("newsletter.mobile"),
22
- tooltipOptions: o("guido__view-option-mobile")
23
- }
24
- ];
25
- return { __sfc: !0, editorStore: e, trans: t, segmentList: i, InSegments: r };
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 };
26
11
  }
27
12
  });
28
13
  export {
29
- f as default
14
+ u as default
30
15
  };
@@ -1,20 +1,19 @@
1
- import { useActionsApi as g } from "./useActionsApi.js";
2
- import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
3
- import { useToaster as E } from "./useToaster.js";
4
- import { displayConditions as S } from "../enums/displayConditions.js";
5
- import y from "../extensions/DynamicContent/extension.js";
6
- import { useStripoApi as C } from "../services/stripoApi.js";
7
- import { useEditorStore as w } from "../stores/editor.js";
8
- const A = (a) => {
9
- const { handleError: d } = E(), { getToken: c, getCustomFonts: u } = C(), l = (e, r = []) => {
10
- const i = w(), { html: t, css: s, forceRecreate: m } = e;
1
+ import { useActionsApi as m } from "./useActionsApi.js";
2
+ import { useCustomInterfaceAppearance as g } from "./useCustomInterfaceAppearance.js";
3
+ import { useToaster as f } from "./useToaster.js";
4
+ import { displayConditions as E } from "../enums/displayConditions.js";
5
+ import S from "../extensions/DynamicContent/extension.js";
6
+ import { useStripoApi as y } from "../services/stripoApi.js";
7
+ import { useEditorStore as C } from "../stores/editor.js";
8
+ const x = (a) => {
9
+ const { handleError: d } = f(), { getToken: c, getCustomFonts: u } = y(), l = (e, r = []) => {
10
+ const i = C(), { html: t, css: s } = e;
11
11
  window.UIEditor.initEditor(
12
12
  document.querySelector("#guido-editor"),
13
13
  {
14
14
  metadata: a,
15
15
  html: t,
16
16
  css: s,
17
- forceRecreate: m,
18
17
  locale: "en",
19
18
  undoButtonSelector: "#guido__undo-button",
20
19
  redoButtonSelector: "#guido__redo-button",
@@ -30,7 +29,7 @@ const A = (a) => {
30
29
  `,
31
30
  conditionsEnabled: !0,
32
31
  customConditionsEnabled: !0,
33
- conditionCategories: S,
32
+ conditionCategories: E,
34
33
  messageSettingsEnabled: !1,
35
34
  editorFonts: {
36
35
  showDefaultStandardFonts: !0,
@@ -47,7 +46,7 @@ const A = (a) => {
47
46
  },
48
47
  onTemplateLoaded() {
49
48
  try {
50
- const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
49
+ const { importCss: o } = g(), { activateCustomViewStyles: n } = m();
51
50
  o(), n();
52
51
  } catch (o) {
53
52
  d(o, "Failed to load custom interface appearance");
@@ -63,7 +62,7 @@ const A = (a) => {
63
62
  i.isVersionHistoryOpen = o;
64
63
  },
65
64
  ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
66
- extensions: [y]
65
+ extensions: [S]
67
66
  }
68
67
  );
69
68
  }, p = (e) => new Promise((r, i) => {
@@ -87,5 +86,5 @@ const A = (a) => {
87
86
  } };
88
87
  };
89
88
  export {
90
- A as useStripo
89
+ x as useStripo
91
90
  };
@@ -0,0 +1,5 @@
1
+ import type { Template } from '@@/Types/stripo';
2
+ export declare const useTemplates: () => {
3
+ getDefaultTemplate: () => Promise<Template>;
4
+ getTemplate: (templateName: string) => Promise<Template>;
5
+ };
@@ -0,0 +1,27 @@
1
+ const s = () => {
2
+ const t = async () => {
3
+ const [e, a] = await Promise.all([
4
+ // eslint-disable-next-line import/extensions
5
+ import("../static/templates/default/index.html.js"),
6
+ import("../static/templates/default/style.css.js")
7
+ ]);
8
+ return {
9
+ html: e.default,
10
+ css: a.default
11
+ };
12
+ };
13
+ return {
14
+ getDefaultTemplate: t,
15
+ getTemplate: async (e) => {
16
+ switch (e) {
17
+ case "default":
18
+ return t();
19
+ default:
20
+ return t();
21
+ }
22
+ }
23
+ };
24
+ };
25
+ export {
26
+ s as useTemplates
27
+ };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .version-history-item[data-v-ee4b9c3f]{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-d82f51a1] .guido__view-option-selection-desktop svg,[data-v-d82f51a1] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d82f51a1] .in-segments-wrapper__button_selected,[data-v-d82f51a1] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-89bedf08],.guido-editor__container[data-v-89bedf08]{width:100%;height:calc(100vh - 75px)}
1
+ .version-history-item[data-v-ee4b9c3f]{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-89423288],.guido-editor__container[data-v-89423288]{width:100%;height:calc(100vh - 75px)}
@@ -1,8 +1,7 @@
1
- import type { CustomFont, Template } from '@@/Types/stripo';
1
+ import type { CustomFont } from '@@/Types/stripo';
2
2
  export declare const useStripoApi: () => {
3
3
  getToken: () => Promise<string>;
4
4
  getCustomFonts: () => Promise<(CustomFont & {
5
5
  active: boolean;
6
6
  })[]>;
7
- getDefaultTemplate: () => Promise<Template>;
8
7
  };
@@ -1,45 +1,25 @@
1
- import { useHttp as a } from "../composables/useHttp.js";
2
- import { useToaster as s } from "../composables/useToaster.js";
1
+ import { useHttp as s } from "../composables/useHttp.js";
2
+ import { useToaster as n } from "../composables/useToaster.js";
3
3
  const m = () => {
4
- const { get: r } = a(), { handleError: o } = s();
4
+ const { get: o } = s(), { handleError: r } = n();
5
5
  return {
6
6
  getToken: async () => {
7
7
  try {
8
- const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await r(`/stripo/get-user-token?test=${t}`);
8
+ const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await o(`/stripo/get-user-token?test=${t}`);
9
9
  return e.body.token;
10
10
  } catch (t) {
11
- return o(t, "Failed to fetch token"), "";
11
+ return r(t, "Failed to fetch token"), "";
12
12
  }
13
13
  },
14
14
  getCustomFonts: async () => {
15
15
  try {
16
- const { data: t = [] } = await r("/stripo/get-partner-custom-fonts");
16
+ const { data: t = [] } = await o("/stripo/get-partner-custom-fonts");
17
17
  return t.map((e) => ({
18
18
  ...e,
19
19
  active: !0
20
20
  }));
21
21
  } catch (t) {
22
- return o(t, "Failed to fetch custom fonts"), [];
23
- }
24
- },
25
- getDefaultTemplate: async () => {
26
- const t = {
27
- html: "",
28
- css: "",
29
- forceRecreate: !0
30
- };
31
- try {
32
- const { data: e } = await r("/stripo/default-template");
33
- try {
34
- return {
35
- ...JSON.parse(e),
36
- forceRecreate: !0
37
- };
38
- } catch {
39
- return t;
40
- }
41
- } catch (e) {
42
- return o(e, "Failed to fetch default template"), t;
22
+ return r(t, "Failed to fetch custom fonts"), [];
43
23
  }
44
24
  }
45
25
  };
@@ -0,0 +1,5 @@
1
+ const t = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta charset="UTF-8"><meta content="width=device-width, initial-scale=1" name="viewport"><meta name="x-apple-disable-message-reformatting"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta content="telephone=no" name="format-detection"><title></title><!--[if (mso 16)]><style type="text/css">a{text-decoration:none;}</style><![endif]--><!--[if gte mso 9]><style>sup{font-size:100% !important;}</style><![endif]--><!--[if gte mso 9]><noscript><xml><o:OfficeDocumentSettings><o:AllowPNG></o:AllowPNG><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml></noscript><![endif]--><!--[if mso]><xml><w:WordDocument xmlns:w="urn:schemas-microsoft-com:office:word"><w:DontUseAdvancedTypographyReadingMail></w:DontUseAdvancedTypographyReadingMail></w:WordDocument></xml><![endif]--></head><body><div class="es-wrapper-color"> <!--[if gte mso 9]> <v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t"> <v:fill type="tile" color="#f6f6f6"></v:fill> </v:background> <![endif]--><table class="es-wrapper" width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td class="esd-email-paddings" valign="top"><table class="es-content esd-header-popover" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="esd-stripe" align="center"><table class="es-content-body" width="600" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center"><tbody><tr><td class="esd-structure es-p20" align="left" bgcolor="#91949F" style="background-color: #91949f;"><table width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td class="esd-container-frame" width="560" valign="top" align="center"><table width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td align="center" class="esd-block-image es-p15" style="font-size: 0px;"><a target="_blank"><img class="adapt-img" src="https://web-image.useinsider.com/email-template/logo.png" alt style="display: block;" height="30"></a></td></tr><tr><td class="esd-block-text" align="center"><h2 style="color: #ffffff; font-size: 30px;"><strong>Time for great email design</strong></h2></td></tr><tr><td class="esd-block-text es-m-txt-c es-p10t" align="center"><p style="color: #ffffff;">I'm a new text block ready for your message content.</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><table class="es-content" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="esd-stripe" align="center"><table class="es-content-body" width="600" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center"><tbody><tr><td class="esd-structure es-p30t es-p20b es-p20r es-p20l" align="left" bgcolor="#F9F9F9" style="background-color: #f9f9f9;"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td width="560" class="esd-container-frame" align="center" valign="top"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" class="esd-block-image es-p30t es-p20r" style="font-size: 0px;"><a target="_blank"><img class="adapt-img" src="https://web-image.useinsider.com/email-template/image-placeholder.png" alt style="display: block;" width="138"></a></td></tr><tr><td align="center" class="esd-block-text es-p10t es-p40b"><p style="color: #c5c6cc;">Image Placeholder</p></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td class="esd-structure es-p20t es-p20r es-p20l" align="left"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td width="560" class="esd-container-frame" align="center" valign="top"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" class="esd-block-text"><p style="font-size: 24px; color: #2c3546;"><strong>This is a sample heading</strong><br></p></td></tr><tr><td align="center" class="esd-block-text"><p style="color: #2c3546;">I'm a new text block ready for your message content.</p></td></tr><tr><td align="center" class="esd-block-text"><p style="color: #959aa3; font-size: 10px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor<br> incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud<br>&nbsp;exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><table class="es-content esd-footer-popover" cellspacing="0" cellpadding="0" align="center"><tbody><tr></tr><tr><td class="esd-stripe" esd-custom-block-id="8631" align="center"><table class="es-footer-body" style="background-color: #ffffff;" width="600" cellspacing="0" cellpadding="0" align="center" bgcolor="#fff"><tbody><tr><td class="esd-structure es-p20t es-p15b es-p20r es-p20l" align="left"> <!--[if mso]><table width="560" cellpadding="0" cellspacing="0"><tr><td width="270" valign="top"><![endif]--><table cellpadding="0" cellspacing="0" class="es-left" align="left"><tbody><tr><td width="270" class="es-m-p20b esd-container-frame" align="left"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="right" class="esd-block-button"><span class="es-button-border" style="border-radius: 4px; border-color: #5d6980; background: #5d6980; border-width: 1px;"><a href class="es-button" target="_blank" style="color: #ffffff; background: #5d6980; border-color: #5d6980; border-radius: 4px; border-width: 10px 15px;"> Button </a></span></td></tr></tbody></table></td></tr></tbody></table> <!--[if mso]></td><td width="20"></td><td width="270" valign="top"><![endif]--><table cellpadding="0" cellspacing="0" class="es-right" align="right"><tbody><tr><td width="270" align="left" class="esd-container-frame"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="left" class="esd-block-button"><span class="es-button-border" style="border-radius: 4px; border-color: #5d6980; background: #ffffff; border-width: 1px;"><a href class="es-button" target="_blank" style="background: #ffffff; border-color: #ffffff; color: #5d6980; border-radius: 4px; border-width: 10px 15px;"> Button </a></span></td></tr></tbody></table></td></tr></tbody></table> <!--[if mso]></td></tr></table><![endif]--></td></tr><tr><td class="esd-structure es-p30t es-p35b es-p40r es-p40l" align="left" bgcolor="#F9F9F9" style="background-color: #f9f9f9;"> <!--[if mso]><table width="520" cellpadding="0" cellspacing="0"><tr><td width="257" valign="top"><![endif]--><table cellpadding="0" cellspacing="0" class="es-left" align="left"><tbody><tr><td width="257" class="es-m-p20b esd-container-frame" align="left"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" class="esd-block-image" style="font-size: 0px;"><a target="_blank"><img class="adapt-img" src="https://web-image.useinsider.com/email-template/image-placeholder.png" alt style="display: block;" width="96"></a></td></tr><tr><td align="center" class="esd-block-text"><p style="color: #c5c6cc;">Image Placeholder</p></td></tr></tbody></table></td></tr></tbody></table> <!--[if mso]></td><td width="0"></td><td width="263" valign="top"><![endif]--><table cellpadding="0" cellspacing="0" class="es-right" align="right"><tbody><tr><td width="263" align="left" class="esd-container-frame"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" class="esd-block-image" style="font-size: 0px;"><a target="_blank"><img class="adapt-img" src="https://web-image.useinsider.com/email-template/image-placeholder.png" alt style="display: block;" width="96"></a></td></tr><tr><td align="center" class="esd-block-text"><p style="color: #c5c6cc;">Image Placeholder</p></td></tr></tbody></table></td></tr></tbody></table> <!--[if mso]></td></tr></table><![endif]--></td></tr><tr><td class="esd-structure es-p20t es-p15b es-p20r es-p20l" align="left"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td width="560" class="esd-container-frame" align="center" valign="top"><table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="left" class="esd-block-text"><p>Text</p></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td class="esd-structure es-p20t es-p20b es-p20r es-p20l" align="left" bgcolor="#2C3546" style="background-color: #2c3546;"><table width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td class="esd-container-frame" width="560" valign="top" align="center"><table width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td align="center" class="esd-block-social" style="font-size:0"><table cellpadding="0" cellspacing="0" class="es-table-not-adapt es-social"><tbody><tr><td align="center" valign="top" class="es-p20r" esd-tmp-icon-type="facebook"><a target="_blank" href="https://facebook.com"><img title="Facebook" src="https://web-image.useinsider.com/email-template/facebook.png" alt="Facebook" width="24" height="24"></a></td><td align="center" valign="top" class="es-p20r" esd-tmp-icon-type="twitter"><a target="_blank" href="https://instagram.com"><img title="Instagram" src="https://web-image.useinsider.com/email-template/instagram.png" alt="Instagram" width="24" height="24"></a></td><td align="center" valign="top" esd-tmp-icon-type="instagram"><a target="_blank" href="https://twitter.com"><img title="Twitter" src="https://web-image.useinsider.com/email-template/twitter.png" alt="Twitter" width="24" height="24"></a></td></tr></tbody></table></td></tr><tr><td align="center" class="esd-block-text es-p20"><p style="font-size: 10px;">ADDRESS LINE, PROVINCE, CITY, COUNTRY - 999999</p></td></tr><tr><td align="center" class="esd-block-text"><p style="color: #959aa2; font-size: 10px;">You can <u>unsubscribe</u> from our emails, if you need to.</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div></body></html>
2
+ `;
3
+ export {
4
+ t as default
5
+ };
@@ -0,0 +1,119 @@
1
+ const t = `/* CONFIG STYLES Please do not delete and edit CSS styles below */ /* IMPORTANT THIS STYLES MUST BE ON FINAL EMAIL */ #outlook a { padding: 0; }.ExternalClass { width: 100%; }.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; }.es-button { mso-style-priority: 100 !important; text-decoration: none !important; }a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; font-size: inherit !important; font-family: inherit !important; font-weight: inherit !important; line-height: inherit !important; }.es-desk-hidden { display: none; float: left; overflow: hidden; width: 0; max-height: 0; line-height: 0; mso-hide: all; }/* END OF IMPORTANT */ html, body { width: 100%; font-family: arial, 'helvetica neue', helvetica, sans-serif; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }table { mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse; border-spacing: 0px; }table td, html, body, .es-wrapper { padding: 0; Margin: 0; }.es-content, .es-header, .es-footer { table-layout: fixed !important; width: 100%; }img { display: block; border: 0; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; }table tr { border-collapse: collapse; }p, hr { Margin: 0; }h1, h2, h3, h4, h5 { Margin: 0; line-height: 120%; mso-line-height-rule: exactly; font-family: arial, 'helvetica neue', helvetica, sans-serif; }p, ul li, ol li, a { -webkit-text-size-adjust: none; -ms-text-size-adjust: none; mso-line-height-rule: exactly; }.es-left { float: left; }.es-right { float: right; }.es-p5 { padding: 5px; }.es-p5t { padding-top: 5px; }.es-p5b { padding-bottom: 5px; }.es-p5l { padding-left: 5px; }.es-p5r { padding-right: 5px; }.es-p10 { padding: 10px; }.es-p10t { padding-top: 10px; }.es-p10b { padding-bottom: 10px; }.es-p10l { padding-left: 10px; }.es-p10r { padding-right: 10px; }.es-p15 { padding: 15px; }.es-p15t { padding-top: 15px; }.es-p15b { padding-bottom: 15px; }.es-p15l { padding-left: 15px; }.es-p15r { padding-right: 15px; }.es-p20 { padding: 20px; }.es-p20t { padding-top: 20px; }.es-p20b { padding-bottom: 20px; }.es-p20l { padding-left: 20px; }.es-p20r { padding-right: 20px; }.es-p25 { padding: 25px; }.es-p25t { padding-top: 25px; }.es-p25b { padding-bottom: 25px; }.es-p25l { padding-left: 25px; }.es-p25r { padding-right: 25px; }.es-p30 { padding: 30px; }.es-p30t { padding-top: 30px; }.es-p30b { padding-bottom: 30px; }.es-p30l { padding-left: 30px; }.es-p30r { padding-right: 30px; }.es-p35 { padding: 35px; }.es-p35t { padding-top: 35px; }.es-p35b { padding-bottom: 35px; }.es-p35l { padding-left: 35px; }.es-p35r { padding-right: 35px; }.es-p40 { padding: 40px; }.es-p40t { padding-top: 40px; }.es-p40b { padding-bottom: 40px; }.es-p40l { padding-left: 40px; }.es-p40r { padding-right: 40px; }.es-menu td { border: 0; }.es-menu td a img { display: inline !important; }/* END CONFIG STYLES */ a { text-decoration: underline; }p, ul li, ol li { font-family: arial, 'helvetica neue', helvetica, sans-serif; line-height: 150%; }ul li, ol li { Margin-bottom: 15px; }.es-menu td a { text-decoration: none; display: block; }.es-wrapper { width: 100%; height: 100%; background-image: ; background-repeat: repeat; background-position: center top; }.es-wrapper-color { background-color: #f6f6f6; }.es-header { background-color: transparent; background-image: ; background-repeat: repeat; background-position: center top; }.es-header-body { background-color: transparent; }.es-header-body p, .es-header-body ul li, .es-header-body ol li { color: #333333; font-size: 14px; }.es-header-body a { color: #333333; font-size: 14px; }.es-content-body { background-color: #ffffff; }.es-content-body p, .es-content-body ul li, .es-content-body ol li { color: #333333; font-size: 14px; }.es-content-body a { color: #333333; font-size: 14px; }.es-footer { background-color: transparent; background-image: ; background-repeat: repeat; background-position: center top; }.es-footer-body { background-color: #333333; }.es-footer-body p, .es-footer-body ul li, .es-footer-body ol li { color: #ffffff; font-size: 14px; }.es-footer-body a { color: #ffffff; font-size: 14px; }.es-infoblock, .es-infoblock p, .es-infoblock ul li, .es-infoblock ol li { line-height: 120%; font-size: 12px; color: #cccccc; }.es-infoblock a { font-size: 12px; color: #cccccc; }h1 { font-size: 30px; font-style: normal; font-weight: normal; color: #333333; }h2 { font-size: 24px; font-style: normal; font-weight: normal; color: #333333; }h3 { font-size: 20px; font-style: normal; font-weight: normal; color: #333333; }.es-header-body h1 a, .es-content-body h1 a, .es-footer-body h1 a { font-size: 30px; }.es-header-body h2 a, .es-content-body h2 a, .es-footer-body h2 a { font-size: 24px; }.es-header-body h3 a, .es-content-body h3 a, .es-footer-body h3 a { font-size: 20px; }a.es-button, button.es-button { border-style: solid; border-color: #f0f0f0; border-width: 5px 30px 5px 30px; display: inline-block; background: #f0f0f0; border-radius: 0px; font-size: 16px; font-family: arial, 'helvetica neue', helvetica, sans-serif; font-weight: normal; font-style: normal; line-height: 120%; color: #333333; text-decoration: none; width: auto; text-align: center; }.es-button-border { border-style: solid solid solid solid; border-color: #808080 #808080 #808080 #808080; background: #f0f0f0; border-width: 2px 2px 2px 2px; display: inline-block; border-radius: 0px; width: auto; }.ins-trim-text {
2
+ overflow: hidden;
3
+ text-overflow: ellipsis;
4
+ white-space: nowrap;
5
+ padding-top: 10px;
6
+ padding-bottom: 10px;
7
+ }/* RESPONSIVE STYLES Please do not delete and edit CSS styles below. If you don't need responsive layout, please delete this section. */ @media only screen and (max-width: 600px) {p, ul li, ol li, a { line-height: 150% !important; }h1 { font-size: 30px !important; text-align: center; line-height: 120% !important; }h2 { font-size: 26px !important; text-align: center; line-height: 120% !important; }h3 { font-size: 20px !important; text-align: center; line-height: 120% !important; }.es-header-body h1 a, .es-content-body h1 a, .es-footer-body h1 a { font-size: 30px !important; }.es-header-body h2 a, .es-content-body h2 a, .es-footer-body h2 a { font-size: 26px !important; }.es-header-body h3 a, .es-content-body h3 a, .es-footer-body h3 a { font-size: 20px !important; }.es-menu td a { font-size: 13px !important; }.es-header-body p, .es-header-body ul li, .es-header-body ol li, .es-header-body a { font-size: 16px !important; }.es-content-body p, .es-content-body ul li, .es-content-body ol li, .es-content-body a { font-size: 16px !important; }.es-footer-body p, .es-footer-body ul li, .es-footer-body ol li, .es-footer-body a { font-size: 16px !important; }.es-infoblock p, .es-infoblock ul li, .es-infoblock ol li, .es-infoblock a { font-size: 12px !important; }*[class="gmail-fix"] { display: none !important; }.es-m-txt-c, .es-m-txt-c h1, .es-m-txt-c h2, .es-m-txt-c h3 { text-align: center !important; }.es-m-txt-r, .es-m-txt-r h1, .es-m-txt-r h2, .es-m-txt-r h3 { text-align: right !important; }.es-m-txt-l, .es-m-txt-l h1, .es-m-txt-l h2, .es-m-txt-l h3 { text-align: left !important; }.es-m-txt-r img, .es-m-txt-c img, .es-m-txt-l img { display: inline !important; }.es-button-border { display: block !important; }a.es-button, button.es-button { font-size: 16px !important; display: block !important; border-width: 10px 0px 10px 0px !important; }.es-btn-fw { border-width: 10px 0px !important; text-align: center !important; }.es-adaptive table, .es-btn-fw, .es-btn-fw-brdr, .es-left, .es-right { width: 100% !important; }.ext-product-button,
8
+ .ext-product-price p,
9
+ .ext-product-original-price p,
10
+ .ext-product-omnibus-price p,
11
+ .ext-product-omnibus-discount p {
12
+ width: 100% !important;
13
+ }
14
+
15
+ .ext-product-button a {
16
+ max-width: 100% !important;
17
+ }
18
+
19
+ .ext-product-name.ins-vertical p {
20
+ height: 90px !important;
21
+ overflow: hidden !important;
22
+ word-break: break-all !important;
23
+ font-size: 12px !important;
24
+ line-height: 150% !important;
25
+ }
26
+
27
+ .ext-product-name.ins-vertical {
28
+ height: 100px !important;
29
+ }
30
+
31
+ .ext-product-omnibus-price.ins-vertical p {
32
+ height: 30px !important;
33
+ overflow: hidden !important;
34
+ word-break: break-all !important;
35
+ font-size: 10px !important;
36
+ line-height: 150% !important;
37
+ }
38
+
39
+ .ext-product-omnibus-price.ins-vertical {
40
+ height: 50px !important;
41
+ }
42
+
43
+ .ext-product-omnibus-discount.ins-vertical p {
44
+ height: 30px !important;
45
+ overflow: hidden !important;
46
+ word-break: break-all !important;
47
+ font-size: 10px !important;
48
+ line-height: 150% !important;
49
+ }
50
+
51
+ .ext-product-omnibus-discount.ins-vertical {
52
+ height: 50px !important;
53
+ }
54
+
55
+ .ext-product-name p {
56
+ height: unset !important;
57
+ width: 100% !important;
58
+ overflow: hidden !important;
59
+ font-size: 16px !important;
60
+ line-height: 150% !important;
61
+ }
62
+
63
+ .ext-product-name {
64
+ height: unset !important;
65
+ }
66
+
67
+ .ext-product-price.ins-vertical p {
68
+ overflow: hidden !important;
69
+ word-break: break-all !important;
70
+ height: 36px !important;
71
+ font-size: 12px !important;
72
+ line-height: 150% !important;
73
+ }
74
+
75
+ .ext-product-price.ins-vertical {
76
+ height: 56px !important;
77
+ }
78
+
79
+ .ext-product-original-price.ins-vertical p {
80
+ overflow: hidden !important;
81
+ word-break: break-all !important;
82
+ height: 36px !important;
83
+ font-size: 12px !important;
84
+ line-height: 150% !important;
85
+ }
86
+
87
+ .ext-product-original-price.ins-vertical {
88
+ height: 56px !important;
89
+ }
90
+
91
+ .ext-ins-attr.ins-vertical p {
92
+ overflow: hidden !important;
93
+ word-break: break-all !important;
94
+ height: 54px !important;
95
+ font-size: 12px !important;
96
+ line-height: 150% !important;
97
+ width: 100% !important;
98
+ }
99
+
100
+ .ext-ins-attr.ins-vertical {
101
+ height: 74px !important;
102
+ }
103
+
104
+ .ext-product-button a.ins-vertical {
105
+ word-break: break-all !important;
106
+ font-size: 12px !important;
107
+ }
108
+
109
+ .ext-product-image.ins-vertical {
110
+ height: unset !important;
111
+ }
112
+
113
+ td.esdev-mso-td.ins-vertical {
114
+ vertical-align: bottom !important;
115
+ }.es-content table, .es-header table, .es-footer table, .es-content, .es-footer, .es-header { width: 100% !important; max-width: 600px !important; }.es-adapt-td { display: block !important; width: 100% !important; }.adapt-img { width: 100% !important; height: auto !important; }.es-m-p0 { padding: 0px !important; }.es-m-p0r { padding-right: 0px !important; }.es-m-p0l { padding-left: 0px !important; }.es-m-p0t { padding-top: 0px !important; }.es-m-p0b { padding-bottom: 0 !important; }.es-m-p20b { padding-bottom: 20px !important; }.es-mobile-hidden, .es-hidden { display: none !important; }.es-desk-hidden { display: table-row !important; width: auto !important; overflow: visible !important; float: none !important; max-height: inherit !important; line-height: inherit !important; }.es-desk-menu-hidden { display: table-cell !important; }table.es-table-not-adapt, .esd-block-html table { width: auto !important; }table.es-social { display: inline-block !important; }table.es-social td { display: inline-block !important; } }/* END RESPONSIVE STYLES */.ext-product-name p { -webkit-line-clamp:3 !important;-webkit-box-orient:vertical !important;overflow:hidden !important; }.ext-product-price p { height:26px !important; }
116
+ `;
117
+ export {
118
+ t as default
119
+ };
@@ -1,2 +1,2 @@
1
1
  import type { TooltipOptions } from '../@types/generic';
2
- export declare const getTooltipOptions: (id: string, options?: Partial<Omit<TooltipOptions, "id">>) => TooltipOptions;
2
+ export declare const getTooltipOptions: (id: string) => TooltipOptions;
@@ -1,11 +1,9 @@
1
- const e = (s, t = {}) => ({
2
- id: s,
3
- dynamicPosition: t.dynamicPosition ?? !1,
4
- staticPosition: t.staticPosition ?? "bottom center",
5
- iconStatus: t.iconStatus ?? !1,
6
- offset: t.offset,
7
- preventXss: t.preventXss
1
+ const o = (t) => ({
2
+ id: t,
3
+ dynamicPosition: !0,
4
+ staticPosition: "top",
5
+ iconStatus: !1
8
6
  });
9
7
  export {
10
- e as getTooltipOptions
8
+ o as getTooltipOptions
11
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.0-beta.9e097de",
3
+ "version": "1.0.0-beta.9fd1b14",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -1,46 +0,0 @@
1
- import type { Template } from '@@/Types/stripo';
2
- import type { InjectionKey } from 'vue';
3
- export type BackHandler = () => void;
4
- export type SaveStartHandler = () => void;
5
- export type SaveCompleteHandler = (template: Omit<Template, 'forceRecreate'>) => void;
6
- export declare const BACK_KEY: InjectionKey<BackHandler>;
7
- export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
8
- export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
9
- /**
10
- * Provides Guido action handlers to child components
11
- */
12
- export declare const provideGuidoActions: (actions: {
13
- onBack: BackHandler;
14
- onSaveStart: SaveStartHandler;
15
- onSaveComplete: SaveCompleteHandler;
16
- }) => void;
17
- /**
18
- * Provides individual Guido action handlers
19
- */
20
- export declare const provideBackHandler: (handler: BackHandler) => void;
21
- export declare const provideSaveStartHandler: (handler: SaveStartHandler) => void;
22
- export declare const provideSaveCompleteHandler: (handler: SaveCompleteHandler) => void;
23
- /**
24
- * Hook to use the back navigation handler
25
- * @returns Back navigation function
26
- */
27
- export declare const useBack: () => BackHandler;
28
- /**
29
- * Hook to use the save start handler
30
- * @returns Save start function
31
- */
32
- export declare const useSaveStart: () => SaveStartHandler;
33
- /**
34
- * Hook to use the save complete handler
35
- * @returns Save complete function
36
- */
37
- export declare const useSaveComplete: () => SaveCompleteHandler;
38
- /**
39
- * Convenience hook to get all Guido actions
40
- * @returns Object containing all action handlers
41
- */
42
- export declare const useGuidoActions: () => {
43
- back: BackHandler;
44
- saveStart: SaveStartHandler;
45
- saveComplete: SaveCompleteHandler;
46
- };
@@ -1,37 +0,0 @@
1
- import { provideValue as o, useInjectedValue as t } from "./useProvideInject.js";
2
- const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symbol.for("guido.save.complete"), s = (e) => {
3
- o(r, e.onBack), o(n, e.onSaveStart), o(a, e.onSaveComplete);
4
- }, u = () => {
5
- try {
6
- return t(r);
7
- } catch {
8
- throw new Error(
9
- "useBack: No back handler provided. Make sure Guido component is in the component tree."
10
- );
11
- }
12
- }, d = () => {
13
- try {
14
- return t(n);
15
- } catch {
16
- throw new Error(
17
- "useSaveStart: No save start handler provided. Make sure Guido component is in the component tree."
18
- );
19
- }
20
- }, i = () => {
21
- try {
22
- return t(a);
23
- } catch {
24
- throw new Error(
25
- "useSaveComplete: No save complete handler provided. Make sure Guido component is in the component tree."
26
- );
27
- }
28
- };
29
- export {
30
- r as BACK_KEY,
31
- a as SAVE_COMPLETE_KEY,
32
- n as SAVE_START_KEY,
33
- s as provideGuidoActions,
34
- u as useBack,
35
- i as useSaveComplete,
36
- d as useSaveStart
37
- };
@@ -1,14 +0,0 @@
1
- import { type InjectionKey } from 'vue';
2
- /**
3
- * Provides a value using Vue's provide/inject system
4
- * @param key - The injection key
5
- * @param value - The value to provide
6
- */
7
- export declare const provideValue: <T>(key: InjectionKey<T>, value: T) => void;
8
- /**
9
- * Injects a value using Vue's provide/inject system
10
- * @param key - The injection key
11
- * @param defaultValue - Optional default value if injection fails
12
- * @returns The injected value
13
- */
14
- export declare const useInjectedValue: <T>(key: InjectionKey<T>, defaultValue?: T) => T;
@@ -1,17 +0,0 @@
1
- import { provide as t, inject as i } from "vue";
2
- const d = (e, o) => {
3
- t(e, o);
4
- }, s = (e, o) => {
5
- const r = i(e, o);
6
- if (r === void 0 && o === void 0) {
7
- const n = e.description || String(e);
8
- throw new Error(
9
- `useInjectedValue: No provider found for key "${n}". Make sure a parent component provides this value.`
10
- );
11
- }
12
- return r;
13
- };
14
- export {
15
- d as provideValue,
16
- s as useInjectedValue
17
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("msw").HttpHandler[];
2
- export default _default;