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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.md +35 -19
  2. package/dist/components/Guido.vue.d.ts +4 -0
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +34 -18
  5. package/dist/components/organisms/base/ModalWrapper.vue.d.ts +72 -0
  6. package/dist/components/organisms/base/ModalWrapper.vue.js +19 -0
  7. package/dist/components/organisms/base/ModalWrapper.vue2.js +43 -0
  8. package/dist/components/organisms/{top-bar/Header.vue.js → header/HeaderWrapper.vue.js} +7 -7
  9. package/dist/components/organisms/header/HeaderWrapper.vue2.js +14 -0
  10. package/dist/components/organisms/header/LeftSlot.vue.js +17 -0
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +13 -0
  12. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +2 -0
  13. package/dist/components/organisms/header/MiddleSlot.vue.js +17 -0
  14. package/dist/components/organisms/header/MiddleSlot.vue2.js +22 -0
  15. package/dist/components/organisms/header/RightSlot.vue.js +17 -0
  16. package/dist/components/organisms/header/RightSlot.vue2.js +21 -0
  17. package/dist/components/organisms/{top-bar/HeaderViewOptions.vue.js → header/ViewOptions.vue.js} +5 -5
  18. package/dist/components/organisms/{top-bar/HeaderViewOptions.vue2.js → header/ViewOptions.vue2.js} +3 -3
  19. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +19 -0
  20. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +14 -0
  21. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +14 -0
  22. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +22 -0
  23. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +18 -0
  24. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +16 -0
  25. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +18 -0
  26. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +16 -0
  27. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +2 -0
  28. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +18 -0
  29. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +23 -0
  30. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +16 -0
  31. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +22 -0
  32. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +86 -0
  33. package/dist/composables/useActionsApi.d.ts +4 -0
  34. package/dist/composables/useActionsApi.js +36 -0
  35. package/dist/composables/useCustomInterfaceAppearance.js +45 -9
  36. package/dist/composables/useExport.d.ts +3 -0
  37. package/dist/composables/useExport.js +30 -0
  38. package/dist/composables/useHttp.js +84 -0
  39. package/dist/composables/usePartner.d.ts +4 -0
  40. package/dist/composables/usePartner.js +16 -0
  41. package/dist/composables/useSaveAsTemplate.d.ts +17 -0
  42. package/dist/composables/useSaveAsTemplate.js +44 -0
  43. package/dist/composables/useStripo.d.ts +2 -2
  44. package/dist/composables/useStripo.js +53 -55
  45. package/dist/composables/useTemplateCategories.d.ts +35 -0
  46. package/dist/composables/useTemplateCategories.js +78 -0
  47. package/dist/composables/useTemplateNameValidation.d.ts +13 -0
  48. package/dist/composables/useTemplateNameValidation.js +57 -0
  49. package/dist/composables/useToaster.d.ts +1 -0
  50. package/dist/composables/useToaster.js +37 -0
  51. package/dist/composables/useTranslations.d.ts +1 -3
  52. package/dist/composables/useTranslations.js +18 -0
  53. package/dist/composables/useVersionHistoryApi.d.ts +8 -0
  54. package/dist/composables/useVersionHistoryApi.js +53 -0
  55. package/dist/enums/defaults.d.ts +2 -0
  56. package/dist/enums/defaults.js +5 -3
  57. package/dist/enums/displayConditions.d.ts +2 -0
  58. package/dist/enums/displayConditions.js +80 -0
  59. package/dist/guido.css +1 -1
  60. package/dist/mock/api/custom-fonts.d.ts +2 -0
  61. package/dist/mock/api/template-library.d.ts +2 -0
  62. package/dist/node_modules/lodash-es/_Hash.js +20 -0
  63. package/dist/node_modules/lodash-es/_ListCache.js +20 -0
  64. package/dist/node_modules/lodash-es/_Map.js +6 -0
  65. package/dist/node_modules/lodash-es/_MapCache.js +20 -0
  66. package/dist/node_modules/lodash-es/_Symbol.js +5 -0
  67. package/dist/node_modules/lodash-es/_assocIndexOf.js +10 -0
  68. package/dist/node_modules/lodash-es/_baseGetTag.js +10 -0
  69. package/dist/node_modules/lodash-es/_baseIsNative.js +16 -0
  70. package/dist/node_modules/lodash-es/_coreJsData.js +5 -0
  71. package/dist/node_modules/lodash-es/_freeGlobal.js +4 -0
  72. package/dist/node_modules/lodash-es/_getMapData.js +8 -0
  73. package/dist/node_modules/lodash-es/_getNative.js +9 -0
  74. package/dist/node_modules/lodash-es/_getRawTag.js +15 -0
  75. package/dist/node_modules/lodash-es/_getValue.js +6 -0
  76. package/dist/node_modules/lodash-es/_hashClear.js +7 -0
  77. package/dist/node_modules/lodash-es/_hashDelete.js +7 -0
  78. package/dist/node_modules/lodash-es/_hashGet.js +13 -0
  79. package/dist/node_modules/lodash-es/_hashHas.js +9 -0
  80. package/dist/node_modules/lodash-es/_hashSet.js +9 -0
  81. package/dist/node_modules/lodash-es/_isKeyable.js +7 -0
  82. package/dist/node_modules/lodash-es/_isMasked.js +11 -0
  83. package/dist/node_modules/lodash-es/_listCacheClear.js +6 -0
  84. package/dist/node_modules/lodash-es/_listCacheDelete.js +12 -0
  85. package/dist/node_modules/lodash-es/_listCacheGet.js +8 -0
  86. package/dist/node_modules/lodash-es/_listCacheHas.js +7 -0
  87. package/dist/node_modules/lodash-es/_listCacheSet.js +8 -0
  88. package/dist/node_modules/lodash-es/_mapCacheClear.js +13 -0
  89. package/dist/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  90. package/dist/node_modules/lodash-es/_mapCacheGet.js +7 -0
  91. package/dist/node_modules/lodash-es/_mapCacheHas.js +7 -0
  92. package/dist/node_modules/lodash-es/_mapCacheSet.js +8 -0
  93. package/dist/node_modules/lodash-es/_nativeCreate.js +5 -0
  94. package/dist/node_modules/lodash-es/_objectToString.js +7 -0
  95. package/dist/node_modules/lodash-es/_root.js +5 -0
  96. package/dist/node_modules/lodash-es/_toSource.js +17 -0
  97. package/dist/node_modules/lodash-es/eq.js +6 -0
  98. package/dist/node_modules/lodash-es/isFunction.js +12 -0
  99. package/dist/node_modules/lodash-es/isObject.js +7 -0
  100. package/dist/node_modules/lodash-es/memoize.js +18 -0
  101. package/dist/services/stripoApi.d.ts +7 -0
  102. package/dist/services/stripoApi.js +29 -0
  103. package/dist/static/styles/base.css.js +11 -0
  104. package/dist/static/styles/components/alert-message.css.js +39 -0
  105. package/dist/static/styles/components/amp-block.css.js +18 -0
  106. package/dist/static/styles/components/base-input.css.js +47 -0
  107. package/dist/static/styles/components/button-group.css.js +54 -0
  108. package/dist/static/styles/components/button.css.js +106 -0
  109. package/dist/static/styles/components/combobox.css.js +49 -0
  110. package/dist/static/styles/components/counter.css.js +42 -0
  111. package/dist/static/styles/components/dropdown-menu.css.js +52 -0
  112. package/dist/static/styles/components/narrow-panel.css.js +38 -0
  113. package/dist/static/styles/components/switcher.css.js +11 -0
  114. package/dist/static/styles/components/tabs.css.js +97 -0
  115. package/dist/static/styles/components/tools.css.js +23 -0
  116. package/dist/static/styles/components/version-history.css.js +30 -0
  117. package/dist/static/styles/components/wide-panel.css.js +135 -0
  118. package/dist/static/styles/variables.css.js +23 -0
  119. package/dist/stores/editor.d.ts +4 -4
  120. package/dist/stores/editor.js +4 -2
  121. package/dist/stores/version-history.d.ts +80 -0
  122. package/dist/stores/version-history.js +28 -0
  123. package/dist/utils/base64.d.ts +1 -0
  124. package/dist/utils/base64.js +14 -0
  125. package/dist/utils/dateUtil.d.ts +1 -0
  126. package/dist/utils/dateUtil.js +16 -0
  127. package/package.json +1 -1
  128. package/dist/components/organisms/top-bar/Header.vue2.js +0 -14
  129. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.js +0 -17
  130. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue2.js +0 -11
  131. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.js +0 -17
  132. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue2.js +0 -17
  133. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.js +0 -18
  134. package/dist/components/organisms/top-bar/HeaderRightSlot.vue2.js +0 -12
  135. package/dist/node_modules/pinia/dist/pinia.js +0 -314
  136. package/dist/node_modules/pinia/node_modules/vue-demi/lib/index.js +0 -11
  137. package/dist/static/editor.css.js +0 -182
  138. package/dist/stores/counter.d.ts +0 -12
  139. /package/dist/components/organisms/{top-bar/Header.vue.d.ts → header/HeaderWrapper.vue.d.ts} +0 -0
  140. /package/dist/components/organisms/{top-bar/HeaderRightSlot.vue.d.ts → header/LeftSlot.vue.d.ts} +0 -0
  141. /package/dist/components/organisms/{top-bar/HeaderLeftSlot.vue.d.ts → header/RightSlot.vue.d.ts} +0 -0
  142. /package/dist/components/organisms/{top-bar/HeaderMiddleSlot.vue.d.ts → header/ViewOptions.vue.d.ts} +0 -0
  143. /package/dist/components/organisms/{top-bar/HeaderViewOptions.vue.d.ts → header/version-history/RestoreButton.vue.d.ts} +0 -0
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ description: string;
3
+ date: number;
4
+ textAlign: string;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
7
+ export default _default;
8
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+ type __VLS_TypePropsToOption<T> = {
10
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
11
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
+ } : {
13
+ type: import('vue').PropType<T[K]>;
14
+ required: true;
15
+ };
16
+ };
@@ -0,0 +1,18 @@
1
+ import e from "./VersionHistoryItem.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var i = function() {
5
+ var s = this, r = s._self._c, t = s._self._setupProxy;
6
+ return r("div", { staticClass: "version-history-item f-g-1" }, [t.props.description ? r("div", { staticClass: "d-f f-d-c", class: { "t-a-r": t.props.textAlign === "right" } }, [r("div", { staticClass: "t-o-e o-h w-s-n-w", domProps: { innerHTML: s._s(t.props.description) } }), r("div", { staticClass: "f-s-1" }, [s._v(" " + s._s(t.formatPatchDate(t.props.date)) + " ")])]) : s._e()]);
7
+ }, a = [], n = /* @__PURE__ */ o(
8
+ e,
9
+ i,
10
+ a,
11
+ !1,
12
+ null,
13
+ "0e2ff42d"
14
+ );
15
+ const d = n.exports;
16
+ export {
17
+ d as default
18
+ };
@@ -0,0 +1,16 @@
1
+ import { defineComponent as o } from "vue";
2
+ import { formatPatchDate as e } from "../../../../utils/dateUtil.js";
3
+ const s = /* @__PURE__ */ o({
4
+ __name: "VersionHistoryItem",
5
+ props: {
6
+ description: null,
7
+ date: null,
8
+ textAlign: null
9
+ },
10
+ setup(t) {
11
+ return { __sfc: !0, props: t, formatPatchDate: e };
12
+ }
13
+ });
14
+ export {
15
+ s as default
16
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import s from "./ViewOptions.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var t = this, o = t._self._c, e = t._self._setupProxy;
6
+ return o(e.InSegments, { attrs: { id: "guido__verion-history-view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.versionHistoryStore.editorVisualMode }, on: { click: e.changeVisualMode } });
7
+ }, n = [], _ = /* @__PURE__ */ i(
8
+ s,
9
+ r,
10
+ n,
11
+ !1,
12
+ null,
13
+ "6a2bde67"
14
+ );
15
+ const d = _.exports;
16
+ export {
17
+ d as default
18
+ };
@@ -0,0 +1,23 @@
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({
6
+ __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();
15
+ return;
16
+ }
17
+ o();
18
+ }, InSegments: m };
19
+ }
20
+ });
21
+ export {
22
+ d as default
23
+ };
@@ -0,0 +1,16 @@
1
+ interface TemplateModalProps {
2
+ isOpen: boolean;
3
+ }
4
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<TemplateModalProps>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
5
+ close: () => void;
6
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<TemplateModalProps>>>, {}>;
7
+ export default _default;
8
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+ type __VLS_TypePropsToOption<T> = {
10
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
11
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
+ } : {
13
+ type: import('vue').PropType<T[K]>;
14
+ required: true;
15
+ };
16
+ };
@@ -0,0 +1,22 @@
1
+ import s from "./SaveTemplateModal.vue2.js";
2
+ import l from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ var r = this, e = r._self._c, t = r._self._setupProxy;
5
+ return e(t.ModalWrapper, { attrs: { "cancel-button-text": t.trans("products.cancel"), description: t.trans("newsletter.save-template-description"), "is-open": t.props.isOpen, "primary-button-loading": t.saveState.saving || t.isLoadingHtml, "primary-button-text": t.trans("products.save"), title: t.trans("products.save-template") }, on: { cancel: t.closeModal, close: t.closeModal, save: t.saveTemplate } }, [e(t.InTextInput, { staticClass: "mb-5 w-1", attrs: { id: "template-name-input", "with-label": "", name: "templateName", invalid: !!t.validationError, "invalid-message": t.validationError, label: t.trans("products.template-name"), placeholder: t.trans("newsletter.enter-template-name") }, model: { value: t.templateNameInput, callback: function(a) {
6
+ t.templateNameInput = typeof a == "string" ? a.trim() : a;
7
+ }, expression: "templateNameInput" } }), e(t.InMultiSelect, { staticClass: "template-category-dropdown mb-5 w-1", attrs: { "create-option-status": "", "search-status": "", "button-status": !1, "character-limit-validation-text": t.trans("validation-v2.duration-value", {
8
+ min: 1,
9
+ max: t.templateCategorySearchInputLimit
10
+ }), "create-button-label": t.trans("products.create-new-category"), "label-text": t.trans("products.template-category"), "loading-state": t.categoriesData.loading || t.categoriesData.loadingCreate, "max-character-limit": t.templateCategorySearchInputLimit, options: t.categoriesData.mappedCategories, "placeholder-text": t.trans("products.select-template-category"), value: t.categoriesData.selectedCategories }, on: { addOption: t.addOption, change: t.setSelectedCategories, resetAllOptions: t.setSelectedCategories, selectAllOptions: t.setSelectedCategories } })], 1);
11
+ }, o = [], i = /* @__PURE__ */ l(
12
+ s,
13
+ n,
14
+ o,
15
+ !1,
16
+ null,
17
+ null
18
+ );
19
+ const d = i.exports;
20
+ export {
21
+ d as default
22
+ };
@@ -0,0 +1,86 @@
1
+ import { defineComponent as N, ref as o, watch as C } from "vue";
2
+ import { useActionsApi as O } from "../../../composables/useActionsApi.js";
3
+ import { useTemplateCategories as j } from "../../../composables/useTemplateCategories.js";
4
+ import { useToaster as x } from "../../../composables/useToaster.js";
5
+ import { useTranslations as E } from "../../../composables/useTranslations.js";
6
+ import H from "../base/ModalWrapper.vue.js";
7
+ import { InMultiSelect as R, InTextInput as V } from "@useinsider/design-system-vue";
8
+ import { useSaveAsTemplate as B } from "../../../composables/useSaveAsTemplate.js";
9
+ import { useTemplateNameValidation as P } from "../../../composables/useTemplateNameValidation.js";
10
+ const X = /* @__PURE__ */ N({
11
+ __name: "SaveTemplateModal",
12
+ props: {
13
+ isOpen: { type: Boolean }
14
+ },
15
+ emits: ["close"],
16
+ setup(I, { emit: u }) {
17
+ const p = I, l = E(), { showToaster: r } = x(), { getCompiledEmail: v } = O(), {
18
+ data: w,
19
+ fetchCategories: f,
20
+ createCategory: d,
21
+ setSelectedCategories: _,
22
+ resetSelection: y,
23
+ getSelectedCategoryIds: g
24
+ } = j(), {
25
+ state: M,
26
+ saveTemplate: T
27
+ } = B(), {
28
+ validationError: b,
29
+ validateTemplateName: n,
30
+ clearValidation: i
31
+ } = P(), t = o(""), a = o(!1), c = o(!1), s = o(""), A = 40, m = () => {
32
+ t.value = "", s.value = "", y(), i();
33
+ }, h = () => {
34
+ m(), u("close");
35
+ }, D = async () => {
36
+ a.value = !0;
37
+ try {
38
+ if (!(await n(t.value)).isValid) {
39
+ a.value = !1;
40
+ return;
41
+ }
42
+ await T({
43
+ name: t.value,
44
+ htmlContent: s.value,
45
+ categoryIds: g.value
46
+ }) && (r({
47
+ message: l(
48
+ "journey-builder.template-saved-successfully",
49
+ { name: t.value }
50
+ ),
51
+ type: "success"
52
+ }), h(), a.value = !1);
53
+ } catch {
54
+ r({
55
+ message: l("journey-builder.template-save-error", { name: t.value }),
56
+ type: "error"
57
+ }), a.value = !1;
58
+ }
59
+ };
60
+ C(t, (e) => {
61
+ e.trim() ? n(e) : i();
62
+ });
63
+ const S = async () => {
64
+ c.value = !0;
65
+ try {
66
+ const { html: e } = await v();
67
+ s.value = e || "";
68
+ } catch {
69
+ s.value = "";
70
+ } finally {
71
+ c.value = !1;
72
+ }
73
+ }, L = async (e) => {
74
+ await d(e);
75
+ };
76
+ return C(() => p.isOpen, async (e) => {
77
+ e ? await Promise.all([
78
+ S(),
79
+ f()
80
+ ]) : m();
81
+ }), { __sfc: !0, props: p, emit: u, trans: l, showToaster: r, getCompiledEmail: v, categoriesData: w, fetchCategories: f, createCategory: d, setSelectedCategories: _, resetSelection: y, getSelectedCategoryIds: g, saveState: M, saveTemplateToLibrary: T, validationError: b, validateTemplateName: n, clearValidation: i, templateNameInput: t, isSaving: a, isLoadingHtml: c, htmlData: s, templateCategorySearchInputLimit: A, resetModalState: m, closeModal: h, saveTemplate: D, fetchHtmlData: S, addOption: L, ModalWrapper: H, InTextInput: V, InMultiSelect: R };
82
+ }
83
+ });
84
+ export {
85
+ X as default
86
+ };
@@ -0,0 +1,4 @@
1
+ import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
2
+ export declare const useActionsApi: () => {
3
+ getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
4
+ };
@@ -0,0 +1,36 @@
1
+ const d = () => ({ getCompiledEmail: (t = {}) => new Promise((a, i) => {
2
+ const m = { ...{
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 }, s = {
22
+ callback: (e, l, n, o, c) => {
23
+ e ? i(e) : a({
24
+ html: l,
25
+ ampHtml: n,
26
+ ampErrors: o,
27
+ displayConditions: c
28
+ });
29
+ },
30
+ ...m
31
+ };
32
+ window.StripoEditorApi.actionsApi.compileEmail(s);
33
+ }) });
34
+ export {
35
+ d as useActionsApi
36
+ };
@@ -1,13 +1,49 @@
1
- import r from "../static/editor.css.js";
2
- const c = () => ({ importCss: () => {
3
- const e = new CSSStyleSheet();
4
- e.replaceSync(r);
5
- const t = document.querySelector("ui-editor");
6
- if (!t)
1
+ import S from "../static/styles/base.css.js";
2
+ import e from "../static/styles/components/alert-message.css.js";
3
+ import m from "../static/styles/components/amp-block.css.js";
4
+ import i from "../static/styles/components/base-input.css.js";
5
+ import p from "../static/styles/components/button-group.css.js";
6
+ import n from "../static/styles/components/button.css.js";
7
+ import s from "../static/styles/components/combobox.css.js";
8
+ import C from "../static/styles/components/counter.css.js";
9
+ import f from "../static/styles/components/dropdown-menu.css.js";
10
+ import a from "../static/styles/components/narrow-panel.css.js";
11
+ import u from "../static/styles/components/switcher.css.js";
12
+ import c from "../static/styles/components/tabs.css.js";
13
+ import d from "../static/styles/components/tools.css.js";
14
+ import l from "../static/styles/components/version-history.css.js";
15
+ import h from "../static/styles/components/wide-panel.css.js";
16
+ import w from "../static/styles/variables.css.js";
17
+ const y = [
18
+ w,
19
+ // Must be on top
20
+ S,
21
+ // Must be on top
22
+ e,
23
+ m,
24
+ i,
25
+ p,
26
+ n,
27
+ s,
28
+ C,
29
+ f,
30
+ a,
31
+ u,
32
+ c,
33
+ d,
34
+ l,
35
+ h
36
+ ].join(`
37
+
38
+ `), N = () => ({ importCss: () => {
39
+ const o = new CSSStyleSheet();
40
+ o.replaceSync(y);
41
+ const r = document.querySelector("ui-editor");
42
+ if (!r)
7
43
  return;
8
- const o = t.shadowRoot;
9
- o && (o.adoptedStyleSheets = [e]);
44
+ const t = r.shadowRoot;
45
+ t && (t.adoptedStyleSheets = [o]);
10
46
  } });
11
47
  export {
12
- c as useCustomInterfaceAppearance
48
+ N as useCustomInterfaceAppearance
13
49
  };
@@ -0,0 +1,3 @@
1
+ export declare const useExport: () => {
2
+ exportHtml: () => Promise<void>;
3
+ };
@@ -0,0 +1,30 @@
1
+ import { useActionsApi as l } from "./useActionsApi.js";
2
+ import { useToaster as m } from "./useToaster.js";
3
+ const u = () => {
4
+ const a = (r, t, e) => {
5
+ const n = new Blob([r], { type: e }), s = URL.createObjectURL(n), o = document.createElement("a");
6
+ o.href = s, o.download = t, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(s);
7
+ }, c = (r) => {
8
+ const t = /* @__PURE__ */ new Date(), e = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), s = t.getFullYear(), o = String(t.getHours()).padStart(2, "0"), i = String(t.getMinutes()).padStart(2, "0");
9
+ return `${r}_${e}-${n}-${s}_${o}-${i}.html`;
10
+ };
11
+ return { exportHtml: async () => {
12
+ const { getCompiledEmail: r } = l(), { showToaster: t } = m();
13
+ try {
14
+ const { html: e } = await r();
15
+ e ? a(e, c("HTML"), "text/html") : t({
16
+ type: "error",
17
+ message: "No HTML content to download"
18
+ });
19
+ } catch (e) {
20
+ const n = e instanceof Error ? e.message : String(e);
21
+ t({
22
+ type: "error",
23
+ message: `Error compiling email: ${n}`
24
+ });
25
+ }
26
+ } };
27
+ };
28
+ export {
29
+ u as useExport
30
+ };
@@ -0,0 +1,84 @@
1
+ import { ref as p, computed as v } from "vue";
2
+ const j = (y = {}) => {
3
+ const h = p(!1), a = p(null), u = p(null), E = v(() => h.value), g = v(() => a.value !== null), T = {
4
+ baseURL: "",
5
+ timeout: 1e4,
6
+ retry: 0,
7
+ retryDelay: 1e3,
8
+ headers: {
9
+ "Content-Type": "application/json"
10
+ },
11
+ ...y
12
+ }, w = (e, s) => {
13
+ if (e.startsWith("http://") || e.startsWith("https://"))
14
+ return e;
15
+ const t = s || T.baseURL || "";
16
+ return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
17
+ }, P = (e) => new Promise((s, t) => {
18
+ setTimeout(() => {
19
+ t(new Error("Request timeout"));
20
+ }, e);
21
+ }), x = (e) => new Promise((s) => {
22
+ setTimeout(s, e);
23
+ }), i = async (e, s, t, D = {}) => {
24
+ a.value = null, h.value = !0, u.value = new AbortController();
25
+ const n = { ...T, ...D }, L = w(s, n.baseURL), c = {
26
+ method: e,
27
+ headers: { ...n.headers },
28
+ signal: u.value.signal,
29
+ ...n
30
+ };
31
+ t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
32
+ const b = async (m = 0) => {
33
+ try {
34
+ const o = [fetch(L, c)];
35
+ n.timeout && o.push(P(n.timeout));
36
+ const r = await Promise.race(o);
37
+ if (!r.ok) {
38
+ const H = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(H);
39
+ throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
40
+ }
41
+ let f;
42
+ const l = r.headers.get("content-type");
43
+ return l != null && l.includes("application/json") ? f = await r.json() : l != null && l.includes("text/") ? f = await r.text() : f = await r.blob(), {
44
+ data: f,
45
+ status: r.status,
46
+ statusText: r.statusText,
47
+ headers: r.headers
48
+ };
49
+ } catch (o) {
50
+ const r = o instanceof Error && o.name === "AbortError";
51
+ if (m < (n.retry || 0) && !r)
52
+ return await x(n.retryDelay || 1e3), b(m + 1);
53
+ throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
54
+ }
55
+ };
56
+ try {
57
+ return await b();
58
+ } finally {
59
+ h.value = !1, u.value = null;
60
+ }
61
+ }, $ = (e, s) => i("GET", e, void 0, s), C = (e, s, t) => i("POST", e, s, t), U = (e, s, t) => i("PUT", e, s, t), A = (e, s, t) => i("PATCH", e, s, t), R = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
62
+ u.value && u.value.abort(e);
63
+ }, q = () => {
64
+ a.value = null;
65
+ };
66
+ return {
67
+ // State
68
+ loading: E,
69
+ error: v(() => a.value),
70
+ hasError: g,
71
+ // Methods
72
+ request: i,
73
+ get: $,
74
+ post: C,
75
+ put: U,
76
+ patch: A,
77
+ delete: R,
78
+ cancel: W,
79
+ clearError: q
80
+ };
81
+ };
82
+ export {
83
+ j as useHttp
84
+ };
@@ -0,0 +1,4 @@
1
+ export declare const usePartner: () => {
2
+ getPartnerName: () => string;
3
+ getProductType: () => string;
4
+ };
@@ -0,0 +1,16 @@
1
+ import { DefaultProductType as o } from "../enums/defaults.js";
2
+ const p = () => {
3
+ const e = {
4
+ email: "newsletter"
5
+ };
6
+ return {
7
+ getPartnerName: () => window.location.hostname.split(".")[0] || "",
8
+ getProductType: () => {
9
+ const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
10
+ return e[t] || t;
11
+ }
12
+ };
13
+ };
14
+ export {
15
+ p as usePartner
16
+ };
@@ -0,0 +1,17 @@
1
+ import type { StripoConfig, RecommendationConfig, RecommendationCampaignUrls } from '@@/Types/template-save';
2
+ interface SaveTemplateData {
3
+ name: string;
4
+ htmlContent: string;
5
+ categoryIds: number[];
6
+ css?: string;
7
+ stripoConfig?: StripoConfig;
8
+ recommendationConfigs?: RecommendationConfig;
9
+ recommendationCampaignUrls?: RecommendationCampaignUrls;
10
+ }
11
+ export declare const useSaveAsTemplate: () => {
12
+ state: {
13
+ saving: boolean;
14
+ };
15
+ saveTemplate: (data: SaveTemplateData) => Promise<boolean>;
16
+ };
17
+ export {};
@@ -0,0 +1,44 @@
1
+ import { useHttp as o } from "./useHttp.js";
2
+ import { base64EncodeWithSpecialChars as n } from "../utils/base64.js";
3
+ import { reactive as a } from "vue";
4
+ const l = () => {
5
+ const { post: i } = o(), s = a({
6
+ saving: !1
7
+ });
8
+ return {
9
+ state: s,
10
+ saveTemplate: async (e) => {
11
+ s.saving = !0;
12
+ try {
13
+ const t = {
14
+ name: e.name,
15
+ categories: e.categoryIds,
16
+ productId: 60,
17
+ editorType: 2,
18
+ content: n(e.htmlContent),
19
+ unsubscriptionPreferencePages: [],
20
+ unsubscriptionPreferencePageStatus: !1
21
+ };
22
+ e.css && (t.css = n(e.css)), e.stripoConfig && (t.stripoConfig = n(
23
+ JSON.stringify(e.stripoConfig)
24
+ )), e.recommendationConfigs && (t.recommendationConfigs = n(
25
+ JSON.stringify(e.recommendationConfigs)
26
+ )), e.recommendationCampaignUrls && (t.recommendationCampaignUrls = n(
27
+ JSON.stringify(e.recommendationCampaignUrls)
28
+ ));
29
+ const r = await i(
30
+ "/newsletter/template-library/create-template",
31
+ t
32
+ );
33
+ return !(!r.data || r.data.type === "error");
34
+ } catch {
35
+ return !1;
36
+ } finally {
37
+ s.saving = !1;
38
+ }
39
+ }
40
+ };
41
+ };
42
+ export {
43
+ l as useSaveAsTemplate
44
+ };
@@ -1,4 +1,4 @@
1
- import type { Template } from '@@/Types/stripo';
2
- export declare const useStripo: (emailId: string) => {
1
+ import type { Metadata, Template } from '@@/Types/stripo';
2
+ export declare const useStripo: (metadata: Metadata) => {
3
3
  initPlugin: (template: Template) => Promise<void>;
4
4
  };