@builder.io/sdk-react 0.2.3-2 → 0.2.3-4

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 (1264) hide show
  1. package/dist/sdk/blocks/BaseText.d.ts +6 -0
  2. package/dist/sdk/blocks/BaseText.js +9 -0
  3. package/dist/sdk/blocks/button/button.d.ts +9 -0
  4. package/dist/sdk/blocks/button/button.js +14 -0
  5. package/dist/sdk/blocks/button/component-info.d.ts +2 -0
  6. package/dist/sdk/blocks/button/component-info.js +38 -0
  7. package/dist/sdk/blocks/columns/columns.d.ts +16 -0
  8. package/dist/sdk/blocks/columns/columns.js +127 -0
  9. package/dist/sdk/blocks/columns/component-info.d.ts +2 -0
  10. package/dist/sdk/blocks/columns/component-info.js +240 -0
  11. package/dist/sdk/blocks/custom-code/component-info.d.ts +2 -0
  12. package/dist/sdk/blocks/custom-code/component-info.js +27 -0
  13. package/dist/sdk/blocks/custom-code/custom-code.d.ts +7 -0
  14. package/dist/sdk/blocks/embed/component-info.d.ts +2 -0
  15. package/dist/sdk/blocks/embed/component-info.js +46 -0
  16. package/dist/sdk/blocks/embed/embed.d.ts +6 -0
  17. package/dist/sdk/blocks/embed/helpers.d.ts +1 -0
  18. package/dist/sdk/blocks/embed/helpers.js +6 -0
  19. package/dist/sdk/blocks/form/component-info.d.ts +2 -0
  20. package/dist/sdk/blocks/form/component-info.js +267 -0
  21. package/dist/sdk/blocks/form/form.d.ts +40 -0
  22. package/dist/sdk/blocks/form/form.js +203 -0
  23. package/dist/sdk/blocks/fragment/component-info.d.ts +2 -0
  24. package/dist/sdk/blocks/fragment/component-info.js +7 -0
  25. package/dist/sdk/blocks/fragment/fragment.d.ts +8 -0
  26. package/dist/sdk/blocks/image/component-info.d.ts +2 -0
  27. package/dist/sdk/blocks/image/component-info.js +152 -0
  28. package/dist/sdk/blocks/image/image.d.ts +22 -0
  29. package/dist/sdk/blocks/image/image.helpers.d.ts +1 -0
  30. package/dist/sdk/blocks/image/image.helpers.js +56 -0
  31. package/dist/sdk/blocks/image/image.js +81 -0
  32. package/dist/sdk/blocks/img/component-info.d.ts +2 -0
  33. package/dist/sdk/blocks/img/component-info.js +17 -0
  34. package/dist/sdk/blocks/img/img.d.ts +11 -0
  35. package/dist/sdk/blocks/input/component-info.d.ts +2 -0
  36. package/dist/sdk/blocks/input/component-info.js +71 -0
  37. package/dist/sdk/blocks/input/input.d.ts +12 -0
  38. package/dist/sdk/blocks/raw-text/component-info.d.ts +2 -0
  39. package/dist/sdk/blocks/raw-text/component-info.js +12 -0
  40. package/dist/sdk/blocks/raw-text/raw-text.d.ts +7 -0
  41. package/dist/sdk/blocks/section/component-info.d.ts +2 -0
  42. package/dist/sdk/blocks/section/component-info.js +45 -0
  43. package/dist/sdk/blocks/section/section.d.ts +9 -0
  44. package/dist/sdk/blocks/select/component-info.d.ts +2 -0
  45. package/dist/sdk/blocks/select/component-info.js +55 -0
  46. package/dist/sdk/blocks/select/select.d.ts +13 -0
  47. package/dist/sdk/blocks/submit-button/component-info.d.ts +2 -0
  48. package/dist/sdk/blocks/submit-button/component-info.js +28 -0
  49. package/dist/sdk/blocks/submit-button/submit-button.d.ts +7 -0
  50. package/dist/sdk/blocks/symbol/component-info.d.ts +2 -0
  51. package/dist/sdk/blocks/symbol/component-info.js +39 -0
  52. package/dist/sdk/blocks/symbol/symbol.d.ts +21 -0
  53. package/dist/sdk/blocks/symbol/symbol.js +68 -0
  54. package/dist/sdk/blocks/text/component-info.d.ts +2 -0
  55. package/dist/sdk/blocks/text/component-info.js +20 -0
  56. package/dist/sdk/blocks/text/text.d.ts +6 -0
  57. package/dist/sdk/blocks/textarea/component-info.d.ts +2 -0
  58. package/dist/sdk/blocks/textarea/component-info.js +43 -0
  59. package/dist/sdk/blocks/textarea/textarea.d.ts +10 -0
  60. package/dist/sdk/blocks/util.d.ts +4 -0
  61. package/dist/sdk/blocks/util.js +13 -0
  62. package/dist/sdk/blocks/video/component-info.d.ts +2 -0
  63. package/dist/sdk/blocks/video/component-info.js +102 -0
  64. package/dist/sdk/blocks/video/video.d.ts +19 -0
  65. package/dist/sdk/blocks/video/video.js +47 -0
  66. package/dist/sdk/components/render-block/block-styles.d.ts +9 -0
  67. package/dist/sdk/components/render-block/render-block.d.ts +9 -0
  68. package/dist/sdk/components/render-block/render-block.helpers.d.ts +13 -0
  69. package/dist/sdk/components/render-block/render-block.helpers.js +98 -0
  70. package/dist/sdk/components/render-block/render-block.js +130 -0
  71. package/dist/sdk/components/render-block/render-component.d.ts +17 -0
  72. package/dist/sdk/components/render-block/render-repeated-block.d.ts +9 -0
  73. package/dist/sdk/components/render-block/render-repeated-block.js +27 -0
  74. package/dist/sdk/components/render-block/types.d.ts +6 -0
  75. package/dist/sdk/components/render-blocks.d.ts +10 -0
  76. package/dist/sdk/components/render-blocks.js +45 -0
  77. package/dist/sdk/components/render-content/builder-editing.d.ts +3 -0
  78. package/dist/sdk/components/render-content/components/render-styles.d.ts +9 -0
  79. package/dist/sdk/components/render-content/components/render-styles.helpers.d.ts +15 -0
  80. package/dist/sdk/components/render-content/components/render-styles.helpers.js +59 -0
  81. package/dist/sdk/components/render-content/components/render-styles.js +32 -0
  82. package/dist/sdk/components/render-content/index.d.ts +1 -0
  83. package/dist/sdk/components/render-content/index.js +1 -0
  84. package/dist/sdk/components/render-content/render-content.d.ts +4 -0
  85. package/dist/sdk/components/render-content/render-content.helpers.d.ts +7 -0
  86. package/dist/sdk/components/render-content/render-content.helpers.js +30 -0
  87. package/dist/sdk/components/render-content/render-content.js +282 -0
  88. package/dist/sdk/components/render-content/render-content.types.d.ts +29 -0
  89. package/dist/sdk/components/render-inlined-styles.d.ts +6 -0
  90. package/dist/sdk/components/render-inlined-styles.js +17 -0
  91. package/dist/sdk/constants/builder-registered-components.d.ts +6 -0
  92. package/dist/sdk/constants/builder-registered-components.js +39 -0
  93. package/dist/sdk/constants/device-sizes.d.ts +13 -0
  94. package/dist/sdk/constants/device-sizes.js +44 -0
  95. package/dist/sdk/constants/target.d.ts +2 -0
  96. package/dist/sdk/constants/target.js +2 -0
  97. package/dist/sdk/context/builder.context.d.ts +3 -0
  98. package/dist/sdk/context/builder.context.js +11 -0
  99. package/dist/sdk/context/types.d.ts +20 -0
  100. package/dist/sdk/functions/camel-to-kebab-case.d.ts +1 -0
  101. package/dist/sdk/functions/camel-to-kebab-case.js +1 -0
  102. package/dist/sdk/functions/evaluate.d.ts +6 -0
  103. package/dist/sdk/functions/evaluate.js +28 -0
  104. package/dist/sdk/functions/event-handler-name.d.ts +1 -0
  105. package/dist/sdk/functions/event-handler-name.js +4 -0
  106. package/dist/sdk/functions/extract-text-styles.d.ts +4 -0
  107. package/dist/sdk/functions/extract-text-styles.js +34 -0
  108. package/dist/sdk/functions/fast-clone.d.ts +4 -0
  109. package/dist/sdk/functions/fast-clone.js +4 -0
  110. package/dist/sdk/functions/get-block-actions-handler.d.ts +8 -0
  111. package/dist/sdk/functions/get-block-actions-handler.js +8 -0
  112. package/dist/sdk/functions/get-block-actions.d.ts +9 -0
  113. package/dist/sdk/functions/get-block-actions.js +15 -0
  114. package/dist/sdk/functions/get-block-component-options.d.ts +2 -0
  115. package/dist/sdk/functions/get-block-component-options.js +10 -0
  116. package/dist/sdk/functions/get-block-properties.d.ts +7 -0
  117. package/dist/sdk/functions/get-block-properties.js +66 -0
  118. package/dist/sdk/functions/get-builder-search-params/fn.test.js +13 -0
  119. package/dist/sdk/functions/get-builder-search-params/index.d.ts +6 -0
  120. package/dist/sdk/functions/get-builder-search-params/index.js +36 -0
  121. package/dist/sdk/functions/get-content/ab-testing.d.ts +5 -0
  122. package/dist/sdk/functions/get-content/ab-testing.js +78 -0
  123. package/dist/sdk/functions/get-content/generate-content-url.d.ts +2 -0
  124. package/dist/sdk/functions/get-content/generate-content-url.js +31 -0
  125. package/dist/sdk/functions/get-content/generate-content-url.test.js +82 -0
  126. package/dist/sdk/functions/get-content/index.d.ts +11 -0
  127. package/dist/sdk/functions/get-content/index.js +40 -0
  128. package/dist/sdk/functions/get-content/types.d.ts +45 -0
  129. package/dist/sdk/functions/get-fetch.d.ts +1 -0
  130. package/dist/sdk/functions/get-fetch.js +11 -0
  131. package/dist/sdk/functions/get-global-this.d.ts +4 -0
  132. package/dist/sdk/functions/get-global-this.js +15 -0
  133. package/dist/sdk/functions/get-processed-block.d.ts +10 -0
  134. package/dist/sdk/functions/get-processed-block.js +30 -0
  135. package/dist/sdk/functions/get-processed-block.test.js +31 -0
  136. package/dist/sdk/functions/get-react-native-block-styles.d.ts +7 -0
  137. package/dist/sdk/functions/get-react-native-block-styles.js +17 -0
  138. package/dist/sdk/functions/if-target.d.ts +7 -0
  139. package/dist/sdk/functions/if-target.js +10 -0
  140. package/dist/sdk/functions/is-browser.d.ts +1 -0
  141. package/dist/sdk/functions/is-browser.js +3 -0
  142. package/dist/sdk/functions/is-editing.d.ts +1 -0
  143. package/dist/sdk/functions/is-editing.js +7 -0
  144. package/dist/sdk/functions/is-iframe.d.ts +1 -0
  145. package/dist/sdk/functions/is-iframe.js +4 -0
  146. package/dist/sdk/functions/is-previewing.d.ts +1 -0
  147. package/dist/sdk/functions/is-previewing.js +11 -0
  148. package/dist/sdk/functions/on-change.d.ts +7 -0
  149. package/dist/sdk/functions/on-change.js +28 -0
  150. package/dist/sdk/functions/on-change.test.js +20 -0
  151. package/dist/sdk/functions/register-component.d.ts +14 -0
  152. package/dist/sdk/functions/register-component.js +26 -0
  153. package/dist/sdk/functions/register.d.ts +16 -0
  154. package/dist/sdk/functions/register.js +27 -0
  155. package/dist/sdk/functions/sanitize-react-native-block-styles.d.ts +3 -0
  156. package/dist/sdk/functions/sanitize-react-native-block-styles.js +53 -0
  157. package/dist/sdk/functions/set-editor-settings.d.ts +4 -0
  158. package/dist/sdk/functions/set-editor-settings.js +12 -0
  159. package/dist/sdk/functions/set.d.ts +7 -0
  160. package/dist/sdk/functions/set.js +21 -0
  161. package/dist/sdk/functions/set.test.js +16 -0
  162. package/dist/sdk/functions/track/helpers.d.ts +5 -0
  163. package/dist/sdk/functions/track/helpers.js +56 -0
  164. package/dist/sdk/functions/track/index.d.ts +51 -0
  165. package/dist/sdk/functions/track/index.js +59 -0
  166. package/dist/sdk/functions/track/interaction.d.ts +13 -0
  167. package/dist/sdk/functions/track/interaction.js +54 -0
  168. package/dist/sdk/functions/transform-block-properties.d.ts +1 -0
  169. package/dist/sdk/functions/transform-block-properties.js +3 -0
  170. package/dist/sdk/functions/transform-block.d.ts +2 -0
  171. package/dist/sdk/functions/transform-block.js +4 -0
  172. package/dist/sdk/helpers/ab-tests.d.ts +8 -0
  173. package/dist/sdk/helpers/ab-tests.js +5 -0
  174. package/dist/sdk/helpers/cookie.d.ts +15 -0
  175. package/dist/sdk/helpers/cookie.js +65 -0
  176. package/dist/sdk/helpers/css.d.ts +7 -0
  177. package/dist/sdk/helpers/css.js +27 -0
  178. package/dist/sdk/helpers/flatten.d.ts +6 -0
  179. package/dist/sdk/helpers/flatten.js +19 -0
  180. package/dist/sdk/helpers/localStorage.d.ts +9 -0
  181. package/dist/sdk/helpers/localStorage.js +24 -0
  182. package/dist/sdk/helpers/logger.d.ts +5 -0
  183. package/dist/sdk/helpers/logger.js +6 -0
  184. package/dist/sdk/helpers/nullable.d.ts +2 -0
  185. package/dist/sdk/helpers/nullable.js +1 -0
  186. package/dist/sdk/helpers/sessionId.d.ts +6 -0
  187. package/dist/sdk/helpers/sessionId.js +23 -0
  188. package/dist/sdk/helpers/time.d.ts +1 -0
  189. package/dist/sdk/helpers/time.js +2 -0
  190. package/dist/sdk/helpers/url.d.ts +6 -0
  191. package/dist/sdk/helpers/url.js +15 -0
  192. package/dist/sdk/helpers/url.test.js +21 -0
  193. package/dist/sdk/helpers/uuid.d.ts +8 -0
  194. package/dist/sdk/helpers/uuid.js +15 -0
  195. package/dist/sdk/helpers/visitorId.d.ts +6 -0
  196. package/dist/sdk/helpers/visitorId.js +27 -0
  197. package/dist/sdk/index-helpers/blocks-exports.d.ts +10 -0
  198. package/dist/sdk/index-helpers/blocks-exports.js +10 -0
  199. package/dist/sdk/index-helpers/top-of-file.d.ts +1 -0
  200. package/dist/sdk/index-helpers/top-of-file.js +4 -0
  201. package/dist/sdk/index.d.ts +12 -0
  202. package/dist/sdk/index.js +10 -0
  203. package/dist/sdk/scripts/init-editing.d.ts +5 -0
  204. package/dist/sdk/scripts/init-editing.js +100 -0
  205. package/dist/sdk/types/api-version.d.ts +2 -0
  206. package/dist/sdk/types/api-version.js +1 -0
  207. package/dist/sdk/types/builder-block.d.ts +66 -0
  208. package/dist/sdk/types/builder-content.d.ts +46 -0
  209. package/dist/sdk/types/can-track.d.ts +3 -0
  210. package/dist/sdk/types/components.d.ts +105 -0
  211. package/dist/sdk/types/deep-partial.d.ts +3 -0
  212. package/dist/sdk/types/element.d.ts +59 -0
  213. package/dist/sdk/types/input.d.ts +121 -0
  214. package/dist/sdk/types/targets.d.ts +3 -0
  215. package/dist/sdk/types/typescript.d.ts +5 -0
  216. package/dist/sdk/types/typescript.js +1 -0
  217. package/dist/server/functions/get-builder-search-params/index.d.ts +6 -0
  218. package/dist/server/functions/get-builder-search-params/index.js +36 -0
  219. package/dist/server/functions/get-content/ab-testing.d.ts +5 -0
  220. package/dist/server/functions/get-content/ab-testing.js +78 -0
  221. package/dist/server/functions/get-content/generate-content-url.d.ts +2 -0
  222. package/dist/server/functions/get-content/generate-content-url.js +31 -0
  223. package/dist/server/functions/get-content/generate-content-url.test.d.ts +1 -0
  224. package/dist/server/functions/get-content/generate-content-url.test.js +82 -0
  225. package/dist/server/functions/get-content/index.d.ts +11 -0
  226. package/dist/server/functions/get-content/index.js +40 -0
  227. package/dist/server/functions/get-content/types.d.ts +45 -0
  228. package/dist/server/functions/get-content/types.js +1 -0
  229. package/dist/server/functions/get-fetch.d.ts +1 -0
  230. package/dist/server/functions/get-fetch.js +11 -0
  231. package/dist/server/functions/get-global-this.d.ts +4 -0
  232. package/dist/server/functions/get-global-this.js +15 -0
  233. package/dist/server/functions/is-browser.d.ts +1 -0
  234. package/dist/server/functions/is-browser.js +3 -0
  235. package/dist/server/helpers/ab-tests.d.ts +8 -0
  236. package/dist/server/helpers/ab-tests.js +5 -0
  237. package/dist/server/helpers/cookie.d.ts +15 -0
  238. package/dist/server/helpers/cookie.js +65 -0
  239. package/dist/server/helpers/flatten.d.ts +6 -0
  240. package/dist/server/helpers/flatten.js +19 -0
  241. package/dist/server/helpers/logger.d.ts +5 -0
  242. package/dist/server/helpers/logger.js +6 -0
  243. package/dist/server/helpers/nullable.d.ts +2 -0
  244. package/dist/server/helpers/nullable.js +1 -0
  245. package/dist/server/helpers/url.d.ts +6 -0
  246. package/dist/server/helpers/url.js +15 -0
  247. package/dist/server/types/api-version.d.ts +2 -0
  248. package/dist/server/types/api-version.js +1 -0
  249. package/dist/server/types/builder-block.d.ts +66 -0
  250. package/dist/server/types/builder-block.js +1 -0
  251. package/dist/server/types/builder-content.d.ts +46 -0
  252. package/dist/server/types/builder-content.js +1 -0
  253. package/dist/server/types/can-track.d.ts +3 -0
  254. package/dist/server/types/can-track.js +1 -0
  255. package/dist/server/types/input.d.ts +121 -0
  256. package/dist/server/types/input.js +1 -0
  257. package/dist/server/types/typescript.d.ts +5 -0
  258. package/dist/server/types/typescript.js +1 -0
  259. package/package.json +12 -13
  260. package/packages/react/src/blocks/BaseText.tsx +19 -0
  261. package/packages/react/src/blocks/button/button.tsx +45 -0
  262. package/packages/react/src/blocks/button/component-info.ts +42 -0
  263. package/packages/react/src/blocks/columns/columns.tsx +211 -0
  264. package/packages/react/src/blocks/columns/component-info.ts +254 -0
  265. package/packages/react/src/blocks/custom-code/component-info.ts +31 -0
  266. package/packages/react/src/blocks/custom-code/custom-code.tsx +76 -0
  267. package/packages/react/src/blocks/embed/component-info.ts +55 -0
  268. package/packages/react/src/blocks/embed/embed.tsx +59 -0
  269. package/packages/react/src/blocks/embed/helpers.ts +8 -0
  270. package/packages/react/src/blocks/form/component-info.ts +282 -0
  271. package/packages/react/src/blocks/form/form.tsx +320 -0
  272. package/packages/react/src/blocks/fragment/component-info.ts +10 -0
  273. package/packages/react/src/blocks/fragment/fragment.tsx +14 -0
  274. package/packages/react/src/blocks/image/component-info.ts +172 -0
  275. package/packages/react/src/blocks/image/image.helpers.ts +75 -0
  276. package/packages/react/src/blocks/image/image.tsx +144 -0
  277. package/packages/react/src/blocks/img/component-info.ts +21 -0
  278. package/packages/react/src/blocks/img/img.tsx +40 -0
  279. package/packages/react/src/blocks/input/component-info.ts +78 -0
  280. package/packages/react/src/blocks/input/input.tsx +33 -0
  281. package/packages/react/src/blocks/raw-text/component-info.ts +15 -0
  282. package/packages/react/src/blocks/raw-text/raw-text.tsx +18 -0
  283. package/packages/react/src/blocks/section/component-info.ts +50 -0
  284. package/packages/react/src/blocks/section/section.tsx +33 -0
  285. package/packages/react/src/blocks/select/component-info.ts +61 -0
  286. package/packages/react/src/blocks/select/select.tsx +35 -0
  287. package/packages/react/src/blocks/submit-button/component-info.ts +32 -0
  288. package/packages/react/src/blocks/submit-button/submit-button.tsx +17 -0
  289. package/packages/react/src/blocks/symbol/component-info.ts +43 -0
  290. package/packages/react/src/blocks/symbol/symbol.tsx +111 -0
  291. package/packages/react/src/blocks/text/component-info.ts +24 -0
  292. package/packages/react/src/blocks/text/text.tsx +20 -0
  293. package/packages/react/src/blocks/textarea/component-info.ts +48 -0
  294. package/packages/react/src/blocks/textarea/textarea.tsx +24 -0
  295. package/packages/react/src/blocks/util.ts +18 -0
  296. package/packages/react/src/blocks/video/component-info.ts +109 -0
  297. package/packages/react/src/blocks/video/video.tsx +84 -0
  298. package/packages/react/src/components/render-block/block-styles.tsx +98 -0
  299. package/packages/react/src/components/render-block/render-block.helpers.ts +138 -0
  300. package/packages/react/src/components/render-block/render-block.tsx +216 -0
  301. package/packages/react/src/components/render-block/render-component.tsx +52 -0
  302. package/packages/react/src/components/render-block/render-repeated-block.tsx +43 -0
  303. package/packages/react/src/components/render-block/types.ts +7 -0
  304. package/packages/react/src/components/render-blocks.tsx +97 -0
  305. package/packages/react/src/components/render-content/builder-editing.tsx +8 -0
  306. package/packages/react/src/components/render-content/components/render-styles.helpers.ts +79 -0
  307. package/packages/react/src/components/render-content/components/render-styles.tsx +45 -0
  308. package/packages/react/src/components/render-content/index.ts +1 -0
  309. package/packages/react/src/components/render-content/render-content.helpers.ts +48 -0
  310. package/packages/react/src/components/render-content/render-content.tsx +410 -0
  311. package/packages/react/src/components/render-content/render-content.types.ts +33 -0
  312. package/packages/react/src/components/render-inlined-styles.tsx +36 -0
  313. package/packages/react/src/constants/builder-registered-components.ts +42 -0
  314. package/packages/react/src/constants/device-sizes.ts +65 -0
  315. package/packages/react/src/constants/target.ts +2 -0
  316. package/packages/react/src/context/builder.context.ts +12 -0
  317. package/packages/react/src/context/types.ts +26 -0
  318. package/packages/react/src/functions/camel-to-kebab-case.ts +2 -0
  319. package/packages/react/src/functions/evaluate.ts +57 -0
  320. package/packages/react/src/functions/event-handler-name.ts +6 -0
  321. package/packages/react/src/functions/extract-text-styles.ts +39 -0
  322. package/packages/react/src/functions/fast-clone.ts +5 -0
  323. package/packages/react/src/functions/get-block-actions-handler.ts +20 -0
  324. package/packages/react/src/functions/get-block-actions.ts +25 -0
  325. package/packages/react/src/functions/get-block-component-options.ts +12 -0
  326. package/packages/react/src/functions/get-block-properties.ts +75 -0
  327. package/packages/react/src/functions/get-builder-search-params/fn.test.ts +19 -0
  328. package/packages/react/src/functions/get-builder-search-params/index.ts +50 -0
  329. package/packages/react/src/functions/get-content/ab-testing.ts +132 -0
  330. package/packages/react/src/functions/get-content/generate-content-url.test.ts +95 -0
  331. package/packages/react/src/functions/get-content/generate-content-url.ts +59 -0
  332. package/packages/react/src/functions/get-content/index.ts +62 -0
  333. package/packages/react/src/functions/get-content/types.ts +53 -0
  334. package/packages/react/src/functions/get-fetch.ts +18 -0
  335. package/packages/react/src/functions/get-global-this.ts +17 -0
  336. package/packages/react/src/functions/get-processed-block.test.ts +33 -0
  337. package/packages/react/src/functions/get-processed-block.ts +54 -0
  338. package/packages/react/src/functions/get-react-native-block-styles.ts +33 -0
  339. package/packages/react/src/functions/if-target.ts +20 -0
  340. package/packages/react/src/functions/is-browser.ts +3 -0
  341. package/packages/react/src/functions/is-editing.ts +10 -0
  342. package/packages/react/src/functions/is-iframe.ts +5 -0
  343. package/packages/react/src/functions/is-previewing.ts +14 -0
  344. package/packages/react/src/functions/on-change.test.ts +23 -0
  345. package/packages/react/src/functions/on-change.ts +29 -0
  346. package/packages/react/src/functions/register-component.ts +50 -0
  347. package/packages/react/src/functions/register.ts +46 -0
  348. package/packages/react/src/functions/sanitize-react-native-block-styles.ts +65 -0
  349. package/packages/react/src/functions/set-editor-settings.ts +16 -0
  350. package/packages/react/src/functions/set.test.ts +19 -0
  351. package/packages/react/src/functions/set.ts +26 -0
  352. package/packages/react/src/functions/track/helpers.ts +67 -0
  353. package/packages/react/src/functions/track/index.ts +136 -0
  354. package/packages/react/src/functions/track/interaction.ts +80 -0
  355. package/packages/react/src/functions/transform-block-properties.ts +3 -0
  356. package/packages/react/src/functions/transform-block.ts +6 -0
  357. package/packages/react/src/helpers/ab-tests.ts +22 -0
  358. package/packages/react/src/helpers/cookie.ts +107 -0
  359. package/packages/react/src/helpers/css.ts +42 -0
  360. package/packages/react/src/helpers/flatten.ts +24 -0
  361. package/packages/react/src/helpers/localStorage.ts +40 -0
  362. package/packages/react/src/helpers/logger.ts +6 -0
  363. package/packages/react/src/helpers/nullable.ts +4 -0
  364. package/packages/react/src/helpers/sessionId.ts +38 -0
  365. package/packages/react/src/helpers/time.ts +4 -0
  366. package/packages/react/src/helpers/url.test.ts +23 -0
  367. package/packages/react/src/helpers/url.ts +16 -0
  368. package/packages/react/src/helpers/uuid.ts +17 -0
  369. package/packages/react/src/helpers/visitorId.ts +40 -0
  370. package/packages/react/src/index-helpers/blocks-exports.ts +10 -0
  371. package/packages/react/src/index-helpers/top-of-file.ts +4 -0
  372. package/packages/react/src/index.ts +14 -0
  373. package/packages/react/src/scripts/init-editing.ts +123 -0
  374. package/packages/react/src/types/api-version.ts +2 -0
  375. package/packages/react/src/types/builder-block.ts +69 -0
  376. package/packages/react/src/types/builder-content.ts +46 -0
  377. package/packages/react/src/types/can-track.ts +3 -0
  378. package/packages/react/src/types/components.ts +117 -0
  379. package/packages/react/src/types/deep-partial.ts +7 -0
  380. package/packages/react/src/types/element.ts +60 -0
  381. package/packages/react/src/types/input.ts +125 -0
  382. package/packages/react/src/types/targets.ts +6 -0
  383. package/packages/react/src/types/typescript.ts +7 -0
  384. package/tsconfig.json +28 -0
  385. package/tsconfig.sdk.json +10 -0
  386. package/tsconfig.server.json +10 -0
  387. package/vite.config.ts +91 -0
  388. package/dist/react/cjs/blocks/BaseText.d.ts +0 -2
  389. package/dist/react/cjs/blocks/BaseText.js +0 -11
  390. package/dist/react/cjs/blocks/button/button.d.ts +0 -2
  391. package/dist/react/cjs/blocks/button/button.js +0 -15
  392. package/dist/react/cjs/blocks/button/component-info.d.ts +0 -38
  393. package/dist/react/cjs/blocks/button/component-info.js +0 -41
  394. package/dist/react/cjs/blocks/columns/columns.d.ts +0 -2
  395. package/dist/react/cjs/blocks/columns/columns.js +0 -133
  396. package/dist/react/cjs/blocks/columns/component-info.d.ts +0 -176
  397. package/dist/react/cjs/blocks/columns/component-info.js +0 -243
  398. package/dist/react/cjs/blocks/custom-code/component-info.d.ts +0 -31
  399. package/dist/react/cjs/blocks/custom-code/component-info.js +0 -31
  400. package/dist/react/cjs/blocks/custom-code/custom-code.d.ts +0 -2
  401. package/dist/react/cjs/blocks/custom-code/custom-code.js +0 -53
  402. package/dist/react/cjs/blocks/embed/component-info.d.ts +0 -22
  403. package/dist/react/cjs/blocks/embed/component-info.js +0 -46
  404. package/dist/react/cjs/blocks/embed/embed.d.ts +0 -2
  405. package/dist/react/cjs/blocks/embed/embed.js +0 -44
  406. package/dist/react/cjs/blocks/embed/helpers.d.ts +0 -1
  407. package/dist/react/cjs/blocks/embed/helpers.js +0 -10
  408. package/dist/react/cjs/blocks/form/component-info.d.ts +0 -235
  409. package/dist/react/cjs/blocks/form/component-info.js +0 -262
  410. package/dist/react/cjs/blocks/form/form.d.ts +0 -2
  411. package/dist/react/cjs/blocks/form/form.js +0 -205
  412. package/dist/react/cjs/blocks/fragment/component-info.d.ts +0 -8
  413. package/dist/react/cjs/blocks/fragment/component-info.js +0 -11
  414. package/dist/react/cjs/blocks/fragment/fragment.d.ts +0 -2
  415. package/dist/react/cjs/blocks/fragment/fragment.js +0 -8
  416. package/dist/react/cjs/blocks/image/component-info.d.ts +0 -114
  417. package/dist/react/cjs/blocks/image/component-info.js +0 -151
  418. package/dist/react/cjs/blocks/image/image.d.ts +0 -2
  419. package/dist/react/cjs/blocks/image/image.helpers.d.ts +0 -1
  420. package/dist/react/cjs/blocks/image/image.helpers.js +0 -49
  421. package/dist/react/cjs/blocks/image/image.js +0 -84
  422. package/dist/react/cjs/blocks/img/component-info.d.ts +0 -15
  423. package/dist/react/cjs/blocks/img/component-info.js +0 -20
  424. package/dist/react/cjs/blocks/img/img.d.ts +0 -2
  425. package/dist/react/cjs/blocks/img/img.js +0 -12
  426. package/dist/react/cjs/blocks/input/component-info.d.ts +0 -66
  427. package/dist/react/cjs/blocks/input/component-info.js +0 -74
  428. package/dist/react/cjs/blocks/input/input.d.ts +0 -2
  429. package/dist/react/cjs/blocks/input/input.js +0 -9
  430. package/dist/react/cjs/blocks/raw-text/component-info.d.ts +0 -10
  431. package/dist/react/cjs/blocks/raw-text/component-info.js +0 -16
  432. package/dist/react/cjs/blocks/raw-text/raw-text.d.ts +0 -2
  433. package/dist/react/cjs/blocks/raw-text/raw-text.js +0 -8
  434. package/dist/react/cjs/blocks/section/component-info.d.ts +0 -43
  435. package/dist/react/cjs/blocks/section/component-info.js +0 -49
  436. package/dist/react/cjs/blocks/section/section.d.ts +0 -2
  437. package/dist/react/cjs/blocks/section/section.js +0 -19
  438. package/dist/react/cjs/blocks/select/component-info.d.ts +0 -61
  439. package/dist/react/cjs/blocks/select/component-info.js +0 -59
  440. package/dist/react/cjs/blocks/select/select.d.ts +0 -2
  441. package/dist/react/cjs/blocks/select/select.js +0 -9
  442. package/dist/react/cjs/blocks/submit-button/component-info.d.ts +0 -23
  443. package/dist/react/cjs/blocks/submit-button/component-info.js +0 -28
  444. package/dist/react/cjs/blocks/submit-button/submit-button.d.ts +0 -2
  445. package/dist/react/cjs/blocks/submit-button/submit-button.js +0 -8
  446. package/dist/react/cjs/blocks/symbol/component-info.d.ts +0 -35
  447. package/dist/react/cjs/blocks/symbol/component-info.js +0 -43
  448. package/dist/react/cjs/blocks/symbol/symbol.d.ts +0 -2
  449. package/dist/react/cjs/blocks/symbol/symbol.js +0 -73
  450. package/dist/react/cjs/blocks/text/component-info.d.ts +0 -19
  451. package/dist/react/cjs/blocks/text/component-info.js +0 -24
  452. package/dist/react/cjs/blocks/text/text.d.ts +0 -2
  453. package/dist/react/cjs/blocks/text/text.js +0 -10
  454. package/dist/react/cjs/blocks/textarea/component-info.d.ts +0 -53
  455. package/dist/react/cjs/blocks/textarea/component-info.js +0 -47
  456. package/dist/react/cjs/blocks/textarea/textarea.d.ts +0 -2
  457. package/dist/react/cjs/blocks/textarea/textarea.js +0 -8
  458. package/dist/react/cjs/blocks/util.d.ts +0 -1
  459. package/dist/react/cjs/blocks/util.js +0 -9
  460. package/dist/react/cjs/blocks/video/component-info.d.ts +0 -80
  461. package/dist/react/cjs/blocks/video/component-info.js +0 -106
  462. package/dist/react/cjs/blocks/video/video.d.ts +0 -2
  463. package/dist/react/cjs/blocks/video/video.js +0 -52
  464. package/dist/react/cjs/components/render-block/block-styles.d.ts +0 -2
  465. package/dist/react/cjs/components/render-block/block-styles.js +0 -66
  466. package/dist/react/cjs/components/render-block/render-block.d.ts +0 -2
  467. package/dist/react/cjs/components/render-block/render-block.helpers.d.ts +0 -13
  468. package/dist/react/cjs/components/render-block/render-block.helpers.js +0 -125
  469. package/dist/react/cjs/components/render-block/render-block.js +0 -134
  470. package/dist/react/cjs/components/render-block/render-component.d.ts +0 -2
  471. package/dist/react/cjs/components/render-block/render-component.js +0 -14
  472. package/dist/react/cjs/components/render-block/render-repeated-block.d.ts +0 -2
  473. package/dist/react/cjs/components/render-block/render-repeated-block.js +0 -20
  474. package/dist/react/cjs/components/render-block/types.d.ts +0 -0
  475. package/dist/react/cjs/components/render-block/types.js +0 -1
  476. package/dist/react/cjs/components/render-blocks.d.ts +0 -2
  477. package/dist/react/cjs/components/render-blocks.js +0 -49
  478. package/dist/react/cjs/components/render-content/builder-editing.d.ts +0 -2
  479. package/dist/react/cjs/components/render-content/builder-editing.js +0 -8
  480. package/dist/react/cjs/components/render-content/components/render-styles.d.ts +0 -2
  481. package/dist/react/cjs/components/render-content/components/render-styles.helpers.d.ts +0 -7
  482. package/dist/react/cjs/components/render-content/components/render-styles.helpers.js +0 -55
  483. package/dist/react/cjs/components/render-content/components/render-styles.js +0 -34
  484. package/dist/react/cjs/components/render-content/index.d.ts +0 -2
  485. package/dist/react/cjs/components/render-content/index.js +0 -5
  486. package/dist/react/cjs/components/render-content/render-content.d.ts +0 -2
  487. package/dist/react/cjs/components/render-content/render-content.helpers.d.ts +0 -9
  488. package/dist/react/cjs/components/render-content/render-content.helpers.js +0 -42
  489. package/dist/react/cjs/components/render-content/render-content.js +0 -297
  490. package/dist/react/cjs/components/render-content/render-content.types.d.ts +0 -0
  491. package/dist/react/cjs/components/render-content/render-content.types.js +0 -1
  492. package/dist/react/cjs/components/render-inlined-styles.d.ts +0 -2
  493. package/dist/react/cjs/components/render-inlined-styles.js +0 -19
  494. package/dist/react/cjs/constants/builder-registered-components.d.ts +0 -1
  495. package/dist/react/cjs/constants/builder-registered-components.js +0 -55
  496. package/dist/react/cjs/constants/device-sizes.d.ts +0 -21
  497. package/dist/react/cjs/constants/device-sizes.js +0 -49
  498. package/dist/react/cjs/constants/target.d.ts +0 -1
  499. package/dist/react/cjs/constants/target.js +0 -5
  500. package/dist/react/cjs/context/builder.context.d.ts +0 -11
  501. package/dist/react/cjs/context/builder.context.js +0 -16
  502. package/dist/react/cjs/context/types.d.ts +0 -0
  503. package/dist/react/cjs/context/types.js +0 -1
  504. package/dist/react/cjs/functions/camel-to-kebab-case.d.ts +0 -1
  505. package/dist/react/cjs/functions/camel-to-kebab-case.js +0 -5
  506. package/dist/react/cjs/functions/evaluate.d.ts +0 -7
  507. package/dist/react/cjs/functions/evaluate.js +0 -25
  508. package/dist/react/cjs/functions/event-handler-name.d.ts +0 -1
  509. package/dist/react/cjs/functions/event-handler-name.js +0 -8
  510. package/dist/react/cjs/functions/extract-text-styles.d.ts +0 -1
  511. package/dist/react/cjs/functions/extract-text-styles.js +0 -23
  512. package/dist/react/cjs/functions/fast-clone.d.ts +0 -1
  513. package/dist/react/cjs/functions/fast-clone.js +0 -5
  514. package/dist/react/cjs/functions/get-block-actions-handler.d.ts +0 -1
  515. package/dist/react/cjs/functions/get-block-actions-handler.js +0 -12
  516. package/dist/react/cjs/functions/get-block-actions.d.ts +0 -1
  517. package/dist/react/cjs/functions/get-block-actions.js +0 -19
  518. package/dist/react/cjs/functions/get-block-component-options.d.ts +0 -1
  519. package/dist/react/cjs/functions/get-block-component-options.js +0 -29
  520. package/dist/react/cjs/functions/get-block-properties.d.ts +0 -1
  521. package/dist/react/cjs/functions/get-block-properties.js +0 -54
  522. package/dist/react/cjs/functions/get-builder-search-params/fn.test.js +0 -15
  523. package/dist/react/cjs/functions/get-builder-search-params/index.d.ts +0 -4
  524. package/dist/react/cjs/functions/get-builder-search-params/index.js +0 -39
  525. package/dist/react/cjs/functions/get-content/ab-testing.d.ts +0 -1
  526. package/dist/react/cjs/functions/get-content/ab-testing.js +0 -89
  527. package/dist/react/cjs/functions/get-content/generate-content-url.d.ts +0 -1
  528. package/dist/react/cjs/functions/get-content/generate-content-url.js +0 -48
  529. package/dist/react/cjs/functions/get-content/generate-content-url.test.js +0 -84
  530. package/dist/react/cjs/functions/get-content/index.d.ts +0 -2
  531. package/dist/react/cjs/functions/get-content/index.js +0 -88
  532. package/dist/react/cjs/functions/get-content/types.d.ts +0 -0
  533. package/dist/react/cjs/functions/get-content/types.js +0 -1
  534. package/dist/react/cjs/functions/get-fetch.d.ts +0 -1
  535. package/dist/react/cjs/functions/get-fetch.js +0 -15
  536. package/dist/react/cjs/functions/get-global-this.d.ts +0 -1
  537. package/dist/react/cjs/functions/get-global-this.js +0 -19
  538. package/dist/react/cjs/functions/get-processed-block.d.ts +0 -6
  539. package/dist/react/cjs/functions/get-processed-block.js +0 -52
  540. package/dist/react/cjs/functions/get-processed-block.test.js +0 -34
  541. package/dist/react/cjs/functions/get-react-native-block-styles.d.ts +0 -5
  542. package/dist/react/cjs/functions/get-react-native-block-styles.js +0 -30
  543. package/dist/react/cjs/functions/if-target.d.ts +0 -5
  544. package/dist/react/cjs/functions/if-target.js +0 -13
  545. package/dist/react/cjs/functions/is-browser.d.ts +0 -1
  546. package/dist/react/cjs/functions/is-browser.js +0 -7
  547. package/dist/react/cjs/functions/is-editing.d.ts +0 -1
  548. package/dist/react/cjs/functions/is-editing.js +0 -9
  549. package/dist/react/cjs/functions/is-iframe.d.ts +0 -1
  550. package/dist/react/cjs/functions/is-iframe.js +0 -8
  551. package/dist/react/cjs/functions/is-previewing.d.ts +0 -1
  552. package/dist/react/cjs/functions/is-previewing.js +0 -15
  553. package/dist/react/cjs/functions/on-change.d.ts +0 -2
  554. package/dist/react/cjs/functions/on-change.js +0 -28
  555. package/dist/react/cjs/functions/on-change.test.js +0 -21
  556. package/dist/react/cjs/functions/register-component.d.ts +0 -6
  557. package/dist/react/cjs/functions/register-component.js +0 -65
  558. package/dist/react/cjs/functions/register.d.ts +0 -1
  559. package/dist/react/cjs/functions/register.js +0 -31
  560. package/dist/react/cjs/functions/sanitize-react-native-block-styles.d.ts +0 -1
  561. package/dist/react/cjs/functions/sanitize-react-native-block-styles.js +0 -71
  562. package/dist/react/cjs/functions/set-editor-settings.d.ts +0 -1
  563. package/dist/react/cjs/functions/set-editor-settings.js +0 -16
  564. package/dist/react/cjs/functions/set.d.ts +0 -1
  565. package/dist/react/cjs/functions/set.js +0 -12
  566. package/dist/react/cjs/functions/set.test.js +0 -18
  567. package/dist/react/cjs/functions/track/helpers.d.ts +0 -5
  568. package/dist/react/cjs/functions/track/helpers.js +0 -53
  569. package/dist/react/cjs/functions/track/index.d.ts +0 -2
  570. package/dist/react/cjs/functions/track/index.js +0 -125
  571. package/dist/react/cjs/functions/track/interaction.d.ts +0 -14
  572. package/dist/react/cjs/functions/track/interaction.js +0 -51
  573. package/dist/react/cjs/functions/transform-block-properties.d.ts +0 -1
  574. package/dist/react/cjs/functions/transform-block-properties.js +0 -7
  575. package/dist/react/cjs/functions/transform-block.d.ts +0 -1
  576. package/dist/react/cjs/functions/transform-block.js +0 -7
  577. package/dist/react/cjs/helpers/ab-tests.d.ts +0 -9
  578. package/dist/react/cjs/helpers/ab-tests.js +0 -10
  579. package/dist/react/cjs/helpers/cookie.d.ts +0 -2
  580. package/dist/react/cjs/helpers/cookie.js +0 -74
  581. package/dist/react/cjs/helpers/css.d.ts +0 -7
  582. package/dist/react/cjs/helpers/css.js +0 -33
  583. package/dist/react/cjs/helpers/flatten.d.ts +0 -1
  584. package/dist/react/cjs/helpers/flatten.js +0 -35
  585. package/dist/react/cjs/helpers/localStorage.d.ts +0 -9
  586. package/dist/react/cjs/helpers/localStorage.js +0 -31
  587. package/dist/react/cjs/helpers/logger.d.ts +0 -5
  588. package/dist/react/cjs/helpers/logger.js +0 -10
  589. package/dist/react/cjs/helpers/nullable.d.ts +0 -1
  590. package/dist/react/cjs/helpers/nullable.js +0 -5
  591. package/dist/react/cjs/helpers/sessionId.d.ts +0 -6
  592. package/dist/react/cjs/helpers/sessionId.js +0 -51
  593. package/dist/react/cjs/helpers/time.d.ts +0 -1
  594. package/dist/react/cjs/helpers/time.js +0 -6
  595. package/dist/react/cjs/helpers/url.d.ts +0 -1
  596. package/dist/react/cjs/helpers/url.js +0 -14
  597. package/dist/react/cjs/helpers/url.test.js +0 -23
  598. package/dist/react/cjs/helpers/uuid.d.ts +0 -2
  599. package/dist/react/cjs/helpers/uuid.js +0 -14
  600. package/dist/react/cjs/helpers/visitorId.d.ts +0 -8
  601. package/dist/react/cjs/helpers/visitorId.js +0 -33
  602. package/dist/react/cjs/index-helpers/blocks-exports.d.ts +0 -11
  603. package/dist/react/cjs/index-helpers/blocks-exports.js +0 -23
  604. package/dist/react/cjs/index-helpers/top-of-file.d.ts +0 -2
  605. package/dist/react/cjs/index-helpers/top-of-file.js +0 -5
  606. package/dist/react/cjs/index.d.ts +0 -11
  607. package/dist/react/cjs/index.js +0 -28
  608. package/dist/react/cjs/scripts/init-editing.d.ts +0 -2
  609. package/dist/react/cjs/scripts/init-editing.js +0 -97
  610. package/dist/react/cjs/types/api-version.d.ts +0 -1
  611. package/dist/react/cjs/types/api-version.js +0 -5
  612. package/dist/react/cjs/types/builder-block.d.ts +0 -0
  613. package/dist/react/cjs/types/builder-block.js +0 -1
  614. package/dist/react/cjs/types/builder-content.d.ts +0 -0
  615. package/dist/react/cjs/types/builder-content.js +0 -1
  616. package/dist/react/cjs/types/can-track.d.ts +0 -0
  617. package/dist/react/cjs/types/can-track.js +0 -1
  618. package/dist/react/cjs/types/components.d.ts +0 -0
  619. package/dist/react/cjs/types/components.js +0 -1
  620. package/dist/react/cjs/types/deep-partial.d.ts +0 -0
  621. package/dist/react/cjs/types/deep-partial.js +0 -1
  622. package/dist/react/cjs/types/element.d.ts +0 -0
  623. package/dist/react/cjs/types/element.js +0 -1
  624. package/dist/react/cjs/types/input.d.ts +0 -0
  625. package/dist/react/cjs/types/input.js +0 -1
  626. package/dist/react/cjs/types/targets.d.ts +0 -0
  627. package/dist/react/cjs/types/targets.js +0 -1
  628. package/dist/react/cjs/types/typescript.d.ts +0 -0
  629. package/dist/react/cjs/types/typescript.js +0 -1
  630. package/dist/react/esm/blocks/BaseText.d.ts +0 -2
  631. package/dist/react/esm/blocks/BaseText.js +0 -9
  632. package/dist/react/esm/blocks/button/button.d.ts +0 -2
  633. package/dist/react/esm/blocks/button/button.js +0 -13
  634. package/dist/react/esm/blocks/button/component-info.d.ts +0 -38
  635. package/dist/react/esm/blocks/button/component-info.js +0 -38
  636. package/dist/react/esm/blocks/columns/columns.d.ts +0 -2
  637. package/dist/react/esm/blocks/columns/columns.js +0 -131
  638. package/dist/react/esm/blocks/columns/component-info.d.ts +0 -176
  639. package/dist/react/esm/blocks/columns/component-info.js +0 -240
  640. package/dist/react/esm/blocks/custom-code/component-info.d.ts +0 -31
  641. package/dist/react/esm/blocks/custom-code/component-info.js +0 -28
  642. package/dist/react/esm/blocks/custom-code/custom-code.d.ts +0 -2
  643. package/dist/react/esm/blocks/embed/component-info.d.ts +0 -22
  644. package/dist/react/esm/blocks/embed/component-info.js +0 -43
  645. package/dist/react/esm/blocks/embed/embed.d.ts +0 -2
  646. package/dist/react/esm/blocks/embed/helpers.d.ts +0 -1
  647. package/dist/react/esm/blocks/embed/helpers.js +0 -7
  648. package/dist/react/esm/blocks/form/component-info.d.ts +0 -235
  649. package/dist/react/esm/blocks/form/component-info.js +0 -259
  650. package/dist/react/esm/blocks/form/form.d.ts +0 -2
  651. package/dist/react/esm/blocks/form/form.js +0 -203
  652. package/dist/react/esm/blocks/fragment/component-info.d.ts +0 -8
  653. package/dist/react/esm/blocks/fragment/component-info.js +0 -8
  654. package/dist/react/esm/blocks/fragment/fragment.d.ts +0 -2
  655. package/dist/react/esm/blocks/image/component-info.d.ts +0 -114
  656. package/dist/react/esm/blocks/image/component-info.js +0 -148
  657. package/dist/react/esm/blocks/image/image.d.ts +0 -2
  658. package/dist/react/esm/blocks/image/image.helpers.d.ts +0 -1
  659. package/dist/react/esm/blocks/image/image.helpers.js +0 -46
  660. package/dist/react/esm/blocks/image/image.js +0 -82
  661. package/dist/react/esm/blocks/img/component-info.d.ts +0 -15
  662. package/dist/react/esm/blocks/img/component-info.js +0 -17
  663. package/dist/react/esm/blocks/img/img.d.ts +0 -2
  664. package/dist/react/esm/blocks/input/component-info.d.ts +0 -66
  665. package/dist/react/esm/blocks/input/component-info.js +0 -71
  666. package/dist/react/esm/blocks/input/input.d.ts +0 -2
  667. package/dist/react/esm/blocks/raw-text/component-info.d.ts +0 -10
  668. package/dist/react/esm/blocks/raw-text/component-info.js +0 -13
  669. package/dist/react/esm/blocks/raw-text/raw-text.d.ts +0 -2
  670. package/dist/react/esm/blocks/section/component-info.d.ts +0 -43
  671. package/dist/react/esm/blocks/section/component-info.js +0 -46
  672. package/dist/react/esm/blocks/section/section.d.ts +0 -2
  673. package/dist/react/esm/blocks/select/component-info.d.ts +0 -61
  674. package/dist/react/esm/blocks/select/component-info.js +0 -56
  675. package/dist/react/esm/blocks/select/select.d.ts +0 -2
  676. package/dist/react/esm/blocks/submit-button/component-info.d.ts +0 -23
  677. package/dist/react/esm/blocks/submit-button/component-info.js +0 -25
  678. package/dist/react/esm/blocks/submit-button/submit-button.d.ts +0 -2
  679. package/dist/react/esm/blocks/symbol/component-info.d.ts +0 -35
  680. package/dist/react/esm/blocks/symbol/component-info.js +0 -40
  681. package/dist/react/esm/blocks/symbol/symbol.d.ts +0 -2
  682. package/dist/react/esm/blocks/symbol/symbol.js +0 -71
  683. package/dist/react/esm/blocks/text/component-info.d.ts +0 -19
  684. package/dist/react/esm/blocks/text/component-info.js +0 -21
  685. package/dist/react/esm/blocks/text/text.d.ts +0 -2
  686. package/dist/react/esm/blocks/textarea/component-info.d.ts +0 -53
  687. package/dist/react/esm/blocks/textarea/component-info.js +0 -44
  688. package/dist/react/esm/blocks/textarea/textarea.d.ts +0 -2
  689. package/dist/react/esm/blocks/util.d.ts +0 -1
  690. package/dist/react/esm/blocks/util.js +0 -6
  691. package/dist/react/esm/blocks/video/component-info.d.ts +0 -80
  692. package/dist/react/esm/blocks/video/component-info.js +0 -103
  693. package/dist/react/esm/blocks/video/video.d.ts +0 -2
  694. package/dist/react/esm/blocks/video/video.js +0 -50
  695. package/dist/react/esm/components/render-block/block-styles.d.ts +0 -2
  696. package/dist/react/esm/components/render-block/render-block.d.ts +0 -2
  697. package/dist/react/esm/components/render-block/render-block.helpers.d.ts +0 -13
  698. package/dist/react/esm/components/render-block/render-block.helpers.js +0 -119
  699. package/dist/react/esm/components/render-block/render-block.js +0 -132
  700. package/dist/react/esm/components/render-block/render-component.d.ts +0 -2
  701. package/dist/react/esm/components/render-block/render-repeated-block.d.ts +0 -2
  702. package/dist/react/esm/components/render-block/render-repeated-block.js +0 -18
  703. package/dist/react/esm/components/render-block/types.d.ts +0 -0
  704. package/dist/react/esm/components/render-block/types.js +0 -1
  705. package/dist/react/esm/components/render-blocks.d.ts +0 -2
  706. package/dist/react/esm/components/render-blocks.js +0 -47
  707. package/dist/react/esm/components/render-content/builder-editing.d.ts +0 -2
  708. package/dist/react/esm/components/render-content/components/render-styles.d.ts +0 -2
  709. package/dist/react/esm/components/render-content/components/render-styles.helpers.d.ts +0 -7
  710. package/dist/react/esm/components/render-content/components/render-styles.helpers.js +0 -51
  711. package/dist/react/esm/components/render-content/components/render-styles.js +0 -32
  712. package/dist/react/esm/components/render-content/index.d.ts +0 -2
  713. package/dist/react/esm/components/render-content/index.js +0 -2
  714. package/dist/react/esm/components/render-content/render-content.d.ts +0 -2
  715. package/dist/react/esm/components/render-content/render-content.helpers.d.ts +0 -9
  716. package/dist/react/esm/components/render-content/render-content.helpers.js +0 -38
  717. package/dist/react/esm/components/render-content/render-content.js +0 -295
  718. package/dist/react/esm/components/render-content/render-content.types.d.ts +0 -0
  719. package/dist/react/esm/components/render-content/render-content.types.js +0 -1
  720. package/dist/react/esm/components/render-inlined-styles.d.ts +0 -2
  721. package/dist/react/esm/components/render-inlined-styles.js +0 -17
  722. package/dist/react/esm/constants/builder-registered-components.d.ts +0 -1
  723. package/dist/react/esm/constants/builder-registered-components.js +0 -52
  724. package/dist/react/esm/constants/device-sizes.d.ts +0 -21
  725. package/dist/react/esm/constants/device-sizes.js +0 -45
  726. package/dist/react/esm/constants/target.d.ts +0 -1
  727. package/dist/react/esm/constants/target.js +0 -2
  728. package/dist/react/esm/context/builder.context.d.ts +0 -11
  729. package/dist/react/esm/context/builder.context.js +0 -13
  730. package/dist/react/esm/context/types.d.ts +0 -0
  731. package/dist/react/esm/context/types.js +0 -1
  732. package/dist/react/esm/functions/camel-to-kebab-case.d.ts +0 -1
  733. package/dist/react/esm/functions/camel-to-kebab-case.js +0 -2
  734. package/dist/react/esm/functions/evaluate.d.ts +0 -7
  735. package/dist/react/esm/functions/evaluate.js +0 -22
  736. package/dist/react/esm/functions/event-handler-name.d.ts +0 -1
  737. package/dist/react/esm/functions/event-handler-name.js +0 -5
  738. package/dist/react/esm/functions/extract-text-styles.d.ts +0 -1
  739. package/dist/react/esm/functions/extract-text-styles.js +0 -20
  740. package/dist/react/esm/functions/fast-clone.d.ts +0 -1
  741. package/dist/react/esm/functions/fast-clone.js +0 -2
  742. package/dist/react/esm/functions/get-block-actions-handler.d.ts +0 -1
  743. package/dist/react/esm/functions/get-block-actions-handler.js +0 -9
  744. package/dist/react/esm/functions/get-block-actions.d.ts +0 -1
  745. package/dist/react/esm/functions/get-block-actions.js +0 -16
  746. package/dist/react/esm/functions/get-block-component-options.d.ts +0 -1
  747. package/dist/react/esm/functions/get-block-component-options.js +0 -26
  748. package/dist/react/esm/functions/get-block-properties.d.ts +0 -1
  749. package/dist/react/esm/functions/get-block-properties.js +0 -51
  750. package/dist/react/esm/functions/get-builder-search-params/fn.test.js +0 -13
  751. package/dist/react/esm/functions/get-builder-search-params/index.d.ts +0 -4
  752. package/dist/react/esm/functions/get-builder-search-params/index.js +0 -33
  753. package/dist/react/esm/functions/get-content/ab-testing.d.ts +0 -1
  754. package/dist/react/esm/functions/get-content/ab-testing.js +0 -86
  755. package/dist/react/esm/functions/get-content/generate-content-url.d.ts +0 -1
  756. package/dist/react/esm/functions/get-content/generate-content-url.js +0 -45
  757. package/dist/react/esm/functions/get-content/generate-content-url.test.js +0 -82
  758. package/dist/react/esm/functions/get-content/index.d.ts +0 -2
  759. package/dist/react/esm/functions/get-content/index.js +0 -84
  760. package/dist/react/esm/functions/get-content/types.d.ts +0 -0
  761. package/dist/react/esm/functions/get-content/types.js +0 -1
  762. package/dist/react/esm/functions/get-fetch.d.ts +0 -1
  763. package/dist/react/esm/functions/get-fetch.js +0 -12
  764. package/dist/react/esm/functions/get-global-this.d.ts +0 -1
  765. package/dist/react/esm/functions/get-global-this.js +0 -16
  766. package/dist/react/esm/functions/get-processed-block.d.ts +0 -6
  767. package/dist/react/esm/functions/get-processed-block.js +0 -49
  768. package/dist/react/esm/functions/get-processed-block.test.js +0 -32
  769. package/dist/react/esm/functions/get-react-native-block-styles.d.ts +0 -5
  770. package/dist/react/esm/functions/get-react-native-block-styles.js +0 -27
  771. package/dist/react/esm/functions/if-target.d.ts +0 -5
  772. package/dist/react/esm/functions/if-target.js +0 -10
  773. package/dist/react/esm/functions/is-browser.d.ts +0 -1
  774. package/dist/react/esm/functions/is-browser.js +0 -4
  775. package/dist/react/esm/functions/is-editing.d.ts +0 -1
  776. package/dist/react/esm/functions/is-editing.js +0 -6
  777. package/dist/react/esm/functions/is-iframe.d.ts +0 -1
  778. package/dist/react/esm/functions/is-iframe.js +0 -5
  779. package/dist/react/esm/functions/is-previewing.d.ts +0 -1
  780. package/dist/react/esm/functions/is-previewing.js +0 -12
  781. package/dist/react/esm/functions/on-change.d.ts +0 -2
  782. package/dist/react/esm/functions/on-change.js +0 -24
  783. package/dist/react/esm/functions/on-change.test.js +0 -19
  784. package/dist/react/esm/functions/register-component.d.ts +0 -6
  785. package/dist/react/esm/functions/register-component.js +0 -60
  786. package/dist/react/esm/functions/register.d.ts +0 -1
  787. package/dist/react/esm/functions/register.js +0 -28
  788. package/dist/react/esm/functions/sanitize-react-native-block-styles.d.ts +0 -1
  789. package/dist/react/esm/functions/sanitize-react-native-block-styles.js +0 -68
  790. package/dist/react/esm/functions/set-editor-settings.d.ts +0 -1
  791. package/dist/react/esm/functions/set-editor-settings.js +0 -13
  792. package/dist/react/esm/functions/set.d.ts +0 -1
  793. package/dist/react/esm/functions/set.js +0 -9
  794. package/dist/react/esm/functions/set.test.js +0 -16
  795. package/dist/react/esm/functions/track/helpers.d.ts +0 -5
  796. package/dist/react/esm/functions/track/helpers.js +0 -50
  797. package/dist/react/esm/functions/track/index.d.ts +0 -2
  798. package/dist/react/esm/functions/track/index.js +0 -121
  799. package/dist/react/esm/functions/track/interaction.d.ts +0 -14
  800. package/dist/react/esm/functions/track/interaction.js +0 -48
  801. package/dist/react/esm/functions/transform-block-properties.d.ts +0 -1
  802. package/dist/react/esm/functions/transform-block-properties.js +0 -4
  803. package/dist/react/esm/functions/transform-block.d.ts +0 -1
  804. package/dist/react/esm/functions/transform-block.js +0 -4
  805. package/dist/react/esm/helpers/ab-tests.d.ts +0 -9
  806. package/dist/react/esm/helpers/ab-tests.js +0 -6
  807. package/dist/react/esm/helpers/cookie.d.ts +0 -2
  808. package/dist/react/esm/helpers/cookie.js +0 -70
  809. package/dist/react/esm/helpers/css.d.ts +0 -7
  810. package/dist/react/esm/helpers/css.js +0 -28
  811. package/dist/react/esm/helpers/flatten.d.ts +0 -1
  812. package/dist/react/esm/helpers/flatten.js +0 -32
  813. package/dist/react/esm/helpers/localStorage.d.ts +0 -9
  814. package/dist/react/esm/helpers/localStorage.js +0 -27
  815. package/dist/react/esm/helpers/logger.d.ts +0 -5
  816. package/dist/react/esm/helpers/logger.js +0 -7
  817. package/dist/react/esm/helpers/nullable.d.ts +0 -1
  818. package/dist/react/esm/helpers/nullable.js +0 -2
  819. package/dist/react/esm/helpers/sessionId.d.ts +0 -6
  820. package/dist/react/esm/helpers/sessionId.js +0 -46
  821. package/dist/react/esm/helpers/time.d.ts +0 -1
  822. package/dist/react/esm/helpers/time.js +0 -3
  823. package/dist/react/esm/helpers/url.d.ts +0 -1
  824. package/dist/react/esm/helpers/url.js +0 -11
  825. package/dist/react/esm/helpers/url.test.js +0 -21
  826. package/dist/react/esm/helpers/uuid.d.ts +0 -2
  827. package/dist/react/esm/helpers/uuid.js +0 -10
  828. package/dist/react/esm/helpers/visitorId.d.ts +0 -8
  829. package/dist/react/esm/helpers/visitorId.js +0 -28
  830. package/dist/react/esm/index-helpers/blocks-exports.d.ts +0 -11
  831. package/dist/react/esm/index-helpers/blocks-exports.js +0 -11
  832. package/dist/react/esm/index-helpers/top-of-file.d.ts +0 -2
  833. package/dist/react/esm/index-helpers/top-of-file.js +0 -2
  834. package/dist/react/esm/index.d.ts +0 -11
  835. package/dist/react/esm/index.js +0 -11
  836. package/dist/react/esm/scripts/init-editing.d.ts +0 -2
  837. package/dist/react/esm/scripts/init-editing.js +0 -93
  838. package/dist/react/esm/types/api-version.d.ts +0 -1
  839. package/dist/react/esm/types/api-version.js +0 -2
  840. package/dist/react/esm/types/builder-block.d.ts +0 -0
  841. package/dist/react/esm/types/builder-block.js +0 -1
  842. package/dist/react/esm/types/builder-content.d.ts +0 -0
  843. package/dist/react/esm/types/builder-content.js +0 -1
  844. package/dist/react/esm/types/can-track.d.ts +0 -0
  845. package/dist/react/esm/types/can-track.js +0 -1
  846. package/dist/react/esm/types/components.d.ts +0 -0
  847. package/dist/react/esm/types/components.js +0 -1
  848. package/dist/react/esm/types/deep-partial.d.ts +0 -0
  849. package/dist/react/esm/types/deep-partial.js +0 -1
  850. package/dist/react/esm/types/element.d.ts +0 -0
  851. package/dist/react/esm/types/element.js +0 -1
  852. package/dist/react/esm/types/input.d.ts +0 -0
  853. package/dist/react/esm/types/input.js +0 -1
  854. package/dist/react/esm/types/targets.d.ts +0 -0
  855. package/dist/react/esm/types/targets.js +0 -1
  856. package/dist/react/esm/types/typescript.d.ts +0 -0
  857. package/dist/react/esm/types/typescript.js +0 -1
  858. package/dist/rsc/blocks/BaseText.d.ts +0 -2
  859. package/dist/rsc/blocks/BaseText.js +0 -8
  860. package/dist/rsc/blocks/button/button.d.ts +0 -2
  861. package/dist/rsc/blocks/button/button.js +0 -13
  862. package/dist/rsc/blocks/button/component-info.d.ts +0 -38
  863. package/dist/rsc/blocks/button/component-info.js +0 -38
  864. package/dist/rsc/blocks/columns/columns.d.ts +0 -2
  865. package/dist/rsc/blocks/columns/columns.js +0 -132
  866. package/dist/rsc/blocks/columns/component-info.d.ts +0 -176
  867. package/dist/rsc/blocks/columns/component-info.js +0 -240
  868. package/dist/rsc/blocks/custom-code/component-info.d.ts +0 -31
  869. package/dist/rsc/blocks/custom-code/component-info.js +0 -28
  870. package/dist/rsc/blocks/custom-code/custom-code.d.ts +0 -2
  871. package/dist/rsc/blocks/custom-code/custom-code.js +0 -46
  872. package/dist/rsc/blocks/embed/component-info.d.ts +0 -22
  873. package/dist/rsc/blocks/embed/component-info.js +0 -43
  874. package/dist/rsc/blocks/embed/embed.d.ts +0 -2
  875. package/dist/rsc/blocks/embed/embed.js +0 -37
  876. package/dist/rsc/blocks/embed/helpers.d.ts +0 -1
  877. package/dist/rsc/blocks/embed/helpers.js +0 -7
  878. package/dist/rsc/blocks/form/component-info.d.ts +0 -235
  879. package/dist/rsc/blocks/form/component-info.js +0 -259
  880. package/dist/rsc/blocks/form/form.d.ts +0 -2
  881. package/dist/rsc/blocks/form/form.js +0 -205
  882. package/dist/rsc/blocks/fragment/component-info.d.ts +0 -8
  883. package/dist/rsc/blocks/fragment/component-info.js +0 -8
  884. package/dist/rsc/blocks/fragment/fragment.d.ts +0 -2
  885. package/dist/rsc/blocks/fragment/fragment.js +0 -6
  886. package/dist/rsc/blocks/image/component-info.d.ts +0 -114
  887. package/dist/rsc/blocks/image/component-info.js +0 -148
  888. package/dist/rsc/blocks/image/image.d.ts +0 -2
  889. package/dist/rsc/blocks/image/image.helpers.d.ts +0 -1
  890. package/dist/rsc/blocks/image/image.helpers.js +0 -46
  891. package/dist/rsc/blocks/image/image.js +0 -84
  892. package/dist/rsc/blocks/img/component-info.d.ts +0 -15
  893. package/dist/rsc/blocks/img/component-info.js +0 -17
  894. package/dist/rsc/blocks/img/img.d.ts +0 -2
  895. package/dist/rsc/blocks/img/img.js +0 -10
  896. package/dist/rsc/blocks/input/component-info.d.ts +0 -66
  897. package/dist/rsc/blocks/input/component-info.js +0 -71
  898. package/dist/rsc/blocks/input/input.d.ts +0 -2
  899. package/dist/rsc/blocks/input/input.js +0 -7
  900. package/dist/rsc/blocks/raw-text/component-info.d.ts +0 -10
  901. package/dist/rsc/blocks/raw-text/component-info.js +0 -13
  902. package/dist/rsc/blocks/raw-text/raw-text.d.ts +0 -2
  903. package/dist/rsc/blocks/raw-text/raw-text.js +0 -6
  904. package/dist/rsc/blocks/section/component-info.d.ts +0 -43
  905. package/dist/rsc/blocks/section/component-info.js +0 -46
  906. package/dist/rsc/blocks/section/section.d.ts +0 -2
  907. package/dist/rsc/blocks/section/section.js +0 -17
  908. package/dist/rsc/blocks/select/component-info.d.ts +0 -61
  909. package/dist/rsc/blocks/select/component-info.js +0 -56
  910. package/dist/rsc/blocks/select/select.d.ts +0 -2
  911. package/dist/rsc/blocks/select/select.js +0 -7
  912. package/dist/rsc/blocks/submit-button/component-info.d.ts +0 -23
  913. package/dist/rsc/blocks/submit-button/component-info.js +0 -25
  914. package/dist/rsc/blocks/submit-button/submit-button.d.ts +0 -2
  915. package/dist/rsc/blocks/submit-button/submit-button.js +0 -6
  916. package/dist/rsc/blocks/symbol/component-info.d.ts +0 -35
  917. package/dist/rsc/blocks/symbol/component-info.js +0 -40
  918. package/dist/rsc/blocks/symbol/symbol.d.ts +0 -2
  919. package/dist/rsc/blocks/symbol/symbol.js +0 -66
  920. package/dist/rsc/blocks/text/component-info.d.ts +0 -19
  921. package/dist/rsc/blocks/text/component-info.js +0 -21
  922. package/dist/rsc/blocks/text/text.d.ts +0 -2
  923. package/dist/rsc/blocks/text/text.js +0 -8
  924. package/dist/rsc/blocks/textarea/component-info.d.ts +0 -53
  925. package/dist/rsc/blocks/textarea/component-info.js +0 -44
  926. package/dist/rsc/blocks/textarea/textarea.d.ts +0 -2
  927. package/dist/rsc/blocks/textarea/textarea.js +0 -6
  928. package/dist/rsc/blocks/util.d.ts +0 -1
  929. package/dist/rsc/blocks/util.js +0 -6
  930. package/dist/rsc/blocks/video/component-info.d.ts +0 -80
  931. package/dist/rsc/blocks/video/component-info.js +0 -103
  932. package/dist/rsc/blocks/video/video.d.ts +0 -2
  933. package/dist/rsc/blocks/video/video.js +0 -52
  934. package/dist/rsc/components/render-block/block-styles.d.ts +0 -2
  935. package/dist/rsc/components/render-block/block-styles.js +0 -66
  936. package/dist/rsc/components/render-block/render-block.d.ts +0 -2
  937. package/dist/rsc/components/render-block/render-block.helpers.d.ts +0 -10
  938. package/dist/rsc/components/render-block/render-block.helpers.js +0 -119
  939. package/dist/rsc/components/render-block/render-block.js +0 -135
  940. package/dist/rsc/components/render-block/render-component-with-context.js +0 -27
  941. package/dist/rsc/components/render-block/render-component.d.ts +0 -2
  942. package/dist/rsc/components/render-block/render-component.js +0 -12
  943. package/dist/rsc/components/render-block/render-repeated-block.d.ts +0 -2
  944. package/dist/rsc/components/render-block/render-repeated-block.js +0 -17
  945. package/dist/rsc/components/render-block/types.d.ts +0 -0
  946. package/dist/rsc/components/render-block/types.js +0 -1
  947. package/dist/rsc/components/render-blocks.d.ts +0 -2
  948. package/dist/rsc/components/render-blocks.js +0 -48
  949. package/dist/rsc/components/render-content/builder-editing.d.ts +0 -27
  950. package/dist/rsc/components/render-content/builder-editing.js +0 -48
  951. package/dist/rsc/components/render-content/components/render-styles.d.ts +0 -2
  952. package/dist/rsc/components/render-content/components/render-styles.helpers.d.ts +0 -7
  953. package/dist/rsc/components/render-content/components/render-styles.helpers.js +0 -51
  954. package/dist/rsc/components/render-content/components/render-styles.js +0 -33
  955. package/dist/rsc/components/render-content/index.d.ts +0 -2
  956. package/dist/rsc/components/render-content/index.js +0 -2
  957. package/dist/rsc/components/render-content/render-content.d.ts +0 -2
  958. package/dist/rsc/components/render-content/render-content.helpers.d.ts +0 -9
  959. package/dist/rsc/components/render-content/render-content.helpers.js +0 -38
  960. package/dist/rsc/components/render-content/render-content.js +0 -205
  961. package/dist/rsc/components/render-content/render-content.types.d.ts +0 -0
  962. package/dist/rsc/components/render-content/render-content.types.js +0 -1
  963. package/dist/rsc/components/render-content-variants/helpers.js +0 -99
  964. package/dist/rsc/components/render-content-variants/render-content-variants.js +0 -45
  965. package/dist/rsc/components/render-inlined-styles.d.ts +0 -2
  966. package/dist/rsc/components/render-inlined-styles.js +0 -19
  967. package/dist/rsc/constants/builder-registered-components.d.ts +0 -1
  968. package/dist/rsc/constants/builder-registered-components.js +0 -52
  969. package/dist/rsc/constants/device-sizes.d.ts +0 -21
  970. package/dist/rsc/constants/device-sizes.js +0 -45
  971. package/dist/rsc/constants/target.d.ts +0 -1
  972. package/dist/rsc/constants/target.js +0 -2
  973. package/dist/rsc/context/builder.context.d.ts +0 -11
  974. package/dist/rsc/context/builder.context.js +0 -12
  975. package/dist/rsc/context/types.d.ts +0 -0
  976. package/dist/rsc/context/types.js +0 -1
  977. package/dist/rsc/functions/camel-to-kebab-case.d.ts +0 -1
  978. package/dist/rsc/functions/camel-to-kebab-case.js +0 -2
  979. package/dist/rsc/functions/evaluate.d.ts +0 -1
  980. package/dist/rsc/functions/evaluate.js +0 -4
  981. package/dist/rsc/functions/event-handler-name.d.ts +0 -1
  982. package/dist/rsc/functions/event-handler-name.js +0 -5
  983. package/dist/rsc/functions/extract-text-styles.d.ts +0 -1
  984. package/dist/rsc/functions/extract-text-styles.js +0 -20
  985. package/dist/rsc/functions/fast-clone.d.ts +0 -1
  986. package/dist/rsc/functions/fast-clone.js +0 -2
  987. package/dist/rsc/functions/get-block-actions-handler.d.ts +0 -1
  988. package/dist/rsc/functions/get-block-actions-handler.js +0 -9
  989. package/dist/rsc/functions/get-block-actions.d.ts +0 -1
  990. package/dist/rsc/functions/get-block-actions.js +0 -16
  991. package/dist/rsc/functions/get-block-component-options.d.ts +0 -1
  992. package/dist/rsc/functions/get-block-component-options.js +0 -26
  993. package/dist/rsc/functions/get-block-properties.d.ts +0 -1
  994. package/dist/rsc/functions/get-block-properties.js +0 -51
  995. package/dist/rsc/functions/get-block-tag.js +0 -4
  996. package/dist/rsc/functions/get-builder-search-params/fn.test.js +0 -13
  997. package/dist/rsc/functions/get-builder-search-params/index.d.ts +0 -4
  998. package/dist/rsc/functions/get-builder-search-params/index.js +0 -33
  999. package/dist/rsc/functions/get-content/ab-testing.d.ts +0 -1
  1000. package/dist/rsc/functions/get-content/ab-testing.js +0 -86
  1001. package/dist/rsc/functions/get-content/generate-content-url.d.ts +0 -1
  1002. package/dist/rsc/functions/get-content/generate-content-url.js +0 -45
  1003. package/dist/rsc/functions/get-content/generate-content-url.test.js +0 -82
  1004. package/dist/rsc/functions/get-content/index.d.ts +0 -2
  1005. package/dist/rsc/functions/get-content/index.js +0 -84
  1006. package/dist/rsc/functions/get-content/types.d.ts +0 -0
  1007. package/dist/rsc/functions/get-content/types.js +0 -1
  1008. package/dist/rsc/functions/get-fetch.d.ts +0 -1
  1009. package/dist/rsc/functions/get-fetch.js +0 -12
  1010. package/dist/rsc/functions/get-global-this.d.ts +0 -1
  1011. package/dist/rsc/functions/get-global-this.js +0 -16
  1012. package/dist/rsc/functions/get-processed-block.d.ts +0 -6
  1013. package/dist/rsc/functions/get-processed-block.js +0 -49
  1014. package/dist/rsc/functions/get-processed-block.test.js +0 -32
  1015. package/dist/rsc/functions/get-react-native-block-styles.d.ts +0 -5
  1016. package/dist/rsc/functions/get-react-native-block-styles.js +0 -27
  1017. package/dist/rsc/functions/if-target.d.ts +0 -5
  1018. package/dist/rsc/functions/if-target.js +0 -10
  1019. package/dist/rsc/functions/is-browser.d.ts +0 -1
  1020. package/dist/rsc/functions/is-browser.js +0 -4
  1021. package/dist/rsc/functions/is-editing.d.ts +0 -1
  1022. package/dist/rsc/functions/is-editing.js +0 -6
  1023. package/dist/rsc/functions/is-iframe.d.ts +0 -1
  1024. package/dist/rsc/functions/is-iframe.js +0 -5
  1025. package/dist/rsc/functions/is-previewing.d.ts +0 -1
  1026. package/dist/rsc/functions/is-previewing.js +0 -12
  1027. package/dist/rsc/functions/on-change.d.ts +0 -2
  1028. package/dist/rsc/functions/on-change.js +0 -24
  1029. package/dist/rsc/functions/on-change.test.js +0 -19
  1030. package/dist/rsc/functions/register-component.d.ts +0 -6
  1031. package/dist/rsc/functions/register-component.js +0 -60
  1032. package/dist/rsc/functions/register.d.ts +0 -1
  1033. package/dist/rsc/functions/register.js +0 -28
  1034. package/dist/rsc/functions/sanitize-react-native-block-styles.d.ts +0 -1
  1035. package/dist/rsc/functions/sanitize-react-native-block-styles.js +0 -68
  1036. package/dist/rsc/functions/set-editor-settings.d.ts +0 -1
  1037. package/dist/rsc/functions/set-editor-settings.js +0 -13
  1038. package/dist/rsc/functions/set.d.ts +0 -1
  1039. package/dist/rsc/functions/set.js +0 -9
  1040. package/dist/rsc/functions/set.test.js +0 -16
  1041. package/dist/rsc/functions/track/helpers.d.ts +0 -5
  1042. package/dist/rsc/functions/track/helpers.js +0 -50
  1043. package/dist/rsc/functions/track/index.d.ts +0 -2
  1044. package/dist/rsc/functions/track/index.js +0 -121
  1045. package/dist/rsc/functions/track/interaction.d.ts +0 -14
  1046. package/dist/rsc/functions/track/interaction.js +0 -48
  1047. package/dist/rsc/functions/track.js +0 -116
  1048. package/dist/rsc/functions/transform-block-properties.d.ts +0 -1
  1049. package/dist/rsc/functions/transform-block-properties.js +0 -4
  1050. package/dist/rsc/functions/transform-block.d.ts +0 -1
  1051. package/dist/rsc/functions/transform-block.js +0 -4
  1052. package/dist/rsc/helpers/ab-tests.d.ts +0 -9
  1053. package/dist/rsc/helpers/ab-tests.js +0 -6
  1054. package/dist/rsc/helpers/cookie.d.ts +0 -2
  1055. package/dist/rsc/helpers/cookie.js +0 -70
  1056. package/dist/rsc/helpers/css.d.ts +0 -7
  1057. package/dist/rsc/helpers/css.js +0 -28
  1058. package/dist/rsc/helpers/flatten.d.ts +0 -1
  1059. package/dist/rsc/helpers/flatten.js +0 -32
  1060. package/dist/rsc/helpers/localStorage.d.ts +0 -9
  1061. package/dist/rsc/helpers/localStorage.js +0 -27
  1062. package/dist/rsc/helpers/logger.d.ts +0 -5
  1063. package/dist/rsc/helpers/logger.js +0 -7
  1064. package/dist/rsc/helpers/nullable.d.ts +0 -1
  1065. package/dist/rsc/helpers/nullable.js +0 -2
  1066. package/dist/rsc/helpers/sessionId.d.ts +0 -6
  1067. package/dist/rsc/helpers/sessionId.js +0 -46
  1068. package/dist/rsc/helpers/time.d.ts +0 -1
  1069. package/dist/rsc/helpers/time.js +0 -3
  1070. package/dist/rsc/helpers/url.d.ts +0 -1
  1071. package/dist/rsc/helpers/url.js +0 -11
  1072. package/dist/rsc/helpers/url.test.js +0 -21
  1073. package/dist/rsc/helpers/uuid.d.ts +0 -2
  1074. package/dist/rsc/helpers/uuid.js +0 -10
  1075. package/dist/rsc/helpers/visitorId.d.ts +0 -8
  1076. package/dist/rsc/helpers/visitorId.js +0 -28
  1077. package/dist/rsc/index-helpers/blocks-exports.d.ts +0 -11
  1078. package/dist/rsc/index-helpers/blocks-exports.js +0 -11
  1079. package/dist/rsc/index-helpers/top-of-file.d.ts +0 -2
  1080. package/dist/rsc/index-helpers/top-of-file.js +0 -2
  1081. package/dist/rsc/index.d.ts +0 -11
  1082. package/dist/rsc/index.js +0 -11
  1083. package/dist/rsc/scripts/init-editing.d.ts +0 -2
  1084. package/dist/rsc/scripts/init-editing.js +0 -93
  1085. package/dist/rsc/types/api-version.d.ts +0 -1
  1086. package/dist/rsc/types/api-version.js +0 -2
  1087. package/dist/rsc/types/builder-block.d.ts +0 -0
  1088. package/dist/rsc/types/builder-block.js +0 -1
  1089. package/dist/rsc/types/builder-content.d.ts +0 -0
  1090. package/dist/rsc/types/builder-content.js +0 -1
  1091. package/dist/rsc/types/can-track.d.ts +0 -0
  1092. package/dist/rsc/types/can-track.js +0 -1
  1093. package/dist/rsc/types/components.d.ts +0 -0
  1094. package/dist/rsc/types/components.js +0 -1
  1095. package/dist/rsc/types/deep-partial.d.ts +0 -0
  1096. package/dist/rsc/types/deep-partial.js +0 -1
  1097. package/dist/rsc/types/element.d.ts +0 -0
  1098. package/dist/rsc/types/element.js +0 -1
  1099. package/dist/rsc/types/input.d.ts +0 -0
  1100. package/dist/rsc/types/input.js +0 -1
  1101. package/dist/rsc/types/targets.d.ts +0 -0
  1102. package/dist/rsc/types/targets.js +0 -1
  1103. package/dist/rsc/types/typescript.d.ts +0 -0
  1104. package/dist/rsc/types/typescript.js +0 -1
  1105. package/packages/react/src/blocks/BaseText.jsx +0 -12
  1106. package/packages/react/src/blocks/button/button.jsx +0 -36
  1107. package/packages/react/src/blocks/button/component-info.js +0 -40
  1108. package/packages/react/src/blocks/columns/columns.jsx +0 -181
  1109. package/packages/react/src/blocks/columns/component-info.js +0 -241
  1110. package/packages/react/src/blocks/custom-code/component-info.js +0 -30
  1111. package/packages/react/src/blocks/custom-code/custom-code.jsx +0 -67
  1112. package/packages/react/src/blocks/embed/component-info.js +0 -43
  1113. package/packages/react/src/blocks/embed/embed.jsx +0 -52
  1114. package/packages/react/src/blocks/embed/helpers.js +0 -9
  1115. package/packages/react/src/blocks/form/component-info.js +0 -261
  1116. package/packages/react/src/blocks/form/form.jsx +0 -255
  1117. package/packages/react/src/blocks/fragment/component-info.js +0 -10
  1118. package/packages/react/src/blocks/fragment/fragment.jsx +0 -8
  1119. package/packages/react/src/blocks/image/component-info.js +0 -150
  1120. package/packages/react/src/blocks/image/image.helpers.js +0 -48
  1121. package/packages/react/src/blocks/image/image.jsx +0 -121
  1122. package/packages/react/src/blocks/img/component-info.js +0 -19
  1123. package/packages/react/src/blocks/img/img.jsx +0 -20
  1124. package/packages/react/src/blocks/input/component-info.js +0 -73
  1125. package/packages/react/src/blocks/input/input.jsx +0 -22
  1126. package/packages/react/src/blocks/raw-text/component-info.js +0 -15
  1127. package/packages/react/src/blocks/raw-text/raw-text.jsx +0 -13
  1128. package/packages/react/src/blocks/section/component-info.js +0 -48
  1129. package/packages/react/src/blocks/section/section.jsx +0 -26
  1130. package/packages/react/src/blocks/select/component-info.js +0 -58
  1131. package/packages/react/src/blocks/select/select.jsx +0 -23
  1132. package/packages/react/src/blocks/submit-button/component-info.js +0 -27
  1133. package/packages/react/src/blocks/submit-button/submit-button.jsx +0 -12
  1134. package/packages/react/src/blocks/symbol/component-info.js +0 -42
  1135. package/packages/react/src/blocks/symbol/symbol.jsx +0 -98
  1136. package/packages/react/src/blocks/text/component-info.js +0 -23
  1137. package/packages/react/src/blocks/text/text.jsx +0 -16
  1138. package/packages/react/src/blocks/textarea/component-info.js +0 -46
  1139. package/packages/react/src/blocks/textarea/textarea.jsx +0 -16
  1140. package/packages/react/src/blocks/util.js +0 -8
  1141. package/packages/react/src/blocks/video/component-info.js +0 -105
  1142. package/packages/react/src/blocks/video/video.jsx +0 -61
  1143. package/packages/react/src/components/render-block/block-styles.jsx +0 -87
  1144. package/packages/react/src/components/render-block/render-block.helpers.js +0 -129
  1145. package/packages/react/src/components/render-block/render-block.jsx +0 -204
  1146. package/packages/react/src/components/render-block/render-component.jsx +0 -36
  1147. package/packages/react/src/components/render-block/render-repeated-block.jsx +0 -25
  1148. package/packages/react/src/components/render-block/types.js +0 -0
  1149. package/packages/react/src/components/render-blocks.jsx +0 -92
  1150. package/packages/react/src/components/render-content/builder-editing.jsx +0 -8
  1151. package/packages/react/src/components/render-content/components/render-styles.helpers.js +0 -57
  1152. package/packages/react/src/components/render-content/components/render-styles.jsx +0 -37
  1153. package/packages/react/src/components/render-content/index.js +0 -4
  1154. package/packages/react/src/components/render-content/render-content.helpers.js +0 -48
  1155. package/packages/react/src/components/render-content/render-content.jsx +0 -389
  1156. package/packages/react/src/components/render-content/render-content.types.js +0 -0
  1157. package/packages/react/src/components/render-inlined-styles.jsx +0 -31
  1158. package/packages/react/src/constants/builder-registered-components.js +0 -54
  1159. package/packages/react/src/constants/device-sizes.js +0 -48
  1160. package/packages/react/src/constants/target.js +0 -4
  1161. package/packages/react/src/context/builder.context.js +0 -15
  1162. package/packages/react/src/context/types.js +0 -0
  1163. package/packages/react/src/functions/camel-to-kebab-case.js +0 -4
  1164. package/packages/react/src/functions/evaluate.js +0 -29
  1165. package/packages/react/src/functions/event-handler-name.js +0 -7
  1166. package/packages/react/src/functions/extract-text-styles.js +0 -22
  1167. package/packages/react/src/functions/fast-clone.js +0 -4
  1168. package/packages/react/src/functions/get-block-actions-handler.js +0 -11
  1169. package/packages/react/src/functions/get-block-actions.js +0 -18
  1170. package/packages/react/src/functions/get-block-component-options.js +0 -28
  1171. package/packages/react/src/functions/get-block-properties.js +0 -53
  1172. package/packages/react/src/functions/get-builder-search-params/fn.test.js +0 -13
  1173. package/packages/react/src/functions/get-builder-search-params/index.js +0 -38
  1174. package/packages/react/src/functions/get-content/ab-testing.js +0 -99
  1175. package/packages/react/src/functions/get-content/generate-content-url.js +0 -60
  1176. package/packages/react/src/functions/get-content/generate-content-url.test.js +0 -82
  1177. package/packages/react/src/functions/get-content/index.js +0 -83
  1178. package/packages/react/src/functions/get-content/types.js +0 -0
  1179. package/packages/react/src/functions/get-fetch.js +0 -14
  1180. package/packages/react/src/functions/get-global-this.js +0 -18
  1181. package/packages/react/src/functions/get-processed-block.js +0 -59
  1182. package/packages/react/src/functions/get-processed-block.test.js +0 -32
  1183. package/packages/react/src/functions/get-react-native-block-styles.js +0 -33
  1184. package/packages/react/src/functions/if-target.js +0 -15
  1185. package/packages/react/src/functions/is-browser.js +0 -6
  1186. package/packages/react/src/functions/is-editing.js +0 -8
  1187. package/packages/react/src/functions/is-iframe.js +0 -7
  1188. package/packages/react/src/functions/is-previewing.js +0 -14
  1189. package/packages/react/src/functions/on-change.js +0 -27
  1190. package/packages/react/src/functions/on-change.test.js +0 -19
  1191. package/packages/react/src/functions/register-component.js +0 -68
  1192. package/packages/react/src/functions/register.js +0 -29
  1193. package/packages/react/src/functions/sanitize-react-native-block-styles.js +0 -66
  1194. package/packages/react/src/functions/set-editor-settings.js +0 -15
  1195. package/packages/react/src/functions/set.js +0 -11
  1196. package/packages/react/src/functions/set.test.js +0 -16
  1197. package/packages/react/src/functions/track/helpers.js +0 -50
  1198. package/packages/react/src/functions/track/index.js +0 -129
  1199. package/packages/react/src/functions/track/interaction.js +0 -53
  1200. package/packages/react/src/functions/transform-block-properties.js +0 -6
  1201. package/packages/react/src/functions/transform-block.js +0 -6
  1202. package/packages/react/src/helpers/ab-tests.js +0 -16
  1203. package/packages/react/src/helpers/cookie.js +0 -81
  1204. package/packages/react/src/helpers/css.js +0 -34
  1205. package/packages/react/src/helpers/flatten.js +0 -34
  1206. package/packages/react/src/helpers/localStorage.js +0 -35
  1207. package/packages/react/src/helpers/logger.js +0 -9
  1208. package/packages/react/src/helpers/nullable.js +0 -4
  1209. package/packages/react/src/helpers/sessionId.js +0 -52
  1210. package/packages/react/src/helpers/time.js +0 -5
  1211. package/packages/react/src/helpers/url.js +0 -13
  1212. package/packages/react/src/helpers/url.test.js +0 -21
  1213. package/packages/react/src/helpers/uuid.js +0 -13
  1214. package/packages/react/src/helpers/visitorId.js +0 -34
  1215. package/packages/react/src/index-helpers/blocks-exports.js +0 -22
  1216. package/packages/react/src/index-helpers/top-of-file.js +0 -4
  1217. package/packages/react/src/index.js +0 -13
  1218. package/packages/react/src/scripts/init-editing.js +0 -93
  1219. package/packages/react/src/types/api-version.js +0 -4
  1220. package/packages/react/src/types/builder-block.js +0 -0
  1221. package/packages/react/src/types/builder-content.js +0 -0
  1222. package/packages/react/src/types/can-track.js +0 -0
  1223. package/packages/react/src/types/components.js +0 -0
  1224. package/packages/react/src/types/deep-partial.js +0 -0
  1225. package/packages/react/src/types/element.js +0 -0
  1226. package/packages/react/src/types/input.js +0 -0
  1227. package/packages/react/src/types/targets.js +0 -0
  1228. package/packages/react/src/types/typescript.js +0 -0
  1229. package/tsconfig.base.json +0 -23
  1230. package/tsconfig.react-cjs.json +0 -10
  1231. package/tsconfig.react-esm.json +0 -10
  1232. package/tsconfig.rsc.json +0 -7
  1233. /package/dist/{react/esm → sdk}/blocks/custom-code/custom-code.js +0 -0
  1234. /package/dist/{react/esm → sdk}/blocks/embed/embed.js +0 -0
  1235. /package/dist/{react/esm → sdk}/blocks/fragment/fragment.js +0 -0
  1236. /package/dist/{react/esm → sdk}/blocks/img/img.js +0 -0
  1237. /package/dist/{react/esm → sdk}/blocks/input/input.js +0 -0
  1238. /package/dist/{react/esm → sdk}/blocks/raw-text/raw-text.js +0 -0
  1239. /package/dist/{react/esm → sdk}/blocks/section/section.js +0 -0
  1240. /package/dist/{react/esm → sdk}/blocks/select/select.js +0 -0
  1241. /package/dist/{react/esm → sdk}/blocks/submit-button/submit-button.js +0 -0
  1242. /package/dist/{react/esm → sdk}/blocks/text/text.js +0 -0
  1243. /package/dist/{react/esm → sdk}/blocks/textarea/textarea.js +0 -0
  1244. /package/dist/{react/esm → sdk}/components/render-block/block-styles.js +0 -0
  1245. /package/dist/{react/esm → sdk}/components/render-block/render-component.js +0 -0
  1246. /package/dist/{react/cjs/functions/get-builder-search-params/fn.test.d.ts → sdk/components/render-block/types.js} +0 -0
  1247. /package/dist/{react/esm → sdk}/components/render-content/builder-editing.js +0 -0
  1248. /package/dist/{react/cjs/functions/get-content/generate-content-url.test.d.ts → sdk/components/render-content/render-content.types.js} +0 -0
  1249. /package/dist/{react/cjs/functions/get-processed-block.test.d.ts → sdk/context/types.js} +0 -0
  1250. /package/dist/{react/esm → sdk}/functions/get-builder-search-params/fn.test.d.ts +0 -0
  1251. /package/dist/{react/esm → sdk}/functions/get-content/generate-content-url.test.d.ts +0 -0
  1252. /package/dist/{react/cjs/functions/on-change.test.d.ts → sdk/functions/get-content/types.js} +0 -0
  1253. /package/dist/{react/esm → sdk}/functions/get-processed-block.test.d.ts +0 -0
  1254. /package/dist/{react/esm → sdk}/functions/on-change.test.d.ts +0 -0
  1255. /package/dist/{react/cjs → sdk}/functions/set.test.d.ts +0 -0
  1256. /package/dist/{react/cjs → sdk}/helpers/url.test.d.ts +0 -0
  1257. /package/dist/{react/esm/functions/set.test.d.ts → sdk/types/builder-block.js} +0 -0
  1258. /package/dist/{react/esm/helpers/url.test.d.ts → sdk/types/builder-content.js} +0 -0
  1259. /package/dist/{rsc/functions/get-builder-search-params/fn.test.d.ts → sdk/types/can-track.js} +0 -0
  1260. /package/dist/{rsc/functions/get-content/generate-content-url.test.d.ts → sdk/types/components.js} +0 -0
  1261. /package/dist/{rsc/functions/get-processed-block.test.d.ts → sdk/types/deep-partial.js} +0 -0
  1262. /package/dist/{rsc/functions/on-change.test.d.ts → sdk/types/element.js} +0 -0
  1263. /package/dist/{rsc/functions/set.test.d.ts → sdk/types/input.js} +0 -0
  1264. /package/dist/{rsc/helpers/url.test.d.ts → sdk/types/targets.js} +0 -0
@@ -0,0 +1,39 @@
1
+ const TEXT_STYLE_KEYS = [
2
+ 'color',
3
+ 'whiteSpace',
4
+ 'direction',
5
+ 'hyphens',
6
+ 'overflowWrap',
7
+ ];
8
+
9
+ /**
10
+ * Check if the key represent a CSS style property that applies to text
11
+ * See MDN docs for refrence of what properties apply to text.
12
+ * https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Fundamentals#summary
13
+ */
14
+ const isTextStyle = (key: string) => {
15
+ return (
16
+ TEXT_STYLE_KEYS.includes(key) ||
17
+ key.startsWith('font') ||
18
+ key.startsWith('text') ||
19
+ key.startsWith('letter') ||
20
+ key.startsWith('line') ||
21
+ key.startsWith('word') ||
22
+ key.startsWith('writing')
23
+ );
24
+ };
25
+
26
+ /**
27
+ * Extract styles that apply to text from a style object.
28
+ */
29
+ export const extractTextStyles = (styles: Partial<CSSStyleDeclaration>) => {
30
+ const textStyles: Partial<CSSStyleDeclaration> = {};
31
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ Object.entries(styles).forEach(([key, value]: [any, any]) => {
33
+ if (isTextStyle(key)) {
34
+ textStyles[key] = value;
35
+ }
36
+ });
37
+
38
+ return textStyles;
39
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * We need to serialize values to a string in case there are Proxy values, as is the case with SolidJS etc.
3
+ */
4
+ export const fastClone = <T extends object>(obj: T): T =>
5
+ JSON.parse(JSON.stringify(obj));
@@ -0,0 +1,20 @@
1
+ import type { BuilderContextInterface } from '../context/types.js';
2
+ import type { BuilderBlock } from '../types/builder-block.js';
3
+ import { evaluate } from './evaluate.js';
4
+
5
+ type Options = {
6
+ block: BuilderBlock;
7
+ } & Pick<BuilderContextInterface, 'state' | 'context'>;
8
+
9
+ type EventHandler = (event: Event) => any;
10
+
11
+ export const createEventHandler =
12
+ (value: string, options: Options): EventHandler =>
13
+ (event) =>
14
+ evaluate({
15
+ code: value,
16
+ context: options.context,
17
+ state: options.state,
18
+ event,
19
+ isExpression: false,
20
+ });
@@ -0,0 +1,25 @@
1
+ import type { BuilderContextInterface } from '../context/types.js';
2
+ import type { BuilderBlock } from '../types/builder-block.js';
3
+ import { getEventHandlerName } from './event-handler-name.js';
4
+ import { createEventHandler } from './get-block-actions-handler.js';
5
+
6
+ type Actions = { [index: string]: (event: Event) => any };
7
+
8
+ export function getBlockActions(
9
+ options: {
10
+ block: BuilderBlock;
11
+ } & Pick<BuilderContextInterface, 'state' | 'context'>
12
+ ): Actions {
13
+ const obj: Actions = {};
14
+ const optionActions = options.block.actions ?? {};
15
+
16
+ for (const key in optionActions) {
17
+ // eslint-disable-next-line no-prototype-builtins
18
+ if (!optionActions.hasOwnProperty(key)) {
19
+ continue;
20
+ }
21
+ const value = optionActions[key];
22
+ obj[getEventHandlerName(key)] = createEventHandler(value, options);
23
+ }
24
+ return obj;
25
+ }
@@ -0,0 +1,12 @@
1
+ import type { BuilderBlock } from '../types/builder-block.js';
2
+
3
+ export function getBlockComponentOptions(block: BuilderBlock) {
4
+ return {
5
+ ...block.component?.options,
6
+ ...(block as any).options,
7
+ /**
8
+ * Our built-in components frequently make use of the block, so we provide all of it under `builderBlock`
9
+ */
10
+ builderBlock: block,
11
+ };
12
+ }
@@ -0,0 +1,75 @@
1
+ import { TARGET } from '../constants/target.js';
2
+ import { convertStyleMapToCSSArray } from '../helpers/css.js';
3
+ import type { BuilderBlock } from '../types/builder-block.js';
4
+ import { transformBlockProperties } from './transform-block-properties.js';
5
+
6
+ const extractRelevantRootBlockProperties = (block: BuilderBlock) => {
7
+ // currently we are only spreading the `href` property
8
+ // TO-DO: potentially spread all properties from block, but only if they are not already defined by BuilderBlock
9
+
10
+ // const {
11
+ // '@type': _type,
12
+ // '@version': _version,
13
+ // id: _id,
14
+ // tagName: _tagName,
15
+ // layerName: _layerName,
16
+ // groupLocked: _groupLocked,
17
+ // layerLocked: _layerLocked,
18
+ // class: _class,
19
+ // children: _children,
20
+ // responsiveStyles: _responsiveStyles,
21
+ // component: _component,
22
+ // bindings: _bindings,
23
+ // meta: _meta,
24
+ // actions: _actions,
25
+ // properties: _properties,
26
+ // code: _code,
27
+ // repeat: _repeat,
28
+ // animations: _animations,
29
+ // style: _style,
30
+ // hide: _hide,
31
+ // show: _show,
32
+ // // anything set by dynamic bindings outside of predefined `BuilderBlock` properties
33
+ // ...remainingBlockProperties
34
+ // } = block;
35
+
36
+ return { href: (block as any).href };
37
+ };
38
+
39
+ export function getBlockProperties(block: BuilderBlock) {
40
+ const properties = {
41
+ ...extractRelevantRootBlockProperties(block),
42
+ ...block.properties,
43
+ 'builder-id': block.id,
44
+ style: getStyleAttribute(block.style),
45
+ class: [block.id, 'builder-block', block.class, block.properties?.class]
46
+ .filter(Boolean)
47
+ .join(' '),
48
+ };
49
+
50
+ return transformBlockProperties(properties);
51
+ }
52
+ /**
53
+ * Svelte does not support style attribute as an object so we need to flatten it.
54
+ *
55
+ * Additionally, Svelte, Vue and other frameworks use kebab-case styles, so we need to convert them.
56
+ */
57
+ function getStyleAttribute(
58
+ style: Partial<CSSStyleDeclaration> | undefined
59
+ ): string | Partial<CSSStyleDeclaration> | undefined {
60
+ if (!style) {
61
+ return undefined;
62
+ }
63
+
64
+ switch (TARGET) {
65
+ case 'svelte':
66
+ case 'vue2':
67
+ case 'vue3':
68
+ case 'solid':
69
+ return convertStyleMapToCSSArray(style).join(' ');
70
+ case 'qwik':
71
+ case 'reactNative':
72
+ case 'react':
73
+ return style;
74
+ }
75
+ }
@@ -0,0 +1,19 @@
1
+ import { convertSearchParamsToQueryObject, getBuilderSearchParams } from '.';
2
+
3
+ const querystring =
4
+ 'someotherValue=jklsjfdal&abc=klfdjklgfds&builder.cachebust=true&builder.preview=page&builder.noCache=true&__builder_editing__=true&builder.overrides.page=037948e52eaf4743afed464f02c70da4&builder.overrides.037948e52eaf4743afed464f02c70da4=037948e52eaf4743afed464f02c70da4&builder.overrides.page%3A%2F=037948e52eaf4743afed464f02c70da4&preview_theme_id=128854393017';
5
+
6
+ const url = new URL(`localhost:3000/about-us?${querystring}`);
7
+
8
+ describe('Get Builder SearchParams', () => {
9
+ test('correctly converts URLSearchParams to object', () => {
10
+ const output = convertSearchParamsToQueryObject(url.searchParams);
11
+ expect(output).toMatchSnapshot();
12
+ });
13
+ test('correctly extracts all builder params from a query object', () => {
14
+ const output = getBuilderSearchParams(
15
+ convertSearchParamsToQueryObject(url.searchParams)
16
+ );
17
+ expect(output).toMatchSnapshot();
18
+ });
19
+ });
@@ -0,0 +1,50 @@
1
+ import { isBrowser } from '../is-browser.js';
2
+
3
+ const BUILDER_SEARCHPARAMS_PREFIX = 'builder.';
4
+ const BUILDER_OPTIONS_PREFIX = 'options.';
5
+ type QueryObject = Record<string, string | string[]>;
6
+
7
+ export const convertSearchParamsToQueryObject = (
8
+ searchParams: URLSearchParams
9
+ ): QueryObject => {
10
+ const options: Record<string, string> = {};
11
+ searchParams.forEach((value, key) => {
12
+ options[key] = value;
13
+ });
14
+ return options;
15
+ };
16
+
17
+ export const getBuilderSearchParams = (
18
+ _options: QueryObject | URLSearchParams | undefined
19
+ ) => {
20
+ if (!_options) {
21
+ return {};
22
+ }
23
+ const options = normalizeSearchParams(_options);
24
+
25
+ const newOptions: QueryObject = {};
26
+ Object.keys(options).forEach((key) => {
27
+ if (key.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
28
+ const trimmedKey = key
29
+ .replace(BUILDER_SEARCHPARAMS_PREFIX, '')
30
+ .replace(BUILDER_OPTIONS_PREFIX, '');
31
+ newOptions[trimmedKey] = options[key];
32
+ }
33
+ });
34
+ return newOptions;
35
+ };
36
+
37
+ export const getBuilderSearchParamsFromWindow = () => {
38
+ if (!isBrowser()) {
39
+ return {};
40
+ }
41
+ const searchParams = new URLSearchParams(window.location.search);
42
+ return getBuilderSearchParams(searchParams);
43
+ };
44
+
45
+ export const normalizeSearchParams = (
46
+ searchParams: QueryObject | URLSearchParams
47
+ ): QueryObject =>
48
+ searchParams instanceof URLSearchParams
49
+ ? convertSearchParamsToQueryObject(searchParams)
50
+ : searchParams;
@@ -0,0 +1,132 @@
1
+ import type {
2
+ BuilderContent,
3
+ BuilderContentVariation,
4
+ } from '../../types/builder-content.js';
5
+ import {
6
+ getContentVariationCookie,
7
+ setContentVariationCookie,
8
+ } from '../../helpers/ab-tests.js';
9
+ import type { Overwrite } from '../../types/typescript.js';
10
+ import type { CanTrack } from '../../types/can-track.js';
11
+ import { checkIsDefined } from '../../helpers/nullable.js';
12
+
13
+ type BuilderContentWithVariations = Overwrite<
14
+ BuilderContent,
15
+ Required<Pick<BuilderContent, 'variations' | 'id'>>
16
+ >;
17
+
18
+ const checkIsBuilderContentWithVariations = (
19
+ item: BuilderContent
20
+ ): item is BuilderContentWithVariations =>
21
+ checkIsDefined(item.id) &&
22
+ checkIsDefined(item.variations) &&
23
+ Object.keys(item.variations).length > 0;
24
+
25
+ /**
26
+ * Randomly assign a variation to this user and store it in cookies/storage
27
+ */
28
+ const getRandomVariationId = ({
29
+ id,
30
+ variations,
31
+ }: BuilderContentWithVariations) => {
32
+ let n = 0;
33
+ const random = Math.random();
34
+
35
+ // loop over variations test ratios, incrementing a counter,
36
+ // until we find the variation that this user should be assigned to
37
+ for (const id in variations) {
38
+ const testRatio = variations[id]?.testRatio;
39
+ n += testRatio!;
40
+
41
+ if (random < n) {
42
+ return id;
43
+ }
44
+ }
45
+
46
+ // `item.variations` does not include the default variation
47
+ // if we arrive here, then it means that the random number fits in the default variation bucket
48
+ return id;
49
+ };
50
+
51
+ const getTestFields = ({
52
+ item,
53
+ testGroupId,
54
+ }: {
55
+ item: BuilderContentWithVariations;
56
+ testGroupId: string;
57
+ }): TestFields => {
58
+ const variationValue = item.variations[testGroupId];
59
+ if (
60
+ testGroupId === item.id ||
61
+ // handle edge-case where `testGroupId` points to non-existing variation
62
+ !variationValue
63
+ ) {
64
+ return {
65
+ testVariationId: item.id,
66
+ testVariationName: 'Default',
67
+ };
68
+ } else {
69
+ return {
70
+ data: variationValue.data,
71
+ testVariationId: variationValue.id,
72
+ testVariationName:
73
+ variationValue.name || (variationValue.id === item.id ? 'Default' : ''),
74
+ };
75
+ }
76
+ };
77
+
78
+ type TestFields = {
79
+ data?: BuilderContentVariation['data'];
80
+ testVariationId?: string;
81
+ testVariationName: string;
82
+ };
83
+
84
+ const getContentVariation = async ({
85
+ item,
86
+ canTrack,
87
+ }: {
88
+ item: BuilderContentWithVariations;
89
+ } & CanTrack): Promise<TestFields> => {
90
+ // try to find test variation in cookies/storage
91
+ const testGroupId = await getContentVariationCookie({
92
+ canTrack,
93
+ contentId: item.id,
94
+ });
95
+
96
+ const testFields = testGroupId
97
+ ? getTestFields({ item, testGroupId })
98
+ : undefined;
99
+
100
+ if (testFields) {
101
+ return testFields;
102
+ } else {
103
+ // if variation not found in storage, assign a random variation to this user
104
+ const randomVariationId = getRandomVariationId({
105
+ variations: item.variations,
106
+ id: item.id,
107
+ });
108
+
109
+ // store variation in cookies/storage
110
+ setContentVariationCookie({
111
+ contentId: item.id,
112
+ value: randomVariationId,
113
+ canTrack,
114
+ }).catch((err) => {
115
+ console.error('could not store A/B test variation: ', err);
116
+ });
117
+
118
+ return getTestFields({ item, testGroupId: randomVariationId });
119
+ }
120
+ };
121
+
122
+ export const handleABTesting = async ({
123
+ item,
124
+ canTrack,
125
+ }: { item: BuilderContent } & CanTrack) => {
126
+ if (!checkIsBuilderContentWithVariations(item)) {
127
+ return;
128
+ }
129
+
130
+ const variationValue = await getContentVariation({ item, canTrack });
131
+ Object.assign(item, variationValue);
132
+ };
@@ -0,0 +1,95 @@
1
+ import { generateContentUrl } from './generate-content-url';
2
+ import type { GetContentOptions } from './types';
3
+
4
+ const testKey = 'YJIGb4i01jvw0SRdL5Bt';
5
+ const testModel = 'page';
6
+ const testId = 'c1b81bab59704599b997574eb0736def';
7
+
8
+ const options = {
9
+ cachebust: 'true',
10
+ noCache: 'true',
11
+ 'overrides.037948e52eaf4743afed464f02c70da4':
12
+ '037948e52eaf4743afed464f02c70da4',
13
+ 'overrides.page': '037948e52eaf4743afed464f02c70da4',
14
+ 'overrides.page:/': '037948e52eaf4743afed464f02c70da4',
15
+ preview: 'page',
16
+ };
17
+
18
+ describe('Generate Content URL', () => {
19
+ test('generates the proper value for a simple query', () => {
20
+ const output = generateContentUrl({
21
+ apiKey: testKey,
22
+ model: testModel,
23
+ query: { id: testId },
24
+ });
25
+ expect(output).toMatchSnapshot();
26
+ });
27
+
28
+ test('Handles overrides correctly', () => {
29
+ const output = generateContentUrl({
30
+ apiKey: testKey,
31
+ model: testModel,
32
+ query: { id: testId },
33
+ options,
34
+ });
35
+ expect(output).toMatchSnapshot();
36
+ });
37
+
38
+ test('generate content url with apiVersion as default', () => {
39
+ const output = generateContentUrl({
40
+ apiKey: testKey,
41
+ model: testModel,
42
+ query: { id: testId },
43
+ options,
44
+ });
45
+ expect(output).toMatchSnapshot();
46
+ });
47
+
48
+ test('generate content url with apiVersion as v2', () => {
49
+ const output = generateContentUrl({
50
+ apiKey: testKey,
51
+ model: testModel,
52
+ query: { id: testId },
53
+ options,
54
+ apiVersion: 'v2',
55
+ });
56
+ expect(output).toMatchSnapshot();
57
+ });
58
+
59
+ test('generate content url with apiVersion as v3', () => {
60
+ const output = generateContentUrl({
61
+ apiKey: testKey,
62
+ model: testModel,
63
+ query: { id: testId },
64
+ options,
65
+ apiVersion: 'v3',
66
+ });
67
+ expect(output).toMatchSnapshot();
68
+ });
69
+
70
+ test('throw error when trying to generate content url with apiVersion as v1', () => {
71
+ expect(() => {
72
+ generateContentUrl({
73
+ apiKey: testKey,
74
+ model: testModel,
75
+ query: { id: testId },
76
+ options,
77
+ apiVersion: 'v1' as GetContentOptions['apiVersion'],
78
+ });
79
+ }).toThrow(`Invalid apiVersion: expected 'v2' or 'v3', received 'v1'`);
80
+ });
81
+
82
+ test('throw error when trying to generate content url with an invalid apiVersion value', () => {
83
+ expect(() => {
84
+ generateContentUrl({
85
+ apiKey: testKey,
86
+ model: testModel,
87
+ query: { id: testId },
88
+ options,
89
+ apiVersion: 'INVALID_API_VERSION' as GetContentOptions['apiVersion'],
90
+ });
91
+ }).toThrow(
92
+ `Invalid apiVersion: expected 'v2' or 'v3', received 'INVALID_API_VERSION'`
93
+ );
94
+ });
95
+ });
@@ -0,0 +1,59 @@
1
+ import { flatten } from '../../helpers/flatten.js';
2
+ import {
3
+ getBuilderSearchParamsFromWindow,
4
+ normalizeSearchParams,
5
+ } from '../get-builder-search-params/index.js';
6
+ import type { GetContentOptions } from './types.js';
7
+ import { DEFAULT_API_VERSION } from '../../types/api-version';
8
+
9
+ export const generateContentUrl = (options: GetContentOptions): URL => {
10
+ const {
11
+ limit = 30,
12
+ userAttributes,
13
+ query,
14
+ noTraverse = false,
15
+ model,
16
+ apiKey,
17
+ includeRefs = true,
18
+ locale,
19
+ apiVersion = DEFAULT_API_VERSION,
20
+ } = options;
21
+
22
+ if (!apiKey) {
23
+ throw new Error('Missing API key');
24
+ }
25
+
26
+ if (!['v2', 'v3'].includes(apiVersion)) {
27
+ throw new Error(
28
+ `Invalid apiVersion: expected 'v2' or 'v3', received '${apiVersion}'`
29
+ );
30
+ }
31
+
32
+ const url = new URL(
33
+ `https://cdn.builder.io/api/${apiVersion}/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}&includeRefs=${includeRefs}${
34
+ locale ? `&locale=${locale}` : ''
35
+ }`
36
+ );
37
+
38
+ const queryOptions = {
39
+ ...getBuilderSearchParamsFromWindow(),
40
+ ...normalizeSearchParams(options.options || {}),
41
+ };
42
+
43
+ const flattened = flatten(queryOptions);
44
+ for (const key in flattened) {
45
+ url.searchParams.set(key, String(flattened[key]));
46
+ }
47
+
48
+ if (userAttributes) {
49
+ url.searchParams.set('userAttributes', JSON.stringify(userAttributes));
50
+ }
51
+ if (query) {
52
+ const flattened = flatten({ query });
53
+ for (const key in flattened) {
54
+ url.searchParams.set(key, JSON.stringify((flattened as any)[key]));
55
+ }
56
+ }
57
+
58
+ return url;
59
+ };
@@ -0,0 +1,62 @@
1
+ import { logger } from '../../helpers/logger.js';
2
+ import type { BuilderContent } from '../../types/builder-content.js';
3
+ import { fetch } from '../get-fetch.js';
4
+ import { handleABTesting } from './ab-testing.js';
5
+ import { generateContentUrl } from './generate-content-url.js';
6
+ import type { GetContentOptions } from './types.js';
7
+
8
+ export async function getContent(
9
+ options: GetContentOptions
10
+ ): Promise<BuilderContent | null> {
11
+ const allContent = await getAllContent({ ...options, limit: 1 });
12
+ if (allContent && 'results' in allContent) {
13
+ return allContent?.results[0] || null;
14
+ }
15
+
16
+ return null;
17
+ }
18
+
19
+ type ContentResponse =
20
+ | {
21
+ results: BuilderContent[];
22
+ }
23
+ | {
24
+ status: number;
25
+ message: string;
26
+ };
27
+
28
+ export async function getAllContent(
29
+ options: GetContentOptions
30
+ ): Promise<ContentResponse | null> {
31
+ try {
32
+ const url = generateContentUrl(options);
33
+
34
+ const res = await fetch(url.href);
35
+ const content = await (res.json() as Promise<ContentResponse>);
36
+
37
+ if ('status' in content && !('results' in content)) {
38
+ logger.error('Error fetching data. ', { url, content, options });
39
+ return content;
40
+ }
41
+
42
+ const canTrack = options.canTrack !== false;
43
+ try {
44
+ if (
45
+ canTrack &&
46
+ // This makes sure we have a non-error response with the results array.
47
+ Array.isArray(content.results)
48
+ ) {
49
+ for (const item of content.results) {
50
+ await handleABTesting({ item, canTrack });
51
+ }
52
+ }
53
+ } catch (e) {
54
+ logger.error('Could not setup A/B testing. ', e);
55
+ }
56
+
57
+ return content;
58
+ } catch (error) {
59
+ logger.error('Error fetching data. ', error);
60
+ return null;
61
+ }
62
+ }
@@ -0,0 +1,53 @@
1
+ export interface GetContentOptions {
2
+ /** The model to get content for */
3
+ model: string;
4
+
5
+ /** Your public API key */
6
+ apiKey: string;
7
+
8
+ /** Number of items to fetch. Default is 1 */
9
+ limit?: number;
10
+
11
+ /** User attributes to target on, such as { urlPath: '/foo', device: 'mobile', ...etc } */
12
+ userAttributes?: (Record<string, string> & { urlPath?: string }) | null;
13
+
14
+ /** Custom query */
15
+ query?: Record<string, any>;
16
+
17
+ /**
18
+ * Any other API options.
19
+ * Accepts both a key/value object or a `URLSearchParams` instance
20
+ * */
21
+ options?: Record<string, any> | URLSearchParams;
22
+
23
+ /**
24
+ * If set to `true`, it will lazy load symbols/references.
25
+ * If set to `false`, it will render the entire content tree eagerly.
26
+ */
27
+ noTraverse?: boolean;
28
+
29
+ /**
30
+ * If set to `false`, it will not use cookies to target content. Therefore, A/B Testing will be disabled and
31
+ * only the default variation will be returned to every user.
32
+ *
33
+ * Defaults to `true`.
34
+ */
35
+ canTrack?: boolean;
36
+
37
+ /**
38
+ * Include references in the response. Defaults to `true`.
39
+ */
40
+ includeRefs?: boolean;
41
+
42
+ /**
43
+ * If provided, the API will auto-resolve localized objects to the value of this `locale` key.
44
+ */
45
+ locale?: string;
46
+
47
+ /**
48
+ * If provided, sets the Builder API version used to fetch content.
49
+ *
50
+ * Defaults to `v3`.
51
+ */
52
+ apiVersion?: 'v2' | 'v3';
53
+ }
@@ -0,0 +1,18 @@
1
+ import { getGlobalThis } from './get-global-this.js';
2
+
3
+ function getFetch(): typeof global.fetch {
4
+ const globalFetch: typeof global.fetch = getGlobalThis().fetch;
5
+
6
+ if (typeof globalFetch === 'undefined') {
7
+ console.warn(
8
+ `Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
9
+ For more information, read https://github.com/BuilderIO/this-package-uses-fetch`
10
+ );
11
+
12
+ throw new Error('Builder SDK could not find a global `fetch` function');
13
+ }
14
+
15
+ return globalFetch;
16
+ }
17
+
18
+ export const fetch = getFetch();
@@ -0,0 +1,17 @@
1
+ type Global = typeof global | typeof window | typeof self | typeof globalThis;
2
+
3
+ export function getGlobalThis(): Global {
4
+ if (typeof globalThis !== 'undefined') {
5
+ return globalThis;
6
+ }
7
+ if (typeof window !== 'undefined') {
8
+ return window;
9
+ }
10
+ if (typeof global !== 'undefined') {
11
+ return global;
12
+ }
13
+ if (typeof self !== 'undefined') {
14
+ return self;
15
+ }
16
+ return globalThis;
17
+ }