@useinsider/guido 1.0.0-beta.dbd0bad → 1.0.0-beta.de03990

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 (156) hide show
  1. package/README.md +159 -23
  2. package/dist/@types/generic.d.ts +22 -1
  3. package/dist/components/Guido.vue.d.ts +11 -1
  4. package/dist/components/Guido.vue.js +8 -8
  5. package/dist/components/Guido.vue2.js +73 -34
  6. package/dist/components/organisms/base/Toaster.vue.d.ts +2 -0
  7. package/dist/components/organisms/base/Toaster.vue.js +17 -0
  8. package/dist/components/organisms/base/Toaster.vue2.js +15 -0
  9. package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +2 -0
  10. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
  11. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
  12. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
  13. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
  14. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
  15. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
  16. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
  17. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
  18. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
  19. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
  20. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +31 -0
  21. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
  22. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
  23. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
  24. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
  25. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
  26. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +25 -0
  27. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
  28. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
  29. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
  30. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
  31. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
  32. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
  33. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
  34. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
  35. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
  36. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  37. package/dist/components/organisms/header/LeftSlot.vue2.js +10 -8
  38. package/dist/components/organisms/header/MiddleSlot.vue.js +5 -5
  39. package/dist/components/organisms/header/MiddleSlot.vue2.js +16 -15
  40. package/dist/components/organisms/header/RightSlot.vue.js +11 -10
  41. package/dist/components/organisms/header/RightSlot.vue2.js +31 -15
  42. package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
  43. package/dist/components/organisms/header/ViewOptions.vue2.js +30 -10
  44. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
  45. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +34 -16
  46. package/dist/components/wrappers/WpModal.vue.d.ts +65 -0
  47. package/dist/components/wrappers/WpModal.vue.js +27 -0
  48. package/dist/components/wrappers/WpModal.vue2.js +22 -0
  49. package/dist/composables/useActionsApi.d.ts +2 -0
  50. package/dist/composables/useActionsApi.js +62 -36
  51. package/dist/composables/useCodeEditorApi.d.ts +4 -0
  52. package/dist/composables/useCodeEditorApi.js +11 -0
  53. package/dist/composables/useConfig.d.ts +4 -0
  54. package/dist/composables/useConfig.js +7 -0
  55. package/dist/composables/useDebounce.d.ts +4 -0
  56. package/dist/composables/useDebounce.js +12 -0
  57. package/dist/composables/useExport.js +6 -6
  58. package/dist/composables/useGuidoActions.d.ts +46 -0
  59. package/dist/composables/useGuidoActions.js +37 -0
  60. package/dist/composables/useHtmlCompiler.js +9 -8
  61. package/dist/composables/usePreviewMode.d.ts +5 -0
  62. package/dist/composables/usePreviewMode.js +31 -0
  63. package/dist/composables/useProvideInject.d.ts +14 -0
  64. package/dist/composables/useProvideInject.js +17 -0
  65. package/dist/composables/useResponsivePreview.d.ts +5 -0
  66. package/dist/composables/useResponsivePreview.js +86 -0
  67. package/dist/composables/useStripo.js +27 -20
  68. package/dist/composables/useToaster.d.ts +1 -16
  69. package/dist/composables/useToaster.js +23 -30
  70. package/dist/composables/useTranslations.js +3 -2
  71. package/dist/composables/useVersionHistoryApi.js +4 -4
  72. package/dist/enums/defaults.js +14 -5
  73. package/dist/enums/preview.d.ts +13 -0
  74. package/dist/enums/preview.js +23 -0
  75. package/dist/extensions/DynamicContent/dynamic-content.js +13 -15
  76. package/dist/guido.css +1 -1
  77. package/dist/mock/api/default-template.d.ts +2 -0
  78. package/dist/node_modules/lodash-es/_Stack.js +18 -0
  79. package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
  80. package/dist/node_modules/lodash-es/_apply.js +16 -0
  81. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +19 -0
  82. package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
  83. package/dist/node_modules/lodash-es/_assignValue.js +10 -0
  84. package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
  85. package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
  86. package/dist/node_modules/lodash-es/_baseFor.js +5 -0
  87. package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
  88. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
  89. package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
  90. package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
  91. package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
  92. package/dist/node_modules/lodash-es/_baseRest.js +9 -0
  93. package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
  94. package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
  95. package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
  96. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  97. package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
  98. package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  99. package/dist/node_modules/lodash-es/_copyArray.js +9 -0
  100. package/dist/node_modules/lodash-es/_copyObject.js +14 -0
  101. package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
  102. package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
  103. package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
  104. package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
  105. package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
  106. package/dist/node_modules/lodash-es/_isIndex.js +8 -0
  107. package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
  108. package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
  109. package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
  110. package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
  111. package/dist/node_modules/lodash-es/_overArg.js +8 -0
  112. package/dist/node_modules/lodash-es/_overRest.js +15 -0
  113. package/dist/node_modules/lodash-es/_safeGet.js +7 -0
  114. package/dist/node_modules/lodash-es/_setToString.js +6 -0
  115. package/dist/node_modules/lodash-es/_shortOut.js +16 -0
  116. package/dist/node_modules/lodash-es/_stackClear.js +7 -0
  117. package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
  118. package/dist/node_modules/lodash-es/_stackGet.js +6 -0
  119. package/dist/node_modules/lodash-es/_stackHas.js +6 -0
  120. package/dist/node_modules/lodash-es/_stackSet.js +17 -0
  121. package/dist/node_modules/lodash-es/constant.js +8 -0
  122. package/dist/node_modules/lodash-es/identity.js +6 -0
  123. package/dist/node_modules/lodash-es/isArguments.js +10 -0
  124. package/dist/node_modules/lodash-es/isArray.js +4 -0
  125. package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
  126. package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  127. package/dist/node_modules/lodash-es/isBuffer.js +6 -0
  128. package/dist/node_modules/lodash-es/isLength.js +7 -0
  129. package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
  130. package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
  131. package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
  132. package/dist/node_modules/lodash-es/keysIn.js +9 -0
  133. package/dist/node_modules/lodash-es/merge.js +8 -0
  134. package/dist/node_modules/lodash-es/stubFalse.js +6 -0
  135. package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
  136. package/dist/services/stripoApi.d.ts +2 -1
  137. package/dist/services/stripoApi.js +27 -7
  138. package/dist/static/assets/inbox-mockup.svg.js +4 -0
  139. package/dist/static/assets/phone-mockup.svg.js +4 -0
  140. package/dist/stores/dynamic-content.d.ts +27 -0
  141. package/dist/stores/dynamic-content.js +23 -0
  142. package/dist/stores/preview.d.ts +46 -0
  143. package/dist/stores/preview.js +53 -0
  144. package/dist/stores/toaster.d.ts +25 -0
  145. package/dist/stores/toaster.js +28 -0
  146. package/dist/utils/arrayUtil.d.ts +1 -0
  147. package/dist/utils/arrayUtil.js +10 -0
  148. package/dist/utils/genericUtil.d.ts +2 -0
  149. package/dist/utils/genericUtil.js +7 -0
  150. package/dist/utils/tooltipUtils.d.ts +1 -1
  151. package/dist/utils/tooltipUtils.js +8 -6
  152. package/package.json +1 -1
  153. package/dist/composables/useTemplates.d.ts +0 -5
  154. package/dist/composables/useTemplates.js +0 -27
  155. package/dist/static/templates/default/index.html.js +0 -5
  156. package/dist/static/templates/default/style.css.js +0 -119
@@ -10,9 +10,9 @@ var r = function() {
10
10
  n,
11
11
  !1,
12
12
  null,
13
- "6a2bde67"
13
+ "421ffc13"
14
14
  );
15
- const d = _.exports;
15
+ const f = _.exports;
16
16
  export {
17
- d as default
17
+ f as default
18
18
  };
@@ -1,23 +1,41 @@
1
- import { defineComponent as s } from "vue";
2
- import { useVersionHistoryApi as n } from "../../../../composables/useVersionHistoryApi.js";
3
- import { useVersionHistoryStore as r } from "../../../../stores/version-history.js";
4
- import { InSegments as m } from "@useinsider/design-system-vue";
5
- const d = /* @__PURE__ */ s({
1
+ import { defineComponent as p } from "vue";
2
+ import { useTranslations as m } from "../../../../composables/useTranslations.js";
3
+ import { useVersionHistoryApi as l } from "../../../../composables/useVersionHistoryApi.js";
4
+ import { useVersionHistoryStore as a } from "../../../../stores/version-history.js";
5
+ import { getTooltipOptions as n } from "../../../../utils/tooltipUtils.js";
6
+ import { InSegments as c } from "@useinsider/design-system-vue";
7
+ const h = /* @__PURE__ */ p({
6
8
  __name: "ViewOptions",
7
- setup(p) {
8
- const e = r(), { switchToDesktopPreview: o, switchToMobilePreview: t } = n();
9
- return { __sfc: !0, versionHistoryStore: e, switchToDesktopPreview: o, switchToMobilePreview: t, segmentList: [
10
- { text: "", icon: "line-desktop", value: "desktop" },
11
- { text: "", icon: "line-menu-mobileapp", value: "mobile" }
12
- ], changeVisualMode: (i) => {
13
- if (e.editorVisualMode = i, i === "mobile") {
14
- t();
9
+ setup(u) {
10
+ const t = a(), { switchToDesktopPreview: e, switchToMobilePreview: i } = l(), o = m(), r = [
11
+ {
12
+ text: "",
13
+ icon: "line-desktop",
14
+ value: "desktop",
15
+ position: "bottom",
16
+ align: "center",
17
+ tooltipText: o("newsletter.desktop"),
18
+ tooltipOptions: n("guido__version-history-view-option-desktop")
19
+ },
20
+ {
21
+ text: "",
22
+ icon: "line-menu-mobileapp",
23
+ value: "mobile",
24
+ position: "bottom",
25
+ align: "center",
26
+ tooltipText: o("newsletter.mobile"),
27
+ tooltipOptions: n("guido__version-history-view-option-mobile")
28
+ }
29
+ ];
30
+ return { __sfc: !0, versionHistoryStore: t, switchToDesktopPreview: e, switchToMobilePreview: i, trans: o, segmentList: r, changeVisualMode: (s) => {
31
+ if (t.editorVisualMode = s, s === "mobile") {
32
+ i();
15
33
  return;
16
34
  }
17
- o();
18
- }, InSegments: m };
35
+ e();
36
+ }, InSegments: c };
19
37
  }
20
38
  });
21
39
  export {
22
- d as default
40
+ h as default
23
41
  };
@@ -0,0 +1,65 @@
1
+ import type { FooterButtonGroup } from '@@/Types/preview';
2
+ type __VLS_Props = {
3
+ id: string;
4
+ title: string;
5
+ description?: string;
6
+ size?: 'small' | 'medium' | 'large';
7
+ footerButtonOptions?: FooterButtonGroup;
8
+ closeButtonStatus?: boolean;
9
+ closeOnOutsideClick?: boolean;
10
+ footerStatus?: boolean;
11
+ };
12
+ declare var __VLS_13: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_13) => any;
15
+ };
16
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
17
+ description: string;
18
+ size: string;
19
+ footerButtonOptions: undefined;
20
+ closeButtonStatus: boolean;
21
+ closeOnOutsideClick: boolean;
22
+ footerStatus: boolean;
23
+ }>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
24
+ close: () => void;
25
+ "primary-action": () => void;
26
+ "secondary-action": () => void;
27
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
28
+ description: string;
29
+ size: string;
30
+ footerButtonOptions: undefined;
31
+ closeButtonStatus: boolean;
32
+ closeOnOutsideClick: boolean;
33
+ footerStatus: boolean;
34
+ }>>>, {
35
+ size: "small" | "medium" | "large";
36
+ description: string;
37
+ footerButtonOptions: FooterButtonGroup;
38
+ closeButtonStatus: boolean;
39
+ closeOnOutsideClick: boolean;
40
+ footerStatus: boolean;
41
+ }>;
42
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
43
+ export default _default;
44
+ type __VLS_WithDefaults<P, D> = {
45
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
46
+ default: D[K];
47
+ }> : P[K];
48
+ };
49
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
50
+ type __VLS_TypePropsToOption<T> = {
51
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
52
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
53
+ } : {
54
+ type: import('vue').PropType<T[K]>;
55
+ required: true;
56
+ };
57
+ };
58
+ type __VLS_WithSlots<T, S> = T & {
59
+ new (): {
60
+ $scopedSlots: S;
61
+ };
62
+ };
63
+ type __VLS_PrettifyLocal<T> = {
64
+ [K in keyof T]: T[K];
65
+ } & {};
@@ -0,0 +1,27 @@
1
+ import r from "./WpModal.vue2.js";
2
+ import s from "../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var t = this, o = t._self._c, e = t._self._setupProxy;
5
+ return o(e.InModalV2, { attrs: { id: t.id, "description-status": "", status: "", "close-button-status": t.closeButtonStatus, "close-on-outside-click": t.closeOnOutsideClick, "description-text": t.description, "footer-button-group-options": t.footerButtonOptions, "footer-status": t.footerStatus, size: t.size, "title-text": t.title }, on: { cancelOrBackButtonEvent: function(n) {
6
+ return e.emit("close");
7
+ }, onCloseEvent: function(n) {
8
+ return e.emit("close");
9
+ }, primaryButtonEvent: function(n) {
10
+ return e.emit("primary-action");
11
+ }, secondaryButtonEvent: function(n) {
12
+ return e.emit("secondary-action");
13
+ } }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
14
+ return [t._t("default")];
15
+ }, proxy: !0 }], null, !0) });
16
+ }, u = [], c = /* @__PURE__ */ s(
17
+ r,
18
+ i,
19
+ u,
20
+ !1,
21
+ null,
22
+ null
23
+ );
24
+ const p = c.exports;
25
+ export {
26
+ p as default
27
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as e } from "vue";
2
+ import { InModalV2 as o } from "@useinsider/design-system-vue";
3
+ const u = /* @__PURE__ */ e({
4
+ __name: "WpModal",
5
+ props: {
6
+ id: null,
7
+ title: null,
8
+ description: { default: "" },
9
+ size: { default: "small" },
10
+ footerButtonOptions: { default: void 0 },
11
+ closeButtonStatus: { type: Boolean, default: !0 },
12
+ closeOnOutsideClick: { type: Boolean, default: !0 },
13
+ footerStatus: { type: Boolean, default: !0 }
14
+ },
15
+ emits: ["close", "primary-action", "secondary-action"],
16
+ setup(l, { emit: t }) {
17
+ return { __sfc: !0, emit: t, InModalV2: o };
18
+ }
19
+ });
20
+ export {
21
+ u as default
22
+ };
@@ -1,5 +1,7 @@
1
+ import type { CompileEmailOptions } from '@@/Types/actions-api';
1
2
  import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
2
3
  export declare const useActionsApi: () => {
3
4
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
4
5
  activateCustomViewStyles: (isActive?: boolean) => void;
6
+ getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
5
7
  };
@@ -1,38 +1,64 @@
1
- const g = () => ({ getCompiledEmail: (t = {}) => new Promise((i, a) => {
2
- const s = { ...{
3
- minimize: !0,
4
- utmEntity: {
5
- utmSource: "",
6
- utmMedium: "",
7
- utmCampaign: "",
8
- utmContent: "",
9
- utmTerm: "",
10
- customUtms: [
11
- {
12
- name1: "val1",
13
- name2: "val2"
14
- }
15
- ]
16
- },
17
- mergeTags: ["Tag1", "Tag2"],
18
- forseAmp: !1,
19
- resetDataSavedFlag: !1,
20
- disableLineHeightsReplace: !0
21
- }, ...t }, o = {
22
- callback: (e, m, l, n, c) => {
23
- e ? a(e) : i({
24
- html: m,
25
- ampHtml: l,
26
- ampErrors: n,
27
- displayConditions: c
28
- });
29
- },
30
- ...s
31
- };
32
- window.StripoEditorApi.actionsApi.compileEmail(o);
33
- }), activateCustomViewStyles: (t = !0) => {
34
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
35
- } });
1
+ import { useToaster as d } from "./useToaster.js";
2
+ const E = () => {
3
+ const { handleError: m } = d(), s = (t = {}) => new Promise((e, a) => {
4
+ const i = { ...{
5
+ minimize: !0,
6
+ utmEntity: {
7
+ utmSource: "",
8
+ utmMedium: "",
9
+ utmCampaign: "",
10
+ utmContent: "",
11
+ utmTerm: "",
12
+ customUtms: [
13
+ {
14
+ name1: "val1",
15
+ name2: "val2"
16
+ }
17
+ ]
18
+ },
19
+ mergeTags: ["Tag1", "Tag2"],
20
+ forseAmp: !1,
21
+ resetDataSavedFlag: !1,
22
+ disableLineHeightsReplace: !0
23
+ }, ...t }, n = {
24
+ callback: (r, l, c, p, u) => {
25
+ r ? a(r) : e({
26
+ html: l,
27
+ ampHtml: c,
28
+ ampErrors: p,
29
+ displayConditions: u
30
+ });
31
+ },
32
+ ...i
33
+ };
34
+ window.StripoEditorApi.actionsApi.compileEmail(n);
35
+ });
36
+ return { getCompiledEmail: s, activateCustomViewStyles: (t = !0) => {
37
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
38
+ }, getPreviewData: async (t) => {
39
+ try {
40
+ const {
41
+ html: e,
42
+ displayConditions: a,
43
+ ampHtml: o = "",
44
+ ampErrors: i = []
45
+ } = await s({ minimize: !1, resetDataSavedFlag: !1, ...t });
46
+ return {
47
+ html: e,
48
+ ampHtml: o,
49
+ ampErrors: i,
50
+ displayConditions: a
51
+ };
52
+ } catch (e) {
53
+ return m(e, "Error loading preview"), {
54
+ html: "",
55
+ ampHtml: "",
56
+ ampErrors: [],
57
+ displayConditions: []
58
+ };
59
+ }
60
+ } };
61
+ };
36
62
  export {
37
- g as useActionsApi
63
+ E as useActionsApi
38
64
  };
@@ -0,0 +1,4 @@
1
+ export declare const useCodeEditorApi: () => {
2
+ openCodeEditor: () => void;
3
+ closeCodeEditor: () => void;
4
+ };
@@ -0,0 +1,11 @@
1
+ const i = () => ({
2
+ openCodeEditor: () => {
3
+ window.StripoEditorApi.codeEditorApi.openCodeEditor();
4
+ },
5
+ closeCodeEditor: () => {
6
+ window.StripoEditorApi.codeEditorApi.closeCodeEditor();
7
+ }
8
+ });
9
+ export {
10
+ i as useCodeEditorApi
11
+ };
@@ -0,0 +1,4 @@
1
+ import type { GuidoConfig } from '@@/Types/generic';
2
+ export declare const useConfig: () => {
3
+ config: GuidoConfig;
4
+ };
@@ -0,0 +1,7 @@
1
+ import { DefaultGuidoConfig as o } from "../enums/defaults.js";
2
+ const t = () => ({
3
+ config: typeof window > "u" ? o : window.GuidoConfig || o
4
+ });
5
+ export {
6
+ t as useConfig
7
+ };
@@ -0,0 +1,4 @@
1
+ export declare const useDebounce: () => {
2
+ debounce: (fn: () => void, ms?: number) => void;
3
+ clearDebounce: () => void;
4
+ };
@@ -0,0 +1,12 @@
1
+ import { ref as c } from "vue";
2
+ const r = () => {
3
+ const e = c(void 0);
4
+ return { debounce: (o, u = 150) => {
5
+ e.value && window.clearTimeout(e.value), e.value = window.setTimeout(o, u);
6
+ }, clearDebounce: () => {
7
+ e.value && (window.clearTimeout(e.value), e.value = void 0);
8
+ } };
9
+ };
10
+ export {
11
+ r as useDebounce
12
+ };
@@ -1,16 +1,16 @@
1
- import { useActionsApi as l } from "./useActionsApi.js";
1
+ import { useActionsApi as c } from "./useActionsApi.js";
2
2
  import { useHtmlCompiler as m } from "./useHtmlCompiler.js";
3
3
  import { useToaster as d } from "./useToaster.js";
4
4
  const h = () => {
5
5
  const a = (s, o, r) => {
6
6
  const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
7
7
  e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
8
- }, c = (s) => {
8
+ }, l = (s) => {
9
9
  const o = /* @__PURE__ */ new Date(), r = String(o.getDate()).padStart(2, "0"), i = String(o.getMonth() + 1).padStart(2, "0"), t = o.getFullYear(), e = String(o.getHours()).padStart(2, "0"), n = String(o.getMinutes()).padStart(2, "0");
10
10
  return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
11
11
  };
12
12
  return { exportHtml: async (s = !0) => {
13
- const { getCompiledEmail: o } = l(), { showToaster: r } = d(), { compileHtml: i } = m();
13
+ const { getCompiledEmail: o } = c(), { showToaster: r } = d(), { compileHtml: i } = m();
14
14
  try {
15
15
  const { html: t } = await o();
16
16
  if (t) {
@@ -25,16 +25,16 @@ const h = () => {
25
25
  executionTime: `${n.stats.executionTime.toFixed(2)}ms`
26
26
  });
27
27
  }
28
- a(e, c("HTML"), "text/html");
28
+ a(e, l("HTML"), "text/html");
29
29
  } else
30
30
  r({
31
- type: "error",
31
+ type: "alert",
32
32
  message: "No HTML content to download"
33
33
  });
34
34
  } catch (t) {
35
35
  const e = t instanceof Error ? t.message : String(t);
36
36
  r({
37
- type: "error",
37
+ type: "alert",
38
38
  message: `Error compiling email: ${e}`
39
39
  });
40
40
  }
@@ -0,0 +1,46 @@
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
+ };
@@ -0,0 +1,37 @@
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,16 +1,17 @@
1
1
  import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
2
2
  import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
3
- const a = () => {
4
- const e = typeof window < "u" ? window.GuidoConfig : void 0, l = (e == null ? void 0 : e.htmlCompilerRules) || [], t = [
5
- ...!!(e != null && e.ignoreDefaultHtmlCompilerRules) ? [] : r,
6
- ...l.map((o, m) => ({
3
+ import { useConfig as s } from "./useConfig.js";
4
+ const R = () => {
5
+ const { config: e } = s(), l = e.htmlCompilerRules || [], t = [
6
+ ...!!e.ignoreDefaultHtmlCompilerRules ? [] : r,
7
+ ...l.map((o, i) => ({
7
8
  ...o,
8
- priority: o.priority + 1e3 + m
9
+ priority: o.priority + 1e3 + i
9
10
  // Ensure additional rules run after default rules
10
11
  }))
11
- ], i = p(t);
12
- return { compileHtml: (o) => i.compile(o) };
12
+ ], m = p(t);
13
+ return { compileHtml: (o) => m.compile(o) };
13
14
  };
14
15
  export {
15
- a as useHtmlCompiler
16
+ R as useHtmlCompiler
16
17
  };
@@ -0,0 +1,5 @@
1
+ export declare const usePreviewMode: () => {
2
+ closePreviewMode: () => void;
3
+ openPreviewMode: () => void;
4
+ loadPreviewData: () => Promise<void>;
5
+ };
@@ -0,0 +1,31 @@
1
+ import { useEditorStore as n } from "../stores/editor.js";
2
+ import { usePreviewStore as m } from "../stores/preview.js";
3
+ import { useActionsApi as p } from "./useActionsApi.js";
4
+ import { useCodeEditorApi as l } from "./useCodeEditorApi.js";
5
+ const E = () => {
6
+ const i = n(), e = m(), { closeCodeEditor: s } = l(), { getPreviewData: a } = p(), r = () => {
7
+ e.isPreviewModeOpen = !1, e.$reset();
8
+ };
9
+ return {
10
+ closePreviewMode: r,
11
+ openPreviewMode: () => {
12
+ i.isCodeEditorOpen && s(), e.isPreviewModeOpen = !0;
13
+ },
14
+ loadPreviewData: async () => {
15
+ if (!(e.isLoading || e.isLoaded)) {
16
+ e.isLoading = !0;
17
+ try {
18
+ const { html: o, ampHtml: t, ampErrors: d } = await a();
19
+ e.templateHtml = o || "", e.ampHtml = t || "", e.ampErrors = d || [], e.setEmailFormat(t ? "AMP" : "html"), e.isLoaded = !0;
20
+ } catch (o) {
21
+ console.error("Failed to load preview data:", o), r();
22
+ } finally {
23
+ e.isLoading = !1;
24
+ }
25
+ }
26
+ }
27
+ };
28
+ };
29
+ export {
30
+ E as usePreviewMode
31
+ };
@@ -0,0 +1,14 @@
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;
@@ -0,0 +1,17 @@
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
+ };
@@ -0,0 +1,5 @@
1
+ export declare const useResponsivePreview: () => {
2
+ setupResponsivePreview: (iframe: HTMLIFrameElement) => void;
3
+ tearDownEmailResponsiveFit: (iframe: HTMLIFrameElement) => void;
4
+ hasResponsiveMetaViewport: (doc: Document) => boolean;
5
+ };