@useinsider/guido 1.0.0-beta.c907a9d → 1.0.0-beta.cd820fb

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 (168) hide show
  1. package/README.md +2 -26
  2. package/dist/@types/generic.d.ts +0 -24
  3. package/dist/components/Guido.vue.d.ts +6 -5
  4. package/dist/components/Guido.vue.js +9 -9
  5. package/dist/components/Guido.vue2.js +54 -58
  6. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +12 -12
  7. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +8 -7
  8. package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
  9. package/dist/components/organisms/header/MiddleSlot.vue2.js +20 -15
  10. package/dist/components/organisms/header/RightSlot.vue.js +9 -10
  11. package/dist/components/organisms/header/RightSlot.vue2.js +26 -26
  12. package/dist/components/organisms/header/ViewOptions.vue.js +10 -10
  13. package/dist/components/organisms/header/ViewOptions.vue2.js +11 -28
  14. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
  15. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +16 -34
  16. package/dist/components/wrappers/WpModal.vue.d.ts +2 -2
  17. package/dist/composables/useActionsApi.d.ts +1 -2
  18. package/dist/composables/useActionsApi.js +36 -51
  19. package/dist/composables/useCustomInterfaceAppearance.js +13 -15
  20. package/dist/composables/useGuidoActions.d.ts +2 -2
  21. package/dist/composables/useHtmlCompiler.js +8 -9
  22. package/dist/composables/useHttp.js +21 -23
  23. package/dist/composables/usePartner.d.ts +1 -1
  24. package/dist/composables/usePartner.js +14 -9
  25. package/dist/composables/usePreviewMode.js +13 -13
  26. package/dist/composables/useStripo.js +24 -28
  27. package/dist/composables/useToaster.d.ts +1 -1
  28. package/dist/composables/useToaster.js +11 -11
  29. package/dist/composables/useTranslations.js +2 -3
  30. package/dist/enums/defaults.d.ts +1 -4
  31. package/dist/enums/defaults.js +2 -13
  32. package/dist/guido.css +1 -1
  33. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +2 -2
  34. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +2 -2
  35. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +2 -2
  36. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +2 -2
  37. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +2 -2
  38. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +2 -2
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +2 -2
  40. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +2 -2
  41. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +2 -2
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +2 -2
  43. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +2 -2
  44. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +2 -2
  45. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +2 -2
  46. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +2 -2
  47. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +2 -2
  48. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +2 -2
  49. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +4 -4
  50. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +4 -4
  51. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +4 -4
  52. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +2 -2
  53. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +4 -4
  54. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +4 -4
  55. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +4 -4
  56. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +4 -4
  57. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +4 -4
  58. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +2 -2
  59. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +4 -4
  60. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +4 -4
  61. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +2 -2
  62. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +2 -2
  63. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +4 -4
  64. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +4 -4
  65. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +4 -4
  66. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +4 -4
  67. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +4 -4
  68. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +4 -4
  69. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +2 -2
  70. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +2 -2
  71. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +2 -2
  72. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +2 -2
  73. package/dist/node_modules/lodash-es/_isMasked.js +2 -2
  74. package/dist/static/styles/components/wide-panel.css.js +2 -2
  75. package/dist/stores/editor.d.ts +1 -176
  76. package/dist/stores/editor.js +4 -22
  77. package/dist/stores/preview.d.ts +28 -2
  78. package/dist/stores/preview.js +24 -20
  79. package/dist/utils/genericUtil.d.ts +0 -1
  80. package/dist/utils/genericUtil.js +3 -7
  81. package/package.json +3 -3
  82. package/dist/@types/save-as-template.d.ts +0 -29
  83. package/dist/components/organisms/LoadingWrapper.vue.d.ts +0 -2
  84. package/dist/components/organisms/LoadingWrapper.vue.js +0 -18
  85. package/dist/components/organisms/LoadingWrapper.vue2.js +0 -12
  86. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -2
  87. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +0 -20
  88. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +0 -63
  89. package/dist/components/wrappers/WpDrawer.vue.d.ts +0 -63
  90. package/dist/components/wrappers/WpDrawer.vue.js +0 -25
  91. package/dist/components/wrappers/WpDrawer.vue2.js +0 -23
  92. package/dist/composables/useValidation.d.ts +0 -56
  93. package/dist/composables/useValidation.js +0 -19
  94. package/dist/composables/validators/saveAsTemplate.d.ts +0 -31
  95. package/dist/composables/validators/saveAsTemplate.js +0 -24
  96. package/dist/mock/api/template-library.d.ts +0 -2
  97. package/dist/node_modules/@vueuse/shared/index.js +0 -45
  98. package/dist/node_modules/lodash-es/_Stack.js +0 -18
  99. package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
  100. package/dist/node_modules/lodash-es/_apply.js +0 -16
  101. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -19
  102. package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
  103. package/dist/node_modules/lodash-es/_assignValue.js +0 -10
  104. package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
  105. package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
  106. package/dist/node_modules/lodash-es/_baseFor.js +0 -5
  107. package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
  108. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
  109. package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
  110. package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
  111. package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  112. package/dist/node_modules/lodash-es/_baseRest.js +0 -9
  113. package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
  114. package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
  115. package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
  116. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  117. package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
  118. package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  119. package/dist/node_modules/lodash-es/_copyArray.js +0 -9
  120. package/dist/node_modules/lodash-es/_copyObject.js +0 -14
  121. package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
  122. package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
  123. package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
  124. package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
  125. package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
  126. package/dist/node_modules/lodash-es/_isIndex.js +0 -8
  127. package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
  128. package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
  129. package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
  130. package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
  131. package/dist/node_modules/lodash-es/_overArg.js +0 -8
  132. package/dist/node_modules/lodash-es/_overRest.js +0 -15
  133. package/dist/node_modules/lodash-es/_safeGet.js +0 -7
  134. package/dist/node_modules/lodash-es/_setToString.js +0 -6
  135. package/dist/node_modules/lodash-es/_shortOut.js +0 -16
  136. package/dist/node_modules/lodash-es/_stackClear.js +0 -7
  137. package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
  138. package/dist/node_modules/lodash-es/_stackGet.js +0 -6
  139. package/dist/node_modules/lodash-es/_stackHas.js +0 -6
  140. package/dist/node_modules/lodash-es/_stackSet.js +0 -17
  141. package/dist/node_modules/lodash-es/constant.js +0 -8
  142. package/dist/node_modules/lodash-es/identity.js +0 -6
  143. package/dist/node_modules/lodash-es/isArguments.js +0 -10
  144. package/dist/node_modules/lodash-es/isArray.js +0 -4
  145. package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
  146. package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  147. package/dist/node_modules/lodash-es/isBuffer.js +0 -6
  148. package/dist/node_modules/lodash-es/isLength.js +0 -7
  149. package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
  150. package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
  151. package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
  152. package/dist/node_modules/lodash-es/keysIn.js +0 -9
  153. package/dist/node_modules/lodash-es/merge.js +0 -8
  154. package/dist/node_modules/lodash-es/stubFalse.js +0 -6
  155. package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
  156. package/dist/node_modules/valibot/dist/index.js +0 -190
  157. package/dist/node_modules/vue-demi/lib/index.js +0 -7
  158. package/dist/services/templateLibraryApi.d.ts +0 -7
  159. package/dist/services/templateLibraryApi.js +0 -87
  160. package/dist/static/styles/components/loader.css.js +0 -10
  161. package/dist/stores/save-as-template.d.ts +0 -73
  162. package/dist/stores/save-as-template.js +0 -48
  163. package/dist/utils/base64.d.ts +0 -1
  164. package/dist/utils/base64.js +0 -7
  165. package/dist/utils/templatePreparation.d.ts +0 -4
  166. package/dist/utils/templatePreparation.js +0 -33
  167. package/dist/utils/tooltipUtils.d.ts +0 -2
  168. package/dist/utils/tooltipUtils.js +0 -11
@@ -10,9 +10,9 @@ var r = function() {
10
10
  n,
11
11
  !1,
12
12
  null,
13
- "421ffc13"
13
+ "6a2bde67"
14
14
  );
15
- const f = _.exports;
15
+ const d = _.exports;
16
16
  export {
17
- f as default
17
+ d as default
18
18
  };
@@ -1,41 +1,23 @@
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({
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({
8
6
  __name: "ViewOptions",
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();
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();
33
15
  return;
34
16
  }
35
- e();
36
- }, InSegments: c };
17
+ o();
18
+ }, InSegments: m };
37
19
  }
38
20
  });
39
21
  export {
40
- h as default
22
+ d as default
41
23
  };
@@ -32,11 +32,11 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
32
32
  closeOnOutsideClick: boolean;
33
33
  footerStatus: boolean;
34
34
  }>>>, {
35
- description: string;
36
35
  size: "small" | "medium" | "large";
37
- closeOnOutsideClick: boolean;
36
+ description: string;
38
37
  footerButtonOptions: FooterButtonGroup;
39
38
  closeButtonStatus: boolean;
39
+ closeOnOutsideClick: boolean;
40
40
  footerStatus: boolean;
41
41
  }>;
42
42
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -1,8 +1,7 @@
1
1
  import type { CompileEmailOptions } from '@@/Types/actions-api';
2
- import { GetCompiledEmailOptions, CompiledEmailResult, TemplateData } from '@@/Types/actions-api';
2
+ import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
3
3
  export declare const useActionsApi: () => {
4
4
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
5
- getTemplateData: () => Promise<TemplateData>;
6
5
  activateCustomViewStyles: (isActive?: boolean) => void;
7
6
  getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
8
7
  };
@@ -1,6 +1,6 @@
1
- import { useToaster as g } from "./useToaster.js";
2
- const A = () => {
3
- const { handleError: l } = g(), n = (t = {}) => new Promise((e, a) => {
1
+ import { useToaster as d } from "./useToaster.js";
2
+ const E = () => {
3
+ const { handleError: m } = d(), s = (t = {}) => new Promise((e, a) => {
4
4
  const i = { ...{
5
5
  minimize: !0,
6
6
  utmEntity: {
@@ -20,60 +20,45 @@ const A = () => {
20
20
  forseAmp: !1,
21
21
  resetDataSavedFlag: !1,
22
22
  disableLineHeightsReplace: !0
23
- }, ...t }, m = {
24
- callback: (s, c, p, u, d) => {
25
- s ? a(s) : e({
26
- html: c,
27
- ampHtml: p,
28
- ampErrors: u,
29
- displayConditions: d
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
30
  });
31
31
  },
32
32
  ...i
33
33
  };
34
- window.StripoEditorApi.actionsApi.compileEmail(m);
34
+ window.StripoEditorApi.actionsApi.compileEmail(n);
35
35
  });
36
- return {
37
- getCompiledEmail: n,
38
- getTemplateData: () => new Promise((t) => {
39
- const e = ({ html: a, css: o, width: i, height: r, utmParams: m, syncModulesIds: s }) => t({
40
- html: a,
41
- css: o,
42
- width: i,
43
- height: r,
44
- utmParams: m,
45
- syncModulesIds: s
46
- });
47
- window.StripoEditorApi.actionsApi.getTemplateData(e);
48
- }),
49
- activateCustomViewStyles: (t = !0) => {
50
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
51
- },
52
- getPreviewData: async (t) => {
53
- try {
54
- const {
55
- html: e,
56
- displayConditions: a,
57
- ampHtml: o = "",
58
- ampErrors: i = []
59
- } = await n({ minimize: !1, resetDataSavedFlag: !1, ...t });
60
- return {
61
- html: e,
62
- ampHtml: o,
63
- ampErrors: i,
64
- displayConditions: a
65
- };
66
- } catch (e) {
67
- return l(e, "Error loading preview"), {
68
- html: "",
69
- ampHtml: "",
70
- ampErrors: [],
71
- displayConditions: []
72
- };
73
- }
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
+ };
74
59
  }
75
- };
60
+ } };
76
61
  };
77
62
  export {
78
- A as useActionsApi
63
+ E as useActionsApi
79
64
  };
@@ -7,16 +7,15 @@ import n from "../static/styles/components/button.css.js";
7
7
  import s from "../static/styles/components/combobox.css.js";
8
8
  import C from "../static/styles/components/counter.css.js";
9
9
  import f from "../static/styles/components/dropdown-menu.css.js";
10
- import a from "../static/styles/components/loader.css.js";
11
- import u from "../static/styles/components/narrow-panel.css.js";
12
- import c from "../static/styles/components/switcher.css.js";
13
- import d from "../static/styles/components/tabs.css.js";
14
- import l from "../static/styles/components/tools.css.js";
15
- import h from "../static/styles/components/version-history.css.js";
16
- import w from "../static/styles/components/wide-panel.css.js";
17
- import y from "../static/styles/variables.css.js";
18
- const B = [
19
- y,
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,
20
19
  // Must be on top
21
20
  S,
22
21
  // Must be on top
@@ -33,13 +32,12 @@ const B = [
33
32
  c,
34
33
  d,
35
34
  l,
36
- h,
37
- w
35
+ h
38
36
  ].join(`
39
37
 
40
- `), R = () => ({ importCss: () => {
38
+ `), N = () => ({ importCss: () => {
41
39
  const o = new CSSStyleSheet();
42
- o.replaceSync(B);
40
+ o.replaceSync(y);
43
41
  const r = document.querySelector("ui-editor");
44
42
  if (!r)
45
43
  return;
@@ -47,5 +45,5 @@ const B = [
47
45
  t && (t.adoptedStyleSheets = [o]);
48
46
  } });
49
47
  export {
50
- R as useCustomInterfaceAppearance
48
+ N as useCustomInterfaceAppearance
51
49
  };
@@ -1,8 +1,8 @@
1
- import type { SavedTemplateDetails } from '@@/Types/stripo';
1
+ import type { Template } from '@@/Types/stripo';
2
2
  import type { InjectionKey } from 'vue';
3
3
  export type BackHandler = () => void;
4
4
  export type SaveStartHandler = () => void;
5
- export type SaveCompleteHandler = (template: Omit<SavedTemplateDetails, 'forceRecreate'>) => void;
5
+ export type SaveCompleteHandler = (template: Omit<Template, 'forceRecreate'>) => void;
6
6
  export declare const BACK_KEY: InjectionKey<BackHandler>;
7
7
  export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
8
8
  export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
@@ -1,17 +1,16 @@
1
1
  import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
2
2
  import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
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) => ({
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) => ({
8
7
  ...o,
9
- priority: o.priority + 1e3 + i
8
+ priority: o.priority + 1e3 + m
10
9
  // Ensure additional rules run after default rules
11
10
  }))
12
- ], m = p(t);
13
- return { compileHtml: (o) => m.compile(o) };
11
+ ], i = p(t);
12
+ return { compileHtml: (o) => i.compile(o) };
14
13
  };
15
14
  export {
16
- R as useHtmlCompiler
15
+ a as useHtmlCompiler
17
16
  };
@@ -1,20 +1,18 @@
1
- import { getCsrfToken as H } from "../utils/genericUtil.js";
2
- import { ref as p, computed as T } from "vue";
3
- const k = (b = {}) => {
4
- const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
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 = {
5
4
  baseURL: "",
6
5
  timeout: 1e4,
7
6
  retry: 0,
8
7
  retryDelay: 1e3,
9
8
  headers: {
10
- "Content-Type": "application/json",
11
- "X-CSRF-TOKEN": H()
9
+ "Content-Type": "application/json"
12
10
  },
13
- ...b
11
+ ...y
14
12
  }, w = (e, s) => {
15
13
  if (e.startsWith("http://") || e.startsWith("https://"))
16
14
  return e;
17
- const t = s || v.baseURL || "";
15
+ const t = s || T.baseURL || "";
18
16
  return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
19
17
  }, P = (e) => new Promise((s, t) => {
20
18
  setTimeout(() => {
@@ -24,20 +22,20 @@ const k = (b = {}) => {
24
22
  setTimeout(s, e);
25
23
  }), i = async (e, s, t, D = {}) => {
26
24
  a.value = null, h.value = !0, u.value = new AbortController();
27
- const n = { ...v, ...D }, L = w(s, n.baseURL), c = {
25
+ const n = { ...T, ...D }, L = w(s, n.baseURL), c = {
28
26
  method: e,
29
27
  headers: { ...n.headers },
30
28
  signal: u.value.signal,
31
29
  ...n
32
30
  };
33
31
  t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
34
- const E = async (m = 0) => {
32
+ const b = async (m = 0) => {
35
33
  try {
36
34
  const o = [fetch(L, c)];
37
35
  n.timeout && o.push(P(n.timeout));
38
36
  const r = await Promise.race(o);
39
37
  if (!r.ok) {
40
- const O = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(O);
38
+ const H = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(H);
41
39
  throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
42
40
  }
43
41
  let f;
@@ -51,36 +49,36 @@ const k = (b = {}) => {
51
49
  } catch (o) {
52
50
  const r = o instanceof Error && o.name === "AbortError";
53
51
  if (m < (n.retry || 0) && !r)
54
- return await x(n.retryDelay || 1e3), E(m + 1);
52
+ return await x(n.retryDelay || 1e3), b(m + 1);
55
53
  throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
56
54
  }
57
55
  };
58
56
  try {
59
- return await E();
57
+ return await b();
60
58
  } finally {
61
59
  h.value = !1, u.value = null;
62
60
  }
63
- }, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
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) => {
64
62
  u.value && u.value.abort(e);
65
63
  }, q = () => {
66
64
  a.value = null;
67
65
  };
68
66
  return {
69
67
  // State
70
- loading: g,
71
- error: T(() => a.value),
72
- hasError: y,
68
+ loading: E,
69
+ error: v(() => a.value),
70
+ hasError: g,
73
71
  // Methods
74
72
  request: i,
75
- get: C,
76
- post: $,
77
- put: R,
78
- patch: U,
79
- delete: A,
73
+ get: $,
74
+ post: C,
75
+ put: U,
76
+ patch: A,
77
+ delete: R,
80
78
  cancel: W,
81
79
  clearError: q
82
80
  };
83
81
  };
84
82
  export {
85
- k as useHttp
83
+ j as useHttp
86
84
  };
@@ -1,4 +1,4 @@
1
1
  export declare const usePartner: () => {
2
2
  getPartnerName: () => string;
3
- getProductType: () => number;
3
+ getProductType: () => string;
4
4
  };
@@ -1,11 +1,16 @@
1
- import { DefaultProductType as e, ProductIds as o } from "../enums/defaults.js";
2
- const c = () => ({
3
- getPartnerName: () => window.location.hostname.split(".")[0] || "",
4
- getProductType: () => {
5
- const t = window.location.pathname.split("/").filter(Boolean)[0] || e;
6
- return o[t] || 0;
7
- }
8
- });
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
+ };
9
14
  export {
10
- c as usePartner
15
+ p as usePartner
11
16
  };
@@ -1,26 +1,26 @@
1
1
  import { useEditorStore as n } from "../stores/editor.js";
2
- import { usePreviewStore as l } from "../stores/preview.js";
3
- import { useActionsApi as m } from "./useActionsApi.js";
4
- import { useCodeEditorApi as p } from "./useCodeEditorApi.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
5
  const E = () => {
6
- const o = n(), e = l(), { closeCodeEditor: a } = p(), { getPreviewData: s } = m(), r = () => {
7
- o.isPreviewModeOpen = !1, e.$reset();
6
+ const i = n(), e = m(), { closeCodeEditor: s } = l(), { getPreviewData: a } = p(), r = () => {
7
+ e.isPreviewModeOpen = !1, e.$reset();
8
8
  };
9
9
  return {
10
10
  closePreviewMode: r,
11
11
  openPreviewMode: () => {
12
- o.isCodeEditorOpen && a(), o.isPreviewModeOpen = !0;
12
+ i.isCodeEditorOpen && s(), e.isPreviewModeOpen = !0;
13
13
  },
14
14
  loadPreviewData: async () => {
15
- if (!(o.loadingStatus || e.isLoaded)) {
16
- o.loadingStatus = !0;
15
+ if (!(e.isLoading || e.isLoaded)) {
16
+ e.isLoading = !0;
17
17
  try {
18
- const { html: t, ampHtml: i, ampErrors: d } = await s();
19
- e.templateHtml = t || "", e.ampHtml = i || "", e.ampErrors = d || [], e.setEmailFormat(i ? "AMP" : "html"), e.isLoaded = !0;
20
- } catch (t) {
21
- console.error("Failed to load preview data:", t), r();
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
22
  } finally {
23
- o.loadingStatus = !1;
23
+ e.isLoading = !1;
24
24
  }
25
25
  }
26
26
  }
@@ -1,14 +1,14 @@
1
1
  import { useActionsApi as g } from "./useActionsApi.js";
2
2
  import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
3
- import { useToaster as S } from "./useToaster.js";
3
+ import { useToaster as y } from "./useToaster.js";
4
4
  import { displayConditions as C } from "../enums/displayConditions.js";
5
- import y from "../extensions/DynamicContent/extension.js";
6
- import { useStripoApi as E } from "../services/stripoApi.js";
7
- import { useEditorStore as h } from "../stores/editor.js";
8
- import { dynamicContentToMergeTags as w } from "../utils/genericUtil.js";
5
+ import E from "../extensions/DynamicContent/extension.js";
6
+ import { useStripoApi as S } from "../services/stripoApi.js";
7
+ import { useEditorStore as w } from "../stores/editor.js";
8
+ import { dynamicContentToMergeTags as b } from "../utils/genericUtil.js";
9
9
  const M = (d) => {
10
- const { handleError: a } = S(), { getToken: c, getCustomFonts: u } = E(), l = (r, i = []) => {
11
- const e = h(), { html: t, css: s, forceRecreate: p } = r;
10
+ const { handleError: c } = y(), { getToken: a, getCustomFonts: u } = S(), l = (e, r = []) => {
11
+ const i = w(), { html: t, css: s, forceRecreate: p } = e;
12
12
  window.UIEditor.initEditor(
13
13
  document.querySelector("#guido-editor"),
14
14
  {
@@ -32,67 +32,63 @@ const M = (d) => {
32
32
  conditionsEnabled: !0,
33
33
  customConditionsEnabled: !0,
34
34
  conditionCategories: C,
35
- enableXSSSecurity: !0,
36
35
  messageSettingsEnabled: !1,
37
36
  editorFonts: {
38
37
  showDefaultStandardFonts: !0,
39
38
  showDefaultNotStandardFonts: !0,
40
- customFonts: i
39
+ customFonts: r
41
40
  },
42
41
  mergeTags: [
43
42
  {
44
- entries: w(d.preselectedDynamicContentList)
43
+ entries: b(d.preselectedDynamicContentList)
45
44
  }
46
45
  ],
47
46
  async onTokenRefreshRequest(o) {
48
47
  try {
49
- const n = await c();
48
+ const n = await a();
50
49
  o(n);
51
50
  } catch (n) {
52
- a(n, "Failed to refresh token");
51
+ c(n, "Failed to refresh token");
53
52
  }
54
53
  },
55
54
  onTemplateLoaded() {
56
55
  try {
57
56
  const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
58
- o(), n(), e.loadingStatus = !1;
57
+ o(), n();
59
58
  } catch (o) {
60
- a(o, "Failed to load custom interface appearance");
59
+ c(o, "Failed to load custom interface appearance");
61
60
  }
62
61
  },
63
62
  onCodeEditorVisibilityChanged(o) {
64
- e.isCodeEditorOpen = o;
63
+ i.isCodeEditorOpen = o;
65
64
  },
66
65
  onEditorVisualModeChanged(o) {
67
- e.editorVisualMode = o.toLowerCase();
66
+ i.editorVisualMode = o.toLowerCase();
68
67
  },
69
68
  onVersionHistoryVisibilityChanged(o) {
70
- e.isVersionHistoryOpen = o;
71
- },
72
- onDataChanged() {
73
- e.hasChanges = !0;
69
+ i.isVersionHistoryOpen = o;
74
70
  },
75
71
  ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
76
- extensions: [y]
72
+ extensions: [E]
77
73
  }
78
74
  );
79
- }, m = (r) => new Promise((i, e) => {
75
+ }, m = (e) => new Promise((r, i) => {
80
76
  if (document.getElementById("UiEditorScript")) {
81
- r(), i();
77
+ e(), r();
82
78
  return;
83
79
  }
84
80
  const t = document.createElement("script");
85
81
  t.id = "UiEditorScript", t.type = "module", t.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t.onload = () => {
86
- r(), i();
82
+ e(), r();
87
83
  }, t.onerror = () => {
88
84
  const s = new Error("Failed to load Stripo UIEditor script");
89
- e(s);
85
+ i(s);
90
86
  }, document.body.appendChild(t);
91
87
  });
92
- return { initPlugin: async (r) => {
88
+ return { initPlugin: async (e) => {
93
89
  await m(async () => {
94
- const i = await u();
95
- l(r, i);
90
+ const r = await u();
91
+ l(e, r);
96
92
  });
97
93
  } };
98
94
  };
@@ -1,4 +1,4 @@
1
- export type ToasterType = 'success' | 'error' | 'info' | 'warning' | 'alert';
1
+ export type ToasterType = 'success' | 'error' | 'info' | 'warning';
2
2
  export type ToasterOptions = {
3
3
  type?: ToasterType;
4
4
  message: string;
@@ -1,32 +1,32 @@
1
- import { ref as n, watch as T } from "vue";
1
+ import { ref as o, watch as T } from "vue";
2
2
  const v = () => {
3
- const t = n(!1), s = n(""), r = n("success"), o = n([]);
3
+ const t = o(!1), s = o(""), c = o("success"), n = o([]);
4
4
  let a = null;
5
5
  function i() {
6
6
  a && (clearTimeout(a), a = null);
7
7
  }
8
8
  function u() {
9
- t.value = !1, o.value = [], s.value = "";
9
+ t.value = !1, n.value = [], s.value = "";
10
10
  }
11
11
  function l(e = { message: "" }) {
12
- u(), s.value = e.message, r.value = e.type || "success", o.value = e.actionButton ? [e.actionButton] : [], t.value = !0;
12
+ u(), s.value = e.message, c.value = e.type || "success", n.value = e.actionButton ? [e.actionButton] : [], t.value = !0;
13
13
  }
14
- function f(e, c) {
14
+ function f(e, r) {
15
15
  const m = e instanceof Error ? e.message : String(e);
16
16
  l({
17
- type: "alert",
18
- message: `${c}: ${m}`
17
+ type: "error",
18
+ message: `${r}: ${m}`
19
19
  });
20
20
  }
21
- return T([t, s], ([e, c]) => {
22
- i(), e && c && (a = setTimeout(() => {
21
+ return T([t, s], ([e, r]) => {
22
+ i(), e && r && (a = setTimeout(() => {
23
23
  u();
24
24
  }, 6e3));
25
25
  }), {
26
26
  isToasterVisible: t,
27
27
  toasterMessage: s,
28
- toasterType: r,
29
- toasterActionButton: o,
28
+ toasterType: c,
29
+ toasterActionButton: n,
30
30
  showToaster: l,
31
31
  hideToaster: u,
32
32
  handleError: f
@@ -1,11 +1,10 @@
1
1
  import memoize from "../node_modules/lodash-es/memoize.js";
2
2
  import { ref } from "vue";
3
- import { useConfig } from "./useConfig.js";
4
3
  const useTranslations = () => {
5
- const { config } = useConfig(), translations = ref(eval(config.translationsPath)), trans = (n, t) => {
4
+ const translations = ref(eval(window.GuidoConfig.translationsPath)), trans = (n, t) => {
6
5
  const r = translations.value[n];
7
6
  return r ? t ? Object.entries(t).reduce(
8
- (e, [o, s]) => e.replace(new RegExp(`{${o}}`, "g"), String(s)),
7
+ (e, [o, i]) => e.replace(new RegExp(`{${o}}`, "g"), String(i)),
9
8
  r
10
9
  ) : r : (console.warn(`Translation key not found: ${n}`), n);
11
10
  };