@useinsider/guido 1.0.0-beta.d77a041 → 1.0.0-beta.dbd0bad

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 (170) hide show
  1. package/README.md +265 -12
  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/LeftSlot.vue.d.ts +1 -1
  52. package/dist/components/organisms/header/LeftSlot.vue.js +8 -8
  53. package/dist/components/organisms/header/LeftSlot.vue2.js +5 -3
  54. package/dist/components/organisms/header/MiddleSlot.vue.js +8 -8
  55. package/dist/components/organisms/header/MiddleSlot.vue2.js +15 -15
  56. package/dist/components/organisms/header/RightSlot.vue.js +10 -13
  57. package/dist/components/organisms/header/RightSlot.vue2.js +14 -17
  58. package/dist/components/organisms/header/ViewOptions.vue.d.ts +1 -1
  59. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +2 -0
  60. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +19 -0
  61. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +14 -0
  62. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +13 -1
  63. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +7 -7
  64. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +13 -10
  65. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +1 -1
  66. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +1 -1
  67. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +1 -1
  68. package/dist/composables/useActionsApi.d.ts +1 -0
  69. package/dist/composables/useActionsApi.js +14 -12
  70. package/dist/composables/useCustomInterfaceAppearance.js +45 -9
  71. package/dist/composables/useExport.d.ts +1 -1
  72. package/dist/composables/useExport.js +35 -20
  73. package/dist/composables/useHtmlCompiler.d.ts +4 -0
  74. package/dist/composables/useHtmlCompiler.js +16 -0
  75. package/dist/composables/useStripo.js +44 -28
  76. package/dist/config/compiler/htmlCompilerRules.d.ts +2 -0
  77. package/dist/config/compiler/htmlCompilerRules.js +145 -0
  78. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  79. package/dist/enums/displayConditions.d.ts +2 -0
  80. package/dist/enums/displayConditions.js +80 -0
  81. package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +6 -0
  82. package/dist/extensions/DynamicContent/dynamic-content-modal.js +27 -0
  83. package/dist/extensions/DynamicContent/dynamic-content.css.js +24 -0
  84. package/dist/extensions/DynamicContent/dynamic-content.d.ts +16 -0
  85. package/dist/extensions/DynamicContent/dynamic-content.js +63 -0
  86. package/dist/extensions/DynamicContent/extension.d.ts +2 -0
  87. package/dist/extensions/DynamicContent/extension.js +11 -0
  88. package/dist/guido.css +1 -1
  89. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +51 -0
  90. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +52 -0
  91. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +41 -0
  92. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +18 -0
  93. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +32 -0
  94. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +18 -0
  95. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +8 -0
  96. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +13 -0
  97. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +34 -0
  98. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +13 -0
  99. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +13 -0
  100. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +104 -0
  101. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +13 -0
  102. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +13 -0
  103. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +13 -0
  104. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +13 -0
  105. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +13 -0
  106. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +13 -0
  107. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +45 -0
  108. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +43 -0
  109. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +46 -0
  110. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +44 -0
  111. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +22 -0
  112. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +46 -0
  113. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +46 -0
  114. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +45 -0
  115. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +45 -0
  116. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +45 -0
  117. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +20 -0
  118. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +43 -0
  119. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +45 -0
  120. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +18 -0
  121. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +32 -0
  122. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +46 -0
  123. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +44 -0
  124. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +43 -0
  125. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +43 -0
  126. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +45 -0
  127. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +43 -0
  128. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +266 -0
  129. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +26 -0
  130. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +22 -0
  131. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +18 -0
  132. package/dist/static/styles/base.css.js +11 -0
  133. package/dist/static/styles/components/alert-message.css.js +39 -0
  134. package/dist/static/styles/components/amp-block.css.js +18 -0
  135. package/dist/static/styles/components/base-input.css.js +47 -0
  136. package/dist/static/styles/components/button-group.css.js +54 -0
  137. package/dist/static/styles/components/button.css.js +106 -0
  138. package/dist/static/styles/components/combobox.css.js +49 -0
  139. package/dist/static/styles/components/counter.css.js +42 -0
  140. package/dist/static/styles/components/dropdown-menu.css.js +52 -0
  141. package/dist/static/styles/components/narrow-panel.css.js +38 -0
  142. package/dist/static/styles/components/switcher.css.js +11 -0
  143. package/dist/static/styles/components/tabs.css.js +97 -0
  144. package/dist/static/styles/components/tools.css.js +23 -0
  145. package/dist/static/styles/components/version-history.css.js +30 -0
  146. package/dist/static/styles/components/wide-panel.css.js +135 -0
  147. package/dist/static/styles/variables.css.js +23 -0
  148. package/dist/stores/editor.d.ts +1 -1
  149. package/dist/stores/editor.js +4 -4
  150. package/dist/utils/htmlCompiler.d.ts +12 -0
  151. package/dist/utils/htmlCompiler.js +70 -0
  152. package/dist/utils/tooltipUtils.d.ts +2 -0
  153. package/dist/utils/tooltipUtils.js +9 -0
  154. package/package.json +6 -5
  155. package/dist/components/organisms/base/ModalWrapper.vue.d.ts +0 -72
  156. package/dist/components/organisms/base/ModalWrapper.vue.js +0 -19
  157. package/dist/components/organisms/base/ModalWrapper.vue2.js +0 -43
  158. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -16
  159. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -22
  160. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -86
  161. package/dist/composables/useSaveAsTemplate.d.ts +0 -17
  162. package/dist/composables/useSaveAsTemplate.js +0 -44
  163. package/dist/composables/useTemplateCategories.d.ts +0 -35
  164. package/dist/composables/useTemplateCategories.js +0 -78
  165. package/dist/composables/useTemplateNameValidation.d.ts +0 -13
  166. package/dist/composables/useTemplateNameValidation.js +0 -57
  167. package/dist/mock/api/template-library.d.ts +0 -2
  168. package/dist/static/editor.css.js +0 -232
  169. package/dist/utils/base64.d.ts +0 -1
  170. package/dist/utils/base64.js +0 -14
@@ -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,74 +1,90 @@
1
- import { useCustomInterfaceAppearance as m } from "./useCustomInterfaceAppearance.js";
2
- import { useToaster as g } from "./useToaster.js";
3
- import { useStripoApi as E } from "../services/stripoApi.js";
4
- import { useEditorStore as S } from "../stores/editor.js";
5
- const _ = (c) => {
6
- const { handleError: d } = g(), { getToken: u, getCustomFonts: a } = E(), l = (e, i = []) => {
7
- const r = S(), { html: t, css: n } = e;
1
+ import { useActionsApi as m } from "./useActionsApi.js";
2
+ import { useCustomInterfaceAppearance as g } from "./useCustomInterfaceAppearance.js";
3
+ import { useToaster as f } from "./useToaster.js";
4
+ import { displayConditions as E } from "../enums/displayConditions.js";
5
+ import S from "../extensions/DynamicContent/extension.js";
6
+ import { useStripoApi as y } from "../services/stripoApi.js";
7
+ import { useEditorStore as C } from "../stores/editor.js";
8
+ const x = (a) => {
9
+ const { handleError: d } = f(), { getToken: c, getCustomFonts: u } = y(), l = (e, r = []) => {
10
+ const i = C(), { html: t, css: s } = e;
8
11
  window.UIEditor.initEditor(
9
12
  document.querySelector("#guido-editor"),
10
13
  {
11
- metadata: c,
14
+ metadata: a,
12
15
  html: t,
13
- css: n,
16
+ css: s,
14
17
  locale: "en",
15
18
  undoButtonSelector: "#guido__undo-button",
16
19
  redoButtonSelector: "#guido__redo-button",
17
20
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
18
21
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
19
22
  codeEditorButtonSelector: "#guido__code-button",
23
+ customAppearanceMergetags: !0,
24
+ customAppearanceMergetagsBorderColor: "#f1f3fe",
25
+ customAppearanceMergetagsBackgroundColor: "#f1f3fe",
26
+ customViewStyles: `
27
+ .esd-x, .esd-merge-tag {color: #0a2ecc !important; box-shadow: none !important;}
28
+ .esd-merge-tag {border: 1px solid #b5c1f1; border-radius: 4px !important;}
29
+ `,
30
+ conditionsEnabled: !0,
31
+ customConditionsEnabled: !0,
32
+ conditionCategories: E,
33
+ messageSettingsEnabled: !1,
20
34
  editorFonts: {
21
35
  showDefaultStandardFonts: !0,
22
36
  showDefaultNotStandardFonts: !0,
23
- customFonts: i
37
+ customFonts: r
24
38
  },
25
39
  async onTokenRefreshRequest(o) {
26
40
  try {
27
- const s = await u();
28
- o(s);
29
- } catch (s) {
30
- d(s, "Failed to refresh token");
41
+ const n = await c();
42
+ o(n);
43
+ } catch (n) {
44
+ d(n, "Failed to refresh token");
31
45
  }
32
46
  },
33
47
  onTemplateLoaded() {
34
48
  try {
35
- const { importCss: o } = m();
36
- o();
49
+ const { importCss: o } = g(), { activateCustomViewStyles: n } = m();
50
+ o(), n();
37
51
  } catch (o) {
38
52
  d(o, "Failed to load custom interface appearance");
39
53
  }
40
54
  },
41
55
  onCodeEditorVisibilityChanged(o) {
42
- r.isCodeEditorOpen = o;
56
+ i.isCodeEditorOpen = o;
43
57
  },
44
58
  onEditorVisualModeChanged(o) {
45
- r.editorVisualMode = o.toLowerCase();
59
+ i.editorVisualMode = o.toLowerCase();
46
60
  },
47
61
  onVersionHistoryVisibilityChanged(o) {
48
- r.isVersionHistoryOpen = o;
49
- }
62
+ i.isVersionHistoryOpen = o;
63
+ },
64
+ ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
65
+ extensions: [S]
50
66
  }
51
67
  );
52
- }, p = (e) => new Promise((i, r) => {
68
+ }, p = (e) => new Promise((r, i) => {
53
69
  if (document.getElementById("UiEditorScript")) {
54
- e(), i();
70
+ e(), r();
55
71
  return;
56
72
  }
57
73
  const t = document.createElement("script");
58
74
  t.id = "UiEditorScript", t.type = "module", t.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t.onload = () => {
59
- e(), i();
75
+ e(), r();
60
76
  }, t.onerror = () => {
61
- const n = new Error("Failed to load Stripo UIEditor script");
62
- r(n);
77
+ const s = new Error("Failed to load Stripo UIEditor script");
78
+ i(s);
63
79
  }, document.body.appendChild(t);
64
80
  });
65
81
  return { initPlugin: async (e) => {
66
82
  await p(async () => {
67
- const i = await a();
68
- l(e, i);
83
+ const r = await u();
84
+ l(e, r);
69
85
  });
70
86
  } };
71
87
  };
72
88
  export {
73
- _ as useStripo
89
+ x as useStripo
74
90
  };
@@ -0,0 +1,2 @@
1
+ import type { CompilerRule } from '@@/Types/html-compiler';
2
+ export declare const defaultHtmlCompilerRules: CompilerRule[];
@@ -0,0 +1,145 @@
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
@@ -0,0 +1,2 @@
1
+ import type { ConditionCategories } from '@@/Types/condition-categories';
2
+ export declare const displayConditions: ConditionCategories;
@@ -0,0 +1,80 @@
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
+ };
@@ -0,0 +1,6 @@
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
+ }
@@ -0,0 +1,27 @@
1
+ var i = Object.defineProperty;
2
+ var d = (t, e, n) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var a = (t, e, n) => d(t, typeof e != "symbol" ? e + "" : e, n);
4
+ class y {
5
+ constructor() {
6
+ a(this, "selectedDynamicContent", null);
7
+ a(this, "dataSelectCallback", () => {
8
+ });
9
+ }
10
+ openMergeTagsLibrary(e, n) {
11
+ this.dataSelectCallback = n, this.selectedDynamicContent = e;
12
+ const s = new CustomEvent("dynamic-content:open", {
13
+ detail: {
14
+ attribute: e
15
+ }
16
+ });
17
+ document.dispatchEvent(s);
18
+ const o = (l) => {
19
+ const c = l.detail;
20
+ this.selectedDynamicContent = c, c.text && c.value && this.dataSelectCallback(c), document.removeEventListener("dynamic-content:close", o);
21
+ };
22
+ document.addEventListener("dynamic-content:close", o);
23
+ }
24
+ }
25
+ export {
26
+ y as ExternalMergeTagsLibrary
27
+ };
@@ -0,0 +1,24 @@
1
+ const n = `
2
+ #guido__btn-add-dynamic-content {
3
+ background-color: transparent;
4
+ }
5
+
6
+ #guido__btn-add-dynamic-content > button {
7
+ color: var(--guido-color-primary-500);
8
+ background-color: transparent;
9
+ box-shadow: none;
10
+ padding: 0;
11
+ border: none;
12
+ }
13
+
14
+ #guido__btn-add-dynamic-content > button:hover {
15
+ text-decoration: underline;
16
+ }
17
+
18
+ .color-primary {
19
+ color: var(--guido-color-primary-500) !important;
20
+ }
21
+ `;
22
+ export {
23
+ n as default
24
+ };
@@ -0,0 +1,16 @@
1
+ import { UIElementType, UIElement, UIElementTagRegistry } from '@stripoinc/ui-editor-extensions';
2
+ export declare class DynamicContentTagRegistry extends UIElementTagRegistry {
3
+ registerUiElements(uiElementsTagsMap: Record<UIElementType, string>): void;
4
+ }
5
+ export declare class DynamicContentUiElementExtension extends UIElement {
6
+ private mergeTagsButton;
7
+ private listener;
8
+ private mergeTagsLibrary;
9
+ private selectedDynamicContent;
10
+ getId(): string;
11
+ onRender(container: HTMLElement): void;
12
+ onDestroy(): void;
13
+ _onClick(): void;
14
+ openMergeTagLibrary(): void;
15
+ getTemplate(): string;
16
+ }
@@ -0,0 +1,63 @@
1
+ var l = Object.defineProperty;
2
+ var o = (i, t, e) => t in i ? l(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var r = (i, t, e) => o(i, typeof t != "symbol" ? t + "" : t, e);
4
+ import { d as n } from "../../_virtual/index.js";
5
+ import { ExternalMergeTagsLibrary as c } from "./dynamic-content-modal.js";
6
+ const a = "external-dynamic-content-ui-element", m = "button-add-dynamic-content";
7
+ class d extends n.UIElementTagRegistry {
8
+ registerUiElements(t) {
9
+ t[n.UIElementType.MERGETAGS] = a;
10
+ }
11
+ }
12
+ class b extends n.UIElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ r(this, "mergeTagsButton", null);
16
+ r(this, "listener", () => {
17
+ });
18
+ r(this, "mergeTagsLibrary", null);
19
+ r(this, "selectedDynamicContent", { value: "", text: "" });
20
+ }
21
+ getId() {
22
+ return a;
23
+ }
24
+ onRender(e) {
25
+ var s;
26
+ this.listener = this._onClick.bind(this), this.mergeTagsButton = e.querySelector("#guido__btn-add-dynamic-content"), (s = this.mergeTagsButton) == null || s.addEventListener("click", this.listener);
27
+ }
28
+ onDestroy() {
29
+ var e;
30
+ (e = this.mergeTagsButton) == null || e.removeEventListener("click", this.listener);
31
+ }
32
+ _onClick() {
33
+ this.openMergeTagLibrary();
34
+ }
35
+ openMergeTagLibrary() {
36
+ this.mergeTagsLibrary || (this.mergeTagsLibrary = new c()), this.mergeTagsLibrary.openMergeTagsLibrary(
37
+ this.selectedDynamicContent,
38
+ (e) => {
39
+ this.api.onValueChanged({
40
+ label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
41
+ value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
42
+ });
43
+ }
44
+ );
45
+ }
46
+ getTemplate() {
47
+ return `
48
+ <div>
49
+ <${n.UIElementType.BUTTON}
50
+ id="guido__btn-add-dynamic-content"
51
+ class="btn btn-primary"
52
+ ${n.UEAttr.BUTTON.name}="${m}">
53
+ <${n.UIElementType.ICON} src="plus" class="icon icon-button color-primary">
54
+ </${n.UIElementType.ICON}>
55
+ ${this.api.translate("Add Dynamic Content")}
56
+ </${n.UIElementType.BUTTON}>
57
+ </div>`;
58
+ }
59
+ }
60
+ export {
61
+ d as DynamicContentTagRegistry,
62
+ b as DynamicContentUiElementExtension
63
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@stripoinc/ui-editor-extensions").Extension;
2
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { d as t } from "../../_virtual/index.js";
2
+ import { DynamicContentUiElementExtension as n, DynamicContentTagRegistry as i } from "./dynamic-content.js";
3
+ import e from "./dynamic-content.css.js";
4
+ const s = new t.ExtensionBuilder().addUiElement(n).withStyles(e).withLocalization({
5
+ en: {
6
+ "Add Dynamic Content": "Add Dynamic Content"
7
+ }
8
+ }).withUiElementTagRegistry(i).build();
9
+ export {
10
+ s as default
11
+ };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .version-history-item[data-v-0e2ff42d]{flex-basis:200px}.version-history-wrapper[data-v-187d41fa]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.header-right-slot[data-v-78791c47]{gap:16px}.guido-editor__wrapper[data-v-f20b186e],.guido-editor__container[data-v-f20b186e]{width:100%;height:100vh}
1
+ .version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-89423288],.guido-editor__container[data-v-89423288]{width:100%;height:calc(100vh - 75px)}
@@ -0,0 +1,51 @@
1
+ import { __exports as e } from "../../../../_virtual/Extension.js";
2
+ var o;
3
+ function m() {
4
+ if (o) return e;
5
+ o = 1, Object.defineProperty(e, "__esModule", { value: !0 }), e.Extension = void 0;
6
+ var a = (
7
+ /** @class */
8
+ function() {
9
+ function t(u, l, i, y, n, p, r, s, h, g, c, f, x, E, d) {
10
+ i === void 0 && (i = []), n === void 0 && (n = []), r === void 0 && (r = []), s === void 0 && (s = []), this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [], this.i18n = u, this.styles = l, this.previewStyles = c, this.uiElements = i, this.uiElementTagRegistry = y, this.controls = n, this.settingsPanelRegistry = p, this.contextActions = r, this.blocks = s, this.externalSmartElementsLibrary = h, this.externalImageLibrary = g, this.externalAiAssistant = f, this.externalDisplayConditionsLibrary = x, this.externalVideoLibrary = E, this.blocksPanel = d, this.id = Math.random().toString(36).substring(2);
11
+ }
12
+ return t.prototype.getI18n = function() {
13
+ return this.i18n;
14
+ }, t.prototype.getStyles = function() {
15
+ return this.styles;
16
+ }, t.prototype.getPreviewStyles = function() {
17
+ return this.previewStyles;
18
+ }, t.prototype.getUiElements = function() {
19
+ return this.uiElements;
20
+ }, t.prototype.getUiElementTagRegistry = function() {
21
+ return this.uiElementTagRegistry;
22
+ }, t.prototype.getControls = function() {
23
+ return this.controls;
24
+ }, t.prototype.getSettingsPanelRegistry = function() {
25
+ return this.settingsPanelRegistry;
26
+ }, t.prototype.getContextActions = function() {
27
+ return this.contextActions;
28
+ }, t.prototype.getBlocks = function() {
29
+ return this.blocks;
30
+ }, t.prototype.getId = function() {
31
+ return this.id;
32
+ }, t.prototype.getExternalSmartElementsLibrary = function() {
33
+ return this.externalSmartElementsLibrary;
34
+ }, t.prototype.getExternalImageLibrary = function() {
35
+ return this.externalImageLibrary;
36
+ }, t.prototype.getExternalAiAssistant = function() {
37
+ return this.externalAiAssistant;
38
+ }, t.prototype.getExternalDisplayConditionsLibrary = function() {
39
+ return this.externalDisplayConditionsLibrary;
40
+ }, t.prototype.getExternalVideoLibrary = function() {
41
+ return this.externalVideoLibrary;
42
+ }, t.prototype.getBlocksPanel = function() {
43
+ return this.blocksPanel;
44
+ }, t;
45
+ }()
46
+ );
47
+ return e.Extension = a, e;
48
+ }
49
+ export {
50
+ m as __require
51
+ };