@useinsider/guido 1.0.0-beta.eda3d24 → 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 (251) hide show
  1. package/README.md +34 -410
  2. package/dist/@types/generic.d.ts +0 -13
  3. package/dist/App.vue.d.ts +1 -1
  4. package/dist/components/Guido.vue.d.ts +3 -20
  5. package/dist/components/Guido.vue.js +8 -8
  6. package/dist/components/Guido.vue2.js +19 -71
  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/top-bar/HeaderViewOptions.vue2.js +15 -0
  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 +4 -10
  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 -1
  37. package/dist/stores/editor.js +1 -2
  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/email-preview/PreviewContainer.vue.js +0 -19
  84. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +0 -19
  85. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -4
  86. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +0 -22
  87. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +0 -30
  88. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +0 -19
  89. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +0 -29
  90. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -2
  91. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +0 -22
  92. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +0 -31
  93. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -2
  94. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  95. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  96. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -2
  97. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +0 -18
  98. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +0 -22
  99. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -4
  100. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +0 -19
  101. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +0 -23
  102. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -4
  103. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +0 -20
  104. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +0 -21
  105. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -2
  106. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +0 -17
  107. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +0 -22
  108. package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +0 -2
  109. package/dist/components/organisms/header/HeaderWrapper.vue2.js +0 -14
  110. package/dist/components/organisms/header/LeftSlot.vue.d.ts +0 -2
  111. package/dist/components/organisms/header/LeftSlot.vue.js +0 -17
  112. package/dist/components/organisms/header/LeftSlot.vue2.js +0 -15
  113. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +0 -2
  114. package/dist/components/organisms/header/MiddleSlot.vue.js +0 -17
  115. package/dist/components/organisms/header/MiddleSlot.vue2.js +0 -25
  116. package/dist/components/organisms/header/RightSlot.vue.d.ts +0 -2
  117. package/dist/components/organisms/header/RightSlot.vue.js +0 -17
  118. package/dist/components/organisms/header/RightSlot.vue2.js +0 -36
  119. package/dist/components/organisms/header/ViewOptions.vue.d.ts +0 -2
  120. package/dist/components/organisms/header/ViewOptions.vue.js +0 -18
  121. package/dist/components/organisms/header/ViewOptions.vue2.js +0 -17
  122. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +0 -2
  123. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
  124. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
  125. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +0 -14
  126. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +0 -22
  127. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +0 -18
  128. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -16
  129. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +0 -18
  130. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +0 -16
  131. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +0 -2
  132. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +0 -18
  133. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +0 -23
  134. package/dist/components/wrappers/WpModal.vue.d.ts +0 -76
  135. package/dist/components/wrappers/WpModal.vue.js +0 -27
  136. package/dist/components/wrappers/WpModal.vue2.js +0 -22
  137. package/dist/composables/useActionsApi.d.ts +0 -7
  138. package/dist/composables/useActionsApi.js +0 -64
  139. package/dist/composables/useCodeEditorApi.d.ts +0 -4
  140. package/dist/composables/useCodeEditorApi.js +0 -11
  141. package/dist/composables/useConfig.d.ts +0 -4
  142. package/dist/composables/useConfig.js +0 -7
  143. package/dist/composables/useDebounce.d.ts +0 -4
  144. package/dist/composables/useDebounce.js +0 -12
  145. package/dist/composables/useExport.d.ts +0 -3
  146. package/dist/composables/useExport.js +0 -45
  147. package/dist/composables/useGuidoActions.d.ts +0 -46
  148. package/dist/composables/useGuidoActions.js +0 -37
  149. package/dist/composables/useHtmlCompiler.d.ts +0 -4
  150. package/dist/composables/useHtmlCompiler.js +0 -16
  151. package/dist/composables/useHttp.js +0 -84
  152. package/dist/composables/usePartner.d.ts +0 -4
  153. package/dist/composables/usePartner.js +0 -16
  154. package/dist/composables/usePreviewMode.d.ts +0 -5
  155. package/dist/composables/usePreviewMode.js +0 -31
  156. package/dist/composables/useProvideInject.d.ts +0 -14
  157. package/dist/composables/useProvideInject.js +0 -17
  158. package/dist/composables/useResponsivePreview.d.ts +0 -5
  159. package/dist/composables/useResponsivePreview.js +0 -86
  160. package/dist/composables/useToaster.js +0 -37
  161. package/dist/composables/useVersionHistoryApi.d.ts +0 -8
  162. package/dist/composables/useVersionHistoryApi.js +0 -53
  163. package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
  164. package/dist/config/compiler/htmlCompilerRules.js +0 -145
  165. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  166. package/dist/enums/displayConditions.d.ts +0 -2
  167. package/dist/enums/displayConditions.js +0 -80
  168. package/dist/enums/preview.d.ts +0 -13
  169. package/dist/enums/preview.js +0 -23
  170. package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +0 -6
  171. package/dist/extensions/DynamicContent/dynamic-content-modal.js +0 -27
  172. package/dist/extensions/DynamicContent/dynamic-content.css.js +0 -24
  173. package/dist/extensions/DynamicContent/dynamic-content.d.ts +0 -16
  174. package/dist/extensions/DynamicContent/dynamic-content.js +0 -63
  175. package/dist/extensions/DynamicContent/extension.d.ts +0 -2
  176. package/dist/extensions/DynamicContent/extension.js +0 -11
  177. package/dist/mock/api/custom-fonts.d.ts +0 -2
  178. package/dist/mock/api/default-template.d.ts +0 -2
  179. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -51
  180. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -52
  181. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -41
  182. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +0 -18
  183. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +0 -32
  184. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +0 -18
  185. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +0 -8
  186. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -13
  187. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +0 -34
  188. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -13
  189. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -13
  190. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -104
  191. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -13
  192. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -13
  193. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -13
  194. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -13
  195. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -13
  196. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -13
  197. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -45
  198. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +0 -43
  199. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +0 -46
  200. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +0 -44
  201. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +0 -22
  202. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +0 -46
  203. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +0 -46
  204. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +0 -45
  205. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +0 -45
  206. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +0 -45
  207. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -20
  208. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +0 -43
  209. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +0 -45
  210. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -18
  211. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -32
  212. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +0 -46
  213. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +0 -44
  214. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +0 -43
  215. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +0 -43
  216. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +0 -45
  217. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +0 -43
  218. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +0 -266
  219. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -26
  220. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -22
  221. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -18
  222. package/dist/services/stripoApi.d.ts +0 -8
  223. package/dist/services/stripoApi.js +0 -49
  224. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  225. package/dist/static/assets/phone-mockup.svg.js +0 -4
  226. package/dist/static/styles/base.css.js +0 -11
  227. package/dist/static/styles/components/alert-message.css.js +0 -39
  228. package/dist/static/styles/components/amp-block.css.js +0 -18
  229. package/dist/static/styles/components/base-input.css.js +0 -47
  230. package/dist/static/styles/components/button-group.css.js +0 -54
  231. package/dist/static/styles/components/button.css.js +0 -106
  232. package/dist/static/styles/components/combobox.css.js +0 -49
  233. package/dist/static/styles/components/counter.css.js +0 -42
  234. package/dist/static/styles/components/dropdown-menu.css.js +0 -52
  235. package/dist/static/styles/components/narrow-panel.css.js +0 -38
  236. package/dist/static/styles/components/switcher.css.js +0 -11
  237. package/dist/static/styles/components/tabs.css.js +0 -97
  238. package/dist/static/styles/components/tools.css.js +0 -23
  239. package/dist/static/styles/components/version-history.css.js +0 -30
  240. package/dist/static/styles/components/wide-panel.css.js +0 -135
  241. package/dist/static/styles/variables.css.js +0 -23
  242. package/dist/stores/preview.d.ts +0 -57
  243. package/dist/stores/preview.js +0 -56
  244. package/dist/stores/version-history.d.ts +0 -80
  245. package/dist/stores/version-history.js +0 -28
  246. package/dist/utils/dateUtil.d.ts +0 -1
  247. package/dist/utils/dateUtil.js +0 -16
  248. package/dist/utils/htmlCompiler.d.ts +0 -12
  249. package/dist/utils/htmlCompiler.js +0 -70
  250. /package/dist/components/organisms/{email-preview/PreviewContainer.vue.d.ts → top-bar/Header.vue.d.ts} +0 -0
  251. /package/dist/components/organisms/{email-preview/amp/AmpToggle.vue.d.ts → top-bar/HeaderRightSlot.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -14,10 +14,7 @@ Guido is a Vue 2 + TypeScript wrapper for the Stripo Email Editor plugin. Easily
14
14
  ```bash
15
15
  npm install @useinsider/guido
16
16
  ```
17
- ### Prerequisites
18
- 🍍 Your project should have `pinia`
19
17
 
20
- ---
21
18
  ## 🚀 Usage
22
19
 
23
20
  ### Basic Usage
@@ -26,16 +23,8 @@ npm install @useinsider/guido
26
23
  <template>
27
24
  <div>
28
25
  <Guido
29
- ref="guidoEditor"
30
- :template-id="templateId"
31
- :user-id="userId"
26
+ :email-id="emailId"
32
27
  :guido-config="guidoConfig"
33
- :html="initialHtml"
34
- :css="initialCss"
35
- @dynamic-content:open="handleDynamicContentOpen"
36
- @back="handleBack"
37
- @save:start="handleSaveStart"
38
- @save:complete="handleSaveComplete"
39
28
  />
40
29
  </div>
41
30
  </template>
@@ -49,55 +38,11 @@ export default {
49
38
  },
50
39
  data() {
51
40
  return {
52
- templateId: 'template-123',
53
- userId: 'user-456',
54
- initialHtml: '<p>Initial HTML content</p>',
55
- initialCss: 'p { color: #333; }',
41
+ emailId: 'abc123',
56
42
  guidoConfig: {
57
- translationsPath: 'window.trans.en',
58
- htmlCompilerRules: [],
59
- ignoreDefaultHtmlCompilerRules: false,
60
- },
61
- dynamicContentModalVisible: false
43
+ translationsPath: 'window.trans.en'
44
+ }
62
45
  };
63
- },
64
-
65
- methods: {
66
- handleDynamicContentOpen(detail) {
67
- console.log('Dynamic content requested:', detail);
68
- this.dynamicContentModalVisible = true;
69
- },
70
-
71
- handleBack() {
72
- console.log('User clicked back button');
73
- // Handle navigation back
74
- },
75
-
76
- handleSaveStart() {
77
- console.log('Save process started');
78
- // Show loading indicator
79
- },
80
-
81
- handleSaveComplete(template) {
82
- console.log('Save completed:', template);
83
- // Handle saved template data
84
- },
85
-
86
- // ⚠️ Your own Dynamic Content Modal should have this id: #guido-dynamic-content-modal
87
- handleDynamicContentInsert() {
88
- this.$refs.guidoEditor?.dynamicContent.insert({
89
- text: 'Display Text',
90
- value: 'actual-value',
91
- fallback: 'Fallback Text'
92
- });
93
-
94
- this.dynamicContentModalVisible = false;
95
- },
96
-
97
- // ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
98
- handleDynamicContentClose() {
99
- this.$refs.guidoEditor?.dynamicContent.close();
100
- }
101
46
  }
102
47
  };
103
48
  </script>
@@ -109,60 +54,20 @@ export default {
109
54
 
110
55
  | Prop | Type | Required | Default | Description |
111
56
  |------|------|----------|---------|-------------|
112
- | `templateId` | `string` | ✅ | - | Unique identifier for the email template |
113
- | `userId` | `string` | ✅ | - | Unique identifier for the user |
57
+ | `emailId` | `string` | ✅ | - | Unique identifier for the email draft |
114
58
  | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
115
- | `partnerName` | `string` | ⚪ | From URL host | Partner identifier |
116
- | `productType` | `string` | ⚪ | From URL path | Product type identifier |
117
- | `username` | `string` | ⚪ | `'Guido User'` | Display name for the user |
118
- | `html` | `string` | ⚪ | `''` | Initial HTML content for the template |
119
- | `css` | `string` | ⚪ | `''` | Initial CSS styles for the template |
120
-
121
- ### Guido Component Events
122
-
123
- | Event | Payload | Description |
124
- |-------|---------|-------------|
125
- | `dynamic-content:open` | `DynamicContent \| null` | Fired when user requests to insert dynamic content |
126
- | `back` | - | Fired when user clicks the back button |
127
- | `save:start` | - | Fired when the save process begins |
128
- | `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
129
-
130
- ### Guido Exposed Methods
131
- ```typescript
132
- dynamicContent.insert(DynamicContent);
133
- dynamicContent.close();
134
- ```
135
59
 
136
- ### Guido Interfaces
60
+ ### GuidoConfig Interface
137
61
 
138
62
  ```typescript
139
63
  interface GuidoConfig {
140
64
  translationsPath: string;
141
- htmlCompilerRules: CompilerRule[];
142
- ignoreDefaultHtmlCompilerRules: boolean;
143
65
  }
144
66
  ```
145
67
 
146
68
  | Property | Type | Default | Description |
147
69
  |----------|------|---------|-------------|
148
70
  | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
149
- | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
150
- | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
151
-
152
- ```typescript
153
- interface DynamicContent {
154
- value: string;
155
- text: string;
156
- fallback?: string;
157
- }
158
- ```
159
- ---
160
-
161
- | Property | Type | Default | Description |
162
- |----------|------|---------|-------------|
163
- | `value` | `string` | '' | Value of the dynamic content |
164
- | `text` | `string` | '' | Visible value of the dynamic content |
165
- | `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
166
71
 
167
72
  ### TypeScript Types
168
73
 
@@ -177,183 +82,17 @@ import type { GuidoConfig } from '@useinsider/guido';
177
82
  import type { StripoEventType } from '@useinsider/guido';
178
83
  ```
179
84
 
180
- ## 🔨 HTML Compiler Rules
181
-
182
- Guido includes a powerful HTML compiler system that allows you to transform HTML content with custom rules. You can define additional rules and optionally ignore the default rules.
183
-
184
- ### Rule Types
185
-
186
- There are 4 types of compiler rules:
187
-
188
- #### 1. Replace Rule
189
- Replace specific strings in HTML content.
190
-
191
- ```typescript
192
- {
193
- id: 'fix-encoding',
194
- description: 'Fix URL encoding issues',
195
- type: 'replace',
196
- search: '{%22', // String to find
197
- replacement: '%7B%22', // String to replace with
198
- replaceAll: true, // Replace all occurrences (default: true)
199
- priority: 10 // Execution priority (lower = earlier)
200
- }
201
- ```
202
-
203
- #### 2. Regex Rule
204
- Use regular expressions for complex pattern matching and replacement.
205
-
206
- ```typescript
207
- {
208
- id: 'remove-comments',
209
- description: 'Remove HTML comments',
210
- type: 'regex',
211
- pattern: '<!--.*?-->', // Regex pattern
212
- replacement: '', // Replacement string
213
- flags: 'g', // Regex flags (default: 'g')
214
- priority: 20
215
- }
216
- ```
217
-
218
- #### 3. Remove Rule
219
- Remove specific strings or patterns from HTML content.
220
-
221
- ```typescript
222
- {
223
- id: 'cleanup-scripts',
224
- description: 'Remove unwanted script tags',
225
- type: 'remove',
226
- targets: [ // Array of strings or RegExp objects
227
- '<script src="unwanted.js"></script>',
228
- /onclick="[^"]*"/g
229
- ],
230
- priority: 30
231
- }
232
- ```
233
-
234
- #### 4. Custom Rule
235
- Define complex transformation logic with a custom processor function.
236
-
237
- ```typescript
238
- {
239
- id: 'add-meta-tags',
240
- description: 'Add custom meta tags to head',
241
- type: 'custom',
242
- processor: (html: string): string => {
243
- // Custom transformation logic
244
- const metaTags = '<meta name="custom" content="value">';
245
- return html.replace('</head>', `${metaTags}</head>`);
246
- },
247
- priority: 40
248
- }
249
- ```
250
-
251
- ### Using HTML Compiler Rules
252
-
253
- #### Basic Usage with Custom Rules
254
-
255
- ```typescript
256
- const guidoConfig = {
257
- translationsPath: 'window.trans.en',
258
- htmlCompilerRules: [
259
- {
260
- id: 'replace-domain',
261
- description: 'Replace old domain with new one',
262
- type: 'replace',
263
- search: 'old-domain.com',
264
- replacement: 'new-domain.com',
265
- replaceAll: true,
266
- priority: 10
267
- },
268
- {
269
- id: 'remove-tracking',
270
- description: 'Remove tracking pixels',
271
- type: 'regex',
272
- pattern: '<img[^>]*tracking[^>]*>',
273
- replacement: '',
274
- flags: 'gi',
275
- priority: 20
276
- }
277
- ]
278
- };
279
- ```
280
-
281
- #### Ignoring Default Rules
282
-
283
- ```typescript
284
- const guidoConfig = {
285
- translationsPath: 'window.trans.en',
286
- ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
287
- htmlCompilerRules: [
288
- // Only your custom rules will be applied
289
- {
290
- id: 'custom-transformation',
291
- type: 'replace',
292
- search: 'old-text',
293
- replacement: 'new-text',
294
- priority: 1
295
- }
296
- ]
297
- };
298
- ```
299
-
300
- ### Rule Execution Order
301
-
302
- Rules are executed in priority order (lower numbers first). Rules with the same priority are executed in array order.
303
-
304
- - **Priority 1-99**: Reserved for critical transformations
305
- - **Priority 100-999**: Standard transformations
306
- - **Priority 1000+**: Additional custom rules (automatically assigned)
307
-
308
- ### Default Rules
309
-
310
- Guido includes several default rules for common email HTML optimizations:
311
-
312
- - **URL encoding fixes**: Fixes malformed URL encoding in dynamic content
313
- - **Template tag restoration**: Restores `{{}}` template tags that got URL encoded
314
- - **HTML entity decoding**: Converts `&lt;` and `&gt;` back to `<` and `>`
315
- - **Cleanup rules**: Removes unwanted iframe and style elements
316
- - **MSO conditions**: Manages Outlook-specific conditional comments
317
- - **Domain replacement**: Updates old image domains to current ones
318
-
319
- You can view all default rules in: `src/config/compiler/htmlCompilerRules.ts`
320
-
321
- ### CompilerRule Interface
85
+ ### StripoEventType
322
86
 
323
87
  ```typescript
324
- type CompilerRuleType = 'replace' | 'regex' | 'remove' | 'custom';
325
-
326
- interface BaseCompilerRule {
327
- id: string;
328
- description?: string;
329
- priority: number;
330
- }
331
-
332
- interface ReplaceRule extends BaseCompilerRule {
333
- type: 'replace';
334
- search: string;
335
- replacement: string;
336
- replaceAll?: boolean; // Default: true
337
- }
338
-
339
- interface RegexRule extends BaseCompilerRule {
340
- type: 'regex';
341
- pattern: string;
342
- replacement: string;
343
- flags?: string; // Default: 'g'
344
- }
345
-
346
- interface RemoveRule extends BaseCompilerRule {
347
- type: 'remove';
348
- targets: (string | RegExp)[]; // Array of strings or RegExp objects
349
- }
350
-
351
- interface CustomRule extends BaseCompilerRule {
352
- type: 'custom';
353
- processor: (html: string) => string;
354
- }
355
-
356
- type CompilerRule = ReplaceRule | RegexRule | RemoveRule | CustomRule;
88
+ type StripoEventType =
89
+ | 'save'
90
+ | 'export'
91
+ | 'close'
92
+ | 'autosave'
93
+ | 'publish'
94
+ | 'export:requested'
95
+ | 'export:ready';
357
96
  ```
358
97
 
359
98
  ---
@@ -399,140 +138,25 @@ VITE_STRIPO_ROLE=your_role
399
138
 
400
139
  ```
401
140
  src/
402
- ├── components/ # Vue components
403
- ├── composables/ # Vue composables & business logic
404
- ├── services/ # API layer
405
- ├── stores/ # State management
406
- ├── @types/ # TypeScript definitions
407
- ├── static/ # Static assets & templates
408
- ├── utils/ # Utility functions
409
- ├── enums/ # Constants & enums
410
- ├── mock/ # Mock data for development
411
- ├── plugins/ # Vue plugins
412
- └── library.ts # Main export
413
- ```
414
-
415
- ## 🔌 Provide/Inject Utilities
416
-
417
- Guido includes type-safe utilities for Vue's provide/inject system to facilitate dependency injection between components.
418
-
419
- ### useProvideInject
420
-
421
- The `useProvideInject` composable provides two helper functions for type-safe dependency injection:
422
-
423
- #### Basic Usage
424
-
425
- ```typescript
426
- // Parent component
427
- import { provideValue } from '@useinsider/guido';
428
- import { InjectionKey } from 'vue';
429
-
430
- // Define a typed injection key
431
- const MyServiceKey: InjectionKey<MyService> = Symbol('MyService');
432
-
433
- // Provide the value
434
- const myService = new MyService();
435
- provideValue(MyServiceKey, myService);
436
-
437
- // Child component
438
- import { useInjectedValue } from '@useinsider/guido';
439
-
440
- // Inject the value with type safety
441
- const myService = useInjectedValue(MyServiceKey);
442
- ```
443
-
444
- #### With Default Value
445
-
446
- ```typescript
447
- // Inject with a fallback value
448
- const myService = useInjectedValue(MyServiceKey, new DefaultService());
449
- ```
450
-
451
- #### Error Handling
452
-
453
- The `useInjectedValue` function will throw a descriptive error if no provider is found and no default value is provided:
454
-
455
- ```typescript
456
- // This will throw an error if no provider exists
457
- try {
458
- const myService = useInjectedValue(MyServiceKey);
459
- } catch (error) {
460
- console.error('No provider found for MyService');
461
- }
141
+ ├── components/
142
+ ├── Guido.vue # Main component
143
+ │ └── organisms/
144
+ │ └── top-bar/ # Header components
145
+ ...
146
+ ├── composables/
147
+ ├── useStripo.ts # Stripo integration
148
+ │ └── useTranslations.ts # Translation management
149
+ ├── @types/
150
+ ├── generic.ts # Generic types
151
+ │ ├── stripo.d.ts # Stripo-specific types
152
+ │ └── events.ts # Event types
153
+ ├── static/
154
+ │ ├── editor.css # Custom editor styles
155
+ │ └── templates/
156
+ │ └── default/ # Default email template
157
+ └── library.ts # Main export for library
462
158
  ```
463
159
 
464
- ### API Reference
465
-
466
- #### `provideValue`
467
-
468
- ```typescript
469
- provideValue<T>(key: InjectionKey<T>, value: T): void
470
- ```
471
-
472
- Provides a value using Vue's provide system with type safety.
473
-
474
- | Parameter | Type | Description |
475
- |-----------|------|-------------|
476
- | `key` | `InjectionKey<T>` | The typed injection key |
477
- | `value` | `T` | The value to provide |
478
-
479
- #### `useInjectedValue`
480
-
481
- ```typescript
482
- useInjectedValue<T>(key: InjectionKey<T>, defaultValue?: T): T
483
- ```
484
-
485
- Injects a value using Vue's inject system with type safety and error handling.
486
-
487
- | Parameter | Type | Required | Description |
488
- |-----------|------|----------|-------------|
489
- | `key` | `InjectionKey<T>` | ✅ | The typed injection key |
490
- | `defaultValue` | `T` | ⚪ | Optional fallback value |
491
-
492
- **Returns:** `T` - The injected value
493
-
494
- **Throws:** `Error` - When no provider is found and no default value is provided
495
-
496
- ## 🌐 i18n
497
- Before running the project, it sends to request to inone.useinsider.com/translations and writes the JSON file into - [trans.json](src/mock/responses/trans.json).
498
- It allows to use production or local translations on your code. 🚀
499
- Example usage:
500
- ```js
501
- import { useTranslations } from '@@/Composables/useTranslations';
502
-
503
- const trans = useTranslations();
504
-
505
- // use everywhere like this:
506
- trans('foo.bar')
507
- ```
508
-
509
- ## 📦 Local Building (Recommended)
510
-
511
- Run this commands if you want to test the package on your local before sending to NPM.
512
- ```sh
513
- bun run build
514
- ```
515
-
516
- Since bun does not have packaging yet, use npm here: 🥲
517
- ```sh
518
- npm pack
519
- ```
520
-
521
- It'll crate like `useinsider-guido-1.0.0.tgz` file.
522
-
523
- Move this file to your project path like: `email-fe` via:
524
- ```sh
525
- cp useinsider-guido-1.0.0.tgz ../email-fe
526
- ```
527
-
528
- Install the file to your project:
529
- ```sh
530
- npm i ./useinsider-guido-1.0.0.tgz
531
- ```
532
-
533
- Then you just need to rebuild to your project or restart the Container. 🎉
534
-
535
- For Future, we can create a shell script for it. Feel free to help 🙃
536
160
 
537
161
  ## 📦 Build Output
538
162
 
@@ -556,6 +180,7 @@ The library builds to multiple formats:
556
180
  }
557
181
  ```
558
182
 
183
+
559
184
  ## 🤝 Contributing
560
185
  - PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
561
186
  - PR Labels should be filled.
@@ -575,8 +200,7 @@ ISC License
575
200
  - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
576
201
 
577
202
  ## 🎯 TODO:
578
- - CSS part should be optimized with variables & `sass-loader`.
203
+ - [editor.css](src/static/editor.css) should be optimized with variables & `sass-loader`.
579
204
  - Master Version Generator should be fixed.
580
205
  - Playwright integration
581
206
  - Commitlint & Precommit Hooks integration
582
- - Get Pre-built display conditions from API
@@ -1,16 +1,3 @@
1
- import type { CompilerRule } from './html-compiler';
2
1
  export type GuidoConfig = {
3
2
  translationsPath: string;
4
- htmlCompilerRules?: CompilerRule[];
5
- ignoreDefaultHtmlCompilerRules?: boolean;
6
- emailHeader: EmailHeader;
7
3
  };
8
- export type DynamicContent = {
9
- value: string;
10
- text: string;
11
- fallback?: string;
12
- };
13
- export interface EmailHeader {
14
- senderName: string;
15
- subject: string;
16
- }
package/dist/App.vue.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import '../node_modules/@useinsider/design-system-vue/dist/design-system-vue.css';
2
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
3
  export default _default;
@@ -1,26 +1,9 @@
1
- import type { DynamicContent, GuidoConfig } from '@@/Types/generic';
2
- import type { Template } from '@@/Types/stripo';
1
+ import type { GuidoConfig } from '@@/Types/generic';
3
2
  type __VLS_Props = {
4
- templateId: string;
5
- userId: string;
6
- partnerName?: string;
7
- productType?: string;
8
- username?: string;
9
- html?: string;
10
- css?: string;
3
+ emailId: string;
11
4
  guidoConfig: GuidoConfig;
12
5
  };
13
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
14
- dynamicContent: {
15
- insert: (data: DynamicContent) => void;
16
- close: () => void;
17
- };
18
- }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
19
- "dynamic-content:open": (detail: DynamicContent | null) => void;
20
- back: () => void;
21
- "save:start": () => void;
22
- "save:complete": (template: Omit<Template, "forceRecreate">) => void;
23
- }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
6
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
24
7
  export default _default;
25
8
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
26
9
  type __VLS_TypePropsToOption<T> = {
@@ -1,18 +1,18 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import t from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
- var i = this, e = i._self._c, r = i._self._setupProxy;
6
- return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.previewStore.isPreviewModeOpen ? e(r.PreviewContainer) : i._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
- }, a = [], n = /* @__PURE__ */ t(
5
+ var e = this, r = e._self._c, t = e._self._setupProxy;
6
+ return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.Header), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
+ }, _ = [], a = /* @__PURE__ */ i(
8
8
  o,
9
9
  s,
10
- a,
10
+ _,
11
11
  !1,
12
12
  null,
13
- "5fe1cbdf"
13
+ "ef4897b1"
14
14
  );
15
- const c = n.exports;
15
+ const p = a.exports;
16
16
  export {
17
- c as default
17
+ p as default
18
18
  };