@useinsider/guido 1.0.0-beta.ef5e504 → 1.0.0-beta.f2786f4

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 (231) hide show
  1. package/README.md +30 -294
  2. package/dist/@types/generic.d.ts +0 -12
  3. package/dist/App.vue.d.ts +1 -1
  4. package/dist/components/Guido.vue.d.ts +3 -17
  5. package/dist/components/Guido.vue.js +8 -8
  6. package/dist/components/Guido.vue2.js +20 -57
  7. package/dist/components/organisms/{header/HeaderWrapper.vue.js → top-bar/Header.vue.js} +7 -7
  8. package/dist/components/organisms/top-bar/Header.vue2.js +14 -0
  9. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.d.ts +2 -0
  10. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.js +17 -0
  11. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue2.js +11 -0
  12. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.d.ts +2 -0
  13. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.js +17 -0
  14. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue2.js +19 -0
  15. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.js +18 -0
  16. package/dist/components/organisms/top-bar/HeaderRightSlot.vue2.js +12 -0
  17. package/dist/components/organisms/top-bar/HeaderViewOptions.vue.d.ts +2 -0
  18. package/dist/components/organisms/top-bar/HeaderViewOptions.vue.js +18 -0
  19. package/dist/components/organisms/{header/ViewOptions.vue2.js → top-bar/HeaderViewOptions.vue2.js} +3 -3
  20. package/dist/composables/useCustomInterfaceAppearance.js +9 -45
  21. package/dist/composables/useStripo.d.ts +2 -2
  22. package/dist/composables/useStripo.js +56 -66
  23. package/dist/composables/useTemplates.d.ts +5 -0
  24. package/dist/composables/useTemplates.js +27 -0
  25. package/dist/composables/useToaster.d.ts +0 -1
  26. package/dist/composables/useTranslations.d.ts +3 -1
  27. package/dist/composables/useTranslations.js +7 -5
  28. package/dist/enums/defaults.d.ts +0 -2
  29. package/dist/enums/defaults.js +3 -5
  30. package/dist/guido.css +1 -1
  31. package/dist/node_modules/pinia/dist/pinia.js +314 -0
  32. package/dist/node_modules/pinia/node_modules/vue-demi/lib/index.js +11 -0
  33. package/dist/static/editor.css.js +182 -0
  34. package/dist/static/templates/default/index.html.js +5 -0
  35. package/dist/static/templates/default/style.css.js +119 -0
  36. package/dist/stores/editor.d.ts +0 -5
  37. package/dist/stores/editor.js +4 -9
  38. package/package.json +5 -6
  39. package/dist/_virtual/AddCustomFont.js +0 -4
  40. package/dist/_virtual/AiAssistantValueType.js +0 -4
  41. package/dist/_virtual/BackgroundColorBuiltInControl.js +0 -4
  42. package/dist/_virtual/BackgroundImageBuiltInControl.js +0 -4
  43. package/dist/_virtual/Block.js +0 -4
  44. package/dist/_virtual/BlockAttributes.js +0 -4
  45. package/dist/_virtual/BlockCompositionType.js +0 -4
  46. package/dist/_virtual/BlockPaddingsBuiltInControl.js +0 -4
  47. package/dist/_virtual/BlockRenderer.js +0 -4
  48. package/dist/_virtual/BlockType.js +0 -4
  49. package/dist/_virtual/BlocksPanel.js +0 -4
  50. package/dist/_virtual/BuiltInControl.js +0 -4
  51. package/dist/_virtual/BuiltInControlTypes.js +0 -4
  52. package/dist/_virtual/ButtonBorderBuiltInControl.js +0 -4
  53. package/dist/_virtual/ButtonColorBuiltInControl.js +0 -4
  54. package/dist/_virtual/ButtonFontColorBuiltInControl.js +0 -4
  55. package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +0 -4
  56. package/dist/_virtual/ButtonTextBuiltInControl.js +0 -4
  57. package/dist/_virtual/ContextAction.js +0 -4
  58. package/dist/_virtual/ContextActionType.js +0 -4
  59. package/dist/_virtual/Control.js +0 -4
  60. package/dist/_virtual/EditorStatePropertyType.js +0 -4
  61. package/dist/_virtual/Extension.js +0 -4
  62. package/dist/_virtual/ExtensionBuilder.js +0 -4
  63. package/dist/_virtual/FontFamilyBuiltInControl.js +0 -4
  64. package/dist/_virtual/LinkColorBuiltInControl.js +0 -4
  65. package/dist/_virtual/ModificationDescription.js +0 -4
  66. package/dist/_virtual/PanelPosition.js +0 -4
  67. package/dist/_virtual/PreviewDeviceMode.js +0 -4
  68. package/dist/_virtual/SettingsPanelRegistry.js +0 -4
  69. package/dist/_virtual/SettingsPanelTab.js +0 -4
  70. package/dist/_virtual/SettingsTab.js +0 -4
  71. package/dist/_virtual/StructureBorderBuiltInControl.js +0 -4
  72. package/dist/_virtual/StructurePaddingsBuiltInControl.js +0 -4
  73. package/dist/_virtual/TextColorBuiltInControl.js +0 -4
  74. package/dist/_virtual/TextLineSpacingBuiltInControl.js +0 -4
  75. package/dist/_virtual/TextSizeBuiltInControl.js +0 -4
  76. package/dist/_virtual/TextStyleBuiltInControl.js +0 -4
  77. package/dist/_virtual/UIElement.js +0 -4
  78. package/dist/_virtual/UIElementTagRegistry.js +0 -4
  79. package/dist/_virtual/UIElementType.js +0 -4
  80. package/dist/_virtual/UIElementsAttributes.js +0 -4
  81. package/dist/_virtual/index.js +0 -5
  82. package/dist/_virtual/index2.js +0 -4
  83. package/dist/components/organisms/design-preview/DesktopPreview.vue.d.ts +0 -16
  84. package/dist/components/organisms/design-preview/DesktopPreview.vue.js +0 -22
  85. package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +0 -28
  86. package/dist/components/organisms/design-preview/EmailPreview.vue.d.ts +0 -16
  87. package/dist/components/organisms/design-preview/EmailPreview.vue.js +0 -17
  88. package/dist/components/organisms/design-preview/EmailPreview.vue2.js +0 -37
  89. package/dist/components/organisms/design-preview/EmailView.vue.d.ts +0 -18
  90. package/dist/components/organisms/design-preview/EmailView.vue.js +0 -19
  91. package/dist/components/organisms/design-preview/EmailView.vue2.js +0 -24
  92. package/dist/components/organisms/design-preview/InboxView.vue.d.ts +0 -17
  93. package/dist/components/organisms/design-preview/InboxView.vue.js +0 -19
  94. package/dist/components/organisms/design-preview/InboxView.vue2.js +0 -23
  95. package/dist/components/organisms/design-preview/MobilePreview.vue.d.ts +0 -17
  96. package/dist/components/organisms/design-preview/MobilePreview.vue.js +0 -17
  97. package/dist/components/organisms/design-preview/MobilePreview.vue2.js +0 -22
  98. package/dist/components/organisms/header/AmpErrorModal.vue.d.ts +0 -16
  99. package/dist/components/organisms/header/AmpErrorModal.vue.js +0 -21
  100. package/dist/components/organisms/header/AmpErrorModal.vue2.js +0 -27
  101. package/dist/components/organisms/header/AmpToggle.vue.js +0 -19
  102. package/dist/components/organisms/header/AmpToggle.vue2.js +0 -38
  103. package/dist/components/organisms/header/HeaderWrapper.vue2.js +0 -14
  104. package/dist/components/organisms/header/LeftSlot.vue.d.ts +0 -2
  105. package/dist/components/organisms/header/LeftSlot.vue.js +0 -17
  106. package/dist/components/organisms/header/LeftSlot.vue2.js +0 -13
  107. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +0 -2
  108. package/dist/components/organisms/header/MiddleSlot.vue.js +0 -17
  109. package/dist/components/organisms/header/MiddleSlot.vue2.js +0 -26
  110. package/dist/components/organisms/header/RightSlot.vue.d.ts +0 -2
  111. package/dist/components/organisms/header/RightSlot.vue.js +0 -17
  112. package/dist/components/organisms/header/RightSlot.vue2.js +0 -21
  113. package/dist/components/organisms/header/ViewOptions.vue.d.ts +0 -2
  114. package/dist/components/organisms/header/ViewOptions.vue.js +0 -18
  115. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +0 -2
  116. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
  117. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
  118. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +0 -14
  119. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +0 -22
  120. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +0 -18
  121. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -16
  122. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +0 -18
  123. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +0 -16
  124. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +0 -2
  125. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +0 -18
  126. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +0 -23
  127. package/dist/composables/useActionsApi.d.ts +0 -5
  128. package/dist/composables/useActionsApi.js +0 -38
  129. package/dist/composables/useDebounce.d.ts +0 -4
  130. package/dist/composables/useDebounce.js +0 -12
  131. package/dist/composables/useExport.d.ts +0 -3
  132. package/dist/composables/useExport.js +0 -45
  133. package/dist/composables/useHtmlCompiler.d.ts +0 -4
  134. package/dist/composables/useHtmlCompiler.js +0 -16
  135. package/dist/composables/useHttp.js +0 -84
  136. package/dist/composables/useMobileGmailFit.d.ts +0 -5
  137. package/dist/composables/useMobileGmailFit.js +0 -69
  138. package/dist/composables/usePartner.d.ts +0 -4
  139. package/dist/composables/usePartner.js +0 -16
  140. package/dist/composables/usePreviewMode.d.ts +0 -6
  141. package/dist/composables/usePreviewMode.js +0 -19
  142. package/dist/composables/useToaster.js +0 -37
  143. package/dist/composables/useVersionHistoryApi.d.ts +0 -8
  144. package/dist/composables/useVersionHistoryApi.js +0 -53
  145. package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
  146. package/dist/config/compiler/htmlCompilerRules.js +0 -145
  147. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  148. package/dist/enums/displayConditions.d.ts +0 -2
  149. package/dist/enums/displayConditions.js +0 -80
  150. package/dist/enums/gmailMobilePreview.d.ts +0 -7
  151. package/dist/enums/gmailMobilePreview.js +0 -17
  152. package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +0 -6
  153. package/dist/extensions/DynamicContent/dynamic-content-modal.js +0 -27
  154. package/dist/extensions/DynamicContent/dynamic-content.css.js +0 -24
  155. package/dist/extensions/DynamicContent/dynamic-content.d.ts +0 -16
  156. package/dist/extensions/DynamicContent/dynamic-content.js +0 -63
  157. package/dist/extensions/DynamicContent/extension.d.ts +0 -2
  158. package/dist/extensions/DynamicContent/extension.js +0 -11
  159. package/dist/inbox-mockup.svg +0 -41
  160. package/dist/mock/api/custom-fonts.d.ts +0 -2
  161. package/dist/mock/api/default-template.d.ts +0 -2
  162. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -51
  163. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -52
  164. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -41
  165. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +0 -18
  166. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +0 -32
  167. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +0 -18
  168. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +0 -8
  169. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -13
  170. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +0 -34
  171. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -13
  172. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -13
  173. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -104
  174. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -13
  175. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -13
  176. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -13
  177. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -13
  178. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -13
  179. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -13
  180. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -45
  181. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +0 -43
  182. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +0 -46
  183. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +0 -44
  184. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +0 -22
  185. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +0 -46
  186. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +0 -46
  187. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +0 -45
  188. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +0 -45
  189. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +0 -45
  190. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -20
  191. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +0 -43
  192. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +0 -45
  193. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -18
  194. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -32
  195. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +0 -46
  196. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +0 -44
  197. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +0 -43
  198. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +0 -43
  199. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +0 -45
  200. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +0 -43
  201. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +0 -266
  202. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -26
  203. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -22
  204. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -18
  205. package/dist/phone-mockup.svg +0 -31
  206. package/dist/services/stripoApi.d.ts +0 -8
  207. package/dist/services/stripoApi.js +0 -45
  208. package/dist/static/styles/base.css.js +0 -11
  209. package/dist/static/styles/components/alert-message.css.js +0 -39
  210. package/dist/static/styles/components/amp-block.css.js +0 -18
  211. package/dist/static/styles/components/base-input.css.js +0 -47
  212. package/dist/static/styles/components/button-group.css.js +0 -54
  213. package/dist/static/styles/components/button.css.js +0 -106
  214. package/dist/static/styles/components/combobox.css.js +0 -49
  215. package/dist/static/styles/components/counter.css.js +0 -42
  216. package/dist/static/styles/components/dropdown-menu.css.js +0 -52
  217. package/dist/static/styles/components/narrow-panel.css.js +0 -38
  218. package/dist/static/styles/components/switcher.css.js +0 -11
  219. package/dist/static/styles/components/tabs.css.js +0 -97
  220. package/dist/static/styles/components/tools.css.js +0 -23
  221. package/dist/static/styles/components/version-history.css.js +0 -30
  222. package/dist/static/styles/components/wide-panel.css.js +0 -135
  223. package/dist/static/styles/variables.css.js +0 -23
  224. package/dist/stores/version-history.d.ts +0 -80
  225. package/dist/stores/version-history.js +0 -28
  226. package/dist/utils/dateUtil.d.ts +0 -1
  227. package/dist/utils/dateUtil.js +0 -16
  228. package/dist/utils/htmlCompiler.d.ts +0 -12
  229. package/dist/utils/htmlCompiler.js +0 -70
  230. /package/dist/components/organisms/{header/AmpToggle.vue.d.ts → top-bar/Header.vue.d.ts} +0 -0
  231. /package/dist/components/organisms/{header/HeaderWrapper.vue.d.ts → top-bar/HeaderRightSlot.vue.d.ts} +0 -0
@@ -1,45 +0,0 @@
1
- import { useActionsApi as l } from "./useActionsApi.js";
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`;
11
- };
12
- return { exportHtml: async (s = !0) => {
13
- const { getCompiledEmail: o } = l(), { showToaster: r } = d(), { compileHtml: i } = m();
14
- try {
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({
37
- type: "error",
38
- message: `Error compiling email: ${e}`
39
- });
40
- }
41
- } };
42
- };
43
- export {
44
- h as useExport
45
- };
@@ -1,4 +0,0 @@
1
- import type { CompilationResult } from '@@/Types/html-compiler';
2
- export declare const useHtmlCompiler: () => {
3
- compileHtml: (html: string) => CompilationResult;
4
- };
@@ -1,16 +0,0 @@
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,84 +0,0 @@
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
- };
@@ -1,5 +0,0 @@
1
- export declare const useMobileGmailFit: () => {
2
- setupMobileGmailFit: (iframe: HTMLIFrameElement) => void;
3
- tearDownMobileGmailFit: (iframe: HTMLIFrameElement) => void;
4
- hasResponsiveMetaViewport: (doc: Document) => boolean;
5
- };
@@ -1,69 +0,0 @@
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
- };
@@ -1,4 +0,0 @@
1
- export declare const usePartner: () => {
2
- getPartnerName: () => string;
3
- getProductType: () => string;
4
- };
@@ -1,16 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
1
- import type { CompiledEmailResult, CompileEmailOptions } from '@@/Types/stripo';
2
- export declare const usePreviewMode: () => {
3
- compile: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
4
- enablePreviewUI: () => void;
5
- disablePreviewUI: () => void;
6
- };
@@ -1,19 +0,0 @@
1
- import { useActionsApi as s } from "./useActionsApi.js";
2
- const a = () => {
3
- const { getCompiledEmail: e } = s();
4
- return { compile: async (t) => {
5
- const i = await e({ minimize: !1, resetDataSavedFlag: !1, ...t });
6
- return {
7
- html: i.html,
8
- ampHtml: i.ampHtml || null,
9
- ampErrors: i.ampErrors || null
10
- };
11
- }, enablePreviewUI: () => {
12
- window.StripoEditorApi.uiApi.setSettingsPanelVisible(!1), window.StripoEditorApi.uiApi.setBlocksPanelVisible(!1);
13
- }, disablePreviewUI: () => {
14
- window.StripoEditorApi.uiApi.setSettingsPanelVisible(!0), window.StripoEditorApi.uiApi.setBlocksPanelVisible(!0);
15
- } };
16
- };
17
- export {
18
- a as usePreviewMode
19
- };
@@ -1,37 +0,0 @@
1
- import { ref as o, watch as T } from "vue";
2
- const v = () => {
3
- const t = o(!1), s = o(""), c = o("success"), n = o([]);
4
- let a = null;
5
- function i() {
6
- a && (clearTimeout(a), a = null);
7
- }
8
- function u() {
9
- t.value = !1, n.value = [], s.value = "";
10
- }
11
- function l(e = { message: "" }) {
12
- u(), s.value = e.message, c.value = e.type || "success", n.value = e.actionButton ? [e.actionButton] : [], t.value = !0;
13
- }
14
- function f(e, r) {
15
- const m = e instanceof Error ? e.message : String(e);
16
- l({
17
- type: "error",
18
- message: `${r}: ${m}`
19
- });
20
- }
21
- return T([t, s], ([e, r]) => {
22
- i(), e && r && (a = setTimeout(() => {
23
- u();
24
- }, 6e3));
25
- }), {
26
- isToasterVisible: t,
27
- toasterMessage: s,
28
- toasterType: c,
29
- toasterActionButton: n,
30
- showToaster: l,
31
- hideToaster: u,
32
- handleError: f
33
- };
34
- };
35
- export {
36
- v as useToaster
37
- };
@@ -1,8 +0,0 @@
1
- export declare const useVersionHistoryApi: () => {
2
- openVersionHistory: () => void;
3
- closeVersionHistory: () => void;
4
- switchToDesktopPreview: () => void;
5
- switchToMobilePreview: () => void;
6
- previewVersion: (id: string) => void;
7
- restoreVersion: (id: string) => void;
8
- };
@@ -1,53 +0,0 @@
1
- import { useVersionHistoryStore as p } from "../stores/version-history.js";
2
- import { useToaster as c } from "./useToaster.js";
3
- const l = () => {
4
- const i = p(), { showToaster: s } = c(), t = (e) => {
5
- i.$reset(), i.updateState(e);
6
- }, n = () => {
7
- i.$reset();
8
- };
9
- return {
10
- openVersionHistory: () => {
11
- window.StripoEditorApi.versionHistoryApi.openVersionHistory(t, n);
12
- },
13
- closeVersionHistory: () => {
14
- window.StripoEditorApi.versionHistoryApi.closeVersionHistory();
15
- },
16
- switchToDesktopPreview: () => {
17
- window.StripoEditorApi.versionHistoryApi.switchToDesktopPreview();
18
- },
19
- switchToMobilePreview: () => {
20
- window.StripoEditorApi.versionHistoryApi.switchToMobilePreview();
21
- },
22
- previewVersion: (e) => {
23
- window.StripoEditorApi.versionHistoryApi.previewVersion(e, (o) => {
24
- const r = o instanceof Error ? o.message : String(o);
25
- s({
26
- type: "error",
27
- message: `Error compiling email: ${r}`
28
- });
29
- });
30
- },
31
- restoreVersion: (e) => {
32
- window.StripoEditorApi.versionHistoryApi.restoreVersion(
33
- e,
34
- () => {
35
- s({
36
- type: "success",
37
- message: `${e} patch restored successfully.`
38
- });
39
- },
40
- (o) => {
41
- const r = o instanceof Error ? o.message : String(o);
42
- s({
43
- type: "error",
44
- message: `Error compiling email: ${r}`
45
- });
46
- }
47
- );
48
- }
49
- };
50
- };
51
- export {
52
- l as useVersionHistoryApi
53
- };
@@ -1,2 +0,0 @@
1
- import type { CompilerRule } from '@@/Types/html-compiler';
2
- export declare const defaultHtmlCompilerRules: CompilerRule[];
@@ -1,145 +0,0 @@
1
- const a = [
2
- {
3
- id: "fix-url-encoding-start",
4
- description: "Replace {%22 with %7B%22 to fix URL encoding",
5
- type: "replace",
6
- search: "{%22",
7
- replacement: "%7B%22",
8
- replaceAll: !0,
9
- priority: 10
10
- },
11
- {
12
- id: "fix-url-encoding-end",
13
- description: "Replace %22} with %22%7D to fix URL encoding",
14
- type: "replace",
15
- search: "%22}",
16
- replacement: "%22%7D",
17
- replaceAll: !0,
18
- priority: 10
19
- },
20
- {
21
- id: "fix-tags-start",
22
- description: "Replace %7B%7B with {{ to fix URL encoding",
23
- type: "replace",
24
- search: "%7B%7B",
25
- replacement: "{{",
26
- replaceAll: !0,
27
- priority: 11
28
- },
29
- {
30
- id: "fix-tags-end",
31
- description: "Replace %7D%7D with }} to fix URL encoding",
32
- type: "replace",
33
- search: "%7D%7D",
34
- replacement: "}}",
35
- replaceAll: !0,
36
- priority: 12
37
- },
38
- {
39
- id: "unescape-inequality-operators-start",
40
- description: "Replace &lt; with < to fix URL encoding",
41
- type: "replace",
42
- search: "&lt;",
43
- replacement: "<",
44
- replaceAll: !0,
45
- priority: 13
46
- },
47
- {
48
- id: "unescape-inequality-operators-end",
49
- description: "Replace &gt; with > to fix URL encoding",
50
- type: "replace",
51
- search: "&gt;",
52
- replacement: ">",
53
- replaceAll: !0,
54
- priority: 14
55
- },
56
- {
57
- id: "remove-apty-iframe",
58
- description: "Cleanup Apty Iframe Code",
59
- type: "remove",
60
- targets: [
61
- '<iframe src="about:blank" id="letznav-iframe-script" allowtransparency="true" style="width:1px;height:1px"></iframe>',
62
- 'src="about:blank" id="letznav-iframe-script" allowtransparency="true" style="width:1px;height:1px"></iframe>'
63
- ],
64
- priority: 20
65
- },
66
- {
67
- id: "remove-apty-styles",
68
- description: "Removing Apty Styles",
69
- type: "regex",
70
- pattern: '<styles*data-styles="apty_styles"s* type="text/css"s*>((s|.)*?)</style>',
71
- replacement: "",
72
- flags: "g",
73
- priority: 21
74
- },
75
- {
76
- id: "remove-mso-conditions",
77
- description: "Removing MSO Conditions",
78
- type: "remove",
79
- targets: [
80
- /<!--\[if\s\(mso 16\)\]>\s*<style\s*\S*>\s*a\s*\{\s*text-decoration\s*:\s*none\s*;*\s*\}\s*<\/style>\s*<!\[endif\]-->/g,
81
- /<!--\[if\sgte mso 9\]>\s*<style\s*\S*>\s*sup\s*\{\s*font-size\s*:\s*100%\s*!important\s*;*\s*\}\s*<\/style>\s*<!\[endif\]-->/g,
82
- /<!--\[if\sgte mso 9\]>\s*<noscript>\s*<xml>\s*<o:OfficeDocumentSettings>\s*<o:AllowPNG>\s*<\/o:AllowPNG>\s*<o:PixelsPerInch>\d+<\/o:PixelsPerInch>\s*<\/o:OfficeDocumentSettings>\s*<\/xml>\s*<\/noscript>\s*<!\[endif\]-->/g,
83
- /<!--\[if mso\]>\s*<xml>\s*<w:WordDocument\s+xmlns:w="urn:schemas-microsoft-com:office:word">\s*<w:DontUseAdvancedTypographyReadingMail><\/w:DontUseAdvancedTypographyReadingMail>\s*<\/w:WordDocument>\s*<\/xml>\s*<!\[endif\]-->/g,
84
- /<\!--\[if \!mso\]><\!--\s*\d*\s*-->\s*<\!--\[if \!mso\]><\!--\s*\d*\s*-->\s*<\!--<!\[endif\]-->/g,
85
- /<!--\[if\s\!mso\]>\s*<!-- \d -->/g
86
- ],
87
- priority: 22
88
- },
89
- {
90
- id: "add-mso-conditions",
91
- description: "Adding MSO Conditions",
92
- type: "custom",
93
- processor: (e) => {
94
- const t = [
95
- `<!--[if gte mso 9]>
96
- <style>sup {
97
- font-size: 100% !important;
98
- }</style><![endif]-->`,
99
- `<!--[if gte mso 9]>
100
- <noscript>
101
- <xml>
102
- <o:OfficeDocumentSettings>
103
- <o:AllowPNG></o:AllowPNG>
104
- <o:PixelsPerInch>96</o:PixelsPerInch>
105
- </o:OfficeDocumentSettings>
106
- </xml>
107
- </noscript><![endif]-->`,
108
- `<!--[if mso]>
109
- <xml>
110
- <w:WordDocument xmlns:w="urn:schemas-microsoft-com:office:word">
111
- <w:DontUseAdvancedTypographyReadingMail></w:DontUseAdvancedTypographyReadingMail>
112
- </w:WordDocument>
113
- </xml><![endif]-->`
114
- ], s = /<head>([\S\s]*)<\/head>/, o = new RegExp(s);
115
- if (!e.match(o))
116
- return e;
117
- let i = e;
118
- return t.forEach((r) => {
119
- i = i.replace("</head>", `${r}</head>`);
120
- }), i;
121
- },
122
- priority: 30
123
- },
124
- {
125
- id: "replace-old-image-domain",
126
- description: "Replacing old image domains",
127
- type: "replace",
128
- search: "stripo-editor-image.s3-eu-west-1.amazonaws.com",
129
- replacement: "email-static.useinsider.com",
130
- replaceAll: !0,
131
- priority: 40
132
- },
133
- {
134
- id: "replace-old-v2-image-domain",
135
- description: "Replacing old image domains",
136
- type: "replace",
137
- search: "email.static.useinsider.com",
138
- replacement: "email-static.useinsider.com",
139
- replaceAll: !0,
140
- priority: 41
141
- }
142
- ];
143
- export {
144
- a as defaultHtmlCompilerRules
145
- };
File without changes
@@ -1,2 +0,0 @@
1
- import type { ConditionCategories } from '@@/Types/condition-categories';
2
- export declare const displayConditions: ConditionCategories;
@@ -1,80 +0,0 @@
1
- const e = [
2
- {
3
- category: "Demographics",
4
- conditions: [
5
- {
6
- id: 1,
7
- name: "Language",
8
- description: "Users who are in the English will see the banner",
9
- beforeScript: '{% if language == "en_US" %}',
10
- afterScript: "{% endif %}"
11
- },
12
- {
13
- id: 2,
14
- name: "Country",
15
- description: "Only people who live in Australia will see the banner",
16
- beforeScript: '{% if country == "Australia" %}',
17
- afterScript: "{% endif %}"
18
- },
19
- {
20
- id: 3,
21
- name: "Country & City",
22
- description: "Only people who are located in that country and city",
23
- beforeScript: '{% if country == "United Kingdom" and city == "London" %}',
24
- afterScript: "{% endif %}"
25
- },
26
- {
27
- id: 4,
28
- name: "Age (Less than operator)",
29
- description: "Users whose age is less than 18",
30
- beforeScript: "{% if age < 18 %}",
31
- afterScript: "{% endif %}"
32
- },
33
- {
34
- id: 5,
35
- name: "Age (Equal and greater than operator)",
36
- description: "Users whose age is equal or greater than 25",
37
- beforeScript: "{% if age >= 25 %}",
38
- afterScript: "{% endif %}"
39
- },
40
- {
41
- id: 6,
42
- name: "Age (Greater than & less than operators)",
43
- description: "Users whose age is between 18 and 25",
44
- beforeScript: "{% if age > 18 and age < 25 %}",
45
- afterScript: "{% endif %}"
46
- },
47
- {
48
- id: 7,
49
- name: "Gender",
50
- description: "Users whose gender is Female",
51
- beforeScript: '{% if gender == "Female" %}',
52
- afterScript: "{% endif %}"
53
- },
54
- {
55
- id: 8,
56
- name: "State",
57
- description: "Users whose state is one of the followings. c_state is a custom attribute. Use this condition if you have the attribute with the same naming. ",
58
- beforeScript: '{% if c_state == "VIC" or c_state == "NSW" or c_state == "QLD" %}',
59
- afterScript: "{% endif %}"
60
- },
61
- {
62
- id: 9,
63
- name: "VIP User",
64
- description: "Users who are VIP users for that brand. c_is_vip_user = true. c_is_vip_user is a custom attribute. Use this condition if you have the attribute with the same naming.",
65
- beforeScript: "{% if c_is_vip_user %}",
66
- afterScript: "{% endif %}"
67
- },
68
- {
69
- id: 10,
70
- name: "Membership Type",
71
- description: "Users who belong to gold or silver membership type. c_is_gold_member = true, c_is_silver_member = true. These are custom attributes. Use this condition if you have the attribute with the same naming.",
72
- beforeScript: "{% if c_is_gold_member or c_is_silver_member %}",
73
- afterScript: "{% endif %}"
74
- }
75
- ]
76
- }
77
- ];
78
- export {
79
- e as displayConditions
80
- };
@@ -1,7 +0,0 @@
1
- export declare const DEFAULT_EMAIL_WIDTH = 600;
2
- export declare const MIN_SCALE = 0.2;
3
- export declare const RESIZE_DEBOUNCE_MS = 100;
4
- export declare const INLINE_WIDTH_REGEX: RegExp;
5
- export declare const TABLE_WIDTH_REGEX: RegExp;
6
- export declare const META_VIEWPORT_REGEX: RegExp;
7
- export declare const EMAIL_CONTAINER_SELECTORS: readonly [".wrapper", ".container", "#wrapper", "#container", "[data-email-container]", "[role=\"presentation\"]"];
@@ -1,17 +0,0 @@
1
- const E = 600, t = 0.2, n = 100, o = /width\s*:\s*(\d+(\.\d+)?)px/i, _ = /^(\d+(\.\d+)?)(px)?$/i, e = /width\s*=\s*device-width/i, i = [
2
- ".wrapper",
3
- ".container",
4
- "#wrapper",
5
- "#container",
6
- "[data-email-container]",
7
- '[role="presentation"]'
8
- ];
9
- export {
10
- E as DEFAULT_EMAIL_WIDTH,
11
- i as EMAIL_CONTAINER_SELECTORS,
12
- o as INLINE_WIDTH_REGEX,
13
- e as META_VIEWPORT_REGEX,
14
- t as MIN_SCALE,
15
- n as RESIZE_DEBOUNCE_MS,
16
- _ as TABLE_WIDTH_REGEX
17
- };
@@ -1,6 +0,0 @@
1
- import type { DynamicContent } from '@@/Types/generic';
2
- export declare class ExternalMergeTagsLibrary {
3
- selectedDynamicContent: DynamicContent | null;
4
- dataSelectCallback: (data: DynamicContent) => void;
5
- openMergeTagsLibrary(dynamicContent: DynamicContent, onDataSelectCallback: (data: DynamicContent) => void): void;
6
- }