@useinsider/guido 1.0.0-beta.3af57f2 → 1.0.0-beta.3e6a15c

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 (380) hide show
  1. package/README.md +570 -82
  2. package/dist/@types/generic.d.ts +42 -3
  3. package/dist/@types/save-as-template.d.ts +29 -0
  4. package/dist/App.vue.d.ts +1 -1
  5. package/dist/_virtual/AddCustomFont.js +4 -0
  6. package/dist/_virtual/AiAssistantValueType.js +4 -0
  7. package/dist/_virtual/BackgroundColorBuiltInControl.js +4 -0
  8. package/dist/_virtual/BackgroundImageBuiltInControl.js +4 -0
  9. package/dist/_virtual/Block.js +4 -0
  10. package/dist/_virtual/BlockAttributes.js +4 -0
  11. package/dist/_virtual/BlockCompositionType.js +4 -0
  12. package/dist/_virtual/BlockPaddingsBuiltInControl.js +4 -0
  13. package/dist/_virtual/BlockRenderer.js +4 -0
  14. package/dist/_virtual/BlockType.js +4 -0
  15. package/dist/_virtual/BlocksPanel.js +4 -0
  16. package/dist/_virtual/BuiltInControl.js +4 -0
  17. package/dist/_virtual/BuiltInControlTypes.js +4 -0
  18. package/dist/_virtual/ButtonBorderBuiltInControl.js +4 -0
  19. package/dist/_virtual/ButtonColorBuiltInControl.js +4 -0
  20. package/dist/_virtual/ButtonFontColorBuiltInControl.js +4 -0
  21. package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +4 -0
  22. package/dist/_virtual/ButtonTextBuiltInControl.js +4 -0
  23. package/dist/_virtual/ContextAction.js +4 -0
  24. package/dist/_virtual/ContextActionType.js +4 -0
  25. package/dist/_virtual/Control.js +4 -0
  26. package/dist/_virtual/EditorStatePropertyType.js +4 -0
  27. package/dist/_virtual/Extension.js +4 -0
  28. package/dist/_virtual/ExtensionBuilder.js +4 -0
  29. package/dist/_virtual/FontFamilyBuiltInControl.js +4 -0
  30. package/dist/_virtual/LinkColorBuiltInControl.js +4 -0
  31. package/dist/_virtual/ModificationDescription.js +4 -0
  32. package/dist/_virtual/PanelPosition.js +4 -0
  33. package/dist/_virtual/PreviewDeviceMode.js +4 -0
  34. package/dist/_virtual/SettingsPanelRegistry.js +4 -0
  35. package/dist/_virtual/SettingsPanelTab.js +4 -0
  36. package/dist/_virtual/SettingsTab.js +4 -0
  37. package/dist/_virtual/StructureBorderBuiltInControl.js +4 -0
  38. package/dist/_virtual/StructurePaddingsBuiltInControl.js +4 -0
  39. package/dist/_virtual/TextColorBuiltInControl.js +4 -0
  40. package/dist/_virtual/TextLineSpacingBuiltInControl.js +4 -0
  41. package/dist/_virtual/TextSizeBuiltInControl.js +4 -0
  42. package/dist/_virtual/TextStyleBuiltInControl.js +4 -0
  43. package/dist/_virtual/UIElement.js +4 -0
  44. package/dist/_virtual/UIElementTagRegistry.js +4 -0
  45. package/dist/_virtual/UIElementType.js +4 -0
  46. package/dist/_virtual/UIElementsAttributes.js +4 -0
  47. package/dist/_virtual/index.js +5 -0
  48. package/dist/_virtual/index2.js +4 -0
  49. package/dist/components/Guido.vue.d.ts +24 -2
  50. package/dist/components/Guido.vue.js +9 -9
  51. package/dist/components/Guido.vue2.js +92 -15
  52. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
  53. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
  54. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
  55. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
  56. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
  57. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
  58. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
  59. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
  60. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
  61. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
  62. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +31 -0
  63. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
  64. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
  65. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
  66. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
  67. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
  68. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +25 -0
  69. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
  70. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
  71. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
  72. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
  73. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
  74. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
  75. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
  76. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
  77. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
  78. package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +2 -0
  79. package/dist/components/organisms/{top-bar/Header.vue.js → header/HeaderWrapper.vue.js} +7 -7
  80. package/dist/components/organisms/header/HeaderWrapper.vue2.js +14 -0
  81. package/dist/components/organisms/header/LeftSlot.vue.d.ts +2 -0
  82. package/dist/components/organisms/header/LeftSlot.vue.js +17 -0
  83. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -0
  84. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +2 -0
  85. package/dist/components/organisms/header/MiddleSlot.vue.js +17 -0
  86. package/dist/components/organisms/header/MiddleSlot.vue2.js +21 -0
  87. package/dist/components/organisms/header/RightSlot.vue.d.ts +2 -0
  88. package/dist/components/organisms/header/RightSlot.vue.js +18 -0
  89. package/dist/components/organisms/header/RightSlot.vue2.js +37 -0
  90. package/dist/components/organisms/header/ViewOptions.vue.d.ts +2 -0
  91. package/dist/components/organisms/header/ViewOptions.vue.js +18 -0
  92. package/dist/components/organisms/header/ViewOptions.vue2.js +35 -0
  93. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +2 -0
  94. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +19 -0
  95. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +14 -0
  96. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +14 -0
  97. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +22 -0
  98. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +18 -0
  99. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +16 -0
  100. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +18 -0
  101. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +16 -0
  102. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +2 -0
  103. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +18 -0
  104. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +41 -0
  105. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +2 -0
  106. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +20 -0
  107. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +63 -0
  108. package/dist/components/wrappers/WpDrawer.vue.d.ts +63 -0
  109. package/dist/components/wrappers/WpDrawer.vue.js +25 -0
  110. package/dist/components/wrappers/WpDrawer.vue2.js +23 -0
  111. package/dist/components/wrappers/WpModal.vue.d.ts +65 -0
  112. package/dist/components/wrappers/WpModal.vue.js +27 -0
  113. package/dist/components/wrappers/WpModal.vue2.js +22 -0
  114. package/dist/composables/useActionsApi.d.ts +8 -0
  115. package/dist/composables/useActionsApi.js +79 -0
  116. package/dist/composables/useCodeEditorApi.d.ts +4 -0
  117. package/dist/composables/useCodeEditorApi.js +11 -0
  118. package/dist/composables/useConfig.d.ts +4 -0
  119. package/dist/composables/useConfig.js +7 -0
  120. package/dist/composables/useCustomInterfaceAppearance.js +45 -9
  121. package/dist/composables/useDebounce.d.ts +4 -0
  122. package/dist/composables/useDebounce.js +12 -0
  123. package/dist/composables/useExport.d.ts +3 -0
  124. package/dist/composables/useExport.js +45 -0
  125. package/dist/composables/useGuidoActions.d.ts +46 -0
  126. package/dist/composables/useGuidoActions.js +37 -0
  127. package/dist/composables/useHtmlCompiler.d.ts +4 -0
  128. package/dist/composables/useHtmlCompiler.js +17 -0
  129. package/dist/composables/useHttp.js +86 -0
  130. package/dist/composables/usePartner.d.ts +4 -0
  131. package/dist/composables/usePartner.js +11 -0
  132. package/dist/composables/usePreviewMode.d.ts +5 -0
  133. package/dist/composables/usePreviewMode.js +31 -0
  134. package/dist/composables/useProvideInject.d.ts +14 -0
  135. package/dist/composables/useProvideInject.js +17 -0
  136. package/dist/composables/useResponsivePreview.d.ts +5 -0
  137. package/dist/composables/useResponsivePreview.js +86 -0
  138. package/dist/composables/useStripo.d.ts +2 -2
  139. package/dist/composables/useStripo.js +81 -49
  140. package/dist/composables/useToaster.d.ts +2 -1
  141. package/dist/composables/useToaster.js +37 -0
  142. package/dist/composables/useTranslations.d.ts +1 -3
  143. package/dist/composables/useTranslations.js +19 -0
  144. package/dist/composables/useValidation.d.ts +56 -0
  145. package/dist/composables/useValidation.js +19 -0
  146. package/dist/composables/useVersionHistoryApi.d.ts +8 -0
  147. package/dist/composables/useVersionHistoryApi.js +53 -0
  148. package/dist/composables/validators/saveAsTemplate.d.ts +31 -0
  149. package/dist/composables/validators/saveAsTemplate.js +24 -0
  150. package/dist/config/compiler/htmlCompilerRules.d.ts +2 -0
  151. package/dist/config/compiler/htmlCompilerRules.js +145 -0
  152. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  153. package/dist/enums/defaults.d.ts +7 -0
  154. package/dist/enums/defaults.js +24 -0
  155. package/dist/enums/displayConditions.d.ts +2 -0
  156. package/dist/enums/displayConditions.js +80 -0
  157. package/dist/enums/preview.d.ts +13 -0
  158. package/dist/enums/preview.js +23 -0
  159. package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +6 -0
  160. package/dist/extensions/DynamicContent/dynamic-content-modal.js +27 -0
  161. package/dist/extensions/DynamicContent/dynamic-content.css.js +24 -0
  162. package/dist/extensions/DynamicContent/dynamic-content.d.ts +16 -0
  163. package/dist/extensions/DynamicContent/dynamic-content.js +61 -0
  164. package/dist/extensions/DynamicContent/extension.d.ts +2 -0
  165. package/dist/extensions/DynamicContent/extension.js +11 -0
  166. package/dist/guido.css +1 -1
  167. package/dist/guido.png +0 -0
  168. package/dist/library.d.ts +1 -0
  169. package/dist/mock/api/custom-fonts.d.ts +2 -0
  170. package/dist/mock/api/default-template.d.ts +2 -0
  171. package/dist/mock/api/template-library.d.ts +2 -0
  172. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +51 -0
  173. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +52 -0
  174. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +41 -0
  175. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +18 -0
  176. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +32 -0
  177. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +18 -0
  178. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +8 -0
  179. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +13 -0
  180. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +34 -0
  181. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +13 -0
  182. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +13 -0
  183. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +104 -0
  184. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +13 -0
  185. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +13 -0
  186. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +13 -0
  187. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +13 -0
  188. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +13 -0
  189. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +13 -0
  190. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +45 -0
  191. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +43 -0
  192. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +46 -0
  193. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +44 -0
  194. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +22 -0
  195. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +46 -0
  196. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +46 -0
  197. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +45 -0
  198. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +45 -0
  199. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +45 -0
  200. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +20 -0
  201. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +43 -0
  202. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +45 -0
  203. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +18 -0
  204. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +32 -0
  205. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +46 -0
  206. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +44 -0
  207. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +43 -0
  208. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +43 -0
  209. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +45 -0
  210. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +43 -0
  211. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +266 -0
  212. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +26 -0
  213. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +22 -0
  214. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +18 -0
  215. package/dist/node_modules/@vueuse/shared/index.js +45 -0
  216. package/dist/node_modules/lodash-es/_Hash.js +20 -0
  217. package/dist/node_modules/lodash-es/_ListCache.js +20 -0
  218. package/dist/node_modules/lodash-es/_Map.js +6 -0
  219. package/dist/node_modules/lodash-es/_MapCache.js +20 -0
  220. package/dist/node_modules/lodash-es/_Stack.js +18 -0
  221. package/dist/node_modules/lodash-es/_Symbol.js +5 -0
  222. package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
  223. package/dist/node_modules/lodash-es/_apply.js +16 -0
  224. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +19 -0
  225. package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
  226. package/dist/node_modules/lodash-es/_assignValue.js +10 -0
  227. package/dist/node_modules/lodash-es/_assocIndexOf.js +10 -0
  228. package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
  229. package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
  230. package/dist/node_modules/lodash-es/_baseFor.js +5 -0
  231. package/dist/node_modules/lodash-es/_baseGetTag.js +10 -0
  232. package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
  233. package/dist/node_modules/lodash-es/_baseIsNative.js +16 -0
  234. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
  235. package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
  236. package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
  237. package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
  238. package/dist/node_modules/lodash-es/_baseRest.js +9 -0
  239. package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
  240. package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
  241. package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
  242. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  243. package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
  244. package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  245. package/dist/node_modules/lodash-es/_copyArray.js +9 -0
  246. package/dist/node_modules/lodash-es/_copyObject.js +14 -0
  247. package/dist/node_modules/lodash-es/_coreJsData.js +5 -0
  248. package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
  249. package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
  250. package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
  251. package/dist/node_modules/lodash-es/_freeGlobal.js +4 -0
  252. package/dist/node_modules/lodash-es/_getMapData.js +8 -0
  253. package/dist/node_modules/lodash-es/_getNative.js +9 -0
  254. package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
  255. package/dist/node_modules/lodash-es/_getRawTag.js +15 -0
  256. package/dist/node_modules/lodash-es/_getValue.js +6 -0
  257. package/dist/node_modules/lodash-es/_hashClear.js +7 -0
  258. package/dist/node_modules/lodash-es/_hashDelete.js +7 -0
  259. package/dist/node_modules/lodash-es/_hashGet.js +13 -0
  260. package/dist/node_modules/lodash-es/_hashHas.js +9 -0
  261. package/dist/node_modules/lodash-es/_hashSet.js +9 -0
  262. package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
  263. package/dist/node_modules/lodash-es/_isIndex.js +8 -0
  264. package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
  265. package/dist/node_modules/lodash-es/_isKeyable.js +7 -0
  266. package/dist/node_modules/lodash-es/_isMasked.js +11 -0
  267. package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
  268. package/dist/node_modules/lodash-es/_listCacheClear.js +6 -0
  269. package/dist/node_modules/lodash-es/_listCacheDelete.js +12 -0
  270. package/dist/node_modules/lodash-es/_listCacheGet.js +8 -0
  271. package/dist/node_modules/lodash-es/_listCacheHas.js +7 -0
  272. package/dist/node_modules/lodash-es/_listCacheSet.js +8 -0
  273. package/dist/node_modules/lodash-es/_mapCacheClear.js +13 -0
  274. package/dist/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  275. package/dist/node_modules/lodash-es/_mapCacheGet.js +7 -0
  276. package/dist/node_modules/lodash-es/_mapCacheHas.js +7 -0
  277. package/dist/node_modules/lodash-es/_mapCacheSet.js +8 -0
  278. package/dist/node_modules/lodash-es/_nativeCreate.js +5 -0
  279. package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
  280. package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
  281. package/dist/node_modules/lodash-es/_objectToString.js +7 -0
  282. package/dist/node_modules/lodash-es/_overArg.js +8 -0
  283. package/dist/node_modules/lodash-es/_overRest.js +15 -0
  284. package/dist/node_modules/lodash-es/_root.js +5 -0
  285. package/dist/node_modules/lodash-es/_safeGet.js +7 -0
  286. package/dist/node_modules/lodash-es/_setToString.js +6 -0
  287. package/dist/node_modules/lodash-es/_shortOut.js +16 -0
  288. package/dist/node_modules/lodash-es/_stackClear.js +7 -0
  289. package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
  290. package/dist/node_modules/lodash-es/_stackGet.js +6 -0
  291. package/dist/node_modules/lodash-es/_stackHas.js +6 -0
  292. package/dist/node_modules/lodash-es/_stackSet.js +17 -0
  293. package/dist/node_modules/lodash-es/_toSource.js +17 -0
  294. package/dist/node_modules/lodash-es/constant.js +8 -0
  295. package/dist/node_modules/lodash-es/eq.js +6 -0
  296. package/dist/node_modules/lodash-es/identity.js +6 -0
  297. package/dist/node_modules/lodash-es/isArguments.js +10 -0
  298. package/dist/node_modules/lodash-es/isArray.js +4 -0
  299. package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
  300. package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  301. package/dist/node_modules/lodash-es/isBuffer.js +6 -0
  302. package/dist/node_modules/lodash-es/isFunction.js +12 -0
  303. package/dist/node_modules/lodash-es/isLength.js +7 -0
  304. package/dist/node_modules/lodash-es/isObject.js +7 -0
  305. package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
  306. package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
  307. package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
  308. package/dist/node_modules/lodash-es/keysIn.js +9 -0
  309. package/dist/node_modules/lodash-es/memoize.js +18 -0
  310. package/dist/node_modules/lodash-es/merge.js +8 -0
  311. package/dist/node_modules/lodash-es/stubFalse.js +6 -0
  312. package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
  313. package/dist/node_modules/valibot/dist/index.js +190 -0
  314. package/dist/node_modules/vue-demi/lib/index.js +7 -0
  315. package/dist/services/stripoApi.d.ts +8 -0
  316. package/dist/services/stripoApi.js +49 -0
  317. package/dist/services/templateLibraryApi.d.ts +7 -0
  318. package/dist/services/templateLibraryApi.js +87 -0
  319. package/dist/static/assets/inbox-mockup.svg.js +4 -0
  320. package/dist/static/assets/phone-mockup.svg.js +4 -0
  321. package/dist/static/styles/base.css.js +11 -0
  322. package/dist/static/styles/components/alert-message.css.js +39 -0
  323. package/dist/static/styles/components/amp-block.css.js +18 -0
  324. package/dist/static/styles/components/base-input.css.js +47 -0
  325. package/dist/static/styles/components/button-group.css.js +54 -0
  326. package/dist/static/styles/components/button.css.js +106 -0
  327. package/dist/static/styles/components/combobox.css.js +49 -0
  328. package/dist/static/styles/components/counter.css.js +42 -0
  329. package/dist/static/styles/components/dropdown-menu.css.js +52 -0
  330. package/dist/static/styles/components/narrow-panel.css.js +38 -0
  331. package/dist/static/styles/components/switcher.css.js +11 -0
  332. package/dist/static/styles/components/tabs.css.js +97 -0
  333. package/dist/static/styles/components/tools.css.js +23 -0
  334. package/dist/static/styles/components/version-history.css.js +30 -0
  335. package/dist/static/styles/components/wide-panel.css.js +139 -0
  336. package/dist/static/styles/customEditorStyle.css.js +18 -0
  337. package/dist/static/styles/variables.css.js +23 -0
  338. package/dist/stores/dynamic-content.d.ts +27 -0
  339. package/dist/stores/dynamic-content.js +23 -0
  340. package/dist/stores/editor.d.ts +8 -0
  341. package/dist/stores/editor.js +14 -0
  342. package/dist/stores/preview.d.ts +46 -0
  343. package/dist/stores/preview.js +53 -0
  344. package/dist/stores/save-as-template.d.ts +73 -0
  345. package/dist/stores/save-as-template.js +48 -0
  346. package/dist/stores/version-history.d.ts +80 -0
  347. package/dist/stores/version-history.js +28 -0
  348. package/dist/utils/arrayUtil.d.ts +1 -0
  349. package/dist/utils/arrayUtil.js +10 -0
  350. package/dist/utils/base64.d.ts +1 -0
  351. package/dist/utils/base64.js +7 -0
  352. package/dist/utils/dateUtil.d.ts +1 -0
  353. package/dist/utils/dateUtil.js +16 -0
  354. package/dist/utils/genericUtil.d.ts +3 -0
  355. package/dist/utils/genericUtil.js +11 -0
  356. package/dist/utils/htmlCompiler.d.ts +12 -0
  357. package/dist/utils/htmlCompiler.js +70 -0
  358. package/dist/utils/templatePreparation.d.ts +4 -0
  359. package/dist/utils/templatePreparation.js +33 -0
  360. package/dist/utils/tooltipUtils.d.ts +2 -0
  361. package/dist/utils/tooltipUtils.js +11 -0
  362. package/package.json +8 -7
  363. package/dist/components/organisms/top-bar/Header.vue2.js +0 -14
  364. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.d.ts +0 -2
  365. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.js +0 -17
  366. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue2.js +0 -11
  367. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.d.ts +0 -2
  368. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.js +0 -17
  369. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue2.js +0 -11
  370. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.d.ts +0 -2
  371. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.js +0 -18
  372. package/dist/components/organisms/top-bar/HeaderRightSlot.vue2.js +0 -14
  373. package/dist/composables/useTemplates.d.ts +0 -5
  374. package/dist/composables/useTemplates.js +0 -27
  375. package/dist/enums/defaults.enum.d.ts +0 -18
  376. package/dist/static/editor.css.js +0 -182
  377. package/dist/static/templates/default/index.html.js +0 -5
  378. package/dist/static/templates/default/style.css.js +0 -119
  379. package/dist/stores/counter.d.ts +0 -12
  380. /package/dist/components/organisms/{top-bar/Header.vue.d.ts → email-preview/PreviewContainer.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -1,25 +1,43 @@
1
- # @useinsider/guido-plugin
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>
2
6
 
3
- Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.
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.
4
11
 
5
12
  ## 📦 Install
13
+
6
14
  ```bash
7
15
  npm install @useinsider/guido
8
16
  ```
17
+ ### Prerequisites
18
+ 🍍 Your project should have `pinia`
19
+
20
+ ---
21
+ ## 🚀 Usage
9
22
 
10
- ## 🚀 Usage (Vue 2)
11
- ```vue
23
+ ### Basic Usage
24
+
25
+ ```html
12
26
  <template>
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
- />
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>
23
41
  </template>
24
42
 
25
43
  <script lang="ts">
@@ -31,35 +49,59 @@ export default {
31
49
  },
32
50
  data() {
33
51
  return {
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'
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,
60
+ features: {
61
+ dynamicContent: true,
62
+ saveAsTemplate: true,
63
+ versionHistory: true
64
+ }
42
65
  },
43
- extensions: {
44
- dynamicContent: true,
45
- unsubPages: true,
46
- header: false,
47
- footer: false
48
- }
66
+ dynamicContentModalVisible: false
49
67
  };
50
68
  },
69
+
51
70
  methods: {
52
- handleSave(data: any) {
53
- console.log('Saved:', data);
71
+ handleDynamicContentOpen(detail) {
72
+ console.log('Dynamic content requested:', detail);
73
+ this.dynamicContentModalVisible = true;
74
+ },
75
+
76
+ handleBack() {
77
+ console.log('User clicked back button');
78
+ // Handle navigation back
54
79
  },
55
- handleHtml({ html }: { html: string }) {
56
- console.log('HTML ready:', html);
80
+
81
+ handleSaveStart() {
82
+ console.log('Save process started');
83
+ // Show loading indicator
57
84
  },
58
- onExportRequested() {
59
- console.log('Export started');
85
+
86
+ handleSaveComplete(template) {
87
+ console.log('Save completed:', template);
88
+ // Handle saved template data
89
+ },
90
+
91
+ // ⚠️ Your own Dynamic Content Modal should have this id: #guido-dynamic-content-modal
92
+ handleDynamicContentInsert() {
93
+ this.$refs.guidoEditor?.dynamicContent.insert({
94
+ text: 'Display Text',
95
+ value: 'actual-value',
96
+ fallback: 'Fallback Text'
97
+ });
98
+
99
+ this.dynamicContentModalVisible = false;
60
100
  },
61
- onClose() {
62
- console.log('Closed');
101
+
102
+ // ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
103
+ handleDynamicContentClose() {
104
+ this.$refs.guidoEditor?.dynamicContent.close();
63
105
  }
64
106
  }
65
107
  };
@@ -67,63 +109,509 @@ export default {
67
109
  ```
68
110
 
69
111
  ## 📚 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 |
110
112
 
113
+ ### Guido Component Props
114
+
115
+ | Prop | Type | Required | Default | Description |
116
+ |------|------|----------|---------|-------------|
117
+ | `templateId` | `string` | ✅ | - | Unique identifier for the email template |
118
+ | `userId` | `string` | ✅ | - | Unique identifier for the user |
119
+ | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
120
+ | `partnerName` | `string` | ⚪ | From URL host | Partner identifier |
121
+ | `productType` | `string` | ⚪ | From URL path | Product type identifier |
122
+ | `username` | `string` | ⚪ | `'Guido User'` | Display name for the user |
123
+ | `html` | `string` | ⚪ | `''` | Initial HTML content for the template |
124
+ | `css` | `string` | ⚪ | `''` | Initial CSS styles for the template |
125
+
126
+ ### Guido Component Events
127
+
128
+ | Event | Payload | Description |
129
+ |-------|---------|-------------|
130
+ | `dynamic-content:open` | `DynamicContent \| null` | Fired when user requests to insert dynamic content |
131
+ | `back` | - | Fired when user clicks the back button |
132
+ | `save:start` | - | Fired when the save process begins |
133
+ | `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
134
+
135
+ ### Guido Exposed Methods
136
+ ```typescript
137
+ dynamicContent.insert(DynamicContent);
138
+ dynamicContent.close();
139
+ ```
140
+
141
+ ### Guido Interfaces
142
+
143
+ ```typescript
144
+ interface GuidoConfig {
145
+ translationsPath: string;
146
+ htmlCompilerRules?: CompilerRule[];
147
+ ignoreDefaultHtmlCompilerRules?: boolean;
148
+ useHeader: boolean
149
+ emailHeader: {
150
+ senderName: string;
151
+ subject: string;
152
+ };
153
+ partner: {
154
+ partnerName: string;
155
+ productType: number;
156
+ messageType: number;
157
+ };
158
+ features: {
159
+ dynamicContent: boolean;
160
+ saveAsTemplate: boolean;
161
+ versionHistory: boolean;
162
+ };
163
+ }
164
+ ```
165
+
166
+ | Property | Type | Default | Description |
167
+ |----------|------|---------|-------------|
168
+ | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
169
+ | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
170
+ | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
171
+ | `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
172
+ | `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
173
+ | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
174
+ | `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
175
+ | `features.versionHistory` | `boolean` | `true` | Enable version history feature |
176
+
177
+ ```typescript
178
+ interface DynamicContent {
179
+ value: string;
180
+ text: string;
181
+ fallback?: string;
182
+ }
183
+ ```
184
+ ---
185
+
186
+ | Property | Type | Default | Description |
187
+ |----------|------|---------|-------------|
188
+ | `value` | `string` | '' | Value of the dynamic content |
189
+ | `text` | `string` | '' | Visible value of the dynamic content |
190
+ | `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
191
+
192
+ ### TypeScript Types
193
+
194
+ The library exports the following TypeScript types:
195
+
196
+ ```typescript
197
+ // Main component
198
+ import { Guido } from '@useinsider/guido';
199
+
200
+ // Types
201
+ import type { GuidoConfig } from '@useinsider/guido';
202
+ import type { StripoEventType } from '@useinsider/guido';
203
+ ```
204
+
205
+ ## 🔨 HTML Compiler Rules
206
+
207
+ 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.
208
+
209
+ ### Rule Types
210
+
211
+ There are 4 types of compiler rules:
212
+
213
+ #### 1. Replace Rule
214
+ Replace specific strings in HTML content.
215
+
216
+ ```typescript
217
+ {
218
+ id: 'fix-encoding',
219
+ description: 'Fix URL encoding issues',
220
+ type: 'replace',
221
+ search: '{%22', // String to find
222
+ replacement: '%7B%22', // String to replace with
223
+ replaceAll: true, // Replace all occurrences (default: true)
224
+ priority: 10 // Execution priority (lower = earlier)
225
+ }
226
+ ```
227
+
228
+ #### 2. Regex Rule
229
+ Use regular expressions for complex pattern matching and replacement.
230
+
231
+ ```typescript
232
+ {
233
+ id: 'remove-comments',
234
+ description: 'Remove HTML comments',
235
+ type: 'regex',
236
+ pattern: '<!--.*?-->', // Regex pattern
237
+ replacement: '', // Replacement string
238
+ flags: 'g', // Regex flags (default: 'g')
239
+ priority: 20
240
+ }
241
+ ```
242
+
243
+ #### 3. Remove Rule
244
+ Remove specific strings or patterns from HTML content.
245
+
246
+ ```typescript
247
+ {
248
+ id: 'cleanup-scripts',
249
+ description: 'Remove unwanted script tags',
250
+ type: 'remove',
251
+ targets: [ // Array of strings or RegExp objects
252
+ '<script src="unwanted.js"></script>',
253
+ /onclick="[^"]*"/g
254
+ ],
255
+ priority: 30
256
+ }
257
+ ```
258
+
259
+ #### 4. Custom Rule
260
+ Define complex transformation logic with a custom processor function.
261
+
262
+ ```typescript
263
+ {
264
+ id: 'add-meta-tags',
265
+ description: 'Add custom meta tags to head',
266
+ type: 'custom',
267
+ processor: (html: string): string => {
268
+ // Custom transformation logic
269
+ const metaTags = '<meta name="custom" content="value">';
270
+ return html.replace('</head>', `${metaTags}</head>`);
271
+ },
272
+ priority: 40
273
+ }
274
+ ```
275
+
276
+ ### Using HTML Compiler Rules
277
+
278
+ #### Basic Usage with Custom Rules
279
+
280
+ ```typescript
281
+ const guidoConfig = {
282
+ translationsPath: 'window.trans.en',
283
+ features: {
284
+ dynamicContent: true,
285
+ saveAsTemplate: true,
286
+ versionHistory: false // Disable version history
287
+ },
288
+ htmlCompilerRules: [
289
+ {
290
+ id: 'replace-domain',
291
+ description: 'Replace old domain with new one',
292
+ type: 'replace',
293
+ search: 'old-domain.com',
294
+ replacement: 'new-domain.com',
295
+ replaceAll: true,
296
+ priority: 10
297
+ },
298
+ {
299
+ id: 'remove-tracking',
300
+ description: 'Remove tracking pixels',
301
+ type: 'regex',
302
+ pattern: '<img[^>]*tracking[^>]*>',
303
+ replacement: '',
304
+ flags: 'gi',
305
+ priority: 20
306
+ }
307
+ ]
308
+ };
309
+ ```
310
+
311
+ #### Ignoring Default Rules
312
+
313
+ ```typescript
314
+ const guidoConfig = {
315
+ translationsPath: 'window.trans.en',
316
+ features: {
317
+ dynamicContent: true,
318
+ saveAsTemplate: true,
319
+ versionHistory: true
320
+ },
321
+ ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
322
+ htmlCompilerRules: [
323
+ // Only your custom rules will be applied
324
+ {
325
+ id: 'custom-transformation',
326
+ type: 'replace',
327
+ search: 'old-text',
328
+ replacement: 'new-text',
329
+ priority: 1
330
+ }
331
+ ]
332
+ };
333
+ ```
334
+
335
+ ### Rule Execution Order
336
+
337
+ Rules are executed in priority order (lower numbers first). Rules with the same priority are executed in array order.
338
+
339
+ - **Priority 1-99**: Reserved for critical transformations
340
+ - **Priority 100-999**: Standard transformations
341
+ - **Priority 1000+**: Additional custom rules (automatically assigned)
342
+
343
+ ### Default Rules
344
+
345
+ Guido includes several default rules for common email HTML optimizations:
346
+
347
+ - **URL encoding fixes**: Fixes malformed URL encoding in dynamic content
348
+ - **Template tag restoration**: Restores `{{}}` template tags that got URL encoded
349
+ - **HTML entity decoding**: Converts `&lt;` and `&gt;` back to `<` and `>`
350
+ - **Cleanup rules**: Removes unwanted iframe and style elements
351
+ - **MSO conditions**: Manages Outlook-specific conditional comments
352
+ - **Domain replacement**: Updates old image domains to current ones
353
+
354
+ You can view all default rules in: `src/config/compiler/htmlCompilerRules.ts`
355
+
356
+ ### CompilerRule Interface
357
+
358
+ ```typescript
359
+ type CompilerRuleType = 'replace' | 'regex' | 'remove' | 'custom';
360
+
361
+ interface BaseCompilerRule {
362
+ id: string;
363
+ description?: string;
364
+ priority: number;
365
+ }
366
+
367
+ interface ReplaceRule extends BaseCompilerRule {
368
+ type: 'replace';
369
+ search: string;
370
+ replacement: string;
371
+ replaceAll?: boolean; // Default: true
372
+ }
373
+
374
+ interface RegexRule extends BaseCompilerRule {
375
+ type: 'regex';
376
+ pattern: string;
377
+ replacement: string;
378
+ flags?: string; // Default: 'g'
379
+ }
380
+
381
+ interface RemoveRule extends BaseCompilerRule {
382
+ type: 'remove';
383
+ targets: (string | RegExp)[]; // Array of strings or RegExp objects
384
+ }
385
+
386
+ interface CustomRule extends BaseCompilerRule {
387
+ type: 'custom';
388
+ processor: (html: string) => string;
389
+ }
390
+
391
+ type CompilerRule = ReplaceRule | RegexRule | RemoveRule | CustomRule;
392
+ ```
111
393
 
112
394
  ---
113
395
 
114
- ## 🛠 Development
396
+ ## 🔧 Development
397
+
398
+ ### Prerequisites
399
+
400
+ - 🧄 `Bun` (strongly recommended)
401
+ or
402
+ - NodeJS 18+ & `npm`
403
+
404
+ ### Setup
405
+
115
406
  ```bash
407
+ # Install dependencies
116
408
  bun install
409
+
410
+ # Start development server
117
411
  bun start
412
+
413
+ # Build for production
414
+ bun run build
415
+
416
+ # Type checking
417
+ bun run type-check
418
+
419
+ # Linting
420
+ bun run lint
118
421
  ```
119
422
 
120
- Build & types:
121
- ```bash
423
+ ### Environment Variables
424
+
425
+ Create a `.env` file with the following variables: (You can get env variables from your senior)
426
+
427
+ ```env
428
+ VITE_STRIPO_PLUGIN_ID=your_plugin_id
429
+ VITE_STRIPO_SECRET_KEY=your_secret_key
430
+ VITE_STRIPO_ROLE=your_role
431
+ ```
432
+
433
+ ### Project Structure
434
+
435
+ ```
436
+ src/
437
+ ├── components/ # Vue components
438
+ ├── composables/ # Vue composables & business logic
439
+ ├── services/ # API layer
440
+ ├── stores/ # State management
441
+ ├── @types/ # TypeScript definitions
442
+ ├── static/ # Static assets & templates
443
+ ├── utils/ # Utility functions
444
+ ├── enums/ # Constants & enums
445
+ ├── mock/ # Mock data for development
446
+ ├── plugins/ # Vue plugins
447
+ └── library.ts # Main export
448
+ ```
449
+
450
+ ## 🔌 Provide/Inject Utilities
451
+
452
+ Guido includes type-safe utilities for Vue's provide/inject system to facilitate dependency injection between components.
453
+
454
+ ### useProvideInject
455
+
456
+ The `useProvideInject` composable provides two helper functions for type-safe dependency injection:
457
+
458
+ #### Basic Usage
459
+
460
+ ```typescript
461
+ // Parent component
462
+ import { provideValue } from '@useinsider/guido';
463
+ import { InjectionKey } from 'vue';
464
+
465
+ // Define a typed injection key
466
+ const MyServiceKey: InjectionKey<MyService> = Symbol('MyService');
467
+
468
+ // Provide the value
469
+ const myService = new MyService();
470
+ provideValue(MyServiceKey, myService);
471
+
472
+ // Child component
473
+ import { useInjectedValue } from '@useinsider/guido';
474
+
475
+ // Inject the value with type safety
476
+ const myService = useInjectedValue(MyServiceKey);
477
+ ```
478
+
479
+ #### With Default Value
480
+
481
+ ```typescript
482
+ // Inject with a fallback value
483
+ const myService = useInjectedValue(MyServiceKey, new DefaultService());
484
+ ```
485
+
486
+ #### Error Handling
487
+
488
+ The `useInjectedValue` function will throw a descriptive error if no provider is found and no default value is provided:
489
+
490
+ ```typescript
491
+ // This will throw an error if no provider exists
492
+ try {
493
+ const myService = useInjectedValue(MyServiceKey);
494
+ } catch (error) {
495
+ console.error('No provider found for MyService');
496
+ }
497
+ ```
498
+
499
+ ### API Reference
500
+
501
+ #### `provideValue`
502
+
503
+ ```typescript
504
+ provideValue<T>(key: InjectionKey<T>, value: T): void
505
+ ```
506
+
507
+ Provides a value using Vue's provide system with type safety.
508
+
509
+ | Parameter | Type | Description |
510
+ |-----------|------|-------------|
511
+ | `key` | `InjectionKey<T>` | The typed injection key |
512
+ | `value` | `T` | The value to provide |
513
+
514
+ #### `useInjectedValue`
515
+
516
+ ```typescript
517
+ useInjectedValue<T>(key: InjectionKey<T>, defaultValue?: T): T
518
+ ```
519
+
520
+ Injects a value using Vue's inject system with type safety and error handling.
521
+
522
+ | Parameter | Type | Required | Description |
523
+ |-----------|------|----------|-------------|
524
+ | `key` | `InjectionKey<T>` | ✅ | The typed injection key |
525
+ | `defaultValue` | `T` | ⚪ | Optional fallback value |
526
+
527
+ **Returns:** `T` - The injected value
528
+
529
+ **Throws:** `Error` - When no provider is found and no default value is provided
530
+
531
+ ## 🌐 i18n
532
+ 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).
533
+ It allows to use production or local translations on your code. 🚀
534
+ Example usage:
535
+ ```js
536
+ import { useTranslations } from '@@/Composables/useTranslations';
537
+
538
+ const trans = useTranslations();
539
+
540
+ // use everywhere like this:
541
+ trans('foo.bar')
542
+ ```
543
+
544
+ ## 📦 Local Building (Recommended)
545
+
546
+ Run this commands if you want to test the package on your local before sending to NPM.
547
+ ```sh
122
548
  bun run build
123
549
  ```
124
550
 
551
+ Since bun does not have packaging yet, use npm here: 🥲
552
+ ```sh
553
+ npm pack
554
+ ```
555
+
556
+ It'll crate like `useinsider-guido-1.0.0.tgz` file.
557
+
558
+ Move this file to your project path like: `email-fe` via:
559
+ ```sh
560
+ cp useinsider-guido-1.0.0.tgz ../email-fe
561
+ ```
562
+
563
+ Install the file to your project:
564
+ ```sh
565
+ npm i ./useinsider-guido-1.0.0.tgz
566
+ ```
567
+
568
+ Then you just need to rebuild to your project or restart the Container. 🎉
569
+
570
+ For Future, we can create a shell script for it. Feel free to help 🙃
571
+
572
+ ## 📦 Build Output
573
+
574
+ The library builds to multiple formats:
575
+
576
+ - **ES Module**: `dist/library.js` (recommended)
577
+ - **CSS**: `dist/guido.css` (custom styles)
578
+
579
+ ### Package Exports
580
+
581
+ ```json
582
+ {
583
+ "exports": {
584
+ ".": {
585
+ "import": "./dist/library.js",
586
+ "types": "./dist/components/Guido.vue.d.ts",
587
+ "require": "./dist/components/Guido.vue.js"
588
+ },
589
+ "./style": "./dist/guido.css"
590
+ }
591
+ }
592
+ ```
593
+
594
+ ## 🤝 Contributing
595
+ - PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
596
+ - PR Labels should be filled.
597
+ - PR Assignee required.
598
+ - Tests should be covered.
599
+ - All required checks should be passed before sending review request.
600
+
601
+ ## 📄 License
602
+
603
+ ISC License
604
+
125
605
  ---
126
606
 
127
- TODO:
128
- [ ] - Default Template @edugencioglu
129
- [ ] - Using CSS variables into [editor.css](./src/static/editor.css) @berkansezer-useinsider
607
+ ## 🔗 Related
608
+
609
+ - [Stripo Email Editor](https://stripo.email/) - The underlying email editor
610
+ - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
611
+
612
+ ## 🎯 TODO:
613
+ - CSS part should be optimized with variables & `sass-loader`.
614
+ - Master Version Generator should be fixed.
615
+ - Playwright integration
616
+ - Commitlint & Precommit Hooks integration
617
+ - Get Pre-built display conditions from API