@useinsider/guido 1.4.4-beta.eb9b460 → 2.0.0-beta.061e9c9

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 (206) hide show
  1. package/README.md +297 -664
  2. package/dist/@types/config/defaults.js +44 -0
  3. package/dist/@types/config/schemas.js +233 -0
  4. package/dist/@types/config/validator.js +56 -0
  5. package/dist/components/Guido.vue.js +3 -3
  6. package/dist/components/Guido.vue2.js +68 -94
  7. package/dist/components/organisms/base/Toaster.vue.js +6 -6
  8. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
  9. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +6 -6
  10. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
  11. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +5 -5
  12. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
  13. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  14. package/dist/components/organisms/header/LeftSlot.vue2.js +18 -15
  15. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  16. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +22 -19
  17. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
  18. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
  19. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  20. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
  21. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
  22. package/dist/composables/useActionsApi.js +42 -25
  23. package/dist/composables/useBlocksConfig.js +23 -20
  24. package/dist/composables/useConfig.js +51 -5
  25. package/dist/composables/useHtmlCompiler.js +20 -19
  26. package/dist/composables/useHtmlValidator.js +41 -41
  27. package/dist/composables/usePartner.js +19 -9
  28. package/dist/composables/useStripo.js +58 -57
  29. package/dist/composables/useTimerClone.js +53 -0
  30. package/dist/composables/useTranslations.js +3 -2
  31. package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
  32. package/dist/enums/defaults.js +4 -67
  33. package/dist/enums/unsubscribe.js +23 -20
  34. package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
  35. package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
  36. package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
  37. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
  38. package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
  39. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +158 -68
  40. package/dist/extensions/Blocks/Recommendation/constants.js +10 -1
  41. package/dist/extensions/Blocks/Recommendation/control.js +74 -59
  42. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +68 -0
  43. package/dist/extensions/Blocks/Recommendation/controls/index.js +272 -0
  44. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +74 -0
  45. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +71 -0
  46. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +71 -0
  47. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +71 -0
  48. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +71 -0
  49. package/dist/extensions/Blocks/Recommendation/controls/priceHideControl.js +60 -0
  50. package/dist/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.js +160 -0
  51. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +188 -0
  52. package/dist/extensions/Blocks/Recommendation/extension.js +16 -40
  53. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +124 -71
  54. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +12 -11
  55. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +89 -65
  56. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +56 -19
  57. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +74 -45
  58. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +25 -0
  59. package/dist/extensions/Blocks/controlFactories.js +124 -113
  60. package/dist/guido.css +1 -1
  61. package/dist/library.js +12 -2
  62. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +14 -14
  63. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
  64. package/dist/node_modules/valibot/dist/index.js +476 -103
  65. package/dist/services/stripoApi.js +11 -16
  66. package/dist/services/templateLibraryApi.js +18 -18
  67. package/dist/src/@types/config/defaults.d.ts +68 -0
  68. package/dist/src/@types/config/index.d.ts +14 -0
  69. package/dist/src/@types/config/schemas.d.ts +513 -0
  70. package/dist/src/@types/config/types.d.ts +142 -0
  71. package/dist/src/@types/config/validator.d.ts +119 -0
  72. package/dist/src/@types/generic.d.ts +4 -45
  73. package/dist/src/components/Guido.vue.d.ts +13 -12
  74. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  75. package/dist/src/composables/useActionsApi.d.ts +2 -0
  76. package/dist/src/composables/useConfig.d.ts +188 -2
  77. package/dist/src/composables/usePartner.d.ts +8 -0
  78. package/dist/src/composables/useTimerClone.d.ts +6 -0
  79. package/dist/src/enums/defaults.d.ts +5 -6
  80. package/dist/src/enums/unsubscribe.d.ts +5 -1
  81. package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
  82. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
  83. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
  84. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +54 -3
  85. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +41 -1
  86. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +5 -2
  87. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +25 -0
  88. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +654 -0
  89. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +16 -0
  90. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +15 -0
  91. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +15 -0
  92. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +15 -0
  93. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +15 -0
  94. package/dist/src/extensions/Blocks/Recommendation/controls/priceHideControl.d.ts +16 -0
  95. package/dist/src/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.d.ts +50 -0
  96. package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +60 -0
  97. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +3 -3
  98. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +1 -1
  99. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +15 -7
  100. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +19 -0
  101. package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
  102. package/dist/src/library.d.ts +3 -1
  103. package/dist/src/stores/config.d.ts +1581 -102
  104. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  105. package/dist/static/styles/components/wide-panel.css.js +0 -4
  106. package/dist/static/styles/customEditorStyle.css.js +13 -0
  107. package/dist/stores/config.js +141 -9
  108. package/package.json +1 -1
  109. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
  110. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
  111. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
  112. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
  113. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
  114. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
  115. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
  116. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
  117. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
  118. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
  119. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
  120. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
  121. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
  122. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
  123. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
  124. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
  125. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
  126. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
  127. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
  128. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
  129. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
  130. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
  131. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
  132. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
  133. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
  134. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
  135. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
  136. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
  137. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
  138. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
  139. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
  140. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
  141. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
  142. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
  143. package/dist/node_modules/lodash-es/_apply.js +0 -16
  144. package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
  145. package/dist/node_modules/lodash-es/_assignValue.js +0 -10
  146. package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
  147. package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
  148. package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
  149. package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
  150. package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  151. package/dist/node_modules/lodash-es/_baseRest.js +0 -9
  152. package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
  153. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  154. package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
  155. package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  156. package/dist/node_modules/lodash-es/_copyArray.js +0 -9
  157. package/dist/node_modules/lodash-es/_copyObject.js +0 -14
  158. package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
  159. package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
  160. package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
  161. package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
  162. package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
  163. package/dist/node_modules/lodash-es/_overRest.js +0 -15
  164. package/dist/node_modules/lodash-es/_safeGet.js +0 -7
  165. package/dist/node_modules/lodash-es/_setToString.js +0 -6
  166. package/dist/node_modules/lodash-es/_shortOut.js +0 -16
  167. package/dist/node_modules/lodash-es/constant.js +0 -8
  168. package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  169. package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
  170. package/dist/node_modules/lodash-es/keysIn.js +0 -9
  171. package/dist/node_modules/lodash-es/merge.js +0 -8
  172. package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
  173. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
  174. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
  175. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
  176. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
  177. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
  178. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
  179. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
  180. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
  181. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
  182. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
  183. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
  184. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
  185. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
  186. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
  187. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
  188. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
  189. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
  190. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
  191. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
  192. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
  193. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
  194. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
  195. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
  196. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
  197. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
  198. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
  199. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
  200. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
  201. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
  202. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
  203. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
  204. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
  205. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
  206. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
@@ -0,0 +1,44 @@
1
+ import { ProductType as a, MessageType as o } from "./schemas.js";
2
+ a.EMAIL;
3
+ o.PROMOTIONAL;
4
+ const e = [
5
+ "alfredtesting",
6
+ "electio",
7
+ "eurekatest",
8
+ "gachapontestpart",
9
+ "gluautomation1",
10
+ "gluautomation2",
11
+ "gluautomation3",
12
+ "gluautomation4",
13
+ "inone",
14
+ "inshoppingcart",
15
+ "krakentest",
16
+ "leeroy",
17
+ "newsletteruat",
18
+ "ozaspava",
19
+ "piratesquad",
20
+ "qaautomation1",
21
+ "qaautomation2",
22
+ "qaautomation3",
23
+ "qaautomation4",
24
+ "roiautomation",
25
+ "seleniumautomation",
26
+ "seleniumautomation1",
27
+ "seleniumautomation2",
28
+ "seleniumautomation3",
29
+ "shopbagg",
30
+ "shopifytest",
31
+ "singlepageqa",
32
+ "testqa",
33
+ "vikingsankara",
34
+ "stripoeditorlivetest"
35
+ ];
36
+ function n(t) {
37
+ return e.includes(t);
38
+ }
39
+ export {
40
+ o as MessageType,
41
+ a as ProductType,
42
+ e as TEST_PARTNERS,
43
+ n as isTestPartner
44
+ };
@@ -0,0 +1,233 @@
1
+ import { object as o, number as p, optional as e, string as t, pipe as m, picklist as n, boolean as c, array as a, minLength as u, literal as r, custom as b, variant as S } from "../../node_modules/valibot/dist/index.js";
2
+ const i = {
3
+ /** Promotional/marketing emails */
4
+ PROMOTIONAL: 1,
5
+ /** Transactional/system emails */
6
+ TRANSACTIONAL: 2
7
+ }, s = {
8
+ /** Standard email campaigns */
9
+ EMAIL: 60,
10
+ /** Architect journey builder */
11
+ ARCHITECT: 49,
12
+ /** Unsubscribe page builder */
13
+ UNSUBSCRIBE_PAGES: 97
14
+ }, h = o({
15
+ /** Unique identifier for the template being edited */
16
+ templateId: m(
17
+ t(),
18
+ u(1, "templateId is required")
19
+ ),
20
+ /** Unique identifier for the user editing the template */
21
+ userId: m(
22
+ t(),
23
+ u(1, "userId is required")
24
+ ),
25
+ /** Optional variation ID for A/B testing */
26
+ variationId: e(t())
27
+ }), k = o({
28
+ /** Partner/organization name (required) */
29
+ name: m(
30
+ t(),
31
+ u(1, "partner.name is required")
32
+ ),
33
+ /** Product type identifier */
34
+ productType: e(
35
+ n([
36
+ s.EMAIL,
37
+ s.ARCHITECT,
38
+ s.UNSUBSCRIBE_PAGES
39
+ ]),
40
+ s.EMAIL
41
+ ),
42
+ /** Message type (promotional or transactional) */
43
+ messageType: e(
44
+ n([i.PROMOTIONAL, i.TRANSACTIONAL]),
45
+ i.PROMOTIONAL
46
+ ),
47
+ /** Display name for the current user */
48
+ username: e(t(), "Guido User")
49
+ }), y = o({
50
+ /** Display text for the dynamic content */
51
+ text: t(),
52
+ /** Template variable value (e.g., {{username}}) */
53
+ value: t(),
54
+ /** Fallback value if variable is empty */
55
+ fallback: e(t()),
56
+ /** Optional formatting options */
57
+ format: e(
58
+ o({
59
+ key: t(),
60
+ value: t()
61
+ })
62
+ )
63
+ }), R = o({
64
+ /** Initial HTML content */
65
+ html: e(t(), ""),
66
+ /** Initial CSS content */
67
+ css: e(t(), ""),
68
+ /** Preselected dynamic content items */
69
+ preselectedDynamicContent: e(
70
+ a(y),
71
+ []
72
+ ),
73
+ /** Selected unsubscribe page IDs */
74
+ selectedUnsubscribePages: e(a(p()), []),
75
+ /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
76
+ forceRecreate: e(c(), !1)
77
+ }), C = o({
78
+ /** Sender display name */
79
+ senderName: e(t(), ""),
80
+ /** Email subject line */
81
+ subject: e(t(), "")
82
+ }), I = o({
83
+ /** Locale for the editor UI */
84
+ locale: e(t(), "en"),
85
+ /** Path to translations object */
86
+ translationsPath: e(t(), "window.trans.en"),
87
+ /** Migration date for template compatibility */
88
+ migrationDate: e(p(), 1759696858),
89
+ /** Email header settings */
90
+ emailHeader: e(C, { senderName: "", subject: "" })
91
+ }), T = o({
92
+ /** Whether to show the header bar */
93
+ showHeader: e(c(), !0),
94
+ /** Custom label for back button (if shown) */
95
+ backButtonLabel: e(t())
96
+ }), A = o({
97
+ /** Enable dynamic content insertion */
98
+ dynamicContent: e(c(), !0),
99
+ /** Enable save as template functionality */
100
+ saveAsTemplate: e(c(), !0),
101
+ /** Enable version history */
102
+ versionHistory: e(c(), !0),
103
+ /** Enable test message sending */
104
+ testMessage: e(c(), !0),
105
+ /** Enable display conditions */
106
+ displayConditions: e(c(), !0),
107
+ /** Enable unsubscribe block */
108
+ unsubscribe: e(c(), !0),
109
+ /** Disable modules panel in the editor */
110
+ modulesDisabled: e(c(), !1)
111
+ }), f = n([
112
+ "amp-accordion",
113
+ "amp-carousel",
114
+ "amp-form-controls",
115
+ "banner-block",
116
+ "button-block",
117
+ "html-block",
118
+ "image-block",
119
+ "menu-block",
120
+ "social-block",
121
+ "spacer-block",
122
+ "text-block",
123
+ "timer-block",
124
+ "video-block"
125
+ ]), g = n([
126
+ "dynamic-content",
127
+ "checkbox-block",
128
+ "radio-button-block",
129
+ "recommendation-block",
130
+ "unsubscribe-block",
131
+ "coupon-block",
132
+ "items-block"
133
+ ]), E = o({
134
+ /** Default blocks to exclude from the editor */
135
+ excludeDefaults: e(
136
+ a(f),
137
+ []
138
+ ),
139
+ /** Custom blocks to include in the editor */
140
+ includeCustoms: e(
141
+ a(g),
142
+ []
143
+ )
144
+ }), l = o({
145
+ /** Unique identifier for the rule */
146
+ id: t(),
147
+ /** Human-readable description */
148
+ description: e(t()),
149
+ /** Priority for rule ordering (lower = earlier) */
150
+ priority: p()
151
+ }), N = o({
152
+ ...l.entries,
153
+ type: r("replace"),
154
+ /** String to search for */
155
+ search: t(),
156
+ /** Replacement string */
157
+ replacement: t(),
158
+ /** Replace all occurrences (default: false) */
159
+ replaceAll: e(c())
160
+ }), O = o({
161
+ ...l.entries,
162
+ type: r("regex"),
163
+ /** Regex pattern string */
164
+ pattern: t(),
165
+ /** Replacement string (supports $1, $2, etc.) */
166
+ replacement: t(),
167
+ /** Regex flags (e.g., 'gi') */
168
+ flags: e(t())
169
+ }), L = o({
170
+ ...l.entries,
171
+ type: r("remove"),
172
+ /** Strings or patterns to remove */
173
+ targets: a(t())
174
+ }), v = o({
175
+ ...l.entries,
176
+ type: r("custom"),
177
+ /** Custom processor function */
178
+ processor: b(
179
+ (d) => typeof d == "function",
180
+ "processor must be a function"
181
+ )
182
+ }), B = S("type", [
183
+ N,
184
+ O,
185
+ L,
186
+ v
187
+ ]), P = o({
188
+ /** Custom compiler rules to apply */
189
+ customRules: e(a(B), []),
190
+ /** Skip default compiler rules */
191
+ ignoreDefaultRules: e(c(), !1)
192
+ }), x = o({
193
+ // Required sections
194
+ /** Identity configuration (required) */
195
+ identity: h,
196
+ /** Partner configuration (required) */
197
+ partner: k,
198
+ // Optional sections (with defaults)
199
+ /** Template content and presets */
200
+ template: e(R, {}),
201
+ /** Editor settings */
202
+ editor: e(I, {}),
203
+ /** UI configuration */
204
+ ui: e(T, {}),
205
+ /** Feature toggles */
206
+ features: e(A, {}),
207
+ /** Block configuration */
208
+ blocks: e(E, {}),
209
+ /** Compiler configuration */
210
+ compiler: e(P, {})
211
+ });
212
+ export {
213
+ E as BlocksSchema,
214
+ B as CompilerRuleSchema,
215
+ P as CompilerSchema,
216
+ g as CustomBlockTypeSchema,
217
+ v as CustomRuleSchema,
218
+ f as DefaultBlockTypeSchema,
219
+ y as DynamicContentSchema,
220
+ I as EditorSchema,
221
+ C as EmailHeaderSchema,
222
+ A as FeaturesSchema,
223
+ x as GuidoConfigSchema,
224
+ h as IdentitySchema,
225
+ i as MessageType,
226
+ k as PartnerSchema,
227
+ s as ProductType,
228
+ O as RegexRuleSchema,
229
+ L as RemoveRuleSchema,
230
+ N as ReplaceRuleSchema,
231
+ R as TemplateSchema,
232
+ T as UISchema
233
+ };
@@ -0,0 +1,56 @@
1
+ import { safeParse as n } from "../../node_modules/valibot/dist/index.js";
2
+ import { GuidoConfigSchema as o } from "./schemas.js";
3
+ function i(s) {
4
+ return s.map((r) => {
5
+ var e;
6
+ return `[${((e = r.path) == null ? void 0 : e.map((a) => a.key).join(".")) || "root"}] ${r.message}`;
7
+ });
8
+ }
9
+ function c(s) {
10
+ return s.map((r) => {
11
+ var t;
12
+ return {
13
+ path: ((t = r.path) == null ? void 0 : t.map((e) => e.key).join(".")) || "root",
14
+ message: r.message
15
+ };
16
+ });
17
+ }
18
+ function u(s) {
19
+ const r = n(o, s);
20
+ return r.success ? {
21
+ success: !0,
22
+ data: r.output
23
+ } : {
24
+ success: !1,
25
+ errors: i(r.issues)
26
+ };
27
+ }
28
+ function p(s) {
29
+ var t;
30
+ const r = u(s);
31
+ if (!r.success)
32
+ throw new Error(
33
+ `Invalid GuidoConfig:
34
+ ${(t = r.errors) == null ? void 0 : t.join(`
35
+ `)}`
36
+ );
37
+ return r.data;
38
+ }
39
+ function m(s) {
40
+ const r = u(s);
41
+ return r.success ? r.data : (console.error("[Guido] Invalid configuration:", r.errors), null);
42
+ }
43
+ function d(s) {
44
+ const r = n(o, s);
45
+ return r.success ? [] : c(r.issues);
46
+ }
47
+ function g(s) {
48
+ return n(o, s).success;
49
+ }
50
+ export {
51
+ d as getValidationErrors,
52
+ g as isValidConfig,
53
+ p as parseConfig,
54
+ m as parseConfigSafe,
55
+ u as validateConfig
56
+ };
@@ -12,9 +12,9 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "4f8acc32"
15
+ "890b5336"
16
16
  );
17
- const u = s.exports;
17
+ const v = s.exports;
18
18
  export {
19
- u as default
19
+ v as default
20
20
  };
@@ -1,136 +1,110 @@
1
- import { defineComponent as B, defineAsyncComponent as U, ref as L, computed as W, watch as K, onMounted as j, onUnmounted as J } from "vue";
2
- import { provideGuidoActions as Q } from "../composables/useGuidoActions.js";
3
- import { usePartner as V } from "../composables/usePartner.js";
4
- import { useStripo as X } from "../composables/useStripo.js";
5
- import { migrate as A } from "../config/migrator/index.js";
6
- import { DefaultUsername as Y, DefaultMessageType as Z, DefaultGuidoConfig as $ } from "../enums/defaults.js";
7
- import ee from "./organisms/base/Toaster.vue.js";
8
- import oe from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
9
- import te from "./organisms/header/HeaderWrapper.vue.js";
10
- import ne from "./organisms/LoadingWrapper.vue.js";
11
- import re from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
12
- import ie from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
13
- import { useStripoApi as ae } from "../services/stripoApi.js";
14
- import { useConfigStore as se } from "../stores/config.js";
15
- import { useDynamicContentStore as ce } from "../stores/dynamic-content.js";
16
- import { useEditorStore as de } from "../stores/editor.js";
17
- import { usePreviewStore as me } from "../stores/preview.js";
18
- import { useToasterStore as le } from "../stores/toaster.js";
19
- import { useUnsubscribeStore as ue } from "../stores/unsubscribe.js";
20
- import pe from "../node_modules/lodash-es/merge.js";
21
- const Ae = /* @__PURE__ */ B({
1
+ import { defineComponent as B, defineAsyncComponent as P, ref as N, computed as U, watch as R, onMounted as z, onUnmounted as K } from "vue";
2
+ import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
3
+ import { usePartner as j } from "../composables/usePartner.js";
4
+ import { useStripo as q } from "../composables/useStripo.js";
5
+ import { useTimerClone as J } from "../composables/useTimerClone.js";
6
+ import { migrate as W } from "../config/migrator/index.js";
7
+ import Q from "./organisms/base/Toaster.vue.js";
8
+ import V from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
9
+ import X from "./organisms/header/HeaderWrapper.vue.js";
10
+ import Y from "./organisms/LoadingWrapper.vue.js";
11
+ import Z from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
12
+ import $ from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
13
+ import { useStripoApi as ee } from "../services/stripoApi.js";
14
+ import { useConfigStore as oe } from "../stores/config.js";
15
+ import { useDynamicContentStore as te } from "../stores/dynamic-content.js";
16
+ import { useEditorStore as ne } from "../stores/editor.js";
17
+ import { usePreviewStore as re } from "../stores/preview.js";
18
+ import { useUnsubscribeStore as se } from "../stores/unsubscribe.js";
19
+ const Ee = /* @__PURE__ */ B({
22
20
  __name: "Guido",
23
21
  props: {
24
- templateId: null,
25
- userId: null,
26
- messageType: null,
27
- partnerName: null,
28
- productType: null,
29
- username: null,
30
- html: null,
31
- css: null,
32
- guidoConfig: null,
33
- templateConfig: null
22
+ config: null
34
23
  },
35
24
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
36
- setup(N, { expose: R, emit: o }) {
37
- const p = N, F = U(
25
+ setup(_, { expose: I, emit: t }) {
26
+ const l = _, L = P(
38
27
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
39
- ), H = U(
28
+ ), A = P(
40
29
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
41
- ), f = L(), a = ce(), g = ue(), y = le(), v = se(), s = de(), x = me(), n = W(() => s.hasChanges), { getPartnerName: b, getProductType: C, isTestPartner: M } = V(), h = () => {
30
+ ), p = N(), c = te(), u = se(), n = oe();
31
+ n.init(l.config);
32
+ const i = ne(), F = re(), r = U(() => i.hasChanges), { isTestPartner: G } = j(), v = () => {
42
33
  var e;
43
- return (e = f.value) == null ? void 0 : e.handleSave(!0);
44
- }, {
45
- templateId: c,
46
- userId: S,
47
- guidoConfig: w,
48
- templateConfig: t,
49
- html: r = "",
50
- css: D = "",
51
- partnerName: d = b(),
52
- productType: m = C(),
53
- messageType: T = Z,
54
- username: E = Y
55
- } = p, l = (t == null ? void 0 : t.preselectedDynamicContentList) || [], i = L(!1);
56
- s.templateId = c, window.GuidoConfig = pe($, w), window.GuidoConfig.partner = {
57
- partnerName: d,
58
- productType: m,
59
- messageType: T
60
- }, v.templateConfig = t;
61
- const { initPlugin: P } = X({
62
- emailId: c,
63
- userId: S,
64
- username: E,
65
- partnerName: d,
66
- productType: m,
67
- preselectedDynamicContentList: l,
34
+ return (e = p.value) == null ? void 0 : e.handleSave(!0);
35
+ }, { templateId: a, userId: y, partnerName: h, productType: b, username: f, template: o } = n, s = (o == null ? void 0 : o.html) || "", g = (o == null ? void 0 : o.css) || "", m = (o == null ? void 0 : o.preselectedDynamicContent) || [];
36
+ i.templateId = a;
37
+ const { initPlugin: S } = q({
38
+ emailId: a,
39
+ userId: y,
40
+ username: f,
41
+ partnerName: h,
42
+ productType: b,
43
+ preselectedDynamicContentList: m,
68
44
  onReady: () => {
69
- console.debug("guido:ready"), o("ready");
45
+ console.debug("guido:ready"), t("ready");
70
46
  }
71
- }), { getDefaultTemplate: k } = ae(), O = W(() => {
47
+ }), { getDefaultTemplate: w } = ee(), { cloneTimersOnSave: C, hasTimerBlocks: D } = J(), H = U(() => {
72
48
  var e;
73
- return !((e = window.GuidoConfig) != null && e.useHeader);
49
+ return !((e = n.ui) != null && e.showHeader);
74
50
  });
75
- Q({
51
+ M({
76
52
  onBack: () => {
77
- console.debug("guido:back"), o("back");
53
+ console.debug("guido:back"), t("back");
78
54
  },
79
55
  onSaveStart: () => {
80
- console.debug("guido:save:start"), o("save:start");
56
+ console.debug("guido:save:start"), t("save:start");
81
57
  },
82
58
  onSaveComplete: (e) => {
83
- console.debug("guido:save:complete", e), o("save:complete", e);
59
+ console.debug("guido:save:complete", e), t("save:complete", e);
84
60
  },
85
61
  onTestEmailClick: () => {
86
- console.debug("guido:test-email:click"), o("test-email:click");
62
+ console.debug("guido:test-email:click"), t("test-email:click");
87
63
  }
88
64
  });
89
- const _ = (e) => {
90
- console.debug("dynamic-content:close", e), a.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
91
- }, G = () => {
65
+ const E = (e) => {
66
+ console.debug("dynamic-content:close", e), c.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
67
+ }, k = () => {
92
68
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
93
69
  };
94
- K(() => n.value, () => {
95
- o("on-change", n.value);
70
+ R(() => r.value, () => {
71
+ t("on-change", r.value);
96
72
  });
97
- const u = (e) => {
98
- const I = e, { attribute: q, position: z } = I.detail;
99
- console.debug("dynamic-content:open", I.detail), o("dynamic-content:open", q, z);
73
+ const d = (e) => {
74
+ const T = e, { attribute: O, position: x } = T.detail;
75
+ console.debug("dynamic-content:open", T.detail), t("dynamic-content:open", O, x);
100
76
  };
101
- return j(async () => {
77
+ return z(async () => {
102
78
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
103
79
  try {
104
- g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
80
+ u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
105
81
  let e = {
106
- html: r && await A(r),
107
- css: D,
108
- forceRecreate: !0
109
- // TODO: It should be false for old templates. We will communicate with Stripo
82
+ html: s && await W(s),
83
+ css: g
110
84
  };
111
- e.html || (e = await k(), e.html = await A(e.html)), await P(e), a.selectedDynamicContentList = l;
85
+ e.html || (e = await w(), e.html = await W(e.html)), D(e.html) && (e.html = await C(e.html)), await S(e), c.selectedDynamicContentList = m;
112
86
  } catch (e) {
113
87
  console.error("Failed to initialize Stripo editor:", e);
114
88
  }
115
- document.addEventListener("dynamic-content:open", u), i.value = !0;
116
- }), J(() => {
117
- var e;
118
- i.value && (y.hideToaster(), (e = document.querySelector("#guido__toaster")) == null || e.remove()), i.value = !1, document.removeEventListener("dynamic-content:open", u);
89
+ document.addEventListener("dynamic-content:open", d);
90
+ }), K(() => {
91
+ document.removeEventListener("dynamic-content:open", d);
119
92
  try {
120
93
  window.UIEditor.removeEditor();
121
94
  } catch {
122
95
  console.debug("Failed to remove Stripo editor: No editor found");
123
96
  }
124
- }), R({
97
+ n.reset();
98
+ }), I({
125
99
  dynamicContent: {
126
- insert: _,
127
- close: G
100
+ insert: E,
101
+ close: k
128
102
  },
129
- hasChanges: n,
130
- saveSilent: h
131
- }), { __sfc: !0, PreviewContainer: F, OnboardingWrapper: H, headerWrapperRef: f, dynamicContentStore: a, unsubscribeStore: g, toasterStore: y, props: p, configStore: v, editorStore: s, previewStore: x, hasChanges: n, getPartnerName: b, getProductType: C, isTestPartner: M, saveSilent: h, templateId: c, userId: S, guidoConfig: w, templateConfig: t, html: r, css: D, partnerName: d, productType: m, messageType: T, username: E, preselectedDynamicContentList: l, editorReady: i, emit: o, initPlugin: P, getDefaultTemplate: k, noHeader: O, insertDynamicContent: _, closeDynamicContent: G, handleDynamicContentOpen: u, Toaster: ee, FilterSelectionDrawer: oe, HeaderWrapper: te, LoadingWrapper: ne, SaveAsTemplateDrawer: re, UnsubscribeWrapper: ie };
103
+ hasChanges: r,
104
+ saveSilent: v
105
+ }), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: p, dynamicContentStore: c, unsubscribeStore: u, props: l, configStore: n, editorStore: i, previewStore: F, hasChanges: r, isTestPartner: G, saveSilent: v, templateId: a, userId: y, partnerName: h, productType: b, username: f, templateConfig: o, html: s, css: g, preselectedDynamicContentList: m, emit: t, initPlugin: S, getDefaultTemplate: w, cloneTimersOnSave: C, hasTimerBlocks: D, noHeader: H, insertDynamicContent: E, closeDynamicContent: k, handleDynamicContentOpen: d, Toaster: Q, FilterSelectionDrawer: V, HeaderWrapper: X, LoadingWrapper: Y, SaveAsTemplateDrawer: Z, UnsubscribeWrapper: $ };
132
106
  }
133
107
  });
134
108
  export {
135
- Ae as default
109
+ Ee as default
136
110
  };
@@ -1,17 +1,17 @@
1
- import n from "./Toaster.vue2.js";
1
+ import e from "./Toaster.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var r = function() {
4
- var o = this, e = o._self._c, t = o._self._setupProxy;
5
- return e(t.InToasts, { attrs: { id: "guido__toaster", "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
4
+ var o = this, n = o._self._c, t = o._self._setupProxy;
5
+ return n(t.InToasts, { attrs: { "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
6
6
  }, a = [], _ = /* @__PURE__ */ s(
7
- n,
7
+ e,
8
8
  r,
9
9
  a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const f = _.exports;
14
+ const l = _.exports;
15
15
  export {
16
- f as default
16
+ l as default
17
17
  };
@@ -1,20 +1,20 @@
1
- import { defineComponent as m, computed as o } from "vue";
2
- import { useConfig as a } from "../../../../composables/useConfig.js";
3
- import { useTranslations as i } from "../../../../composables/useTranslations.js";
4
- import { InIcons as c } from "@useinsider/design-system-vue";
5
- const l = /* @__PURE__ */ m({
1
+ import { defineComponent as i, computed as s } from "vue";
2
+ import { useConfig as c } from "../../../../composables/useConfig.js";
3
+ import { useTranslations as d } from "../../../../composables/useTranslations.js";
4
+ import { InIcons as u } from "@useinsider/design-system-vue";
5
+ const g = /* @__PURE__ */ i({
6
6
  __name: "EmailHeaderInfo",
7
7
  setup(f) {
8
- const { config: t } = a(), n = i(), s = o(() => {
9
- var e;
10
- return ((e = t.emailHeader) == null ? void 0 : e.senderName) || n("settings.sender-name");
11
- }), r = o(() => {
12
- var e;
13
- return ((e = t.emailHeader) == null ? void 0 : e.subject) || n("email-editor.default-subject");
8
+ const { config: n } = c(), r = d(), a = s(() => {
9
+ var e, t, o;
10
+ return ((o = (t = (e = n.value) == null ? void 0 : e.editor) == null ? void 0 : t.emailHeader) == null ? void 0 : o.senderName) || r("settings.sender-name");
11
+ }), m = s(() => {
12
+ var e, t, o;
13
+ return ((o = (t = (e = n.value) == null ? void 0 : e.editor) == null ? void 0 : t.emailHeader) == null ? void 0 : o.subject) || r("email-editor.default-subject");
14
14
  });
15
- return { __sfc: !0, config: t, trans: n, senderName: s, subject: r, InIcons: c };
15
+ return { __sfc: !0, config: n, trans: r, senderName: a, subject: m, InIcons: u };
16
16
  }
17
17
  });
18
18
  export {
19
- l as default
19
+ g as default
20
20
  };
@@ -1,16 +1,16 @@
1
1
  import i from "./EmailSizeIndicator.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var r = function() {
3
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
5
  var s = this, e = s._self._c, t = s._self._setupProxy;
6
- return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltipV2, { attrs: { id: "email-size-tooltip", "icon-status": "", "static-position": "bottom center", "dynamic-position": !1, text: t.trans("email-editor.preview-design-size-tooltip") } })], 1);
7
- }, a = [], n = /* @__PURE__ */ o(
6
+ return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltip, { staticClass: "d-f ml-1", attrs: { id: "email-size-tooltip", align: "center", position: "bottom", text: t.trans("email-editor.preview-design-size-tooltip") } })], 1);
7
+ }, a = [], n = /* @__PURE__ */ r(
8
8
  i,
9
- r,
9
+ o,
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "eb2f9f20"
13
+ "c2adc57d"
14
14
  );
15
15
  const m = n.exports;
16
16
  export {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
2
2
  import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
3
  import { usePreviewStore as _ } from "../../../../stores/preview.js";
4
- import { InTooltipV2 as v, InProgress as f } from "@useinsider/design-system-vue";
4
+ import { InTooltip as v, InProgress as f } from "@useinsider/design-system-vue";
5
5
  const S = /* @__PURE__ */ c({
6
6
  __name: "EmailSizeIndicator",
7
7
  setup(w) {
@@ -17,7 +17,7 @@ const S = /* @__PURE__ */ c({
17
17
  }, i = p();
18
18
  return u(() => t.previewHtml, () => {
19
19
  r();
20
- }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltipV2: v };
20
+ }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltip: v };
21
21
  }
22
22
  });
23
23
  export {