@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.
- package/README.md +159 -23
- package/dist/@types/generic.d.ts +22 -1
- package/dist/components/Guido.vue.d.ts +11 -1
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +73 -34
- package/dist/components/organisms/base/Toaster.vue.d.ts +2 -0
- package/dist/components/organisms/base/Toaster.vue.js +17 -0
- package/dist/components/organisms/base/Toaster.vue2.js +15 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +31 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +25 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +10 -8
- package/dist/components/organisms/header/MiddleSlot.vue.js +5 -5
- package/dist/components/organisms/header/MiddleSlot.vue2.js +16 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +31 -15
- package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
- package/dist/components/organisms/header/ViewOptions.vue2.js +30 -10
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +34 -16
- package/dist/components/wrappers/WpModal.vue.d.ts +65 -0
- package/dist/components/wrappers/WpModal.vue.js +27 -0
- package/dist/components/wrappers/WpModal.vue2.js +22 -0
- package/dist/composables/useActionsApi.d.ts +2 -0
- package/dist/composables/useActionsApi.js +62 -36
- package/dist/composables/useCodeEditorApi.d.ts +4 -0
- package/dist/composables/useCodeEditorApi.js +11 -0
- package/dist/composables/useConfig.d.ts +4 -0
- package/dist/composables/useConfig.js +7 -0
- package/dist/composables/useDebounce.d.ts +4 -0
- package/dist/composables/useDebounce.js +12 -0
- package/dist/composables/useExport.js +6 -6
- package/dist/composables/useGuidoActions.d.ts +46 -0
- package/dist/composables/useGuidoActions.js +37 -0
- package/dist/composables/useHtmlCompiler.js +9 -8
- package/dist/composables/usePreviewMode.d.ts +5 -0
- package/dist/composables/usePreviewMode.js +31 -0
- package/dist/composables/useProvideInject.d.ts +14 -0
- package/dist/composables/useProvideInject.js +17 -0
- package/dist/composables/useResponsivePreview.d.ts +5 -0
- package/dist/composables/useResponsivePreview.js +86 -0
- package/dist/composables/useStripo.js +27 -20
- package/dist/composables/useToaster.d.ts +1 -16
- package/dist/composables/useToaster.js +23 -30
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useVersionHistoryApi.js +4 -4
- package/dist/enums/defaults.js +14 -5
- package/dist/enums/preview.d.ts +13 -0
- package/dist/enums/preview.js +23 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +13 -15
- package/dist/guido.css +1 -1
- package/dist/mock/api/default-template.d.ts +2 -0
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_apply.js +16 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +19 -0
- package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
- package/dist/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
- package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
- package/dist/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/lodash-es/_copyArray.js +9 -0
- package/dist/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
- package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_overRest.js +15 -0
- package/dist/node_modules/lodash-es/_safeGet.js +7 -0
- package/dist/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/lodash-es/_shortOut.js +16 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/lodash-es/merge.js +8 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
- package/dist/services/stripoApi.d.ts +2 -1
- package/dist/services/stripoApi.js +27 -7
- package/dist/static/assets/inbox-mockup.svg.js +4 -0
- package/dist/static/assets/phone-mockup.svg.js +4 -0
- package/dist/stores/dynamic-content.d.ts +27 -0
- package/dist/stores/dynamic-content.js +23 -0
- package/dist/stores/preview.d.ts +46 -0
- package/dist/stores/preview.js +53 -0
- package/dist/stores/toaster.d.ts +25 -0
- package/dist/stores/toaster.js +28 -0
- package/dist/utils/arrayUtil.d.ts +1 -0
- package/dist/utils/arrayUtil.js +10 -0
- package/dist/utils/genericUtil.d.ts +2 -0
- package/dist/utils/genericUtil.js +7 -0
- package/dist/utils/tooltipUtils.d.ts +1 -1
- package/dist/utils/tooltipUtils.js +8 -6
- package/package.json +1 -1
- package/dist/composables/useTemplates.d.ts +0 -5
- package/dist/composables/useTemplates.js +0 -27
- package/dist/static/templates/default/index.html.js +0 -5
- package/dist/static/templates/default/style.css.js +0 -119
|
@@ -1,23 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
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(
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
18
|
-
}, InSegments:
|
|
35
|
+
e();
|
|
36
|
+
}, InSegments: c };
|
|
19
37
|
}
|
|
20
38
|
});
|
|
21
39
|
export {
|
|
22
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
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
|
-
|
|
63
|
+
E as useActionsApi
|
|
38
64
|
};
|
|
@@ -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
|
|
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
|
-
},
|
|
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 } =
|
|
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,
|
|
28
|
+
a(e, l("HTML"), "text/html");
|
|
29
29
|
} else
|
|
30
30
|
r({
|
|
31
|
-
type: "
|
|
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: "
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 +
|
|
9
|
+
priority: o.priority + 1e3 + i
|
|
9
10
|
// Ensure additional rules run after default rules
|
|
10
11
|
}))
|
|
11
|
-
],
|
|
12
|
-
return { compileHtml: (o) =>
|
|
12
|
+
], m = p(t);
|
|
13
|
+
return { compileHtml: (o) => m.compile(o) };
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
R as useHtmlCompiler
|
|
16
17
|
};
|
|
@@ -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
|
+
};
|