@useinsider/guido 1.0.0-beta.8861b13 → 1.0.0-beta.8f8745d

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 (233) hide show
  1. package/README.md +398 -33
  2. package/dist/@types/generic.d.ts +12 -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 +21 -3
  49. package/dist/components/Guido.vue.js +8 -8
  50. package/dist/components/Guido.vue2.js +72 -20
  51. package/dist/components/organisms/design-preview/AmpErrorModal.vue.d.ts +16 -0
  52. package/dist/components/organisms/design-preview/AmpErrorModal.vue.js +21 -0
  53. package/dist/components/organisms/design-preview/AmpErrorModal.vue2.js +30 -0
  54. package/dist/components/organisms/design-preview/DesktopPreview.vue.d.ts +16 -0
  55. package/dist/components/organisms/design-preview/DesktopPreview.vue.js +22 -0
  56. package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +29 -0
  57. package/dist/components/organisms/design-preview/EmailPreview.vue.d.ts +16 -0
  58. package/dist/components/organisms/design-preview/EmailPreview.vue.js +17 -0
  59. package/dist/components/organisms/design-preview/EmailPreview.vue2.js +33 -0
  60. package/dist/components/organisms/design-preview/EmailView.vue.d.ts +18 -0
  61. package/dist/components/organisms/design-preview/EmailView.vue.js +19 -0
  62. package/dist/components/organisms/design-preview/EmailView.vue2.js +24 -0
  63. package/dist/components/organisms/design-preview/InboxView.vue.d.ts +17 -0
  64. package/dist/components/organisms/design-preview/InboxView.vue.js +19 -0
  65. package/dist/components/organisms/design-preview/InboxView.vue2.js +23 -0
  66. package/dist/components/organisms/design-preview/MobilePreview.vue.d.ts +17 -0
  67. package/dist/components/organisms/design-preview/MobilePreview.vue.js +17 -0
  68. package/dist/components/organisms/design-preview/MobilePreview.vue2.js +23 -0
  69. package/dist/components/organisms/header/AmpToggle.vue.js +17 -0
  70. package/dist/components/organisms/header/AmpToggle.vue2.js +48 -0
  71. package/dist/components/organisms/{top-bar/Header.vue.js → header/HeaderWrapper.vue.js} +7 -7
  72. package/dist/components/organisms/header/HeaderWrapper.vue2.js +14 -0
  73. package/dist/components/organisms/header/LeftSlot.vue.d.ts +2 -0
  74. package/dist/components/organisms/header/LeftSlot.vue.js +17 -0
  75. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -0
  76. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +2 -0
  77. package/dist/components/organisms/header/MiddleSlot.vue.js +17 -0
  78. package/dist/components/organisms/header/MiddleSlot.vue2.js +25 -0
  79. package/dist/components/organisms/header/RightSlot.vue.d.ts +2 -0
  80. package/dist/components/organisms/header/RightSlot.vue.js +17 -0
  81. package/dist/components/organisms/header/RightSlot.vue2.js +35 -0
  82. package/dist/components/organisms/header/ViewOptions.vue.d.ts +2 -0
  83. package/dist/components/organisms/header/ViewOptions.vue.js +18 -0
  84. package/dist/components/organisms/{top-bar/HeaderViewOptions.vue2.js → header/ViewOptions.vue2.js} +3 -3
  85. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +2 -0
  86. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +19 -0
  87. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +14 -0
  88. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +14 -0
  89. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +22 -0
  90. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +18 -0
  91. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +16 -0
  92. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +18 -0
  93. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +16 -0
  94. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +2 -0
  95. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +18 -0
  96. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +23 -0
  97. package/dist/composables/useActionsApi.d.ts +3 -0
  98. package/dist/composables/useActionsApi.js +47 -34
  99. package/dist/composables/useCustomInterfaceAppearance.js +45 -9
  100. package/dist/composables/useDebounce.d.ts +4 -0
  101. package/dist/composables/useDebounce.js +12 -0
  102. package/dist/composables/useExport.d.ts +1 -1
  103. package/dist/composables/useExport.js +35 -20
  104. package/dist/composables/useGuidoActions.d.ts +46 -0
  105. package/dist/composables/useGuidoActions.js +37 -0
  106. package/dist/composables/useHtmlCompiler.d.ts +4 -0
  107. package/dist/composables/useHtmlCompiler.js +16 -0
  108. package/dist/composables/useHttp.js +84 -0
  109. package/dist/composables/useMobileGmailFit.d.ts +5 -0
  110. package/dist/composables/useMobileGmailFit.js +69 -0
  111. package/dist/composables/usePartner.d.ts +4 -0
  112. package/dist/composables/usePartner.js +16 -0
  113. package/dist/composables/useProvideInject.d.ts +14 -0
  114. package/dist/composables/useProvideInject.js +17 -0
  115. package/dist/composables/useStripo.d.ts +2 -2
  116. package/dist/composables/useStripo.js +66 -56
  117. package/dist/composables/useToaster.d.ts +1 -0
  118. package/dist/composables/useToaster.js +24 -16
  119. package/dist/composables/useVersionHistoryApi.d.ts +8 -0
  120. package/dist/composables/useVersionHistoryApi.js +53 -0
  121. package/dist/config/compiler/htmlCompilerRules.d.ts +2 -0
  122. package/dist/config/compiler/htmlCompilerRules.js +145 -0
  123. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  124. package/dist/enums/defaults.d.ts +2 -0
  125. package/dist/enums/defaults.js +5 -3
  126. package/dist/enums/displayConditions.d.ts +2 -0
  127. package/dist/enums/displayConditions.js +80 -0
  128. package/dist/enums/emailPreview.d.ts +3 -0
  129. package/dist/enums/emailPreview.js +6 -0
  130. package/dist/enums/gmailMobilePreview.d.ts +7 -0
  131. package/dist/enums/gmailMobilePreview.js +17 -0
  132. package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +6 -0
  133. package/dist/extensions/DynamicContent/dynamic-content-modal.js +27 -0
  134. package/dist/extensions/DynamicContent/dynamic-content.css.js +24 -0
  135. package/dist/extensions/DynamicContent/dynamic-content.d.ts +16 -0
  136. package/dist/extensions/DynamicContent/dynamic-content.js +63 -0
  137. package/dist/extensions/DynamicContent/extension.d.ts +2 -0
  138. package/dist/extensions/DynamicContent/extension.js +11 -0
  139. package/dist/guido.css +1 -1
  140. package/dist/inbox-mockup.svg +39 -0
  141. package/dist/mock/api/custom-fonts.d.ts +2 -0
  142. package/dist/mock/api/default-template.d.ts +2 -0
  143. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +51 -0
  144. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +52 -0
  145. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +41 -0
  146. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +18 -0
  147. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +32 -0
  148. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +18 -0
  149. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +8 -0
  150. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +13 -0
  151. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +34 -0
  152. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +13 -0
  153. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +13 -0
  154. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +104 -0
  155. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +13 -0
  156. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +13 -0
  157. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +13 -0
  158. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +13 -0
  159. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +13 -0
  160. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +13 -0
  161. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +45 -0
  162. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +43 -0
  163. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +46 -0
  164. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +44 -0
  165. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +22 -0
  166. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +46 -0
  167. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +46 -0
  168. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +45 -0
  169. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +45 -0
  170. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +45 -0
  171. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +20 -0
  172. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +43 -0
  173. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +45 -0
  174. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +18 -0
  175. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +32 -0
  176. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +46 -0
  177. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +44 -0
  178. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +43 -0
  179. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +43 -0
  180. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +45 -0
  181. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +43 -0
  182. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +266 -0
  183. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +26 -0
  184. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +22 -0
  185. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +18 -0
  186. package/dist/phone-mockup.svg +31 -0
  187. package/dist/services/stripoApi.d.ts +8 -0
  188. package/dist/services/stripoApi.js +49 -0
  189. package/dist/static/styles/base.css.js +11 -0
  190. package/dist/static/styles/components/alert-message.css.js +39 -0
  191. package/dist/static/styles/components/amp-block.css.js +18 -0
  192. package/dist/static/styles/components/base-input.css.js +47 -0
  193. package/dist/static/styles/components/button-group.css.js +54 -0
  194. package/dist/static/styles/components/button.css.js +106 -0
  195. package/dist/static/styles/components/combobox.css.js +49 -0
  196. package/dist/static/styles/components/counter.css.js +42 -0
  197. package/dist/static/styles/components/dropdown-menu.css.js +52 -0
  198. package/dist/static/styles/components/narrow-panel.css.js +38 -0
  199. package/dist/static/styles/components/switcher.css.js +11 -0
  200. package/dist/static/styles/components/tabs.css.js +97 -0
  201. package/dist/static/styles/components/tools.css.js +23 -0
  202. package/dist/static/styles/components/version-history.css.js +30 -0
  203. package/dist/static/styles/components/wide-panel.css.js +135 -0
  204. package/dist/static/styles/variables.css.js +23 -0
  205. package/dist/stores/editor.d.ts +5 -0
  206. package/dist/stores/editor.js +9 -4
  207. package/dist/stores/version-history.d.ts +80 -0
  208. package/dist/stores/version-history.js +28 -0
  209. package/dist/utils/dateUtil.d.ts +1 -0
  210. package/dist/utils/dateUtil.js +16 -0
  211. package/dist/utils/htmlCompiler.d.ts +12 -0
  212. package/dist/utils/htmlCompiler.js +70 -0
  213. package/package.json +6 -5
  214. package/dist/components/organisms/top-bar/Header.vue2.js +0 -14
  215. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.d.ts +0 -2
  216. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.js +0 -17
  217. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue2.js +0 -11
  218. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.d.ts +0 -2
  219. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.js +0 -17
  220. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue2.js +0 -19
  221. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.js +0 -18
  222. package/dist/components/organisms/top-bar/HeaderRightSlot.vue2.js +0 -14
  223. package/dist/components/organisms/top-bar/HeaderViewOptions.vue.d.ts +0 -2
  224. package/dist/components/organisms/top-bar/HeaderViewOptions.vue.js +0 -18
  225. package/dist/composables/useTemplates.d.ts +0 -5
  226. package/dist/composables/useTemplates.js +0 -27
  227. package/dist/node_modules/pinia/dist/pinia.js +0 -314
  228. package/dist/node_modules/pinia/node_modules/vue-demi/lib/index.js +0 -11
  229. package/dist/static/editor.css.js +0 -182
  230. package/dist/static/templates/default/index.html.js +0 -5
  231. package/dist/static/templates/default/style.css.js +0 -119
  232. /package/dist/components/organisms/{top-bar/Header.vue.d.ts → header/AmpToggle.vue.d.ts} +0 -0
  233. /package/dist/components/organisms/{top-bar/HeaderRightSlot.vue.d.ts → header/HeaderWrapper.vue.d.ts} +0 -0
@@ -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,4 @@
1
+ export declare const useDebounce: () => {
2
+ debounce: (fn: () => void, ms?: number) => void;
3
+ clearDebounce: () => void;
4
+ };
@@ -0,0 +1,12 @@
1
+ import { ref as c } from "vue";
2
+ const r = () => {
3
+ const e = c(void 0);
4
+ return { debounce: (o, u = 150) => {
5
+ e.value && window.clearTimeout(e.value), e.value = window.setTimeout(o, u);
6
+ }, clearDebounce: () => {
7
+ e.value && (window.clearTimeout(e.value), e.value = void 0);
8
+ } };
9
+ };
10
+ export {
11
+ r as useDebounce
12
+ };
@@ -1,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,46 @@
1
+ import type { Template } from '@@/Types/stripo';
2
+ import type { InjectionKey } from 'vue';
3
+ export type BackHandler = () => void;
4
+ export type SaveStartHandler = () => void;
5
+ export type SaveCompleteHandler = (template: Omit<Template, 'forceRecreate'>) => void;
6
+ export declare const BACK_KEY: InjectionKey<BackHandler>;
7
+ export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
8
+ export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
9
+ /**
10
+ * Provides Guido action handlers to child components
11
+ */
12
+ export declare const provideGuidoActions: (actions: {
13
+ onBack: BackHandler;
14
+ onSaveStart: SaveStartHandler;
15
+ onSaveComplete: SaveCompleteHandler;
16
+ }) => void;
17
+ /**
18
+ * Provides individual Guido action handlers
19
+ */
20
+ export declare const provideBackHandler: (handler: BackHandler) => void;
21
+ export declare const provideSaveStartHandler: (handler: SaveStartHandler) => void;
22
+ export declare const provideSaveCompleteHandler: (handler: SaveCompleteHandler) => void;
23
+ /**
24
+ * Hook to use the back navigation handler
25
+ * @returns Back navigation function
26
+ */
27
+ export declare const useBack: () => BackHandler;
28
+ /**
29
+ * Hook to use the save start handler
30
+ * @returns Save start function
31
+ */
32
+ export declare const useSaveStart: () => SaveStartHandler;
33
+ /**
34
+ * Hook to use the save complete handler
35
+ * @returns Save complete function
36
+ */
37
+ export declare const useSaveComplete: () => SaveCompleteHandler;
38
+ /**
39
+ * Convenience hook to get all Guido actions
40
+ * @returns Object containing all action handlers
41
+ */
42
+ export declare const useGuidoActions: () => {
43
+ back: BackHandler;
44
+ saveStart: SaveStartHandler;
45
+ saveComplete: SaveCompleteHandler;
46
+ };
@@ -0,0 +1,37 @@
1
+ import { provideValue as o, useInjectedValue as t } from "./useProvideInject.js";
2
+ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symbol.for("guido.save.complete"), s = (e) => {
3
+ o(r, e.onBack), o(n, e.onSaveStart), o(a, e.onSaveComplete);
4
+ }, u = () => {
5
+ try {
6
+ return t(r);
7
+ } catch {
8
+ throw new Error(
9
+ "useBack: No back handler provided. Make sure Guido component is in the component tree."
10
+ );
11
+ }
12
+ }, d = () => {
13
+ try {
14
+ return t(n);
15
+ } catch {
16
+ throw new Error(
17
+ "useSaveStart: No save start handler provided. Make sure Guido component is in the component tree."
18
+ );
19
+ }
20
+ }, i = () => {
21
+ try {
22
+ return t(a);
23
+ } catch {
24
+ throw new Error(
25
+ "useSaveComplete: No save complete handler provided. Make sure Guido component is in the component tree."
26
+ );
27
+ }
28
+ };
29
+ export {
30
+ r as BACK_KEY,
31
+ a as SAVE_COMPLETE_KEY,
32
+ n as SAVE_START_KEY,
33
+ s as provideGuidoActions,
34
+ u as useBack,
35
+ i as useSaveComplete,
36
+ d as useSaveStart
37
+ };
@@ -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
+ };
@@ -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,5 @@
1
+ export declare const useMobileGmailFit: () => {
2
+ setupMobileGmailFit: (iframe: HTMLIFrameElement) => void;
3
+ tearDownMobileGmailFit: (iframe: HTMLIFrameElement) => void;
4
+ hasResponsiveMetaViewport: (doc: Document) => boolean;
5
+ };
@@ -0,0 +1,69 @@
1
+ import { useDebounce as p } from "./useDebounce.js";
2
+ import { META_VIEWPORT_REGEX as h, INLINE_WIDTH_REGEX as w, EMAIL_CONTAINER_SELECTORS as f, DEFAULT_EMAIL_WIDTH as b, MIN_SCALE as v, TABLE_WIDTH_REGEX as A, RESIZE_DEBOUNCE_MS as u } from "../enums/gmailMobilePreview.js";
3
+ let a = null, c = null;
4
+ const { debounce: y } = p(), M = (t) => {
5
+ if (!t)
6
+ return null;
7
+ const e = t.match(A);
8
+ if (!e)
9
+ return null;
10
+ const r = Number(e[1]);
11
+ return Number.isNaN(r) ? null : r;
12
+ }, g = (t) => {
13
+ const e = Array.from(t.querySelectorAll("table[width]")).reduce(
14
+ (n, i) => {
15
+ const o = M(i.getAttribute("width"));
16
+ return o && o > n ? o : n;
17
+ },
18
+ 0
19
+ ), r = Array.from(t.querySelectorAll('[style*="width"]')).reduce(
20
+ (n, i) => {
21
+ const l = (i.getAttribute("style") || "").match(w);
22
+ if (!l)
23
+ return n;
24
+ const m = Number(l[1]);
25
+ return !Number.isNaN(m) && m > n ? m : n;
26
+ },
27
+ 0
28
+ ), s = f.reduce((n, i) => {
29
+ const o = t.querySelector(i);
30
+ if (!o)
31
+ return n;
32
+ const l = Math.max(o.offsetWidth, o.scrollWidth);
33
+ return l > n ? l : n;
34
+ }, 0);
35
+ return Math.max(e, r, s) || b;
36
+ }, N = (t) => {
37
+ t.documentElement.style.setProperty("overflow-x", "visible", "important"), t.body.style.setProperty("visibility", "visible", "important");
38
+ }, S = (t) => {
39
+ t.documentElement.style.removeProperty("transform"), t.documentElement.style.removeProperty("transform-origin"), t.documentElement.style.removeProperty("height"), t.body.style.removeProperty("overflow-x");
40
+ }, d = (t) => {
41
+ const e = t.querySelector('meta[name="viewport"]');
42
+ if (!e)
43
+ return !1;
44
+ const r = e.getAttribute("content") || "";
45
+ return h.test(r);
46
+ }, W = (t, e) => {
47
+ const r = g(t), s = e / r, n = Math.min(Math.max(s, v), 1);
48
+ t.documentElement.style.setProperty("height", "100%", "important"), t.documentElement.style.setProperty("transform", `scale(${n})`, "important"), t.documentElement.style.setProperty("transform-origin", "top left", "important"), t.body.style.setProperty("overflow-x", "hidden", "important");
49
+ }, E = (t) => {
50
+ const e = t.contentWindow;
51
+ c && e && e.removeEventListener("resize", c), a && window.removeEventListener("resize", a), c = null, a = null;
52
+ }, P = () => ({ setupMobileGmailFit: (e) => {
53
+ const r = e.contentDocument, s = e.contentWindow;
54
+ if (!r || !s)
55
+ return;
56
+ N(r);
57
+ const n = () => {
58
+ const i = e.clientWidth || e.getBoundingClientRect().width || 375;
59
+ if (d(r)) {
60
+ S(r);
61
+ return;
62
+ }
63
+ W(r, i);
64
+ };
65
+ n(), E(e), c = () => y(n, u), s.addEventListener("resize", c), a = () => y(n, u), window.addEventListener("resize", a);
66
+ }, tearDownMobileGmailFit: E, hasResponsiveMetaViewport: d });
67
+ export {
68
+ P as useMobileGmailFit
69
+ };
@@ -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,14 @@
1
+ import { type InjectionKey } from 'vue';
2
+ /**
3
+ * Provides a value using Vue's provide/inject system
4
+ * @param key - The injection key
5
+ * @param value - The value to provide
6
+ */
7
+ export declare const provideValue: <T>(key: InjectionKey<T>, value: T) => void;
8
+ /**
9
+ * Injects a value using Vue's provide/inject system
10
+ * @param key - The injection key
11
+ * @param defaultValue - Optional default value if injection fails
12
+ * @returns The injected value
13
+ */
14
+ export declare const useInjectedValue: <T>(key: InjectionKey<T>, defaultValue?: T) => T;
@@ -0,0 +1,17 @@
1
+ import { provide as t, inject as i } from "vue";
2
+ const d = (e, o) => {
3
+ t(e, o);
4
+ }, s = (e, o) => {
5
+ const r = i(e, o);
6
+ if (r === void 0 && o === void 0) {
7
+ const n = e.description || String(e);
8
+ throw new Error(
9
+ `useInjectedValue: No provider found for key "${n}". Make sure a parent component provides this value.`
10
+ );
11
+ }
12
+ return r;
13
+ };
14
+ export {
15
+ d as provideValue,
16
+ s as useInjectedValue
17
+ };
@@ -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
  };
@@ -1,81 +1,91 @@
1
- import { useCustomInterfaceAppearance as u } from "./useCustomInterfaceAppearance.js";
2
- import { useEditorStore as l } from "../stores/editor.js";
3
- const g = (s) => {
4
- const c = () => {
5
- const t = new Headers();
6
- t.append("Content-Type", "application/json");
7
- const r = JSON.stringify({
8
- pluginId: void 0,
9
- secretKey: void 0,
10
- role: void 0,
11
- userId: s
12
- });
13
- return fetch("/v2/stripo/get-token", {
14
- method: "POST",
15
- headers: t,
16
- body: r,
17
- redirect: "follow"
18
- }).then((o) => o.json());
19
- }, d = (t) => {
20
- const r = l(), n = t.html, o = t.css;
1
+ import { useActionsApi as g } from "./useActionsApi.js";
2
+ import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
3
+ import { useToaster as E } from "./useToaster.js";
4
+ import { displayConditions as S } from "../enums/displayConditions.js";
5
+ import y from "../extensions/DynamicContent/extension.js";
6
+ import { useStripoApi as C } from "../services/stripoApi.js";
7
+ import { useEditorStore as w } from "../stores/editor.js";
8
+ const A = (a) => {
9
+ const { handleError: d } = E(), { getToken: c, getCustomFonts: u } = C(), l = (e, r = []) => {
10
+ const i = w(), { html: t, css: s, forceRecreate: m } = e;
21
11
  window.UIEditor.initEditor(
22
12
  document.querySelector("#guido-editor"),
23
13
  {
24
- metadata: {
25
- emailId: s,
26
- userId: "1",
27
- username: "Plugin Demo User"
28
- },
29
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
30
- html: n,
31
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
32
- css: o,
14
+ metadata: a,
15
+ html: t,
16
+ css: s,
17
+ forceRecreate: m,
33
18
  locale: "en",
34
19
  undoButtonSelector: "#guido__undo-button",
35
20
  redoButtonSelector: "#guido__redo-button",
36
21
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
37
22
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
38
- versionHistoryButtonSelector: "#guido__history-button",
39
23
  codeEditorButtonSelector: "#guido__code-button",
40
- async onTokenRefreshRequest(e) {
24
+ customAppearanceMergetags: !0,
25
+ customAppearanceMergetagsBorderColor: "#f1f3fe",
26
+ customAppearanceMergetagsBackgroundColor: "#f1f3fe",
27
+ customViewStyles: `
28
+ .esd-x, .esd-merge-tag {color: #0a2ecc !important; box-shadow: none !important;}
29
+ .esd-merge-tag {border: 1px solid #b5c1f1; border-radius: 4px !important;}
30
+ `,
31
+ conditionsEnabled: !0,
32
+ customConditionsEnabled: !0,
33
+ conditionCategories: S,
34
+ messageSettingsEnabled: !1,
35
+ editorFonts: {
36
+ showDefaultStandardFonts: !0,
37
+ showDefaultNotStandardFonts: !0,
38
+ customFonts: r
39
+ },
40
+ async onTokenRefreshRequest(o) {
41
41
  try {
42
- const i = await c();
43
- e(i.token);
44
- } catch (i) {
45
- console.error("Failed to refresh token:", i);
42
+ const n = await c();
43
+ o(n);
44
+ } catch (n) {
45
+ d(n, "Failed to refresh token");
46
46
  }
47
47
  },
48
48
  onTemplateLoaded() {
49
49
  try {
50
- const { importCss: e } = u();
51
- e();
52
- } catch (e) {
53
- console.error("Failed to load custom interface appearance:", e);
50
+ const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
51
+ o(), n();
52
+ } catch (o) {
53
+ d(o, "Failed to load custom interface appearance");
54
54
  }
55
55
  },
56
- onCodeEditorVisibilityChanged(e) {
57
- r.isCodeEditorOpen = e;
56
+ onCodeEditorVisibilityChanged(o) {
57
+ i.isCodeEditorOpen = o;
58
58
  },
59
- onEditorVisualModeChanged(e) {
60
- r.editorVisualMode = e.toLowerCase();
61
- }
59
+ onEditorVisualModeChanged(o) {
60
+ i.editorVisualMode = o.toLowerCase();
61
+ },
62
+ onVersionHistoryVisibilityChanged(o) {
63
+ i.isVersionHistoryOpen = o;
64
+ },
65
+ ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
66
+ extensions: [y]
62
67
  }
63
68
  );
64
- };
65
- return { initPlugin: (t) => new Promise((r, n) => {
69
+ }, p = (e) => new Promise((r, i) => {
66
70
  if (document.getElementById("UiEditorScript")) {
67
- d(t), r();
71
+ e(), r();
68
72
  return;
69
73
  }
70
- const o = document.createElement("script");
71
- o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
72
- d(t), r();
73
- }, o.onerror = () => {
74
- const e = new Error("Failed to load Stripo UIEditor script");
75
- n(e);
76
- }, document.body.appendChild(o);
77
- }) };
74
+ const t = document.createElement("script");
75
+ t.id = "UiEditorScript", t.type = "module", t.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t.onload = () => {
76
+ e(), r();
77
+ }, t.onerror = () => {
78
+ const s = new Error("Failed to load Stripo UIEditor script");
79
+ i(s);
80
+ }, document.body.appendChild(t);
81
+ });
82
+ return { initPlugin: async (e) => {
83
+ await p(async () => {
84
+ const r = await u();
85
+ l(e, r);
86
+ });
87
+ } };
78
88
  };
79
89
  export {
80
- g as useStripo
90
+ A as useStripo
81
91
  };
@@ -17,4 +17,5 @@ export declare const useToaster: () => {
17
17
  } | undefined)[]>;
18
18
  showToaster: (options?: ToasterOptions) => void;
19
19
  hideToaster: () => void;
20
+ handleError: (error: unknown, context: string) => void;
20
21
  };