@useinsider/guido 1.0.3-beta.a35cbc4 → 1.0.3-beta.a5608d9

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 (367) hide show
  1. package/README.md +152 -627
  2. package/dist/{src/@types → @types}/generic.d.ts +0 -28
  3. package/dist/{src/components → components}/Guido.vue.d.ts +2 -4
  4. package/dist/components/Guido.vue.js +10 -14
  5. package/dist/components/Guido.vue2.js +71 -77
  6. package/dist/{src/components → components}/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  7. package/dist/components/organisms/header/HeaderWrapper.vue.js +8 -10
  8. package/dist/components/organisms/header/HeaderWrapper.vue2.js +13 -14
  9. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  10. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -16
  11. package/dist/{src/components → components}/organisms/header/RightSlot.vue.d.ts +1 -3
  12. package/dist/components/organisms/header/RightSlot.vue.js +11 -13
  13. package/dist/components/organisms/header/RightSlot.vue2.js +23 -24
  14. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  15. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  16. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  17. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  18. package/dist/{src/components → components}/wrappers/WpDrawer.vue.d.ts +4 -6
  19. package/dist/components/wrappers/WpDrawer.vue.js +4 -6
  20. package/dist/composables/useStripo.js +55 -55
  21. package/dist/config/compiler/unsubscribeCompilerRules.js +29 -47
  22. package/dist/config/migrator/index.d.ts +1 -0
  23. package/dist/config/migrator/index.js +6 -9
  24. package/dist/enums/defaults.js +9 -19
  25. package/dist/enums/onboarding.d.ts +1 -0
  26. package/dist/enums/onboarding.js +1 -2
  27. package/dist/enums/unsubscribe.d.ts +15 -0
  28. package/dist/enums/unsubscribe.js +6 -44
  29. package/dist/{src/extensions → extensions}/Blocks/Checkbox/block.d.ts +0 -1
  30. package/dist/extensions/Blocks/Checkbox/block.js +24 -15
  31. package/dist/extensions/Blocks/Checkbox/control.js +67 -55
  32. package/dist/extensions/Blocks/Checkbox/extension.js +16 -5
  33. package/dist/extensions/Blocks/Checkbox/settingsPanel.js +25 -12
  34. package/dist/extensions/Blocks/Checkbox/template.js +16 -5
  35. package/dist/{src/extensions → extensions}/Blocks/RadioButton/block.d.ts +0 -1
  36. package/dist/extensions/Blocks/RadioButton/block.js +22 -13
  37. package/dist/extensions/Blocks/RadioButton/control.js +52 -40
  38. package/dist/extensions/Blocks/RadioButton/extension.js +15 -4
  39. package/dist/extensions/Blocks/RadioButton/settingsPanel.js +26 -13
  40. package/dist/extensions/Blocks/RadioButton/template.js +24 -13
  41. package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/block.d.ts +0 -1
  42. package/dist/extensions/DynamicContent/dynamic-content.js +45 -31
  43. package/dist/extensions/DynamicContent/extension.js +18 -6
  44. package/dist/guido.css +1 -1
  45. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +75 -0
  46. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +77 -0
  47. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +123 -0
  48. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +7 -0
  49. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +7 -0
  50. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +12 -0
  51. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +7 -0
  52. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +119 -0
  53. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +7 -0
  54. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +7 -0
  55. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +7 -0
  56. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +12 -0
  57. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +7 -0
  58. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +7 -0
  59. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +7 -0
  60. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +24 -0
  61. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +24 -0
  62. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +11 -0
  63. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +33 -0
  64. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +22 -0
  65. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +40 -0
  66. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +5 -0
  67. package/dist/services/stripoApi.js +1 -1
  68. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  69. package/dist/static/styles/customEditorStyle.css.js +0 -5
  70. package/dist/{src/stores → stores}/editor.d.ts +0 -21
  71. package/dist/stores/editor.js +1 -2
  72. package/dist/stores/unsubscribe.d.ts +8 -0
  73. package/dist/stores/unsubscribe.js +6 -126
  74. package/dist/utils/dateUtil.d.ts +1 -0
  75. package/dist/utils/dateUtil.js +3 -24
  76. package/dist/{src/utils → utils}/genericUtil.d.ts +0 -1
  77. package/dist/utils/genericUtil.js +7 -8
  78. package/dist/utils/templatePreparation.js +16 -17
  79. package/package.json +3 -8
  80. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +0 -28
  81. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +0 -38
  82. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +0 -17
  83. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +0 -37
  84. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +0 -20
  85. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +0 -44
  86. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +0 -17
  87. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +0 -27
  88. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
  89. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
  90. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
  91. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
  92. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
  93. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
  94. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
  95. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
  96. package/dist/composables/useBlocksConfig.js +0 -49
  97. package/dist/config/migrator/couponBlockMigrator.js +0 -67
  98. package/dist/config/migrator/recommendationMigrator.js +0 -293
  99. package/dist/config/migrator/unsubscribeMigrator.js +0 -124
  100. package/dist/enums/date.js +0 -6
  101. package/dist/enums/extensions/recommendationBlock.js +0 -80
  102. package/dist/extensions/Blocks/Checkbox/iconsRegistry.js +0 -18
  103. package/dist/extensions/Blocks/CouponBlock/block.js +0 -33
  104. package/dist/extensions/Blocks/CouponBlock/extension.js +0 -8
  105. package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +0 -33
  106. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +0 -24
  107. package/dist/extensions/Blocks/CouponBlock/template.js +0 -18
  108. package/dist/extensions/Blocks/RadioButton/iconsRegistry.js +0 -14
  109. package/dist/extensions/Blocks/Recommendation/block.js +0 -30
  110. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -103
  111. package/dist/extensions/Blocks/Recommendation/constants.js +0 -5
  112. package/dist/extensions/Blocks/Recommendation/control.js +0 -306
  113. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
  114. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
  115. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
  116. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
  117. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
  118. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
  119. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
  120. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
  121. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
  122. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
  123. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
  124. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
  125. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
  126. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
  127. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
  128. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
  129. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
  130. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
  131. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
  132. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
  133. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
  134. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
  135. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
  136. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
  137. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
  138. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
  139. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
  140. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
  141. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
  142. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
  143. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
  144. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
  145. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
  146. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
  147. package/dist/extensions/Blocks/Recommendation/extension.js +0 -45
  148. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +0 -51
  149. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +0 -19
  150. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +0 -117
  151. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +0 -266
  152. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -160
  153. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -152
  154. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -180
  155. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +0 -28
  156. package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
  157. package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
  158. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
  159. package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
  160. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
  161. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
  162. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
  163. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
  164. package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
  165. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
  166. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
  167. package/dist/extensions/Blocks/common-control.js +0 -184
  168. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +0 -866
  169. package/dist/package.json.js +0 -7
  170. package/dist/services/recommendationApi.js +0 -43
  171. package/dist/services/unsubscribeApi.js +0 -16
  172. package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -19
  173. package/dist/src/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +0 -16
  174. package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -4
  175. package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -4
  176. package/dist/src/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
  177. package/dist/src/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
  178. package/dist/src/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
  179. package/dist/src/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
  180. package/dist/src/composables/useBlocksConfig.d.ts +0 -11
  181. package/dist/src/config/migrator/couponBlockMigrator.d.ts +0 -1
  182. package/dist/src/config/migrator/index.d.ts +0 -1
  183. package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
  184. package/dist/src/config/migrator/unsubscribeMigrator.d.ts +0 -1
  185. package/dist/src/enums/date.d.ts +0 -4
  186. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -16
  187. package/dist/src/enums/onboarding.d.ts +0 -2
  188. package/dist/src/enums/unsubscribe.d.ts +0 -38
  189. package/dist/src/extensions/Blocks/Checkbox/iconsRegistry.d.ts +0 -4
  190. package/dist/src/extensions/Blocks/CouponBlock/block.d.ts +0 -12
  191. package/dist/src/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +0 -4
  192. package/dist/src/extensions/Blocks/CouponBlock/settingsPanel.d.ts +0 -4
  193. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +0 -3
  194. package/dist/src/extensions/Blocks/RadioButton/iconsRegistry.d.ts +0 -4
  195. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -11
  196. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -28
  197. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -51
  198. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -35
  199. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
  200. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
  201. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
  202. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
  203. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
  204. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
  205. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
  206. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
  207. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
  208. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
  209. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
  210. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
  211. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
  212. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
  213. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
  214. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
  215. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
  216. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
  217. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
  218. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
  219. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
  220. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
  221. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
  222. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
  223. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
  224. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
  225. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
  226. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
  227. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
  228. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
  229. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
  230. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
  231. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
  232. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
  233. package/dist/src/extensions/Blocks/Recommendation/iconsRegistry.d.ts +0 -4
  234. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -555
  235. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  236. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
  237. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -44
  238. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -7
  239. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
  240. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
  241. package/dist/src/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
  242. package/dist/src/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
  243. package/dist/src/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -4
  244. package/dist/src/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
  245. package/dist/src/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
  246. package/dist/src/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
  247. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
  248. package/dist/src/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
  249. package/dist/src/extensions/Blocks/_Boilerplate/extension.d.ts +0 -2
  250. package/dist/src/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -4
  251. package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
  252. package/dist/src/extensions/Blocks/common-control.d.ts +0 -87
  253. package/dist/src/extensions/DynamicContent/extension.d.ts +0 -2
  254. package/dist/src/mock/api/recommendation.d.ts +0 -2
  255. package/dist/src/services/recommendationApi.d.ts +0 -6
  256. package/dist/src/services/unsubscribeApi.d.ts +0 -4
  257. package/dist/src/stores/config.d.ts +0 -103
  258. package/dist/src/stores/unsubscribe.d.ts +0 -256
  259. package/dist/src/utils/dateUtil.d.ts +0 -22
  260. package/dist/stores/config.js +0 -17
  261. package/dist/{src/@types → @types}/events.d.ts +0 -0
  262. package/dist/{src/@types → @types}/save-as-template.d.ts +0 -0
  263. package/dist/{src/App.vue.d.ts → App.vue.d.ts} +0 -0
  264. package/dist/{src/components → components}/organisms/LoadingWrapper.vue.d.ts +0 -0
  265. package/dist/{src/components → components}/organisms/base/Toaster.vue.d.ts +0 -0
  266. package/dist/{src/components → components}/organisms/email-preview/PreviewContainer.vue.d.ts +0 -0
  267. package/dist/{src/components → components}/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -0
  268. package/dist/{src/components → components}/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -0
  269. package/dist/{src/components → components}/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -0
  270. package/dist/{src/components → components}/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -0
  271. package/dist/{src/components → components}/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -0
  272. package/dist/{src/components → components}/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -0
  273. package/dist/{src/components → components}/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -0
  274. package/dist/{src/components → components}/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -0
  275. package/dist/{src/components → components}/organisms/header/LeftSlot.vue.d.ts +0 -0
  276. package/dist/{src/components → components}/organisms/header/MiddleSlot.vue.d.ts +0 -0
  277. package/dist/{src/components → components}/organisms/header/ViewOptions.vue.d.ts +0 -0
  278. package/dist/{src/components → components}/organisms/header/version-history/RestoreButton.vue.d.ts +0 -0
  279. package/dist/{src/components → components}/organisms/header/version-history/VersionHistory.vue.d.ts +0 -0
  280. package/dist/{src/components → components}/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -0
  281. package/dist/{src/components → components}/organisms/header/version-history/ViewOptions.vue.d.ts +0 -0
  282. package/dist/{src/components → components}/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -0
  283. package/dist/{src/components → components}/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -0
  284. package/dist/{src/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts → components/organisms/onboarding/NewVersionPopup.vue.d.ts} +0 -0
  285. package/dist/{src/components/organisms/extensions/recommendation/Filters.vue.d.ts → components/organisms/onboarding/OnboardingWrapper.vue.d.ts} +0 -0
  286. package/dist/{src/components → components}/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -0
  287. package/dist/{src/components → components}/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -0
  288. package/dist/{src/components → components}/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -0
  289. package/dist/{src/components → components}/wrappers/WpModal.vue.d.ts +1 -1
  290. /package/dist/{src/composables → composables}/useActionsApi.d.ts +0 -0
  291. /package/dist/{src/composables → composables}/useApiExample.d.ts +0 -0
  292. /package/dist/{src/composables → composables}/useCodeEditorApi.d.ts +0 -0
  293. /package/dist/{src/composables → composables}/useConfig.d.ts +0 -0
  294. /package/dist/{src/composables → composables}/useCustomInterfaceAppearance.d.ts +0 -0
  295. /package/dist/{src/composables → composables}/useDebounce.d.ts +0 -0
  296. /package/dist/{src/composables → composables}/useExport.d.ts +0 -0
  297. /package/dist/{src/composables → composables}/useGuidoActions.d.ts +0 -0
  298. /package/dist/{src/composables → composables}/useHtmlCompiler.d.ts +0 -0
  299. /package/dist/{src/composables → composables}/useHtmlValidator.d.ts +0 -0
  300. /package/dist/{src/composables → composables}/useHttp.d.ts +0 -0
  301. /package/dist/{src/composables → composables}/usePartner.d.ts +0 -0
  302. /package/dist/{src/composables → composables}/usePreviewMode.d.ts +0 -0
  303. /package/dist/{src/composables → composables}/useProvideInject.d.ts +0 -0
  304. /package/dist/{src/composables → composables}/useRecommendation.d.ts +0 -0
  305. /package/dist/{src/composables → composables}/useResponsivePreview.d.ts +0 -0
  306. /package/dist/{src/composables → composables}/useSave.d.ts +0 -0
  307. /package/dist/{src/composables → composables}/useStripo.d.ts +0 -0
  308. /package/dist/{src/composables → composables}/useStripoEventHandler.d.ts +0 -0
  309. /package/dist/{src/composables → composables}/useToaster.d.ts +0 -0
  310. /package/dist/{src/composables → composables}/useTranslations.d.ts +0 -0
  311. /package/dist/{src/composables → composables}/useValidation.d.ts +0 -0
  312. /package/dist/{src/composables → composables}/useVersionHistoryApi.d.ts +0 -0
  313. /package/dist/{src/composables → composables}/validators/saveAsTemplate.d.ts +0 -0
  314. /package/dist/{src/config → config}/compiler/htmlCompilerRules.d.ts +0 -0
  315. /package/dist/{src/config → config}/compiler/outlookCompilerRules.d.ts +0 -0
  316. /package/dist/{src/config → config}/compiler/recommendationCompilerRules.d.ts +0 -0
  317. /package/dist/{src/config → config}/compiler/socialCompilerRules.d.ts +0 -0
  318. /package/dist/{src/config → config}/compiler/unsubscribeCompilerRules.d.ts +0 -0
  319. /package/dist/{src/config → config}/migrator/checkboxMigrator.d.ts +0 -0
  320. /package/dist/{src/config → config}/migrator/radioButtonMigrator.d.ts +0 -0
  321. /package/dist/{src/enums → enums}/defaults.d.ts +0 -0
  322. /package/dist/{src/enums → enums}/displayConditions.d.ts +0 -0
  323. /package/dist/{src/enums → enums}/html-validator.d.ts +0 -0
  324. /package/dist/{src/enums → enums}/preview.d.ts +0 -0
  325. /package/dist/{src/enums → enums}/recommendation.d.ts +0 -0
  326. /package/dist/{src/enums → enums}/toaster.d.ts +0 -0
  327. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/control.d.ts +0 -0
  328. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/extension.d.ts +0 -0
  329. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/settingsPanel.d.ts +0 -0
  330. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/template.d.ts +0 -0
  331. /package/dist/{src/extensions → extensions}/Blocks/RadioButton/control.d.ts +0 -0
  332. /package/dist/{src/extensions/Blocks/CouponBlock → extensions/Blocks/RadioButton}/extension.d.ts +0 -0
  333. /package/dist/{src/extensions → extensions}/Blocks/RadioButton/settingsPanel.d.ts +0 -0
  334. /package/dist/{src/extensions → extensions}/Blocks/RadioButton/template.d.ts +0 -0
  335. /package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/control.d.ts +0 -0
  336. /package/dist/{src/extensions/Blocks/RadioButton → extensions/Blocks/_Boilerplate}/extension.d.ts +0 -0
  337. /package/dist/{src/extensions/Blocks/Recommendation → extensions/Blocks/_Boilerplate}/settingsPanel.d.ts +0 -0
  338. /package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/template.d.ts +0 -0
  339. /package/dist/{src/extensions → extensions}/DynamicContent/dynamic-content-modal.d.ts +0 -0
  340. /package/dist/{src/extensions → extensions}/DynamicContent/dynamic-content.d.ts +0 -0
  341. /package/dist/{src/extensions/Blocks/Recommendation → extensions/DynamicContent}/extension.d.ts +0 -0
  342. /package/dist/{src/library.d.ts → library.d.ts} +0 -0
  343. /package/dist/{src/main.d.ts → main.d.ts} +0 -0
  344. /package/dist/{src/mock → mock}/api/auth.d.ts +0 -0
  345. /package/dist/{src/mock → mock}/api/custom-fonts.d.ts +0 -0
  346. /package/dist/{src/mock → mock}/api/default-template.d.ts +0 -0
  347. /package/dist/{src/mock → mock}/api/template-library.d.ts +0 -0
  348. /package/dist/{src/mock → mock}/api/unsubscribe.d.ts +0 -0
  349. /package/dist/{src/mock → mock}/api/user-modal-state.d.ts +0 -0
  350. /package/dist/{src/mock → mock}/api/validator.d.ts +0 -0
  351. /package/dist/{src/mock → mock}/browser.d.ts +0 -0
  352. /package/dist/{src/mock → mock}/handlers.d.ts +0 -0
  353. /package/dist/{src/services → services}/onboardingApi.d.ts +0 -0
  354. /package/dist/{src/services → services}/stripoApi.d.ts +0 -0
  355. /package/dist/{src/services → services}/templateLibraryApi.d.ts +0 -0
  356. /package/dist/{src/stores → stores}/dynamic-content.d.ts +0 -0
  357. /package/dist/{src/stores → stores}/onboarding.d.ts +0 -0
  358. /package/dist/{src/stores → stores}/preview.d.ts +0 -0
  359. /package/dist/{src/stores → stores}/recommendation.d.ts +0 -0
  360. /package/dist/{src/stores → stores}/save-as-template.d.ts +0 -0
  361. /package/dist/{src/stores → stores}/toaster.d.ts +0 -0
  362. /package/dist/{src/stores → stores}/version-history.d.ts +0 -0
  363. /package/dist/{src/utils → utils}/arrayUtil.d.ts +0 -0
  364. /package/dist/{src/utils → utils}/base64.d.ts +0 -0
  365. /package/dist/{src/utils → utils}/htmlCompiler.d.ts +0 -0
  366. /package/dist/{src/utils → utils}/templatePreparation.d.ts +0 -0
  367. /package/dist/{src/utils → utils}/tooltipUtils.d.ts +0 -0
package/README.md CHANGED
@@ -4,784 +4,309 @@
4
4
  </a>
5
5
  </p>
6
6
 
7
-
8
7
  # @useinsider/guido
9
8
 
10
9
  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.
11
10
 
11
+ ## 📚 Table of Contents
12
+
13
+ - [Install](#-install)
14
+ - [Quick Start](#-quick-start)
15
+ - [Documentation](#-documentation)
16
+ - [Development](#-development)
17
+ - [Contributing](#-contributing)
18
+ - [License](#-license)
19
+
20
+ ## 📖 Documentation
21
+
22
+ **For comprehensive documentation, visit our [Wiki](./wiki/Home.md):**
23
+
24
+ - **[Getting Started Guide](./wiki/Getting-Started.md)** - Installation, setup, and basic usage
25
+ - **[API Reference](./wiki/API-Reference.md)** - Complete API documentation with examples
26
+ - **[HTML Compiler Rules](./wiki/HTML-Compiler-Rules.md)** - Advanced HTML transformation guide
27
+ - **[Architecture](./wiki/Architecture.md)** - Project structure and design patterns
28
+ - **[Contributing Guide](./wiki/Contributing.md)** - Development workflow and coding standards
29
+
12
30
  ## 📦 Install
13
31
 
14
32
  ```bash
15
33
  npm install @useinsider/guido
16
34
  ```
35
+
36
+ Or using bun:
37
+
38
+ ```bash
39
+ bun add @useinsider/guido
40
+ ```
41
+
17
42
  ### Prerequisites
18
- 🍍 Your project should have `pinia`
19
- You need to be sure those lines added in your config file:
20
-
21
- ℹ️ It helps to optimize your dependencies and sharing by Guido. This is why Guido pretty fast and tiny.
22
-
23
- #### For Webpack
24
- `/webpack.config.js` or `/vue.config.js`
25
- ```js
26
- // ... Previous Configs
43
+
44
+ **Required:** Your project must have `pinia` installed.
45
+
46
+ **Bundler Configuration** (required for proper module sharing):
47
+
48
+ <details>
49
+ <summary>Webpack Configuration</summary>
50
+
51
+ ```js
52
+ // webpack.config.js or vue.config.js
53
+ {
27
54
  shared: {
28
55
  vue: { singleton: true },
29
56
  pinia: { singleton: true },
30
- },
31
- // ... Upcoming Configs
32
- ```
57
+ }
58
+ }
59
+ ```
60
+ </details>
61
+
62
+ <details>
63
+ <summary>Vite Configuration</summary>
33
64
 
34
- ##### For Vite:
35
- `/vite.config.js`
36
- ```js
37
- // ... Previous Configs
65
+ ```js
66
+ // vite.config.js
67
+ {
38
68
  resolve: {
39
69
  dedupe: ['vue', 'pinia'],
40
- },
41
- // ... Upcoming Configs
42
- ```
43
- ---
44
- ## 🚀 Usage
70
+ }
71
+ }
72
+ ```
73
+ </details>
45
74
 
46
- ### Basic Usage
75
+ ---
76
+ ## 🚀 Quick Start
47
77
 
48
- ```html
78
+ ```vue
49
79
  <template>
50
- <div>
51
- <Guido
52
- ref="guidoEditor"
53
- :template-id="templateId"
54
- :user-id="userId"
55
- :migration-date="migrationDate"
56
- :guido-config="guidoConfig"
57
- :html="initialHtml"
58
- :css="initialCss"
59
- @dynamic-content:open="handleDynamicContentOpen"
60
- @back="handleBack"
61
- @save:start="handleSaveStart"
62
- @save:complete="handleSaveComplete"
63
- />
64
- </div>
80
+ <Guido
81
+ ref="guidoEditor"
82
+ :template-id="templateId"
83
+ :user-id="userId"
84
+ :guido-config="guidoConfig"
85
+ @save:complete="handleSave"
86
+ />
65
87
  </template>
66
88
 
67
89
  <script lang="ts">
68
90
  import { Guido } from '@useinsider/guido';
91
+ import '@useinsider/guido/style';
69
92
 
70
93
  export default {
71
- components: {
72
- Guido
73
- },
94
+ components: { Guido },
95
+
74
96
  data() {
75
97
  return {
76
98
  templateId: 'template-123',
77
99
  userId: 'user-456',
78
- migrationDate: 1699488000,
79
- initialHtml: '<p>Initial HTML content</p>',
80
- initialCss: 'p { color: #333; }',
81
100
  guidoConfig: {
82
101
  translationsPath: 'window.trans.en',
83
- htmlCompilerRules: [],
84
- ignoreDefaultHtmlCompilerRules: false,
85
- backButtonLabel?: "Back to Design",
102
+ useHeader: true,
103
+ emailHeader: {
104
+ senderName: 'Your Company',
105
+ subject: 'Email Subject'
106
+ },
107
+ partner: {
108
+ partnerName: 'your-partner',
109
+ productType: 1,
110
+ messageType: 1
111
+ },
86
112
  features: {
87
113
  dynamicContent: true,
88
114
  saveAsTemplate: true,
89
- versionHistory: true,
90
- testMessage: true
115
+ versionHistory: true
91
116
  }
92
- },
93
- dynamicContentModalVisible: false
117
+ }
94
118
  };
95
119
  },
96
120
 
97
121
  methods: {
98
- handleDynamicContentOpen(detail) {
99
- console.log('Dynamic content requested:', detail);
100
- this.dynamicContentModalVisible = true;
101
- },
102
-
103
- handleBack() {
104
- console.log('User clicked back button');
105
- // Handle navigation back
106
- },
107
-
108
- handleSaveStart() {
109
- console.log('Save process started');
110
- // Show loading indicator
111
- },
112
-
113
- handleSaveComplete(template) {
114
- console.log('Save completed:', template);
115
- // Handle saved template data
116
- },
117
-
118
- // ⚠️ Your own Dynamic Content Modal should have this id: #guido-dynamic-content-modal
119
- handleDynamicContentInsert() {
120
- this.$refs.guidoEditor?.dynamicContent.insert({
121
- text: 'Display Text',
122
- value: 'actual-value',
123
- fallback: 'Fallback Text'
124
- });
125
-
126
- this.dynamicContentModalVisible = false;
127
- },
128
-
129
- // ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
130
- handleDynamicContentClose() {
131
- this.$refs.guidoEditor?.dynamicContent.close();
132
- },
133
-
134
- // If you need to trigger save manually like leave modal cases, you can use this method.
135
- save () {
136
- this.$refs.guidoEditor?.saveSilent();
122
+ handleSave(template) {
123
+ console.log('Template saved:', template);
137
124
  }
138
125
  }
139
126
  };
140
127
  </script>
141
128
  ```
142
129
 
143
- ## 📚 API
130
+ > For complete usage examples including dynamic content, see the [Getting Started Guide](./wiki/Getting-Started.md)
131
+
132
+ ## 📚 API Quick Reference
144
133
 
145
- ### Guido Component Props
134
+ ### Props
146
135
 
147
- | Prop | Type | Required | Default | Description |
148
- |------|------|----------|---------|-------------|
149
- | `templateId` | `string` | ✅ | - | Unique identifier for the email template |
150
- | `userId` | `string` | ✅ | - | Unique identifier for the user |
151
- | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
152
- | `migrationDate` | `number` | ✅ | - | Stripo migration date in Unix timestamp (seconds). Retrieved from backend `/partner-settings` endpoint as `migrationDate`. Used for onboarding process |
153
- | `partnerName` | `string` | ⚪ | From URL host | Partner identifier |
154
- | `productType` | `string` | ⚪ | From URL path | Product type identifier |
155
- | `username` | `string` | ⚪ | `'Guido User'` | Display name for the user |
156
- | `html` | `string` | ⚪ | `''` | Initial HTML content for the template |
157
- | `css` | `string` | ⚪ | `''` | Initial CSS styles for the template |
136
+ | Prop | Type | Required | Description |
137
+ |------|------|----------|-------------|
138
+ | `templateId` | `string` | ✅ | Unique identifier for the email template |
139
+ | `userId` | `string` | ✅ | Unique identifier for the user |
140
+ | `guidoConfig` | `GuidoConfig` | ✅ | Configuration object for the editor |
141
+ | `html` | `string` | ⚪ | Initial HTML content |
142
+ | `css` | `string` | ⚪ | Initial CSS styles |
158
143
 
159
- ### Guido Component Events
144
+ ### Events
160
145
 
161
146
  | Event | Payload | Description |
162
147
  |-------|---------|-------------|
163
- | `dynamic-content:open` | `DynamicContent \| null` | Fired when user requests to insert dynamic content |
164
- | `back` | - | Fired when user clicks the back button |
165
- | `save:start` | - | Fired when the save process begins |
166
- | `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
167
- | `on-change` | void | It Fires once for managing leave modal etc. |
168
- | `ready` | void | Fired when the editor is ready and template is loaded |
169
- | `onboarding-finished` | void | Fired when the onboarding popup is dismissed or completed, allowing parent applications to track onboarding state |
170
- | `test-email:click` | - | Fired when user clicks the test email button in the header |
171
-
172
- ### Guido Exposed Methods
173
- ```typescript
174
- dynamicContent.insert(DynamicContent);
175
- dynamicContent.close();
176
- saveSilent();
177
- ```
178
-
179
- ### Guido Interfaces
180
-
181
- ```typescript
182
- interface GuidoConfig {
183
- translationsPath: string;
184
- htmlCompilerRules?: CompilerRule[];
185
- ignoreDefaultHtmlCompilerRules?: boolean;
186
- useHeader: boolean
187
- emailHeader: {
188
- senderName: string;
189
- subject: string;
190
- };
191
- partner: {
192
- partnerName: string;
193
- productType: number;
194
- messageType: number;
195
- };
196
- features: {
197
- dynamicContent: boolean;
198
- saveAsTemplate: boolean;
199
- versionHistory: boolean;
200
- testMessage: boolean;
201
- };
202
- blocks?: {
203
- excludeDefaults?: GuidoBlockType[];
204
- includeCustoms?: GuidoCustomBlockType[];
205
- };
206
- }
207
- ```
208
-
209
- | Property | Type | Default | Description |
210
- |----------|------|---------|-------------|
211
- | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
212
- | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
213
- | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
214
- | `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
215
- | `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
216
- | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
217
- | `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
218
- | `features.versionHistory` | `boolean` | `true` | Enable version history feature |
219
- | `blocks` | `BlocksConfig` | `{ excludeDefaults: [], includeCustoms: [] }` | Block configuration for excluding default blocks and including custom blocks. See [Blocks Configuration](#-blocks-configuration) section below |
220
- | `blocks.excludeDefaults` | `GuidoBlockType[]` | `[]` | Array of default Stripo blocks to exclude from the editor |
221
- | `blocks.includeCustoms` | `GuidoCustomBlockType[]` | `[]` | Array of custom blocks to include in the editor |
222
-
223
- ```typescript
224
- interface DynamicContent {
225
- value: string;
226
- text: string;
227
- fallback?: string;
228
- }
229
- ```
230
- ---
231
-
232
- | Property | Type | Default | Description |
233
- |----------|------|---------|-------------|
234
- | `value` | `string` | '' | Value of the dynamic content |
235
- | `text` | `string` | '' | Visible value of the dynamic content |
236
- | `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
237
-
238
- ## 🧱 Blocks Configuration
239
-
240
- Guido allows you to customize which blocks are available in the editor. You can exclude default Stripo blocks and selectively include custom blocks to create tailored editing experiences for different product types.
241
-
242
- ### Block Types
243
-
244
- #### Default Blocks (GuidoBlockType)
245
-
246
- These are the standard Stripo email editor blocks that can be excluded:
148
+ | `save:complete` | `Template` | Fired when template is saved |
149
+ | `save:start` | - | Fired when save begins |
150
+ | `dynamic-content:open` | `DynamicContent \| null` | Dynamic content requested |
151
+ | `back` | - | Back button clicked |
152
+ | `ready` | - | Editor is ready |
153
+ | `on-change` | - | Template content changed |
247
154
 
248
- ```typescript
249
- type GuidoBlockType =
250
- | 'amp-accordion' // AMP accordion component
251
- | 'amp-carousel' // AMP image carousel
252
- | 'amp-form-controls' // AMP form elements
253
- | 'banner-block' // Banner/hero section
254
- | 'button-block' // Call-to-action buttons
255
- | 'html-block' // Custom HTML
256
- | 'image-block' // Image elements
257
- | 'menu-block' // Navigation menu
258
- | 'social-block' // Social media links
259
- | 'spacer-block' // Vertical spacing
260
- | 'text-block' // Text content
261
- | 'timer-block' // Countdown timer
262
- | 'video-block' // Video embeds
263
- ```
264
-
265
- #### Custom Blocks (GuidoCustomBlockType)
266
-
267
- These are custom blocks that can be selectively included:
268
-
269
- ```typescript
270
- type GuidoCustomBlockType =
271
- | 'dynamic-content' // Dynamic content merge tags
272
- | 'checkbox-block' // Checkbox form input
273
- | 'radio-button-block' // Radio button form input
274
- | 'recommendation-block' // Product recommendations
275
- | 'unsubscribe-block' // Unsubscribe link
276
- | 'coupon-block' // Coupon/promo code
277
- | 'items-block' // Cart items display
278
- ```
279
-
280
- ### Configuration Examples
281
-
282
- #### Example 1: Exclude Specific Default Blocks
283
-
284
- Disable button, image, and video blocks while keeping all custom blocks:
285
-
286
- ```typescript
287
- const guidoConfig = {
288
- translationsPath: 'window.trans.en',
289
- features: {
290
- dynamicContent: true,
291
- saveAsTemplate: true,
292
- versionHistory: true,
293
- testMessage: true
294
- },
295
- blocks: {
296
- excludeDefaults: ['button-block', 'image-block', 'video-block']
297
- }
298
- };
299
- ```
300
-
301
- **Result:**
302
- - Button, Image, Video blocks disabled
303
- - All other default blocks enabled
304
- - All custom blocks are disabled.
305
-
306
- #### Example 2: Include Only Specific Custom Blocks
307
-
308
- Enable only coupon and recommendation blocks:
309
-
310
- ```typescript
311
- const guidoConfig = {
312
- translationsPath: 'window.trans.en',
313
- features: {
314
- dynamicContent: true,
315
- saveAsTemplate: true,
316
- versionHistory: true,
317
- testMessage: true
318
- },
319
- blocks: {
320
- includeCustoms: ['coupon-block', 'recommendation-block']
321
- }
322
- };
323
- ```
324
-
325
- **Result:**
326
- - All default blocks enabled
327
- - Only Coupon and Recommendation extensions enabled.
328
- - Other custom blocks are disabled
329
-
330
- ### Default Behavior
331
-
332
- When `blocks` is not provided or is `undefined`:
155
+ ### Exposed Methods
333
156
 
334
157
  ```typescript
335
- const guidoConfig = {
336
- translationsPath: 'window.trans.en',
337
- features: {
338
- dynamicContent: true,
339
- saveAsTemplate: true,
340
- versionHistory: true,
341
- testMessage: true
342
- },
343
- // No blocks config
344
- };
345
- ```
346
-
347
- **Result:**
348
- - All 13 default Stripo blocks enabled
349
- - All custom blocks are disabled.
158
+ // Insert dynamic content
159
+ this.$refs.guidoEditor?.dynamicContent.insert({ value, text, fallback });
350
160
 
351
- ### Block Configuration Interface
161
+ // Close dynamic content modal
162
+ this.$refs.guidoEditor?.dynamicContent.close();
352
163
 
353
- ```typescript
354
- interface BlocksConfig {
355
- excludeDefaults?: GuidoBlockType[];
356
- includeCustoms?: GuidoCustomBlockType[];
357
- }
164
+ // Silent save (no notifications)
165
+ this.$refs.guidoEditor?.saveSilent();
358
166
  ```
359
167
 
360
- ### TypeScript Types
361
-
362
- The library exports the following TypeScript types:
363
-
364
- ```typescript
365
- // Main component
366
- import { Guido } from '@useinsider/guido';
367
-
368
- // Types
369
- import type { GuidoConfig } from '@useinsider/guido';
370
- import type { StripoEventType } from '@useinsider/guido';
371
- ```
168
+ > For complete API documentation, see [API Reference](./wiki/API-Reference.md)
372
169
 
373
170
  ## 🔨 HTML Compiler Rules
374
171
 
375
- 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.
172
+ Transform HTML content with custom rules before saving. Supports 4 rule types:
376
173
 
377
- ### Rule Types
378
-
379
- There are 4 types of compiler rules:
380
-
381
- #### 1. Replace Rule
382
- Replace specific strings in HTML content.
174
+ <details>
175
+ <summary><b>1. Replace Rule</b> - String replacement</summary>
383
176
 
384
177
  ```typescript
385
178
  {
386
179
  id: 'fix-encoding',
387
- description: 'Fix URL encoding issues',
388
180
  type: 'replace',
389
- search: '{%22', // String to find
390
- replacement: '%7B%22', // String to replace with
391
- replaceAll: true, // Replace all occurrences (default: true)
392
- priority: 10 // Execution priority (lower = earlier)
181
+ search: '{%22',
182
+ replacement: '%7B%22',
183
+ priority: 10
393
184
  }
394
185
  ```
186
+ </details>
395
187
 
396
- #### 2. Regex Rule
397
- Use regular expressions for complex pattern matching and replacement.
188
+ <details>
189
+ <summary><b>2. Regex Rule</b> - Pattern matching</summary>
398
190
 
399
191
  ```typescript
400
192
  {
401
193
  id: 'remove-comments',
402
- description: 'Remove HTML comments',
403
194
  type: 'regex',
404
- pattern: '<!--.*?-->', // Regex pattern
405
- replacement: '', // Replacement string
406
- flags: 'g', // Regex flags (default: 'g')
195
+ pattern: '<!--.*?-->',
196
+ replacement: '',
197
+ flags: 'g',
407
198
  priority: 20
408
199
  }
409
200
  ```
201
+ </details>
410
202
 
411
- #### 3. Remove Rule
412
- Remove specific strings or patterns from HTML content.
203
+ <details>
204
+ <summary><b>3. Remove Rule</b> - Remove content</summary>
413
205
 
414
206
  ```typescript
415
207
  {
416
208
  id: 'cleanup-scripts',
417
- description: 'Remove unwanted script tags',
418
209
  type: 'remove',
419
- targets: [ // Array of strings or RegExp objects
210
+ targets: [
420
211
  '<script src="unwanted.js"></script>',
421
212
  /onclick="[^"]*"/g
422
213
  ],
423
214
  priority: 30
424
215
  }
425
216
  ```
217
+ </details>
426
218
 
427
- #### 4. Custom Rule
428
- Define complex transformation logic with a custom processor function.
219
+ <details>
220
+ <summary><b>4. Custom Rule</b> - Custom processor</summary>
429
221
 
430
222
  ```typescript
431
223
  {
432
224
  id: 'add-meta-tags',
433
- description: 'Add custom meta tags to head',
434
225
  type: 'custom',
435
226
  processor: (html: string): string => {
436
- // Custom transformation logic
437
227
  const metaTags = '<meta name="custom" content="value">';
438
228
  return html.replace('</head>', `${metaTags}</head>`);
439
229
  },
440
230
  priority: 40
441
231
  }
442
232
  ```
233
+ </details>
443
234
 
444
- ### Using HTML Compiler Rules
445
-
446
- #### Basic Usage with Custom Rules
235
+ ### Quick Example
447
236
 
448
237
  ```typescript
449
238
  const guidoConfig = {
450
- translationsPath: 'window.trans.en',
451
- features: {
452
- dynamicContent: true,
453
- saveAsTemplate: true,
454
- versionHistory: false, // Disable version history
455
- testMessage: true
456
- },
457
239
  htmlCompilerRules: [
458
240
  {
459
241
  id: 'replace-domain',
460
- description: 'Replace old domain with new one',
461
242
  type: 'replace',
462
243
  search: 'old-domain.com',
463
244
  replacement: 'new-domain.com',
464
- replaceAll: true,
465
245
  priority: 10
466
- },
467
- {
468
- id: 'remove-tracking',
469
- description: 'Remove tracking pixels',
470
- type: 'regex',
471
- pattern: '<img[^>]*tracking[^>]*>',
472
- replacement: '',
473
- flags: 'gi',
474
- priority: 20
475
246
  }
476
247
  ]
477
248
  };
478
249
  ```
479
250
 
480
- #### Ignoring Default Rules
481
-
482
- ```typescript
483
- const guidoConfig = {
484
- translationsPath: 'window.trans.en',
485
- features: {
486
- dynamicContent: true,
487
- saveAsTemplate: true,
488
- versionHistory: true,
489
- testMessage: true
490
- },
491
- ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
492
- htmlCompilerRules: [
493
- // Only your custom rules will be applied
494
- {
495
- id: 'custom-transformation',
496
- type: 'replace',
497
- search: 'old-text',
498
- replacement: 'new-text',
499
- priority: 1
500
- }
501
- ]
502
- };
503
- ```
504
-
505
- ### Rule Execution Order
506
-
507
- Rules are executed in priority order (lower numbers first). Rules with the same priority are executed in array order.
508
-
509
- - **Priority 1-99**: Reserved for critical transformations
510
- - **Priority 100-999**: Standard transformations
511
- - **Priority 1000+**: Additional custom rules (automatically assigned)
512
-
513
- ### Default Rules
514
-
515
- Guido includes several default rules for common email HTML optimizations:
516
-
517
- - **URL encoding fixes**: Fixes malformed URL encoding in dynamic content
518
- - **Template tag restoration**: Restores `{{}}` template tags that got URL encoded
519
- - **HTML entity decoding**: Converts `&lt;` and `&gt;` back to `<` and `>`
520
- - **Cleanup rules**: Removes unwanted iframe and style elements
521
- - **MSO conditions**: Manages Outlook-specific conditional comments
522
- - **Domain replacement**: Updates old image domains to current ones
523
-
524
- You can view all default rules in: `src/config/compiler/htmlCompilerRules.ts`
525
-
526
- ### CompilerRule Interface
527
-
528
- ```typescript
529
- type CompilerRuleType = 'replace' | 'regex' | 'remove' | 'custom';
530
-
531
- interface BaseCompilerRule {
532
- id: string;
533
- description?: string;
534
- priority: number;
535
- }
536
-
537
- interface ReplaceRule extends BaseCompilerRule {
538
- type: 'replace';
539
- search: string;
540
- replacement: string;
541
- replaceAll?: boolean; // Default: true
542
- }
543
-
544
- interface RegexRule extends BaseCompilerRule {
545
- type: 'regex';
546
- pattern: string;
547
- replacement: string;
548
- flags?: string; // Default: 'g'
549
- }
550
-
551
- interface RemoveRule extends BaseCompilerRule {
552
- type: 'remove';
553
- targets: (string | RegExp)[]; // Array of strings or RegExp objects
554
- }
555
-
556
- interface CustomRule extends BaseCompilerRule {
557
- type: 'custom';
558
- processor: (html: string) => string;
559
- }
560
-
561
- type CompilerRule = ReplaceRule | RegexRule | RemoveRule | CustomRule;
562
- ```
251
+ > For comprehensive compiler rules documentation, see [HTML Compiler Rules Guide](./wiki/HTML-Compiler-Rules.md)
563
252
 
564
253
  ---
565
254
 
566
255
  ## 🔧 Development
567
256
 
568
- ### Prerequisites
569
-
570
- - 🧄 `Bun` (strongly recommended)
571
- or
572
- - NodeJS 18+ & `npm`
573
-
574
- ### Setup
257
+ ### Quick Commands
575
258
 
576
259
  ```bash
577
260
  # Install dependencies
578
261
  bun install
579
262
 
580
- # Start development server
263
+ # Start dev server (localhost:3000)
581
264
  bun start
582
265
 
583
- # Build for production
266
+ # Build library
584
267
  bun run build
585
268
 
586
- # Type checking
587
- bun run type-check
588
-
589
- # Linting
269
+ # Run linting & type checking
590
270
  bun run lint
591
271
  ```
592
272
 
593
- ### Environment Variables
594
-
595
- Create a `.env` file with the following variables: (You can get env variables from your senior)
596
-
597
- ```env
598
- VITE_STRIPO_PLUGIN_ID=your_plugin_id
599
- VITE_STRIPO_SECRET_KEY=your_secret_key
600
- VITE_STRIPO_ROLE=your_role
601
- ```
602
-
603
- ### Project Structure
604
-
605
- ```
606
- src/
607
- ├── components/ # Vue components
608
- ├── composables/ # Vue composables & business logic
609
- ├── services/ # API layer
610
- ├── stores/ # State management
611
- ├── @types/ # TypeScript definitions
612
- ├── static/ # Static assets & templates
613
- ├── utils/ # Utility functions
614
- ├── enums/ # Constants & enums
615
- ├── mock/ # Mock data for development
616
- ├── plugins/ # Vue plugins
617
- └── library.ts # Main export
618
- ```
619
-
620
- ## 🔌 Provide/Inject Utilities
621
-
622
- Guido includes type-safe utilities for Vue's provide/inject system to facilitate dependency injection between components.
623
-
624
- ### useProvideInject
625
-
626
- The `useProvideInject` composable provides two helper functions for type-safe dependency injection:
627
-
628
- #### Basic Usage
629
-
630
- ```typescript
631
- // Parent component
632
- import { provideValue } from '@useinsider/guido';
633
- import { InjectionKey } from 'vue';
634
-
635
- // Define a typed injection key
636
- const MyServiceKey: InjectionKey<MyService> = Symbol('MyService');
637
-
638
- // Provide the value
639
- const myService = new MyService();
640
- provideValue(MyServiceKey, myService);
641
-
642
- // Child component
643
- import { useInjectedValue } from '@useinsider/guido';
644
-
645
- // Inject the value with type safety
646
- const myService = useInjectedValue(MyServiceKey);
647
- ```
273
+ ### Local Testing
648
274
 
649
- #### With Default Value
275
+ Test the package locally before publishing:
650
276
 
651
- ```typescript
652
- // Inject with a fallback value
653
- const myService = useInjectedValue(MyServiceKey, new DefaultService());
654
- ```
655
-
656
- #### Error Handling
657
-
658
- The `useInjectedValue` function will throw a descriptive error if no provider is found and no default value is provided:
659
-
660
- ```typescript
661
- // This will throw an error if no provider exists
662
- try {
663
- const myService = useInjectedValue(MyServiceKey);
664
- } catch (error) {
665
- console.error('No provider found for MyService');
666
- }
667
- ```
668
-
669
- ### API Reference
670
-
671
- #### `provideValue`
672
-
673
- ```typescript
674
- provideValue<T>(key: InjectionKey<T>, value: T): void
675
- ```
676
-
677
- Provides a value using Vue's provide system with type safety.
678
-
679
- | Parameter | Type | Description |
680
- |-----------|------|-------------|
681
- | `key` | `InjectionKey<T>` | The typed injection key |
682
- | `value` | `T` | The value to provide |
683
-
684
- #### `useInjectedValue`
685
-
686
- ```typescript
687
- useInjectedValue<T>(key: InjectionKey<T>, defaultValue?: T): T
688
- ```
689
-
690
- Injects a value using Vue's inject system with type safety and error handling.
691
-
692
- | Parameter | Type | Required | Description |
693
- |-----------|------|----------|-------------|
694
- | `key` | `InjectionKey<T>` | ✅ | The typed injection key |
695
- | `defaultValue` | `T` | ⚪ | Optional fallback value |
696
-
697
- **Returns:** `T` - The injected value
698
-
699
- **Throws:** `Error` - When no provider is found and no default value is provided
700
-
701
- ## 🌐 i18n
702
- 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).
703
- It allows to use production or local translations on your code. 🚀
704
- Example usage:
705
- ```js
706
- import { useTranslations } from '@@/Composables/useTranslations';
707
-
708
- const trans = useTranslations();
709
-
710
- // use everywhere like this:
711
- trans('foo.bar')
712
- ```
713
-
714
- ## 📦 Local Building (Recommended)
715
-
716
- Run this commands if you want to test the package on your local before sending to NPM.
717
- ```sh
718
- bun run build
719
- ```
720
-
721
- Since bun does not have packaging yet, use npm here: 🥲
722
- ```sh
723
- npm pack
724
- ```
725
-
726
- It'll crate like `useinsider-guido-1.0.0.tgz` file.
727
-
728
- Move this file to your project path like: `email-fe` via:
729
- ```sh
730
- cp useinsider-guido-1.0.0.tgz ../email-fe
731
- ```
277
+ ```bash
278
+ # Build and create tarball
279
+ bun run build && npm pack
732
280
 
733
- Install the file to your project:
734
- ```sh
735
- npm i ./useinsider-guido-1.0.0.tgz
281
+ # Install in your project
282
+ npm i ./useinsider-guido-1.0.3.tgz
736
283
  ```
737
284
 
738
- Then you just need to rebuild to your project or restart the Container. 🎉
739
-
740
- For Future, we can create a shell script for it. Feel free to help 🙃
285
+ > For complete development setup, project structure, and contribution guidelines, see [Contributing Guide](./wiki/Contributing.md)
741
286
 
742
- ## 📦 Build Output
743
-
744
- The library builds to multiple formats:
745
-
746
- - **ES Module**: `dist/library.js` (recommended)
747
- - **CSS**: `dist/guido.css` (custom styles)
287
+ ## 🤝 Contributing
748
288
 
749
- ### Package Exports
289
+ Contributions are welcome! Please follow these guidelines:
750
290
 
751
- ```json
752
- {
753
- "exports": {
754
- ".": {
755
- "import": "./dist/library.js",
756
- "types": "./dist/components/Guido.vue.d.ts",
757
- "require": "./dist/components/Guido.vue.js"
758
- },
759
- "./style": "./dist/guido.css"
760
- }
761
- }
762
- ```
291
+ - **PR Title Format**: `TASK-ID | EMOJI | Clear Description`
292
+ - Example: `SD-12345 | ✨ | Add new feature`
293
+ - **PR Requirements**:
294
+ - Fill PR labels
295
+ - Assign to yourself
296
+ - Include tests
297
+ - Pass all checks before review
763
298
 
764
- ## 🤝 Contributing
765
- - PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
766
- - PR Labels should be filled.
767
- - PR Assignee required.
768
- - Tests should be covered.
769
- - All required checks should be passed before sending review request.
299
+ > For detailed contribution guidelines, see [Contributing Guide](./wiki/Contributing.md)
770
300
 
771
301
  ## 📄 License
772
302
 
773
303
  ISC License
774
304
 
775
- ---
776
-
777
- ## 🔗 Related
305
+ ## 🔗 Related Resources
778
306
 
779
307
  - [Stripo Email Editor](https://stripo.email/) - The underlying email editor
780
308
  - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
781
309
 
782
- ## 🎯 TODO:
783
- - CSS part should be optimized with variables & `sass-loader`.
784
- - Master Version Generator should be fixed.
785
- - Playwright integrationBoilerplate/control.ts
786
- - Commitlint & Precommit Hooks integration
787
- - Get Pre-built display conditions from API
310
+ ---
311
+
312
+ **Made with ❤️ by the Insider Team**