@useinsider/guido 1.0.0-beta.7f477db → 1.0.0-beta.80693fc

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 (147) hide show
  1. package/README.md +259 -11
  2. package/dist/@types/generic.d.ts +14 -0
  3. package/dist/App.vue.d.ts +1 -1
  4. package/dist/_virtual/AddCustomFont.js +4 -0
  5. package/dist/_virtual/AiAssistantValueType.js +4 -0
  6. package/dist/_virtual/BackgroundColorBuiltInControl.js +4 -0
  7. package/dist/_virtual/BackgroundImageBuiltInControl.js +4 -0
  8. package/dist/_virtual/Block.js +4 -0
  9. package/dist/_virtual/BlockAttributes.js +4 -0
  10. package/dist/_virtual/BlockCompositionType.js +4 -0
  11. package/dist/_virtual/BlockPaddingsBuiltInControl.js +4 -0
  12. package/dist/_virtual/BlockRenderer.js +4 -0
  13. package/dist/_virtual/BlockType.js +4 -0
  14. package/dist/_virtual/BlocksPanel.js +4 -0
  15. package/dist/_virtual/BuiltInControl.js +4 -0
  16. package/dist/_virtual/BuiltInControlTypes.js +4 -0
  17. package/dist/_virtual/ButtonBorderBuiltInControl.js +4 -0
  18. package/dist/_virtual/ButtonColorBuiltInControl.js +4 -0
  19. package/dist/_virtual/ButtonFontColorBuiltInControl.js +4 -0
  20. package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +4 -0
  21. package/dist/_virtual/ButtonTextBuiltInControl.js +4 -0
  22. package/dist/_virtual/ContextAction.js +4 -0
  23. package/dist/_virtual/ContextActionType.js +4 -0
  24. package/dist/_virtual/Control.js +4 -0
  25. package/dist/_virtual/EditorStatePropertyType.js +4 -0
  26. package/dist/_virtual/Extension.js +4 -0
  27. package/dist/_virtual/ExtensionBuilder.js +4 -0
  28. package/dist/_virtual/FontFamilyBuiltInControl.js +4 -0
  29. package/dist/_virtual/LinkColorBuiltInControl.js +4 -0
  30. package/dist/_virtual/ModificationDescription.js +4 -0
  31. package/dist/_virtual/PanelPosition.js +4 -0
  32. package/dist/_virtual/PreviewDeviceMode.js +4 -0
  33. package/dist/_virtual/SettingsPanelRegistry.js +4 -0
  34. package/dist/_virtual/SettingsPanelTab.js +4 -0
  35. package/dist/_virtual/SettingsTab.js +4 -0
  36. package/dist/_virtual/StructureBorderBuiltInControl.js +4 -0
  37. package/dist/_virtual/StructurePaddingsBuiltInControl.js +4 -0
  38. package/dist/_virtual/TextColorBuiltInControl.js +4 -0
  39. package/dist/_virtual/TextLineSpacingBuiltInControl.js +4 -0
  40. package/dist/_virtual/TextSizeBuiltInControl.js +4 -0
  41. package/dist/_virtual/TextStyleBuiltInControl.js +4 -0
  42. package/dist/_virtual/UIElement.js +4 -0
  43. package/dist/_virtual/UIElementTagRegistry.js +4 -0
  44. package/dist/_virtual/UIElementType.js +4 -0
  45. package/dist/_virtual/UIElementsAttributes.js +4 -0
  46. package/dist/_virtual/index.js +5 -0
  47. package/dist/_virtual/index2.js +4 -0
  48. package/dist/components/Guido.vue.d.ts +9 -2
  49. package/dist/components/Guido.vue.js +8 -8
  50. package/dist/components/Guido.vue2.js +38 -27
  51. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  52. package/dist/components/organisms/header/MiddleSlot.vue2.js +19 -17
  53. package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -1
  54. package/dist/components/organisms/header/RightSlot.vue.js +7 -7
  55. package/dist/components/organisms/header/RightSlot.vue2.js +17 -15
  56. package/dist/components/organisms/header/ViewOptions.vue.d.ts +1 -1
  57. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +1 -1
  58. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +1 -1
  59. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +1 -1
  60. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +1 -1
  61. package/dist/composables/useActionsApi.d.ts +2 -2
  62. package/dist/composables/useActionsApi.js +36 -43
  63. package/dist/composables/useExport.d.ts +1 -1
  64. package/dist/composables/useExport.js +35 -20
  65. package/dist/composables/useHtmlCompiler.d.ts +4 -0
  66. package/dist/composables/useHtmlCompiler.js +16 -0
  67. package/dist/composables/useHttp.js +21 -23
  68. package/dist/composables/useStripo.js +39 -28
  69. package/dist/config/compiler/htmlCompilerRules.d.ts +2 -0
  70. package/dist/config/compiler/htmlCompilerRules.js +145 -0
  71. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  72. package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +6 -0
  73. package/dist/extensions/DynamicContent/dynamic-content-modal.js +27 -0
  74. package/dist/extensions/DynamicContent/dynamic-content.css.js +24 -0
  75. package/dist/extensions/DynamicContent/dynamic-content.d.ts +16 -0
  76. package/dist/extensions/DynamicContent/dynamic-content.js +63 -0
  77. package/dist/extensions/DynamicContent/extension.d.ts +2 -0
  78. package/dist/extensions/DynamicContent/extension.js +11 -0
  79. package/dist/guido.css +1 -1
  80. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +51 -0
  81. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +52 -0
  82. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +41 -0
  83. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +18 -0
  84. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +32 -0
  85. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +18 -0
  86. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +8 -0
  87. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +13 -0
  88. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +34 -0
  89. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +13 -0
  90. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +13 -0
  91. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +104 -0
  92. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +13 -0
  93. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +13 -0
  94. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +13 -0
  95. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +13 -0
  96. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +13 -0
  97. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +13 -0
  98. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +45 -0
  99. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +43 -0
  100. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +46 -0
  101. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +44 -0
  102. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +22 -0
  103. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +46 -0
  104. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +46 -0
  105. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +45 -0
  106. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +45 -0
  107. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +45 -0
  108. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +20 -0
  109. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +43 -0
  110. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +45 -0
  111. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +18 -0
  112. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +32 -0
  113. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +46 -0
  114. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +44 -0
  115. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +43 -0
  116. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +43 -0
  117. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +45 -0
  118. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +43 -0
  119. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +266 -0
  120. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +26 -0
  121. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +22 -0
  122. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +18 -0
  123. package/dist/stores/editor.d.ts +1 -1
  124. package/dist/stores/editor.js +4 -4
  125. package/dist/utils/htmlCompiler.d.ts +12 -0
  126. package/dist/utils/htmlCompiler.js +70 -0
  127. package/dist/utils/tooltipUtils.d.ts +2 -0
  128. package/dist/utils/tooltipUtils.js +9 -0
  129. package/package.json +4 -1
  130. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -16
  131. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -20
  132. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -78
  133. package/dist/components/wrappers/ModalWrapper.vue.d.ts +0 -72
  134. package/dist/components/wrappers/ModalWrapper.vue.js +0 -19
  135. package/dist/components/wrappers/ModalWrapper.vue2.js +0 -43
  136. package/dist/composables/useSaveAsTemplate.d.ts +0 -7
  137. package/dist/composables/useSaveAsTemplate.js +0 -51
  138. package/dist/composables/useTemplateNameValidation.d.ts +0 -7
  139. package/dist/composables/useTemplateNameValidation.js +0 -33
  140. package/dist/mock/api/template-library.d.ts +0 -2
  141. package/dist/stores/template-categories.d.ts +0 -41
  142. package/dist/stores/template-categories.js +0 -91
  143. package/dist/utils/base64.d.ts +0 -2
  144. package/dist/utils/base64.js +0 -14
  145. package/dist/utils/generic.d.ts +0 -1
  146. package/dist/utils/generic.js +0 -7
  147. package/dist/utils/textUtil.d.ts +0 -2
@@ -1,12 +1,10 @@
1
- import { defineComponent as g, onMounted as T } from "vue";
2
- import { usePartner as S } from "../composables/usePartner.js";
3
- import { useStripo as C } from "../composables/useStripo.js";
4
- import { useTemplates as _ } from "../composables/useTemplates.js";
5
- import { DefaultUsername as y, DefaultGuidoConfig as w } from "../enums/defaults.js";
6
- import I from "./organisms/header/HeaderWrapper.vue.js";
7
- import M from "./organisms/save-template/SaveTemplateModal.vue.js";
8
- import { useEditorStore as P } from "../stores/editor.js";
9
- const F = /* @__PURE__ */ g({
1
+ import { defineComponent as v, onMounted as w } from "vue";
2
+ import { usePartner as h } from "../composables/usePartner.js";
3
+ import { useStripo as D } from "../composables/useStripo.js";
4
+ import { useTemplates as E } from "../composables/useTemplates.js";
5
+ import { DefaultUsername as _, DefaultGuidoConfig as b } from "../enums/defaults.js";
6
+ import T from "./organisms/header/HeaderWrapper.vue.js";
7
+ const W = /* @__PURE__ */ v({
10
8
  __name: "Guido",
11
9
  props: {
12
10
  emailId: null,
@@ -16,32 +14,45 @@ const F = /* @__PURE__ */ g({
16
14
  username: null,
17
15
  guidoConfig: null
18
16
  },
19
- setup(f) {
20
- const o = f, { getPartnerName: t, getProductType: r } = S(), {
21
- emailId: a,
22
- userId: n,
23
- guidoConfig: i,
24
- partnerName: l = t(),
25
- productType: m = r(),
26
- username: p = y
27
- } = o;
17
+ emits: ["dynamic-content:open"],
18
+ setup(g, { expose: C, emit: n }) {
19
+ const t = g, { getPartnerName: o, getProductType: c } = h(), {
20
+ emailId: i,
21
+ userId: a,
22
+ guidoConfig: r,
23
+ partnerName: s = o(),
24
+ productType: d = c(),
25
+ username: u = _
26
+ } = t;
28
27
  window.GuidoConfig = {
29
- ...w,
30
- ...i
28
+ ...b,
29
+ ...r
31
30
  };
32
- const { initPlugin: u } = C({ emailId: a, userId: n, username: p, partnerName: l, productType: m }), { getDefaultTemplate: s } = _(), d = P(), c = () => {
33
- d.isSaveTemplateModalOpen = !1;
31
+ const { initPlugin: m } = D({ emailId: i, userId: a, username: u, partnerName: s, productType: d }), { getDefaultTemplate: l } = E(), p = (e) => {
32
+ console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
33
+ }, y = () => {
34
+ console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
34
35
  };
35
- return T(async () => {
36
+ return w(async () => {
37
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
36
38
  try {
37
- const e = await s();
38
- await u(e);
39
+ const e = await l();
40
+ await m(e);
39
41
  } catch (e) {
40
42
  console.error("Failed to initialize Stripo editor:", e);
41
43
  }
42
- }), { __sfc: !0, props: o, getPartnerName: t, getProductType: r, emailId: a, userId: n, guidoConfig: i, partnerName: l, productType: m, username: p, initPlugin: u, getDefaultTemplate: s, editorStore: d, handleCloseSaveTemplateModal: c, HeaderWrapper: I, SaveTemplateModal: M };
44
+ document.addEventListener("dynamic-content:open", (e) => {
45
+ const f = e;
46
+ console.debug("dynamic-content:open", f.detail), n("dynamic-content:open", f.detail);
47
+ });
48
+ }), C({
49
+ dynamicContent: {
50
+ insert: p,
51
+ close: y
52
+ }
53
+ }), { __sfc: !0, props: t, getPartnerName: o, getProductType: c, emailId: i, userId: a, guidoConfig: r, partnerName: s, productType: d, username: u, emit: n, initPlugin: m, getDefaultTemplate: l, insertDynamicContent: p, closeDynamicContent: y, HeaderWrapper: T };
43
54
  }
44
55
  });
45
56
  export {
46
- F as default
57
+ W as default
47
58
  };
@@ -1,17 +1,17 @@
1
- import s from "./MiddleSlot.vue2.js";
2
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
1
+ import i from "./MiddleSlot.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
4
  var e = this, o = e._self._c, t = e._self._setupProxy;
5
- return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.trans("newsletter.email-preview") } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
6
- }, l = [], r = /* @__PURE__ */ i(
7
- s,
5
+ return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__undo-button"), "tooltip-text": t.trans("action-builder.undo") } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__redo-button"), "tooltip-text": t.trans("action-builder.redo") } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button"), "tooltip-text": t.codeEditorTooltipText } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreview } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
6
+ }, l = [], r = /* @__PURE__ */ s(
7
+ i,
8
8
  n,
9
9
  l,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const p = r.exports;
14
+ const u = r.exports;
15
15
  export {
16
- p as default
16
+ u as default
17
17
  };
@@ -1,22 +1,24 @@
1
- import { defineComponent as r } from "vue";
2
- import { useTranslations as s } from "../../../composables/useTranslations.js";
3
- import { useEditorStore as n } from "../../../stores/editor.js";
4
- import { InButtonV2 as e } from "@useinsider/design-system-vue";
5
- import m from "./version-history/VersionHistory.vue.js";
6
- import p from "./version-history/ViewOptions.vue.js";
7
- import f from "./ViewOptions.vue.js";
8
- const y = /* @__PURE__ */ r({
1
+ import { defineComponent as s, computed as t } from "vue";
2
+ import { useTranslations as n } from "../../../composables/useTranslations.js";
3
+ import { useEditorStore as p } from "../../../stores/editor.js";
4
+ import { InButtonV2 as m } from "@useinsider/design-system-vue";
5
+ import { getTooltipOptions as l } from "../../../utils/tooltipUtils.js";
6
+ import d from "./version-history/VersionHistory.vue.js";
7
+ import w from "./version-history/ViewOptions.vue.js";
8
+ import c from "./ViewOptions.vue.js";
9
+ const M = /* @__PURE__ */ s({
9
10
  __name: "MiddleSlot",
10
- setup(a) {
11
- const o = n(), t = s();
12
- return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
- id: `${i}-tooltip`,
14
- dynamicPosition: !1,
15
- staticPosition: "bottom center",
16
- iconStatus: !1
17
- }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
11
+ setup(f) {
12
+ const e = p(), o = n(), r = t(
13
+ () => e.isCodeEditorOpen ? o("newsletter.close-html-editor") : o("newsletter.html-editor")
14
+ ), i = t(
15
+ () => e.isPreviewModeOpen ? o("newsletter.close-email-preview") : o("newsletter.email-preview")
16
+ );
17
+ return { __sfc: !0, editorStore: e, trans: o, codeEditorTooltipText: r, previewTooltipText: i, handlePreview: () => {
18
+ e.isPreviewModeOpen = !e.isPreviewModeOpen;
19
+ }, InButtonV2: m, getTooltipOptions: l, VersionHistory: d, VersionHistoryViewOptions: w, ViewOptions: c };
18
20
  }
19
21
  });
20
22
  export {
21
- y as default
23
+ M as default
22
24
  };
@@ -1,2 +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<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -1,17 +1,17 @@
1
- import o from "./RightSlot.vue2.js";
1
+ import s from "./RightSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var s = this, e = s._self._c, t = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.handleSaveAsTemplate } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
6
- }, r = [], a = /* @__PURE__ */ i(
7
- o,
4
+ var e = this, o = e._self._c, t = e._self._setupProxy;
5
+ return o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }), o(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.exportHtml } }), o(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") } }), o(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), o(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
6
+ }, r = [], l = /* @__PURE__ */ i(
7
+ s,
8
8
  n,
9
9
  r,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const c = a.exports;
14
+ const d = l.exports;
15
15
  export {
16
- c as default
16
+ d as default
17
17
  };
@@ -1,23 +1,25 @@
1
- import { defineComponent as s } from "vue";
2
- import { useExport as n } from "../../../composables/useExport.js";
3
- import { useVersionHistoryApi as i } from "../../../composables/useVersionHistoryApi.js";
4
- import { useEditorStore as p } from "../../../stores/editor.js";
5
- import { InButtonV2 as m } from "@useinsider/design-system-vue";
6
- const H = /* @__PURE__ */ s({
1
+ import { defineComponent as p, computed as m } from "vue";
2
+ import { useTranslations as c } from "../../../composables/useTranslations.js";
3
+ import { useExport as f } from "../../../composables/useExport.js";
4
+ import { useVersionHistoryApi as l } from "../../../composables/useVersionHistoryApi.js";
5
+ import { useEditorStore as u } from "../../../stores/editor.js";
6
+ import { InButtonV2 as y } from "@useinsider/design-system-vue";
7
+ import { getTooltipOptions as a } from "../../../utils/tooltipUtils.js";
8
+ const O = /* @__PURE__ */ p({
7
9
  __name: "RightSlot",
8
- setup(a) {
9
- const { exportHtml: r } = n(), { openVersionHistory: e, closeVersionHistory: t } = i(), o = p();
10
- return { __sfc: !0, exportHtml: r, openVersionHistory: e, closeVersionHistory: t, editorStore: o, handleVersionHistory: () => {
10
+ setup(H) {
11
+ const { exportHtml: e } = f(), { openVersionHistory: r, closeVersionHistory: s } = l(), o = u(), t = c(), i = () => {
11
12
  if (o.isVersionHistoryOpen) {
12
- t();
13
+ s();
13
14
  return;
14
15
  }
15
- e();
16
- }, handleSaveAsTemplate: async () => {
17
- o.isSaveTemplateModalOpen = !0;
18
- }, InButtonV2: m };
16
+ r();
17
+ }, n = m(
18
+ () => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")
19
+ );
20
+ return { __sfc: !0, exportHtml: e, openVersionHistory: r, closeVersionHistory: s, editorStore: o, trans: t, handleVersionHistory: i, versionHistoryTooltipText: n, InButtonV2: y, getTooltipOptions: a };
19
21
  }
20
22
  });
21
23
  export {
22
- H as default
24
+ O as default
23
25
  };
@@ -1,2 +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<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -1,2 +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<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -3,7 +3,7 @@ type __VLS_Props = {
3
3
  date: number;
4
4
  textAlign: string;
5
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>>>, {}>;
6
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
7
7
  export default _default;
8
8
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
9
  type __VLS_TypePropsToOption<T> = {
@@ -10,7 +10,7 @@ var i = function() {
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "0e2ff42d"
13
+ "ee4b9c3f"
14
14
  );
15
15
  const d = n.exports;
16
16
  export {
@@ -1,2 +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<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -1,5 +1,5 @@
1
- import { GetCompiledEmailOptions, CompiledEmailResult, TemplateDataResult } from '@@/Types/actions-api';
1
+ import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
2
2
  export declare const useActionsApi: () => {
3
3
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
4
- getRawTemplateData: () => Promise<TemplateDataResult>;
4
+ activateCustomViewStyles: (isActive?: boolean) => void;
5
5
  };
@@ -1,45 +1,38 @@
1
- const d = () => ({
2
- getCompiledEmail: (t = {}) => new Promise((e, i) => {
3
- const m = {
4
- ...{ ...{
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 },
24
- callback: (a, o, n, s, l) => {
25
- a ? i(a) : e({
26
- html: o,
27
- ampHtml: n,
28
- ampErrors: s,
29
- displayConditions: l
30
- });
31
- }
32
- };
33
- window.StripoEditorApi.actionsApi.compileEmail(m);
34
- }),
35
- getRawTemplateData: () => new Promise((t) => {
36
- window.StripoEditorApi.actionsApi.getTemplateData(
37
- (e) => {
38
- t(e);
39
- }
40
- );
41
- })
42
- });
1
+ const g = () => ({ getCompiledEmail: (t = {}) => new Promise((i, a) => {
2
+ const s = { ...{
3
+ minimize: !0,
4
+ utmEntity: {
5
+ utmSource: "",
6
+ utmMedium: "",
7
+ utmCampaign: "",
8
+ utmContent: "",
9
+ utmTerm: "",
10
+ customUtms: [
11
+ {
12
+ name1: "val1",
13
+ name2: "val2"
14
+ }
15
+ ]
16
+ },
17
+ mergeTags: ["Tag1", "Tag2"],
18
+ forseAmp: !1,
19
+ resetDataSavedFlag: !1,
20
+ disableLineHeightsReplace: !0
21
+ }, ...t }, o = {
22
+ callback: (e, m, l, n, c) => {
23
+ e ? a(e) : i({
24
+ html: m,
25
+ ampHtml: l,
26
+ ampErrors: n,
27
+ displayConditions: c
28
+ });
29
+ },
30
+ ...s
31
+ };
32
+ window.StripoEditorApi.actionsApi.compileEmail(o);
33
+ }), activateCustomViewStyles: (t = !0) => {
34
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
35
+ } });
43
36
  export {
44
- d as useActionsApi
37
+ g as useActionsApi
45
38
  };
@@ -1,3 +1,3 @@
1
1
  export declare const useExport: () => {
2
- exportHtml: () => Promise<void>;
2
+ exportHtml: (compile?: boolean) => Promise<void>;
3
3
  };
@@ -1,30 +1,45 @@
1
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`;
2
+ import { useHtmlCompiler as m } from "./useHtmlCompiler.js";
3
+ import { useToaster as d } from "./useToaster.js";
4
+ const h = () => {
5
+ const a = (s, o, r) => {
6
+ const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
7
+ e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
8
+ }, c = (s) => {
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
+ return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
10
11
  };
11
- return { exportHtml: async () => {
12
- const { getCompiledEmail: r } = l(), { showToaster: t } = m();
12
+ return { exportHtml: async (s = !0) => {
13
+ const { getCompiledEmail: o } = l(), { showToaster: r } = d(), { compileHtml: i } = m();
13
14
  try {
14
- const { html: e } = await r();
15
- e ? a(e, c("HTML"), "text/html") : t({
15
+ const { html: t } = await o();
16
+ if (t) {
17
+ let e = t;
18
+ if (s) {
19
+ const n = i(t);
20
+ e = n.compiledHtml, console.debug("HTML Compilation Stats:", {
21
+ originalSize: n.stats.originalSize,
22
+ compiledSize: n.stats.compiledSize,
23
+ reduction: `${n.stats.reductionPercentage.toFixed(2)}%`,
24
+ appliedRules: n.appliedRules,
25
+ executionTime: `${n.stats.executionTime.toFixed(2)}ms`
26
+ });
27
+ }
28
+ a(e, c("HTML"), "text/html");
29
+ } else
30
+ r({
31
+ type: "error",
32
+ message: "No HTML content to download"
33
+ });
34
+ } catch (t) {
35
+ const e = t instanceof Error ? t.message : String(t);
36
+ r({
16
37
  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}`
38
+ message: `Error compiling email: ${e}`
24
39
  });
25
40
  }
26
41
  } };
27
42
  };
28
43
  export {
29
- u as useExport
44
+ h as useExport
30
45
  };
@@ -0,0 +1,4 @@
1
+ import type { CompilationResult } from '@@/Types/html-compiler';
2
+ export declare const useHtmlCompiler: () => {
3
+ compileHtml: (html: string) => CompilationResult;
4
+ };
@@ -0,0 +1,16 @@
1
+ import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
2
+ import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
3
+ const a = () => {
4
+ const e = typeof window < "u" ? window.GuidoConfig : void 0, l = (e == null ? void 0 : e.htmlCompilerRules) || [], t = [
5
+ ...!!(e != null && e.ignoreDefaultHtmlCompilerRules) ? [] : r,
6
+ ...l.map((o, m) => ({
7
+ ...o,
8
+ priority: o.priority + 1e3 + m
9
+ // Ensure additional rules run after default rules
10
+ }))
11
+ ], i = p(t);
12
+ return { compileHtml: (o) => i.compile(o) };
13
+ };
14
+ export {
15
+ a as useHtmlCompiler
16
+ };
@@ -1,20 +1,18 @@
1
- import { ref as p, computed as T } from "vue";
2
- import { getCsrfToken as H } from "../utils/generic.js";
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
  };