@useinsider/guido 1.0.0-beta.35d2ac4 → 1.0.0-beta.3af57f2

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 (275) hide show
  1. package/README.md +82 -535
  2. package/dist/@types/generic.d.ts +4 -13
  3. package/dist/App.vue.d.ts +1 -1
  4. package/dist/components/Guido.vue.d.ts +2 -22
  5. package/dist/components/Guido.vue.js +7 -7
  6. package/dist/components/Guido.vue2.js +15 -74
  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 +11 -0
  15. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.d.ts +2 -0
  16. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.js +18 -0
  17. package/dist/components/organisms/top-bar/HeaderRightSlot.vue2.js +14 -0
  18. package/dist/composables/useCustomInterfaceAppearance.js +9 -45
  19. package/dist/composables/useStripo.d.ts +2 -2
  20. package/dist/composables/useStripo.js +50 -73
  21. package/dist/composables/useTemplates.d.ts +5 -0
  22. package/dist/composables/useTemplates.js +27 -0
  23. package/dist/composables/useToaster.d.ts +0 -1
  24. package/dist/composables/useTranslations.d.ts +3 -1
  25. package/dist/enums/defaults.enum.d.ts +18 -0
  26. package/dist/guido.css +1 -1
  27. package/dist/library.d.ts +0 -1
  28. package/dist/static/editor.css.js +182 -0
  29. package/dist/static/templates/default/index.html.js +5 -0
  30. package/dist/static/templates/default/style.css.js +119 -0
  31. package/dist/stores/counter.d.ts +12 -0
  32. package/package.json +5 -6
  33. package/dist/_virtual/AddCustomFont.js +0 -4
  34. package/dist/_virtual/AiAssistantValueType.js +0 -4
  35. package/dist/_virtual/BackgroundColorBuiltInControl.js +0 -4
  36. package/dist/_virtual/BackgroundImageBuiltInControl.js +0 -4
  37. package/dist/_virtual/Block.js +0 -4
  38. package/dist/_virtual/BlockAttributes.js +0 -4
  39. package/dist/_virtual/BlockCompositionType.js +0 -4
  40. package/dist/_virtual/BlockPaddingsBuiltInControl.js +0 -4
  41. package/dist/_virtual/BlockRenderer.js +0 -4
  42. package/dist/_virtual/BlockType.js +0 -4
  43. package/dist/_virtual/BlocksPanel.js +0 -4
  44. package/dist/_virtual/BuiltInControl.js +0 -4
  45. package/dist/_virtual/BuiltInControlTypes.js +0 -4
  46. package/dist/_virtual/ButtonBorderBuiltInControl.js +0 -4
  47. package/dist/_virtual/ButtonColorBuiltInControl.js +0 -4
  48. package/dist/_virtual/ButtonFontColorBuiltInControl.js +0 -4
  49. package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +0 -4
  50. package/dist/_virtual/ButtonTextBuiltInControl.js +0 -4
  51. package/dist/_virtual/ContextAction.js +0 -4
  52. package/dist/_virtual/ContextActionType.js +0 -4
  53. package/dist/_virtual/Control.js +0 -4
  54. package/dist/_virtual/EditorStatePropertyType.js +0 -4
  55. package/dist/_virtual/Extension.js +0 -4
  56. package/dist/_virtual/ExtensionBuilder.js +0 -4
  57. package/dist/_virtual/FontFamilyBuiltInControl.js +0 -4
  58. package/dist/_virtual/LinkColorBuiltInControl.js +0 -4
  59. package/dist/_virtual/ModificationDescription.js +0 -4
  60. package/dist/_virtual/PanelPosition.js +0 -4
  61. package/dist/_virtual/PreviewDeviceMode.js +0 -4
  62. package/dist/_virtual/SettingsPanelRegistry.js +0 -4
  63. package/dist/_virtual/SettingsPanelTab.js +0 -4
  64. package/dist/_virtual/SettingsTab.js +0 -4
  65. package/dist/_virtual/StructureBorderBuiltInControl.js +0 -4
  66. package/dist/_virtual/StructurePaddingsBuiltInControl.js +0 -4
  67. package/dist/_virtual/TextColorBuiltInControl.js +0 -4
  68. package/dist/_virtual/TextLineSpacingBuiltInControl.js +0 -4
  69. package/dist/_virtual/TextSizeBuiltInControl.js +0 -4
  70. package/dist/_virtual/TextStyleBuiltInControl.js +0 -4
  71. package/dist/_virtual/UIElement.js +0 -4
  72. package/dist/_virtual/UIElementTagRegistry.js +0 -4
  73. package/dist/_virtual/UIElementType.js +0 -4
  74. package/dist/_virtual/UIElementsAttributes.js +0 -4
  75. package/dist/_virtual/index.js +0 -5
  76. package/dist/_virtual/index2.js +0 -4
  77. package/dist/components/organisms/design-preview/AmpErrorModal.vue.d.ts +0 -16
  78. package/dist/components/organisms/design-preview/AmpErrorModal.vue.js +0 -21
  79. package/dist/components/organisms/design-preview/AmpErrorModal.vue2.js +0 -30
  80. package/dist/components/organisms/design-preview/DesktopPreview.vue.d.ts +0 -16
  81. package/dist/components/organisms/design-preview/DesktopPreview.vue.js +0 -22
  82. package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +0 -43
  83. package/dist/components/organisms/design-preview/EmailPreview.vue.d.ts +0 -16
  84. package/dist/components/organisms/design-preview/EmailPreview.vue.js +0 -17
  85. package/dist/components/organisms/design-preview/EmailPreview.vue2.js +0 -33
  86. package/dist/components/organisms/design-preview/EmailView.vue.d.ts +0 -18
  87. package/dist/components/organisms/design-preview/EmailView.vue.js +0 -19
  88. package/dist/components/organisms/design-preview/EmailView.vue2.js +0 -24
  89. package/dist/components/organisms/design-preview/InboxView.vue.d.ts +0 -17
  90. package/dist/components/organisms/design-preview/InboxView.vue.js +0 -19
  91. package/dist/components/organisms/design-preview/InboxView.vue2.js +0 -23
  92. package/dist/components/organisms/design-preview/MobilePreview.vue.d.ts +0 -17
  93. package/dist/components/organisms/design-preview/MobilePreview.vue.js +0 -17
  94. package/dist/components/organisms/design-preview/MobilePreview.vue2.js +0 -23
  95. package/dist/components/organisms/header/AmpToggle.vue.js +0 -17
  96. package/dist/components/organisms/header/AmpToggle.vue2.js +0 -48
  97. package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +0 -2
  98. package/dist/components/organisms/header/HeaderWrapper.vue2.js +0 -14
  99. package/dist/components/organisms/header/LeftSlot.vue.d.ts +0 -2
  100. package/dist/components/organisms/header/LeftSlot.vue.js +0 -17
  101. package/dist/components/organisms/header/LeftSlot.vue2.js +0 -15
  102. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +0 -2
  103. package/dist/components/organisms/header/MiddleSlot.vue.js +0 -17
  104. package/dist/components/organisms/header/MiddleSlot.vue2.js +0 -25
  105. package/dist/components/organisms/header/RightSlot.vue.d.ts +0 -2
  106. package/dist/components/organisms/header/RightSlot.vue.js +0 -17
  107. package/dist/components/organisms/header/RightSlot.vue2.js +0 -35
  108. package/dist/components/organisms/header/ViewOptions.vue.d.ts +0 -2
  109. package/dist/components/organisms/header/ViewOptions.vue.js +0 -18
  110. package/dist/components/organisms/header/ViewOptions.vue2.js +0 -15
  111. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +0 -2
  112. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
  113. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
  114. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +0 -14
  115. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +0 -22
  116. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +0 -18
  117. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -16
  118. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +0 -18
  119. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +0 -16
  120. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +0 -2
  121. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +0 -18
  122. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +0 -23
  123. package/dist/composables/useActionsApi.d.ts +0 -7
  124. package/dist/composables/useActionsApi.js +0 -49
  125. package/dist/composables/useDebounce.d.ts +0 -4
  126. package/dist/composables/useDebounce.js +0 -12
  127. package/dist/composables/useExport.d.ts +0 -3
  128. package/dist/composables/useExport.js +0 -45
  129. package/dist/composables/useGuidoActions.d.ts +0 -46
  130. package/dist/composables/useGuidoActions.js +0 -37
  131. package/dist/composables/useHtmlCompiler.d.ts +0 -4
  132. package/dist/composables/useHtmlCompiler.js +0 -16
  133. package/dist/composables/useHttp.js +0 -84
  134. package/dist/composables/useMobileGmailFit.d.ts +0 -5
  135. package/dist/composables/useMobileGmailFit.js +0 -69
  136. package/dist/composables/usePartner.d.ts +0 -4
  137. package/dist/composables/usePartner.js +0 -16
  138. package/dist/composables/useProvideInject.d.ts +0 -14
  139. package/dist/composables/useProvideInject.js +0 -17
  140. package/dist/composables/useToaster.js +0 -37
  141. package/dist/composables/useTranslations.js +0 -18
  142. package/dist/composables/useVersionHistoryApi.d.ts +0 -8
  143. package/dist/composables/useVersionHistoryApi.js +0 -53
  144. package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
  145. package/dist/config/compiler/htmlCompilerRules.js +0 -145
  146. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  147. package/dist/enums/defaults.d.ts +0 -4
  148. package/dist/enums/defaults.js +0 -8
  149. package/dist/enums/displayConditions.d.ts +0 -2
  150. package/dist/enums/displayConditions.js +0 -80
  151. package/dist/enums/emailPreview.d.ts +0 -3
  152. package/dist/enums/emailPreview.js +0 -6
  153. package/dist/enums/gmailMobilePreview.d.ts +0 -7
  154. package/dist/enums/gmailMobilePreview.js +0 -17
  155. package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +0 -6
  156. package/dist/extensions/DynamicContent/dynamic-content-modal.js +0 -27
  157. package/dist/extensions/DynamicContent/dynamic-content.css.js +0 -24
  158. package/dist/extensions/DynamicContent/dynamic-content.d.ts +0 -16
  159. package/dist/extensions/DynamicContent/dynamic-content.js +0 -63
  160. package/dist/extensions/DynamicContent/extension.d.ts +0 -2
  161. package/dist/extensions/DynamicContent/extension.js +0 -11
  162. package/dist/guido.png +0 -0
  163. package/dist/inbox-mockup.svg +0 -39
  164. package/dist/mock/api/custom-fonts.d.ts +0 -2
  165. package/dist/mock/api/default-template.d.ts +0 -2
  166. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -51
  167. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -52
  168. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -41
  169. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +0 -18
  170. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +0 -32
  171. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +0 -18
  172. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +0 -8
  173. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -13
  174. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +0 -34
  175. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -13
  176. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -13
  177. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -104
  178. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -13
  179. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -13
  180. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -13
  181. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -13
  182. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -13
  183. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -13
  184. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -45
  185. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +0 -43
  186. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +0 -46
  187. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +0 -44
  188. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +0 -22
  189. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +0 -46
  190. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +0 -46
  191. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +0 -45
  192. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +0 -45
  193. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +0 -45
  194. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -20
  195. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +0 -43
  196. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +0 -45
  197. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -18
  198. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -32
  199. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +0 -46
  200. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +0 -44
  201. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +0 -43
  202. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +0 -43
  203. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +0 -45
  204. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +0 -43
  205. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +0 -266
  206. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -26
  207. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -22
  208. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -18
  209. package/dist/node_modules/lodash-es/_Hash.js +0 -20
  210. package/dist/node_modules/lodash-es/_ListCache.js +0 -20
  211. package/dist/node_modules/lodash-es/_Map.js +0 -6
  212. package/dist/node_modules/lodash-es/_MapCache.js +0 -20
  213. package/dist/node_modules/lodash-es/_Symbol.js +0 -5
  214. package/dist/node_modules/lodash-es/_assocIndexOf.js +0 -10
  215. package/dist/node_modules/lodash-es/_baseGetTag.js +0 -10
  216. package/dist/node_modules/lodash-es/_baseIsNative.js +0 -16
  217. package/dist/node_modules/lodash-es/_coreJsData.js +0 -5
  218. package/dist/node_modules/lodash-es/_freeGlobal.js +0 -4
  219. package/dist/node_modules/lodash-es/_getMapData.js +0 -8
  220. package/dist/node_modules/lodash-es/_getNative.js +0 -9
  221. package/dist/node_modules/lodash-es/_getRawTag.js +0 -15
  222. package/dist/node_modules/lodash-es/_getValue.js +0 -6
  223. package/dist/node_modules/lodash-es/_hashClear.js +0 -7
  224. package/dist/node_modules/lodash-es/_hashDelete.js +0 -7
  225. package/dist/node_modules/lodash-es/_hashGet.js +0 -13
  226. package/dist/node_modules/lodash-es/_hashHas.js +0 -9
  227. package/dist/node_modules/lodash-es/_hashSet.js +0 -9
  228. package/dist/node_modules/lodash-es/_isKeyable.js +0 -7
  229. package/dist/node_modules/lodash-es/_isMasked.js +0 -11
  230. package/dist/node_modules/lodash-es/_listCacheClear.js +0 -6
  231. package/dist/node_modules/lodash-es/_listCacheDelete.js +0 -12
  232. package/dist/node_modules/lodash-es/_listCacheGet.js +0 -8
  233. package/dist/node_modules/lodash-es/_listCacheHas.js +0 -7
  234. package/dist/node_modules/lodash-es/_listCacheSet.js +0 -8
  235. package/dist/node_modules/lodash-es/_mapCacheClear.js +0 -13
  236. package/dist/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  237. package/dist/node_modules/lodash-es/_mapCacheGet.js +0 -7
  238. package/dist/node_modules/lodash-es/_mapCacheHas.js +0 -7
  239. package/dist/node_modules/lodash-es/_mapCacheSet.js +0 -8
  240. package/dist/node_modules/lodash-es/_nativeCreate.js +0 -5
  241. package/dist/node_modules/lodash-es/_objectToString.js +0 -7
  242. package/dist/node_modules/lodash-es/_root.js +0 -5
  243. package/dist/node_modules/lodash-es/_toSource.js +0 -17
  244. package/dist/node_modules/lodash-es/eq.js +0 -6
  245. package/dist/node_modules/lodash-es/isFunction.js +0 -12
  246. package/dist/node_modules/lodash-es/isObject.js +0 -7
  247. package/dist/node_modules/lodash-es/memoize.js +0 -18
  248. package/dist/phone-mockup.svg +0 -31
  249. package/dist/services/stripoApi.d.ts +0 -8
  250. package/dist/services/stripoApi.js +0 -49
  251. package/dist/static/styles/base.css.js +0 -11
  252. package/dist/static/styles/components/alert-message.css.js +0 -39
  253. package/dist/static/styles/components/amp-block.css.js +0 -18
  254. package/dist/static/styles/components/base-input.css.js +0 -47
  255. package/dist/static/styles/components/button-group.css.js +0 -54
  256. package/dist/static/styles/components/button.css.js +0 -106
  257. package/dist/static/styles/components/combobox.css.js +0 -49
  258. package/dist/static/styles/components/counter.css.js +0 -42
  259. package/dist/static/styles/components/dropdown-menu.css.js +0 -52
  260. package/dist/static/styles/components/narrow-panel.css.js +0 -38
  261. package/dist/static/styles/components/switcher.css.js +0 -11
  262. package/dist/static/styles/components/tabs.css.js +0 -97
  263. package/dist/static/styles/components/tools.css.js +0 -23
  264. package/dist/static/styles/components/version-history.css.js +0 -30
  265. package/dist/static/styles/components/wide-panel.css.js +0 -135
  266. package/dist/static/styles/variables.css.js +0 -23
  267. package/dist/stores/editor.d.ts +0 -9
  268. package/dist/stores/editor.js +0 -15
  269. package/dist/stores/version-history.d.ts +0 -80
  270. package/dist/stores/version-history.js +0 -28
  271. package/dist/utils/dateUtil.d.ts +0 -1
  272. package/dist/utils/dateUtil.js +0 -16
  273. package/dist/utils/htmlCompiler.d.ts +0 -12
  274. package/dist/utils/htmlCompiler.js +0 -70
  275. /package/dist/components/organisms/{header/AmpToggle.vue.d.ts → top-bar/Header.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -1,43 +1,25 @@
1
- <p align="center">
2
- <a href="https://www.youtube.com/shorts/Y0RwBeMezL4" target="_blank" rel="noopener noreferrer">
3
- <img width="180" src="./public/guido.png" alt="Guido logo">
4
- </a>
5
- </p>
1
+ # @useinsider/guido-plugin
6
2
 
7
-
8
- # @useinsider/guido
9
-
10
- Guido is a Vue 2 + TypeScript wrapper for the Stripo Email Editor plugin. Easily embed the professional email editor in your Vue applications with a clean, customizable interface.
3
+ Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.
11
4
 
12
5
  ## 📦 Install
13
-
14
6
  ```bash
15
7
  npm install @useinsider/guido
16
8
  ```
17
- ### Prerequisites
18
- 🍍 Your project should have `pinia`
19
-
20
- ---
21
- ## 🚀 Usage
22
9
 
23
- ### Basic Usage
24
-
25
- ```html
10
+ ## 🚀 Usage (Vue 2)
11
+ ```vue
26
12
  <template>
27
- <div>
28
- <Guido
29
- ref="guidoEditor"
30
- :template-id="templateId"
31
- :user-id="userId"
32
- :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
- />
40
- </div>
13
+ <Guido
14
+ email-id="abc123"
15
+ :api="apiEndpoints"
16
+ :extensions="extensions"
17
+ :insider-stripo-config="insiderStripoConfig"
18
+ @save="handleSave"
19
+ @export:requested="onExportRequested"
20
+ @export:ready="handleHtml"
21
+ @close="onClose"
22
+ />
41
23
  </template>
42
24
 
43
25
  <script lang="ts">
@@ -49,54 +31,35 @@ export default {
49
31
  },
50
32
  data() {
51
33
  return {
52
- templateId: 'template-123',
53
- userId: 'user-456',
54
- initialHtml: '<p>Initial HTML content</p>',
55
- initialCss: 'p { color: #333; }',
56
- guidoConfig: {
57
- translationsPath: 'window.trans.en',
58
- htmlCompilerRules: [],
59
- ignoreDefaultHtmlCompilerRules: false,
34
+ apiEndpoints: {
35
+ dynamicContent: '/api/dynamic-content',
36
+ unsubPages: '/api/unsub-pages',
37
+ header: '/api/header',
38
+ footer: '/api/footer',
39
+ productName: '/api/product-name',
40
+ productVersion: '/api/product-version',
41
+ token: '/api/stripo-token'
60
42
  },
61
- dynamicContentModalVisible: false
43
+ extensions: {
44
+ dynamicContent: true,
45
+ unsubPages: true,
46
+ header: false,
47
+ footer: false
48
+ }
62
49
  };
63
50
  },
64
-
65
51
  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
52
+ handleSave(data: any) {
53
+ console.log('Saved:', data);
74
54
  },
75
-
76
- handleSaveStart() {
77
- console.log('Save process started');
78
- // Show loading indicator
55
+ handleHtml({ html }: { html: string }) {
56
+ console.log('HTML ready:', html);
79
57
  },
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;
58
+ onExportRequested() {
59
+ console.log('Export started');
95
60
  },
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();
61
+ onClose() {
62
+ console.log('Closed');
100
63
  }
101
64
  }
102
65
  };
@@ -104,479 +67,63 @@ export default {
104
67
  ```
105
68
 
106
69
  ## 📚 API
70
+ ### `<StripoEditor />` Props
71
+ | Prop | Type | Required | Description |
72
+ |-------------|----------|----------|----------------------------|
73
+ | emailId | string | ✅ | Stripo email draft ID |
74
+ | iframeId | string | ❌ | Custom iframe ID |
75
+ | api | object | ❌ | Custom API endpoints |
76
+ | extensions | object | ❌ | Enable/disable extensions |
77
+ | insiderStripoConfig | object | ❌ | Insider Stripo configuration |
78
+
79
+ ### Extensions
80
+ | Extension | Type | Default | Description |
81
+ |----------------|-----------|---------|--------------------------------|
82
+ | dynamicContent | boolean | true | Dynamic content functionality |
83
+ | unsubPages | boolean | true | Unsubscribe pages feature |
84
+ | header | boolean | true | Header customization |
85
+ | footer | boolean | true | Footer customization |
86
+
87
+ ### Insider Stripo Configuration
88
+ | Property | Type | Default | Description |
89
+ |-------------------|----------|---------|--------------------------------|
90
+ | translationsPath | string | 'window.trans.en | JS Path to translations file |
91
+
92
+ ### API Endpoints
93
+ | Endpoint | Default Path | Description |
94
+ |-------------------|------------------------|--------------------------------|
95
+ | dynamicContent | /api/dynamic-content | Dynamic content endpoint |
96
+ | unsubPages | /api/unsub-pages | Unsubscribe pages endpoint |
97
+ | header | /api/header | Header endpoint |
98
+ | footer | /api/footer | Footer endpoint |
99
+ | productName | /api/product-name | Product name endpoint |
100
+ | productVersion | /api/product-version | Product version endpoint |
101
+ | token | /api/stripo-token | Authentication token endpoint |
102
+
103
+ ### Events
104
+ | Event | Payload | Description |
105
+ |-------------------|------------------------|--------------------------------|
106
+ | `save` | any | Triggered on save |
107
+ | `export:requested`| void | Triggered when export starts |
108
+ | `export:ready` | { html: string } | Triggered when HTML is ready |
109
+ | `close` | void | Triggered when editor closes |
107
110
 
108
- ### Guido Component Props
109
-
110
- | Prop | Type | Required | Default | Description |
111
- |------|------|----------|---------|-------------|
112
- | `templateId` | `string` | ✅ | - | Unique identifier for the email template |
113
- | `userId` | `string` | ✅ | - | Unique identifier for the user |
114
- | `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
-
136
- ### Guido Interfaces
137
-
138
- ```typescript
139
- interface GuidoConfig {
140
- translationsPath: string;
141
- htmlCompilerRules: CompilerRule[];
142
- ignoreDefaultHtmlCompilerRules: boolean;
143
- }
144
- ```
145
-
146
- | Property | Type | Default | Description |
147
- |----------|------|---------|-------------|
148
- | `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
111
 
152
- ```typescript
153
- interface DynamicContent {
154
- value: string;
155
- text: string;
156
- fallback?: string;
157
- }
158
- ```
159
112
  ---
160
113
 
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
-
167
- ### TypeScript Types
168
-
169
- The library exports the following TypeScript types:
170
-
171
- ```typescript
172
- // Main component
173
- import { Guido } from '@useinsider/guido';
174
-
175
- // Types
176
- import type { GuidoConfig } from '@useinsider/guido';
177
- import type { StripoEventType } from '@useinsider/guido';
178
- ```
179
-
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
322
-
323
- ```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;
357
- ```
358
-
359
- ---
360
-
361
- ## 🔧 Development
362
-
363
- ### Prerequisites
364
-
365
- - 🧄 `Bun` (strongly recommended)
366
- or
367
- - NodeJS 18+ & `npm`
368
-
369
- ### Setup
370
-
114
+ ## 🛠 Development
371
115
  ```bash
372
- # Install dependencies
373
116
  bun install
374
-
375
- # Start development server
376
117
  bun start
377
-
378
- # Build for production
379
- bun run build
380
-
381
- # Type checking
382
- bun run type-check
383
-
384
- # Linting
385
- bun run lint
386
- ```
387
-
388
- ### Environment Variables
389
-
390
- Create a `.env` file with the following variables: (You can get env variables from your senior)
391
-
392
- ```env
393
- VITE_STRIPO_PLUGIN_ID=your_plugin_id
394
- VITE_STRIPO_SECRET_KEY=your_secret_key
395
- VITE_STRIPO_ROLE=your_role
396
- ```
397
-
398
- ### Project Structure
399
-
400
- ```
401
- 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
- }
462
- ```
463
-
464
- ### API Reference
465
-
466
- #### `provideValue`
467
-
468
- ```typescript
469
- provideValue<T>(key: InjectionKey<T>, value: T): void
470
118
  ```
471
119
 
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
120
+ Build & types:
121
+ ```bash
513
122
  bun run build
514
123
  ```
515
124
 
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
-
537
- ## 📦 Build Output
538
-
539
- The library builds to multiple formats:
540
-
541
- - **ES Module**: `dist/library.js` (recommended)
542
- - **CSS**: `dist/guido.css` (custom styles)
543
-
544
- ### Package Exports
545
-
546
- ```json
547
- {
548
- "exports": {
549
- ".": {
550
- "import": "./dist/library.js",
551
- "types": "./dist/components/Guido.vue.d.ts",
552
- "require": "./dist/components/Guido.vue.js"
553
- },
554
- "./style": "./dist/guido.css"
555
- }
556
- }
557
- ```
558
-
559
- ## 🤝 Contributing
560
- - PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
561
- - PR Labels should be filled.
562
- - PR Assignee required.
563
- - Tests should be covered.
564
- - All required checks should be passed before sending review request.
565
-
566
- ## 📄 License
567
-
568
- ISC License
569
-
570
125
  ---
571
126
 
572
- ## 🔗 Related
573
-
574
- - [Stripo Email Editor](https://stripo.email/) - The underlying email editor
575
- - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
576
-
577
- ## 🎯 TODO:
578
- - CSS part should be optimized with variables & `sass-loader`.
579
- - Master Version Generator should be fixed.
580
- - Playwright integration
581
- - Commitlint & Precommit Hooks integration
582
- - Get Pre-built display conditions from API
127
+ TODO:
128
+ [ ] - Default Template @edugencioglu
129
+ [ ] - Using CSS variables into [editor.css](./src/static/editor.css) @berkansezer-useinsider
@@ -1,15 +1,6 @@
1
- import type { CompilerRule } from './html-compiler';
2
- export type GuidoConfig = {
3
- translationsPath: string;
4
- htmlCompilerRules?: CompilerRule[];
5
- ignoreDefaultHtmlCompilerRules?: boolean;
1
+ export type Translations = {
2
+ [key: string]: string;
6
3
  };
7
- export type DynamicContent = {
8
- value: string;
9
- text: string;
10
- fallback?: string;
4
+ export type InsiderStripoConfig = {
5
+ translationsPath: string;
11
6
  };
12
- export interface EmailData {
13
- senderName: string;
14
- subject: string;
15
- }
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;