crmbonus-component-wake 2.1.41-ngrok → 2.1.41-shoulder

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 (303) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/app-modal.cjs.entry.js +2 -2
  3. package/dist/cjs/app-modal.cjs.entry.js.map +1 -1
  4. package/dist/cjs/bc-crmbonus.cjs.entry.js +28 -0
  5. package/dist/cjs/bc-crmbonus.cjs.entry.js.map +1 -0
  6. package/dist/cjs/bc-phone-form_2.cjs.entry.js +333 -0
  7. package/dist/cjs/bc-phone-form_2.cjs.entry.js.map +1 -0
  8. package/dist/cjs/bc-wake-crmbonus.cjs.entry.js +18 -0
  9. package/dist/cjs/bc-wake-crmbonus.cjs.entry.js.map +1 -0
  10. package/dist/cjs/cart.helper-d1f02660.js +201 -0
  11. package/dist/cjs/cart.helper-d1f02660.js.map +1 -0
  12. package/dist/cjs/container-empty.cjs.entry.js +2 -2
  13. package/dist/cjs/container-empty.cjs.entry.js.map +1 -1
  14. package/dist/cjs/countdown-timer-v2.cjs.entry.js +2 -2
  15. package/dist/cjs/countdown-timer-v2.cjs.entry.js.map +1 -1
  16. package/dist/cjs/countdown-timer_11.cjs.entry.js +55 -43
  17. package/dist/cjs/countdown-timer_11.cjs.entry.js.map +1 -1
  18. package/dist/cjs/crm-bonus-note.cjs.entry.js +14 -12
  19. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
  20. package/dist/cjs/crmbonus-component-wake.cjs.js +2 -2
  21. package/dist/{components/p-0d09c221.js → cjs/crmbonus.service-ef8fe456.js} +30 -117
  22. package/dist/cjs/crmbonus.service-ef8fe456.js.map +1 -0
  23. package/dist/{esm/info.config.helper-e4b8c478.js → cjs/i18n-defaa4f8.js} +3 -30
  24. package/dist/cjs/i18n-defaa4f8.js.map +1 -0
  25. package/dist/cjs/{index-a7537457.js → index-e45b352e.js} +17 -1
  26. package/dist/cjs/index-e45b352e.js.map +1 -0
  27. package/dist/cjs/info.config.helper-52984ab9.js +36 -0
  28. package/dist/cjs/info.config.helper-52984ab9.js.map +1 -0
  29. package/dist/cjs/loader.cjs.js +2 -2
  30. package/dist/cjs/pedido-finalizado.cjs.entry.js +6 -5
  31. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -1
  32. package/dist/cjs/utils-5d59acb1.js.map +1 -1
  33. package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +5 -5
  34. package/dist/collection/collection-manifest.json +5 -1
  35. package/dist/collection/components/button/crm-button.css +21 -21
  36. package/dist/collection/components/button/index.js +1 -1
  37. package/dist/collection/components/button/index.js.map +1 -1
  38. package/dist/collection/components/countdown-timer/countdown-timer.js +1 -1
  39. package/dist/collection/components/countdown-timer/countdown-timer.js.map +1 -1
  40. package/dist/collection/components/countdown-timer/countdown-timer.v2.js +2 -2
  41. package/dist/collection/components/countdown-timer/countdown-timer.v2.js.map +1 -1
  42. package/dist/collection/components/crm-bonus/assets/logo.svg +17 -17
  43. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +17 -17
  44. package/dist/collection/components/crm-bonus/crm-bonus.css +86 -82
  45. package/dist/collection/components/crm-bonus/crm-bonus.js +16 -7
  46. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
  47. package/dist/collection/components/crmbonus/crmbonus.js +26 -0
  48. package/dist/collection/components/crmbonus/crmbonus.js.map +1 -0
  49. package/dist/collection/components/crmbonus/subcomponents/phone-form/index.js +95 -0
  50. package/dist/collection/components/crmbonus/subcomponents/phone-form/index.js.map +1 -0
  51. package/dist/collection/components/crmbonus/subcomponents/phone-form/styles.scss +5 -0
  52. package/dist/collection/components/crmbonus/subcomponents/phone-validate/index.js +129 -0
  53. package/dist/collection/components/crmbonus/subcomponents/phone-validate/index.js.map +1 -0
  54. package/dist/collection/components/crmbonus/subcomponents/phone-validate/styles.scss +84 -0
  55. package/dist/collection/components/giftback-form/giftback-form.css +74 -74
  56. package/dist/collection/components/giftback-form/giftback-form.js +5 -5
  57. package/dist/collection/components/giftback-form/giftback-form.js.map +1 -1
  58. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +181 -181
  59. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +6 -6
  60. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -1
  61. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +1 -1
  62. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +1 -1
  63. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +1 -1
  64. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +83 -83
  65. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +1 -1
  66. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +1 -1
  67. package/dist/collection/components/loading-container/container-empty.js +1 -1
  68. package/dist/collection/components/loading-container/container-empty.js.map +1 -1
  69. package/dist/collection/components/loading-container/loading-container.css +53 -53
  70. package/dist/collection/components/loading-container/loading-container.js +1 -1
  71. package/dist/collection/components/loading-container/loading-container.js.map +1 -1
  72. package/dist/collection/components/loading-spinner/loading-spinner.css +16 -16
  73. package/dist/collection/components/loading-spinner/loading-spinner.js +1 -1
  74. package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -1
  75. package/dist/collection/components/modal/app-modal.css +44 -44
  76. package/dist/collection/components/modal/app-modal.js +1 -1
  77. package/dist/collection/components/modal/app-modal.js.map +1 -1
  78. package/dist/collection/components/note/crm-bonus-note.css +68 -68
  79. package/dist/collection/components/note/crm-bonus-note.js +2 -2
  80. package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
  81. package/dist/collection/components/pedido/pedido.js +2 -2
  82. package/dist/collection/components/pedido/pedido.js.map +1 -1
  83. package/dist/collection/components/phone/phone-input-mask.css +40 -40
  84. package/dist/collection/components/phone/phone-input-mask.js +1 -1
  85. package/dist/collection/components/phone/phone-input-mask.js.map +1 -1
  86. package/dist/collection/components/tooltip/crm-tooltip.css +48 -48
  87. package/dist/collection/components/tooltip/tooltip.js +1 -1
  88. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  89. package/dist/collection/contants/index.js.map +1 -1
  90. package/dist/collection/contants/mocks.js.map +1 -1
  91. package/dist/collection/dto/checkout.dto.js +2 -0
  92. package/dist/collection/dto/checkout.dto.js.map +1 -0
  93. package/dist/collection/dto/pin.sent.js.map +1 -1
  94. package/dist/collection/dto/reserved-info.dto.js.map +1 -1
  95. package/dist/collection/dto/update.order.dto.js.map +1 -1
  96. package/dist/collection/dto/validate.pin.bonus.js.map +1 -1
  97. package/dist/collection/helpers/build.payload.helper.js +1 -0
  98. package/dist/collection/helpers/build.payload.helper.js.map +1 -1
  99. package/dist/collection/helpers/cart.helper.js +55 -1
  100. package/dist/collection/helpers/cart.helper.js.map +1 -1
  101. package/dist/collection/helpers/info.config.helper.js.map +1 -1
  102. package/dist/collection/helpers/payload.interface.js.map +1 -1
  103. package/dist/collection/helpers/time.helper.js.map +1 -1
  104. package/dist/collection/i18n/i18n.js.map +1 -1
  105. package/dist/collection/index.js.map +1 -1
  106. package/dist/collection/objectvalues/cart.wake.js +33 -8
  107. package/dist/collection/objectvalues/cart.wake.js.map +1 -1
  108. package/dist/collection/platforms/wake/index.js +8 -0
  109. package/dist/collection/platforms/wake/index.js.map +1 -0
  110. package/dist/collection/services/crmbonus.service.js +21 -2
  111. package/dist/collection/services/crmbonus.service.js.map +1 -1
  112. package/dist/collection/utils/keys.storage.js.map +1 -1
  113. package/dist/collection/utils/retry.utils.js.map +1 -1
  114. package/dist/collection/utils/utils.js.map +1 -1
  115. package/dist/components/app-modal.js +2 -2
  116. package/dist/components/app-modal.js.map +1 -1
  117. package/dist/components/bc-crmbonus.d.ts +11 -0
  118. package/dist/components/bc-crmbonus.js +8 -0
  119. package/dist/components/bc-crmbonus.js.map +1 -0
  120. package/dist/components/bc-phone-form.d.ts +11 -0
  121. package/dist/components/bc-phone-form.js +8 -0
  122. package/dist/components/bc-phone-form.js.map +1 -0
  123. package/dist/components/bc-phone-validate-pin-form.d.ts +11 -0
  124. package/dist/components/bc-phone-validate-pin-form.js +8 -0
  125. package/dist/components/bc-phone-validate-pin-form.js.map +1 -0
  126. package/dist/components/bc-wake-crmbonus.d.ts +11 -0
  127. package/dist/components/bc-wake-crmbonus.js +74 -0
  128. package/dist/components/bc-wake-crmbonus.js.map +1 -0
  129. package/dist/components/container-empty.js +2 -2
  130. package/dist/components/container-empty.js.map +1 -1
  131. package/dist/components/countdown-timer-v2.js +2 -2
  132. package/dist/components/countdown-timer-v2.js.map +1 -1
  133. package/dist/components/countdown-timer.js +1 -1
  134. package/dist/components/crm-bonus-note.js +8 -7
  135. package/dist/components/crm-bonus-note.js.map +1 -1
  136. package/dist/components/crm-bonus.js +30 -19
  137. package/dist/components/crm-bonus.js.map +1 -1
  138. package/dist/components/crm-button.js +1 -1
  139. package/dist/components/crm-giftback-form.js +1 -1
  140. package/dist/components/crm-tooltip.js +1 -1
  141. package/dist/components/giftback-info.js +1 -1
  142. package/dist/components/index.js +1 -1
  143. package/dist/components/loading-container.js +1 -1
  144. package/dist/components/loading-spinner.js +1 -1
  145. package/dist/components/p-06d73541.js +80 -0
  146. package/dist/components/p-06d73541.js.map +1 -0
  147. package/dist/components/p-09f86f1d.js +106 -0
  148. package/dist/components/p-09f86f1d.js.map +1 -0
  149. package/dist/components/p-1b441909.js.map +1 -1
  150. package/dist/components/p-2362455d.js +195 -0
  151. package/dist/components/p-2362455d.js.map +1 -0
  152. package/dist/components/p-2fac7f5e.js +78 -0
  153. package/dist/components/p-2fac7f5e.js.map +1 -0
  154. package/dist/components/{p-786485b2.js → p-39bd2459.js} +3 -3
  155. package/dist/components/p-39bd2459.js.map +1 -0
  156. package/dist/components/{p-144c34f6.js → p-496bc4af.js} +17 -16
  157. package/dist/components/p-496bc4af.js.map +1 -0
  158. package/dist/{esm/cart.helper-8c8d4a0a.js → components/p-60787be2.js} +25 -117
  159. package/dist/components/p-60787be2.js.map +1 -0
  160. package/dist/components/{p-0a7ccd8c.js → p-6aa17c2b.js} +6 -6
  161. package/dist/components/p-6aa17c2b.js.map +1 -0
  162. package/dist/components/{p-c250687d.js → p-80a69118.js} +4 -4
  163. package/dist/components/p-80a69118.js.map +1 -0
  164. package/dist/components/p-81e4e697.js +1298 -0
  165. package/dist/components/p-81e4e697.js.map +1 -0
  166. package/dist/components/{p-2cece106.js → p-8f45d088.js} +3 -3
  167. package/dist/components/p-8f45d088.js.map +1 -0
  168. package/dist/components/{p-9b5c07d8.js → p-9231dc5e.js} +4 -4
  169. package/dist/components/p-9231dc5e.js.map +1 -0
  170. package/dist/components/{p-3c8ae82e.js → p-ade5e41e.js} +11 -10
  171. package/dist/components/p-ade5e41e.js.map +1 -0
  172. package/dist/components/p-af3ba015.js.map +1 -1
  173. package/dist/components/{p-e6863cf5.js → p-bf1d624e.js} +6 -6
  174. package/dist/components/p-bf1d624e.js.map +1 -0
  175. package/dist/components/{p-8274e2c4.js → p-c1522ad8.js} +3 -3
  176. package/dist/components/p-c1522ad8.js.map +1 -0
  177. package/dist/components/p-c53241bf.js.map +1 -1
  178. package/dist/components/{p-11520f0f.js → p-eabf185c.js} +3 -3
  179. package/dist/components/p-eabf185c.js.map +1 -0
  180. package/dist/components/p-ecc51430.js.map +1 -1
  181. package/dist/components/{p-9d950d25.js → p-f58c9cb2.js} +2 -2
  182. package/dist/components/p-f58c9cb2.js.map +1 -0
  183. package/dist/components/pedido-finalizado.js +5 -4
  184. package/dist/components/pedido-finalizado.js.map +1 -1
  185. package/dist/components/phone-form.js +1 -1
  186. package/dist/components/phone-input-mask.js +1 -1
  187. package/dist/components/pin-form.js +1 -1
  188. package/dist/crmbonus-component-wake/assets/logo.svg +17 -17
  189. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  190. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  191. package/dist/crmbonus-component-wake/{p-ac027576.entry.js → p-06d494c4.entry.js} +2 -2
  192. package/dist/crmbonus-component-wake/p-06d494c4.entry.js.map +1 -0
  193. package/dist/crmbonus-component-wake/{p-8c362346.js → p-19848de4.js} +2 -2
  194. package/dist/crmbonus-component-wake/p-19848de4.js.map +1 -0
  195. package/dist/crmbonus-component-wake/p-20d0467e.js +2 -0
  196. package/dist/crmbonus-component-wake/p-20d0467e.js.map +1 -0
  197. package/dist/crmbonus-component-wake/p-2362455d.js +2 -0
  198. package/dist/crmbonus-component-wake/p-2362455d.js.map +1 -0
  199. package/dist/crmbonus-component-wake/p-2dd97532.entry.js +2 -0
  200. package/dist/crmbonus-component-wake/p-2dd97532.entry.js.map +1 -0
  201. package/dist/crmbonus-component-wake/p-3e02757c.entry.js +2 -0
  202. package/dist/crmbonus-component-wake/p-3e02757c.entry.js.map +1 -0
  203. package/dist/crmbonus-component-wake/p-4cbebe64.entry.js +2 -0
  204. package/dist/crmbonus-component-wake/p-4cbebe64.entry.js.map +1 -0
  205. package/dist/crmbonus-component-wake/{p-0d09c221.js → p-60787be2.js} +2 -2
  206. package/dist/crmbonus-component-wake/p-60787be2.js.map +1 -0
  207. package/dist/crmbonus-component-wake/p-6e7c09cd.entry.js +2 -0
  208. package/dist/crmbonus-component-wake/p-6e7c09cd.entry.js.map +1 -0
  209. package/dist/crmbonus-component-wake/p-9b556ee6.entry.js +2 -0
  210. package/dist/crmbonus-component-wake/p-9b556ee6.entry.js.map +1 -0
  211. package/dist/crmbonus-component-wake/p-af3ba015.js.map +1 -1
  212. package/dist/crmbonus-component-wake/p-b435da9a.entry.js +2 -0
  213. package/dist/crmbonus-component-wake/p-b435da9a.entry.js.map +1 -0
  214. package/dist/crmbonus-component-wake/p-c53241bf.js +2 -0
  215. package/dist/crmbonus-component-wake/p-c53241bf.js.map +1 -0
  216. package/dist/crmbonus-component-wake/p-c533ea8b.entry.js +2 -0
  217. package/dist/crmbonus-component-wake/p-c533ea8b.entry.js.map +1 -0
  218. package/dist/crmbonus-component-wake/p-c7d03986.entry.js +2 -0
  219. package/dist/crmbonus-component-wake/p-c7d03986.entry.js.map +1 -0
  220. package/dist/env.js +2 -2
  221. package/dist/env.js.map +1 -1
  222. package/dist/esm/app-modal.entry.js +2 -2
  223. package/dist/esm/app-modal.entry.js.map +1 -1
  224. package/dist/esm/bc-crmbonus.entry.js +24 -0
  225. package/dist/esm/bc-crmbonus.entry.js.map +1 -0
  226. package/dist/esm/bc-phone-form_2.entry.js +328 -0
  227. package/dist/esm/bc-phone-form_2.entry.js.map +1 -0
  228. package/dist/esm/bc-wake-crmbonus.entry.js +14 -0
  229. package/dist/esm/bc-wake-crmbonus.entry.js.map +1 -0
  230. package/dist/esm/cart.helper-22ecdec9.js +195 -0
  231. package/dist/esm/cart.helper-22ecdec9.js.map +1 -0
  232. package/dist/esm/container-empty.entry.js +2 -2
  233. package/dist/esm/container-empty.entry.js.map +1 -1
  234. package/dist/esm/countdown-timer-v2.entry.js +2 -2
  235. package/dist/esm/countdown-timer-v2.entry.js.map +1 -1
  236. package/dist/esm/countdown-timer_11.entry.js +41 -29
  237. package/dist/esm/countdown-timer_11.entry.js.map +1 -1
  238. package/dist/esm/crm-bonus-note.entry.js +9 -7
  239. package/dist/esm/crm-bonus-note.entry.js.map +1 -1
  240. package/dist/esm/crmbonus-component-wake.js +3 -3
  241. package/dist/{cjs/cart.helper-31ba8997.js → esm/crmbonus.service-d83e6bb6.js} +25 -125
  242. package/dist/esm/crmbonus.service-d83e6bb6.js.map +1 -0
  243. package/dist/{cjs/info.config.helper-d4b1291b.js → esm/i18n-b9d8b0cc.js} +2 -36
  244. package/dist/esm/i18n-b9d8b0cc.js.map +1 -0
  245. package/dist/esm/{index-bdb70d5a.js → index-09314622.js} +16 -2
  246. package/dist/esm/index-09314622.js.map +1 -0
  247. package/dist/esm/info.config.helper-156cb9b2.js +32 -0
  248. package/dist/esm/info.config.helper-156cb9b2.js.map +1 -0
  249. package/dist/esm/loader.js +3 -3
  250. package/dist/esm/pedido-finalizado.entry.js +5 -4
  251. package/dist/esm/pedido-finalizado.entry.js.map +1 -1
  252. package/dist/esm/utils-dec6df66.js.map +1 -1
  253. package/dist/store.js +25 -0
  254. package/dist/store.js.map +1 -0
  255. package/dist/types/components/crmbonus/crmbonus.d.ts +9 -0
  256. package/dist/types/components/crmbonus/subcomponents/phone-form/index.d.ts +13 -0
  257. package/dist/types/components/crmbonus/subcomponents/phone-validate/index.d.ts +17 -0
  258. package/dist/types/components.d.ts +76 -0
  259. package/dist/types/dto/checkout.dto.d.ts +8 -0
  260. package/dist/types/dto/pin.sent.d.ts +3 -0
  261. package/dist/types/dto/validate.pin.bonus.d.ts +9 -0
  262. package/dist/types/helpers/cart.helper.d.ts +1 -0
  263. package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +2 -0
  264. package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/store.d.ts +11 -0
  265. package/dist/types/objectvalues/cart.wake.d.ts +2 -1
  266. package/dist/types/platforms/wake/index.d.ts +3 -0
  267. package/dist/types/services/crmbonus.service.d.ts +4 -2
  268. package/package.json +59 -58
  269. package/readme.md +114 -114
  270. package/dist/cjs/cart.helper-31ba8997.js.map +0 -1
  271. package/dist/cjs/index-a7537457.js.map +0 -1
  272. package/dist/cjs/info.config.helper-d4b1291b.js.map +0 -1
  273. package/dist/components/p-0a7ccd8c.js.map +0 -1
  274. package/dist/components/p-0d09c221.js.map +0 -1
  275. package/dist/components/p-11520f0f.js.map +0 -1
  276. package/dist/components/p-144c34f6.js.map +0 -1
  277. package/dist/components/p-2cece106.js.map +0 -1
  278. package/dist/components/p-3c8ae82e.js.map +0 -1
  279. package/dist/components/p-786485b2.js.map +0 -1
  280. package/dist/components/p-8274e2c4.js.map +0 -1
  281. package/dist/components/p-9b5c07d8.js.map +0 -1
  282. package/dist/components/p-9d950d25.js.map +0 -1
  283. package/dist/components/p-c250687d.js.map +0 -1
  284. package/dist/components/p-e6863cf5.js.map +0 -1
  285. package/dist/crmbonus-component-wake/p-0d09c221.js.map +0 -1
  286. package/dist/crmbonus-component-wake/p-1644deef.entry.js +0 -2
  287. package/dist/crmbonus-component-wake/p-1644deef.entry.js.map +0 -1
  288. package/dist/crmbonus-component-wake/p-60742512.entry.js +0 -2
  289. package/dist/crmbonus-component-wake/p-60742512.entry.js.map +0 -1
  290. package/dist/crmbonus-component-wake/p-7e52727e.entry.js +0 -2
  291. package/dist/crmbonus-component-wake/p-7e52727e.entry.js.map +0 -1
  292. package/dist/crmbonus-component-wake/p-8c362346.js.map +0 -1
  293. package/dist/crmbonus-component-wake/p-ac027576.entry.js.map +0 -1
  294. package/dist/crmbonus-component-wake/p-ac1e7c32.entry.js +0 -2
  295. package/dist/crmbonus-component-wake/p-ac1e7c32.entry.js.map +0 -1
  296. package/dist/crmbonus-component-wake/p-b4f52f79.js +0 -2
  297. package/dist/crmbonus-component-wake/p-b4f52f79.js.map +0 -1
  298. package/dist/crmbonus-component-wake/p-df80d1b0.entry.js +0 -2
  299. package/dist/crmbonus-component-wake/p-df80d1b0.entry.js.map +0 -1
  300. package/dist/esm/cart.helper-8c8d4a0a.js.map +0 -1
  301. package/dist/esm/index-bdb70d5a.js.map +0 -1
  302. package/dist/esm/info.config.helper-e4b8c478.js.map +0 -1
  303. package/dist/types/Users/Darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +0 -2
package/dist/store.js ADDED
@@ -0,0 +1,25 @@
1
+ import { createStore } from "@stencil/store";
2
+ const { state, onChange } = createStore({
3
+ storeConfig: {
4
+ btnApplyBonusLabel: 'Avançar',
5
+ confirmationMessage: '',
6
+ giftbackTitle: 'giftback',
7
+ keepStoreFrontStyle: false
8
+ },
9
+ checkout: {
10
+ cellphone: null,
11
+ checkoutId: '',
12
+ checkoutProducts: [],
13
+ crmbonuStoreId: null,
14
+ crmbonusUserId: null,
15
+ storeName: ''
16
+ },
17
+ clicks: 0,
18
+ seconds: 0,
19
+ squaredClicks: 0
20
+ });
21
+ onChange('clicks', value => {
22
+ state.squaredClicks = value ** 2;
23
+ });
24
+ export default state;
25
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAc7C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAiB;IACtD,WAAW,EAAE;QACX,kBAAkB,EAAE,SAAS;QAC7B,mBAAmB,EAAE,EAAE;QACvB,aAAa,EAAE,UAAU;QACzB,mBAAmB,EAAE,KAAK;KAC3B;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,EAAE;QACd,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,IAAI;QACpB,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,EAAE;KACd;IACD,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,aAAa,EAAE,CAAC;CACjB,CAAC,CAAC;AAEH,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE;IACzB,KAAK,CAAC,aAAa,GAAG,KAAK,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { createStore } from \"@stencil/store\";\n\nimport { IInfoStore } from \"./src/helpers/info.config.helper\";\nimport { ICheckoutDTO } from \"./src/dto/checkout.dto\";\n\n\ninterface IStoreCheckout {\n clicks: number;\n squaredClicks: number;\n seconds: number;\n storeConfig: IInfoStore;\n checkout: ICheckoutDTO;\n}\n\nconst { state, onChange } = createStore<IStoreCheckout>({\n storeConfig: {\n btnApplyBonusLabel: 'Avançar',\n confirmationMessage: '',\n giftbackTitle: 'giftback',\n keepStoreFrontStyle: false\n },\n checkout: {\n cellphone: null,\n checkoutId: '',\n checkoutProducts: [],\n crmbonuStoreId: null,\n crmbonusUserId: null,\n storeName: ''\n },\n clicks: 0,\n seconds: 0,\n squaredClicks: 0\n});\n\nonChange('clicks', value => {\n state.squaredClicks = value ** 2;\n});\n\nexport default state;"]}
@@ -0,0 +1,9 @@
1
+ import { ICheckoutDTO } from "../../dto/checkout.dto";
2
+ export declare class CrmBonus {
3
+ storeName: string;
4
+ private crmBonusService;
5
+ checkout: Partial<ICheckoutDTO>;
6
+ handlerToken(): Promise<void>;
7
+ componentDidLoad(): void;
8
+ render(): any;
9
+ }
@@ -0,0 +1,13 @@
1
+ import { EventEmitter } from "../../../../stencil-public-runtime";
2
+ import { CrmBonusService } from "../../../../services/crmbonus.service";
3
+ export declare class PhoneForm {
4
+ private phoneInputMask;
5
+ crmbonusService: CrmBonusService;
6
+ loading: boolean;
7
+ storeName: string;
8
+ actionError: EventEmitter<Partial<{
9
+ message: string;
10
+ }>>;
11
+ handlerPhone(): Promise<void>;
12
+ render(): any;
13
+ }
@@ -0,0 +1,17 @@
1
+ import { CrmBonusService } from "../../../../services/crmbonus.service";
2
+ export declare class PhoneValidatePinForm {
3
+ crmbonusService: CrmBonusService;
4
+ storeName: string;
5
+ phone: number;
6
+ cancel: () => void;
7
+ pin: string[];
8
+ isVerified: boolean;
9
+ canResend: boolean;
10
+ loading: boolean;
11
+ handleInput(event: Event, index: number): void;
12
+ handleResend(): Promise<void>;
13
+ buildTime(): string;
14
+ handleTimeout(): void;
15
+ validatePin(): void;
16
+ render(): any;
17
+ }
@@ -20,6 +20,18 @@ export namespace Components {
20
20
  "isOpen": boolean;
21
21
  "modalTitle": string;
22
22
  }
23
+ interface BcCrmbonus {
24
+ }
25
+ interface BcPhoneForm {
26
+ "storeName": string;
27
+ }
28
+ interface BcPhoneValidatePinForm {
29
+ "cancel": () => void;
30
+ "phone": number;
31
+ "storeName": string;
32
+ }
33
+ interface BcWakeCrmbonus {
34
+ }
23
35
  interface ContainerEmpty {
24
36
  }
25
37
  interface CountdownTimer {
@@ -110,6 +122,10 @@ export interface AppModalCustomEvent<T> extends CustomEvent<T> {
110
122
  detail: T;
111
123
  target: HTMLAppModalElement;
112
124
  }
125
+ export interface BcPhoneFormCustomEvent<T> extends CustomEvent<T> {
126
+ detail: T;
127
+ target: HTMLBcPhoneFormElement;
128
+ }
113
129
  declare global {
114
130
  interface HTMLAppModalElementEventMap {
115
131
  "modalClosed": void;
@@ -128,6 +144,41 @@ declare global {
128
144
  prototype: HTMLAppModalElement;
129
145
  new (): HTMLAppModalElement;
130
146
  };
147
+ interface HTMLBcCrmbonusElement extends Components.BcCrmbonus, HTMLStencilElement {
148
+ }
149
+ var HTMLBcCrmbonusElement: {
150
+ prototype: HTMLBcCrmbonusElement;
151
+ new (): HTMLBcCrmbonusElement;
152
+ };
153
+ interface HTMLBcPhoneFormElementEventMap {
154
+ "actionError": Partial<{ message: string }>;
155
+ }
156
+ interface HTMLBcPhoneFormElement extends Components.BcPhoneForm, HTMLStencilElement {
157
+ addEventListener<K extends keyof HTMLBcPhoneFormElementEventMap>(type: K, listener: (this: HTMLBcPhoneFormElement, ev: BcPhoneFormCustomEvent<HTMLBcPhoneFormElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
158
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
159
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
160
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
161
+ removeEventListener<K extends keyof HTMLBcPhoneFormElementEventMap>(type: K, listener: (this: HTMLBcPhoneFormElement, ev: BcPhoneFormCustomEvent<HTMLBcPhoneFormElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
162
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
163
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
164
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
165
+ }
166
+ var HTMLBcPhoneFormElement: {
167
+ prototype: HTMLBcPhoneFormElement;
168
+ new (): HTMLBcPhoneFormElement;
169
+ };
170
+ interface HTMLBcPhoneValidatePinFormElement extends Components.BcPhoneValidatePinForm, HTMLStencilElement {
171
+ }
172
+ var HTMLBcPhoneValidatePinFormElement: {
173
+ prototype: HTMLBcPhoneValidatePinFormElement;
174
+ new (): HTMLBcPhoneValidatePinFormElement;
175
+ };
176
+ interface HTMLBcWakeCrmbonusElement extends Components.BcWakeCrmbonus, HTMLStencilElement {
177
+ }
178
+ var HTMLBcWakeCrmbonusElement: {
179
+ prototype: HTMLBcWakeCrmbonusElement;
180
+ new (): HTMLBcWakeCrmbonusElement;
181
+ };
131
182
  interface HTMLContainerEmptyElement extends Components.ContainerEmpty, HTMLStencilElement {
132
183
  }
133
184
  var HTMLContainerEmptyElement: {
@@ -220,6 +271,10 @@ declare global {
220
271
  };
221
272
  interface HTMLElementTagNameMap {
222
273
  "app-modal": HTMLAppModalElement;
274
+ "bc-crmbonus": HTMLBcCrmbonusElement;
275
+ "bc-phone-form": HTMLBcPhoneFormElement;
276
+ "bc-phone-validate-pin-form": HTMLBcPhoneValidatePinFormElement;
277
+ "bc-wake-crmbonus": HTMLBcWakeCrmbonusElement;
223
278
  "container-empty": HTMLContainerEmptyElement;
224
279
  "countdown-timer": HTMLCountdownTimerElement;
225
280
  "countdown-timer-v2": HTMLCountdownTimerV2Element;
@@ -243,6 +298,19 @@ declare namespace LocalJSX {
243
298
  "modalTitle"?: string;
244
299
  "onModalClosed"?: (event: AppModalCustomEvent<void>) => void;
245
300
  }
301
+ interface BcCrmbonus {
302
+ }
303
+ interface BcPhoneForm {
304
+ "onActionError"?: (event: BcPhoneFormCustomEvent<Partial<{ message: string }>>) => void;
305
+ "storeName"?: string;
306
+ }
307
+ interface BcPhoneValidatePinForm {
308
+ "cancel"?: () => void;
309
+ "phone"?: number;
310
+ "storeName"?: string;
311
+ }
312
+ interface BcWakeCrmbonus {
313
+ }
246
314
  interface ContainerEmpty {
247
315
  }
248
316
  interface CountdownTimer {
@@ -324,6 +392,10 @@ declare namespace LocalJSX {
324
392
  }
325
393
  interface IntrinsicElements {
326
394
  "app-modal": AppModal;
395
+ "bc-crmbonus": BcCrmbonus;
396
+ "bc-phone-form": BcPhoneForm;
397
+ "bc-phone-validate-pin-form": BcPhoneValidatePinForm;
398
+ "bc-wake-crmbonus": BcWakeCrmbonus;
327
399
  "container-empty": ContainerEmpty;
328
400
  "countdown-timer": CountdownTimer;
329
401
  "countdown-timer-v2": CountdownTimerV2;
@@ -346,6 +418,10 @@ declare module "@stencil/core" {
346
418
  export namespace JSX {
347
419
  interface IntrinsicElements {
348
420
  "app-modal": LocalJSX.AppModal & JSXBase.HTMLAttributes<HTMLAppModalElement>;
421
+ "bc-crmbonus": LocalJSX.BcCrmbonus & JSXBase.HTMLAttributes<HTMLBcCrmbonusElement>;
422
+ "bc-phone-form": LocalJSX.BcPhoneForm & JSXBase.HTMLAttributes<HTMLBcPhoneFormElement>;
423
+ "bc-phone-validate-pin-form": LocalJSX.BcPhoneValidatePinForm & JSXBase.HTMLAttributes<HTMLBcPhoneValidatePinFormElement>;
424
+ "bc-wake-crmbonus": LocalJSX.BcWakeCrmbonus & JSXBase.HTMLAttributes<HTMLBcWakeCrmbonusElement>;
349
425
  "container-empty": LocalJSX.ContainerEmpty & JSXBase.HTMLAttributes<HTMLContainerEmptyElement>;
350
426
  "countdown-timer": LocalJSX.CountdownTimer & JSXBase.HTMLAttributes<HTMLCountdownTimerElement>;
351
427
  "countdown-timer-v2": LocalJSX.CountdownTimerV2 & JSXBase.HTMLAttributes<HTMLCountdownTimerV2Element>;
@@ -0,0 +1,8 @@
1
+ export interface ICheckoutDTO {
2
+ storeName: string;
3
+ checkoutId: string;
4
+ cellphone: number;
5
+ checkoutProducts: [];
6
+ crmbonuStoreId: number;
7
+ crmbonusUserId: number;
8
+ }
@@ -2,3 +2,6 @@ export interface IPinSent {
2
2
  storeId: number;
3
3
  userId: number;
4
4
  }
5
+ export interface IPinPayloadEvent extends IPinSent {
6
+ cellphone: number;
7
+ }
@@ -47,6 +47,15 @@ export interface IProccesPinBonusDto {
47
47
  cellphone: number;
48
48
  pin: string;
49
49
  }
50
+ export interface IProccesPinDto {
51
+ storeName: string;
52
+ name: string;
53
+ checkoutId: string;
54
+ storeId: string;
55
+ userId: string;
56
+ cellphone: number;
57
+ pin: string;
58
+ }
50
59
  export interface IBonus {
51
60
  hasBonus: boolean;
52
61
  bonusBalance: number;
@@ -1,5 +1,6 @@
1
1
  import { CartWake } from "../objectvalues/cart.wake";
2
2
  import { ReservedInfoDTO } from '../dto/reserved-info.dto';
3
+ export declare const getCartStoreFront: () => Promise<CartWake>;
3
4
  export declare const getCart: () => Promise<CartWake>;
4
5
  export declare const getInfoBonusByCartIdAndStoreName: (cartId: any, storeName: any) => Promise<ReservedInfoDTO>;
5
6
  export declare const persisteMetadata: (storeName: string, cartId: string, metadata?: {}) => Promise<void>;
@@ -0,0 +1,2 @@
1
+ export declare const CRM_BONUS_API_URL = "https://wake.crmbonus.com/api";
2
+ export declare const CHECKOUT_CART_WAKE = "http://localhost:3001";
@@ -0,0 +1,11 @@
1
+ import { IInfoStore } from "./src/helpers/info.config.helper";
2
+ import { ICheckoutDTO } from "./src/dto/checkout.dto";
3
+ interface IStoreCheckout {
4
+ clicks: number;
5
+ squaredClicks: number;
6
+ seconds: number;
7
+ storeConfig: IInfoStore;
8
+ checkout: ICheckoutDTO;
9
+ }
10
+ declare const state: IStoreCheckout;
11
+ export default state;
@@ -6,7 +6,8 @@ export declare class CartWake {
6
6
  products: IProductWake[];
7
7
  user: IUser;
8
8
  store: IStore;
9
- constructor(cart: any);
9
+ static fromCheckout(cart: any): CartWake;
10
+ static fromCheckoutStoreFront(checkoutInfo: any): CartWake;
10
11
  private buildUserInfo;
11
12
  private buildStoreInfo;
12
13
  }
@@ -0,0 +1,3 @@
1
+ export declare class WakeCrmbonus {
2
+ render(): any;
3
+ }
@@ -1,5 +1,5 @@
1
1
  import { IPinSent } from '../dto/pin.sent';
2
- import { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';
2
+ import { IBonus, IProccesPinBonusDto, IProccesPinDto, IReserveDTO } from '../dto/validate.pin.bonus';
3
3
  import { UpdateOrderDTO } from '../dto/update.order.dto';
4
4
  import { IPersisteInfoPayload } from '../helpers/payload.interface';
5
5
  export declare class CrmBonusService {
@@ -10,11 +10,13 @@ export declare class CrmBonusService {
10
10
  static getInstance(): CrmBonusService;
11
11
  getCustomer(userId: number, store: string): Promise<any>;
12
12
  updateOrder(updateOrderDTO: UpdateOrderDTO): Promise<void>;
13
- sendPin(phone: number, name: string, store: string): Promise<IPinSent>;
13
+ sendPin(phone: number, name: string, storeName: string): Promise<IPinSent>;
14
14
  validatePinBonus(payload: IProccesPinBonusDto): Promise<IBonus>;
15
+ validatePin(payload: IProccesPinDto): Promise<IBonus>;
15
16
  reserve(payload: IReserveDTO): Promise<any>;
16
17
  cancel(cartId: string): Promise<any>;
17
18
  getToken(store: string): Promise<string>;
19
+ saveTracking(checkoutId: string, payload: any): Promise<void>;
18
20
  getCustomization(storeName: string): Promise<any>;
19
21
  cancelBonus(cartId: string, storeName: string): Promise<void>;
20
22
  getInfoBonus(cartId: string, storeName: string): Promise<any>;
package/package.json CHANGED
@@ -1,58 +1,59 @@
1
- {
2
- "name": "crmbonus-component-wake",
3
- "version": "2.1.41-ngrok",
4
- "description": "Stencil Component Starter",
5
- "main": "dist/index.cjs.js",
6
- "module": "dist/index.js",
7
- "types": "dist/types/index.d.ts",
8
- "collection": "dist/collection/collection-manifest.json",
9
- "collection:main": "dist/collection/index.js",
10
- "unpkg": "dist/crmbonus-component-wake/crmbonus-component-wake.esm.js",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/crmbonus-component-wake/crmbonus-component-wake.esm.js",
14
- "require": "./dist/crmbonus-component-wake/crmbonus-component-wake.cjs.js"
15
- },
16
- "./my-component": {
17
- "import": "./dist/components/my-component.js",
18
- "types": "./dist/components/my-component.d.ts"
19
- },
20
- "./loader": {
21
- "import": "./loader/index.js",
22
- "require": "./loader/index.cjs",
23
- "types": "./loader/index.d.ts"
24
- }
25
- },
26
- "repository": {
27
- "type": "git",
28
- "url": "https://github.com/ionic-team/stencil-component-starter.git"
29
- },
30
- "files": [
31
- "dist/",
32
- "loader/"
33
- ],
34
- "scripts": {
35
- "build": "stencil build",
36
- "start": "stencil build --dev --watch --serve",
37
- "dev": "concurrently \"npm run mock\" \"stencil build --dev --watch --serve\"",
38
- "test": "stencil test --spec --e2e",
39
- "test.watch": "stencil test --spec --e2e --watchAll",
40
- "generate": "stencil generate",
41
- "mock": "json-server --watch local-server/db.json --routes local-server/routes.json --port 3001"
42
- },
43
- "devDependencies": {
44
- "@stencil/core": "^4.7.0",
45
- "@types/jest": "^29.5.6",
46
- "@types/node": "^16.18.11",
47
- "concurrently": "^9.1.2",
48
- "jest": "^29.7.0",
49
- "jest-cli": "^29.7.0",
50
- "json-server": "0.17.0",
51
- "puppeteer": "^21.9.0"
52
- },
53
- "license": "MIT",
54
- "dependencies": {
55
- "axios": "^1.7.7",
56
- "i18next": "^24.0.5"
57
- }
58
- }
1
+ {
2
+ "name": "crmbonus-component-wake",
3
+ "version": "2.1.41-shoulder",
4
+ "description": "Stencil Component Starter",
5
+ "main": "dist/index.cjs.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "collection": "dist/collection/collection-manifest.json",
9
+ "collection:main": "dist/collection/index.js",
10
+ "unpkg": "dist/crmbonus-component-wake/crmbonus-component-wake.esm.js",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/crmbonus-component-wake/crmbonus-component-wake.esm.js",
14
+ "require": "./dist/crmbonus-component-wake/crmbonus-component-wake.cjs.js"
15
+ },
16
+ "./my-component": {
17
+ "import": "./dist/components/my-component.js",
18
+ "types": "./dist/components/my-component.d.ts"
19
+ },
20
+ "./loader": {
21
+ "import": "./loader/index.js",
22
+ "require": "./loader/index.cjs",
23
+ "types": "./loader/index.d.ts"
24
+ }
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/ionic-team/stencil-component-starter.git"
29
+ },
30
+ "files": [
31
+ "dist/",
32
+ "loader/"
33
+ ],
34
+ "scripts": {
35
+ "build": "stencil build",
36
+ "start": "stencil build --dev --watch --serve",
37
+ "dev": "concurrently \"npm run mock\" \"stencil build --dev --watch --serve\"",
38
+ "test": "stencil test --spec --e2e",
39
+ "test.watch": "stencil test --spec --e2e --watchAll",
40
+ "generate": "stencil generate",
41
+ "mock": "json-server --watch local-server/db.json --routes local-server/routes.json --port 3001"
42
+ },
43
+ "devDependencies": {
44
+ "@stencil/core": "^4.7.0",
45
+ "@stencil/store": "^2.2.0",
46
+ "@types/jest": "^29.5.6",
47
+ "@types/node": "^16.18.11",
48
+ "concurrently": "^9.1.2",
49
+ "jest": "^29.7.0",
50
+ "jest-cli": "^29.7.0",
51
+ "json-server": "0.17.0",
52
+ "puppeteer": "^21.9.0"
53
+ },
54
+ "license": "MIT",
55
+ "dependencies": {
56
+ "axios": "^1.7.7",
57
+ "i18next": "^24.0.5"
58
+ }
59
+ }
package/readme.md CHANGED
@@ -1,115 +1,115 @@
1
- [![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square)](https://stenciljs.com)
2
-
3
- # Stencil Component Starter
4
-
5
- This is a starter project for building a standalone Web Component using Stencil.
6
-
7
- Stencil is also great for building entire apps. For that, use the [stencil-app-starter](https://github.com/ionic-team/stencil-app-starter) instead.
8
-
9
- # Stencil
10
-
11
- Stencil is a compiler for building fast web apps using Web Components.
12
-
13
- Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than runtime tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
14
-
15
- Stencil components are just Web Components, so they work in any major framework or with no framework at all.
16
-
17
- ## Getting Started
18
-
19
- To start building a new web component using Stencil, clone this repo to a new directory:
20
-
21
- ```bash
22
- git clone https://github.com/ionic-team/stencil-component-starter.git my-component
23
- cd my-component
24
- git remote rm origin
25
- ```
26
-
27
- and run:
28
-
29
- ```bash
30
- npm install
31
- npm start
32
- ```
33
-
34
- To build the component for production, run:
35
-
36
- ```bash
37
- npm run build
38
- ```
39
-
40
- To run the unit tests for the components, run:
41
-
42
- ```bash
43
- npm test
44
- ```
45
-
46
- Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).
47
-
48
- ## Naming Components
49
-
50
- When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: `<stencil-datepicker>`). This is because the generated component has little to nothing to do with Stencil; it's just a web component!
51
-
52
- Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic-generated web components use the prefix `ion`.
53
-
54
- ## Using this component
55
-
56
- There are two strategies we recommend for using web components built with Stencil.
57
-
58
- The first step for all two of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
59
-
60
- You can read more about these different approaches in the [Stencil docs](https://stenciljs.com/docs/publishing).
61
-
62
- ### Lazy Loading
63
-
64
- If your Stencil project is built with the [`dist`](https://stenciljs.com/docs/distribution) output target, you can import a small bootstrap script that registers all components and allows you to load individual component scripts lazily.
65
-
66
- For example, given your Stencil project namespace is called `my-design-system`, to use `my-component` on any website, inject this into your HTML:
67
-
68
- ```html
69
- <script type="module" src="https://unpkg.com/my-design-system"></script>
70
- <!--
71
- To avoid unpkg.com redirects to the actual file, you can also directly import:
72
- https://unpkg.com/foobar-design-system@0.0.1/dist/foobar-design-system/foobar-design-system.esm.js
73
- -->
74
- <my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>
75
- ```
76
-
77
- This will only load the necessary scripts needed to render `<my-component />`. Once more components of this package are used, they will automatically be loaded lazily.
78
-
79
- You can also import the script as part of your `node_modules` in your applications entry file:
80
-
81
- ```tsx
82
- import 'foobar-design-system/dist/foobar-design-system/foobar-design-system.esm.js';
83
- ```
84
-
85
- Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-y6v26a?file=src%2Fmain.tsx).
86
-
87
- ### Standalone
88
-
89
- If you are using a Stencil component library with `dist-custom-elements`, we recommend importing Stencil components individually in those files where they are needed.
90
-
91
- To export Stencil components as standalone components make sure you have the [`dist-custom-elements`](https://stenciljs.com/docs/custom-elements) output target defined in your `stencil.config.ts`.
92
-
93
- For example, given you'd like to use `<my-component />` as part of a React component, you can import the component directly via:
94
-
95
- ```tsx
96
- import 'foobar-design-system/my-component';
97
-
98
- function App() {
99
- return (
100
- <>
101
- <div>
102
- <my-component
103
- first="Stencil"
104
- middle="'Don't call me a framework'"
105
- last="JS"
106
- ></my-component>
107
- </div>
108
- </>
109
- );
110
- }
111
-
112
- export default App;
113
- ```
114
-
1
+ [![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square)](https://stenciljs.com)
2
+
3
+ # Stencil Component Starter
4
+
5
+ This is a starter project for building a standalone Web Component using Stencil.
6
+
7
+ Stencil is also great for building entire apps. For that, use the [stencil-app-starter](https://github.com/ionic-team/stencil-app-starter) instead.
8
+
9
+ # Stencil
10
+
11
+ Stencil is a compiler for building fast web apps using Web Components.
12
+
13
+ Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than runtime tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
14
+
15
+ Stencil components are just Web Components, so they work in any major framework or with no framework at all.
16
+
17
+ ## Getting Started
18
+
19
+ To start building a new web component using Stencil, clone this repo to a new directory:
20
+
21
+ ```bash
22
+ git clone https://github.com/ionic-team/stencil-component-starter.git my-component
23
+ cd my-component
24
+ git remote rm origin
25
+ ```
26
+
27
+ and run:
28
+
29
+ ```bash
30
+ npm install
31
+ npm start
32
+ ```
33
+
34
+ To build the component for production, run:
35
+
36
+ ```bash
37
+ npm run build
38
+ ```
39
+
40
+ To run the unit tests for the components, run:
41
+
42
+ ```bash
43
+ npm test
44
+ ```
45
+
46
+ Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).
47
+
48
+ ## Naming Components
49
+
50
+ When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: `<stencil-datepicker>`). This is because the generated component has little to nothing to do with Stencil; it's just a web component!
51
+
52
+ Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic-generated web components use the prefix `ion`.
53
+
54
+ ## Using this component
55
+
56
+ There are two strategies we recommend for using web components built with Stencil.
57
+
58
+ The first step for all two of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
59
+
60
+ You can read more about these different approaches in the [Stencil docs](https://stenciljs.com/docs/publishing).
61
+
62
+ ### Lazy Loading
63
+
64
+ If your Stencil project is built with the [`dist`](https://stenciljs.com/docs/distribution) output target, you can import a small bootstrap script that registers all components and allows you to load individual component scripts lazily.
65
+
66
+ For example, given your Stencil project namespace is called `my-design-system`, to use `my-component` on any website, inject this into your HTML:
67
+
68
+ ```html
69
+ <script type="module" src="https://unpkg.com/my-design-system"></script>
70
+ <!--
71
+ To avoid unpkg.com redirects to the actual file, you can also directly import:
72
+ https://unpkg.com/foobar-design-system@0.0.1/dist/foobar-design-system/foobar-design-system.esm.js
73
+ -->
74
+ <my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>
75
+ ```
76
+
77
+ This will only load the necessary scripts needed to render `<my-component />`. Once more components of this package are used, they will automatically be loaded lazily.
78
+
79
+ You can also import the script as part of your `node_modules` in your applications entry file:
80
+
81
+ ```tsx
82
+ import 'foobar-design-system/dist/foobar-design-system/foobar-design-system.esm.js';
83
+ ```
84
+
85
+ Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-y6v26a?file=src%2Fmain.tsx).
86
+
87
+ ### Standalone
88
+
89
+ If you are using a Stencil component library with `dist-custom-elements`, we recommend importing Stencil components individually in those files where they are needed.
90
+
91
+ To export Stencil components as standalone components make sure you have the [`dist-custom-elements`](https://stenciljs.com/docs/custom-elements) output target defined in your `stencil.config.ts`.
92
+
93
+ For example, given you'd like to use `<my-component />` as part of a React component, you can import the component directly via:
94
+
95
+ ```tsx
96
+ import 'foobar-design-system/my-component';
97
+
98
+ function App() {
99
+ return (
100
+ <>
101
+ <div>
102
+ <my-component
103
+ first="Stencil"
104
+ middle="'Don't call me a framework'"
105
+ last="JS"
106
+ ></my-component>
107
+ </div>
108
+ </>
109
+ );
110
+ }
111
+
112
+ export default App;
113
+ ```
114
+
115
115
  Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-b6zuds?file=src%2FApp.tsx).