@builder.io/sdk-react 0.4.4 → 0.5.0

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 (406) hide show
  1. package/dist/{sdk/blocks → blocks}/BaseText.d.ts +0 -1
  2. package/dist/{sdk/blocks → blocks}/BaseText.js +2 -2
  3. package/dist/{sdk/blocks → blocks}/button/button.d.ts +3 -2
  4. package/dist/{sdk/blocks → blocks}/button/button.js +3 -5
  5. package/dist/blocks/button/component-info.d.ts +2 -0
  6. package/dist/{sdk/blocks → blocks}/button/component-info.js +9 -13
  7. package/dist/blocks/columns/columns.d.ts +16 -0
  8. package/dist/{sdk/blocks → blocks}/columns/columns.js +15 -21
  9. package/dist/blocks/columns/component-info.d.ts +2 -0
  10. package/dist/{sdk/blocks → blocks}/columns/component-info.js +62 -83
  11. package/dist/blocks/custom-code/component-info.d.ts +2 -0
  12. package/dist/{sdk/blocks → blocks}/custom-code/component-info.js +7 -11
  13. package/dist/{sdk/blocks → blocks}/custom-code/custom-code.d.ts +0 -1
  14. package/dist/{sdk/blocks → blocks}/custom-code/custom-code.js +1 -1
  15. package/dist/blocks/embed/component-info.d.ts +2 -0
  16. package/dist/{sdk/blocks → blocks}/embed/component-info.js +8 -15
  17. package/dist/{sdk/blocks → blocks}/embed/embed.d.ts +0 -1
  18. package/dist/{sdk/blocks → blocks}/embed/embed.js +1 -1
  19. package/dist/blocks/embed/helpers.js +2 -0
  20. package/dist/blocks/form/component-info.d.ts +2 -0
  21. package/dist/{sdk/blocks → blocks}/form/component-info.js +94 -129
  22. package/dist/blocks/form/form.d.ts +2 -0
  23. package/dist/blocks/form/form.js +6 -0
  24. package/dist/blocks/fragment/component-info.d.ts +2 -0
  25. package/dist/{sdk/blocks → blocks}/fragment/component-info.js +1 -1
  26. package/dist/{sdk/blocks → blocks}/fragment/fragment.d.ts +0 -1
  27. package/dist/{sdk/blocks → blocks}/fragment/fragment.js +1 -1
  28. package/dist/blocks/helpers.d.ts +13 -0
  29. package/dist/blocks/helpers.js +40 -0
  30. package/dist/blocks/image/component-info.d.ts +2 -0
  31. package/dist/{sdk/blocks → blocks}/image/component-info.js +33 -63
  32. package/dist/{sdk/blocks → blocks}/image/image.d.ts +0 -1
  33. package/dist/{sdk/blocks → blocks}/image/image.helpers.js +2 -11
  34. package/dist/{sdk/blocks → blocks}/image/image.js +7 -7
  35. package/dist/blocks/img/component-info.d.ts +2 -0
  36. package/dist/{sdk/blocks → blocks}/img/component-info.js +4 -6
  37. package/dist/{sdk/blocks → blocks}/img/img.d.ts +3 -2
  38. package/dist/{sdk/blocks → blocks}/img/img.js +1 -1
  39. package/dist/blocks/input/component-info.d.ts +2 -0
  40. package/dist/{sdk/blocks → blocks}/input/component-info.js +15 -40
  41. package/dist/{sdk/blocks → blocks}/input/input.d.ts +3 -2
  42. package/dist/{sdk/blocks → blocks}/input/input.js +1 -1
  43. package/dist/blocks/raw-text/component-info.d.ts +2 -0
  44. package/dist/{sdk/blocks → blocks}/raw-text/component-info.js +3 -5
  45. package/dist/{sdk/blocks → blocks}/raw-text/raw-text.d.ts +0 -1
  46. package/dist/blocks/raw-text/raw-text.js +6 -0
  47. package/dist/blocks/section/component-info.d.ts +2 -0
  48. package/dist/{sdk/blocks → blocks}/section/component-info.js +13 -18
  49. package/dist/{sdk/blocks → blocks}/section/section.d.ts +3 -2
  50. package/dist/{sdk/blocks → blocks}/section/section.js +1 -1
  51. package/dist/blocks/select/component-info.d.ts +2 -0
  52. package/dist/{sdk/blocks → blocks}/select/component-info.js +22 -34
  53. package/dist/{sdk/blocks → blocks}/select/select.d.ts +3 -2
  54. package/dist/{sdk/blocks → blocks}/select/select.js +1 -1
  55. package/dist/blocks/submit-button/component-info.d.ts +2 -0
  56. package/dist/{sdk/blocks → blocks}/submit-button/component-info.js +5 -7
  57. package/dist/{sdk/blocks → blocks}/submit-button/submit-button.d.ts +3 -2
  58. package/dist/{sdk/blocks → blocks}/submit-button/submit-button.js +1 -1
  59. package/dist/blocks/symbol/component-info.d.ts +2 -0
  60. package/dist/{sdk/blocks → blocks}/symbol/component-info.js +12 -17
  61. package/dist/blocks/symbol/symbol.d.ts +23 -0
  62. package/dist/blocks/symbol/symbol.helpers.d.ts +14 -0
  63. package/dist/blocks/symbol/symbol.helpers.js +31 -0
  64. package/dist/blocks/symbol/symbol.js +45 -0
  65. package/dist/blocks/text/component-info.d.ts +2 -0
  66. package/dist/{sdk/blocks → blocks}/text/component-info.js +6 -7
  67. package/dist/{sdk/blocks → blocks}/text/text.d.ts +1 -2
  68. package/dist/{sdk/blocks → blocks}/text/text.js +2 -2
  69. package/dist/blocks/textarea/component-info.d.ts +2 -0
  70. package/dist/{sdk/blocks → blocks}/textarea/component-info.js +13 -19
  71. package/dist/{sdk/blocks → blocks}/textarea/textarea.d.ts +3 -2
  72. package/dist/{sdk/blocks → blocks}/textarea/textarea.js +1 -1
  73. package/dist/blocks/video/component-info.d.ts +2 -0
  74. package/dist/{sdk/blocks → blocks}/video/component-info.js +35 -55
  75. package/dist/{sdk/blocks → blocks}/video/video.d.ts +1 -1
  76. package/dist/{sdk/blocks → blocks}/video/video.js +2 -2
  77. package/dist/components/block/block.d.ts +9 -0
  78. package/dist/components/block/block.helpers.d.ts +13 -0
  79. package/dist/{sdk/components/render-block/render-block.helpers.js → components/block/block.helpers.js} +12 -29
  80. package/dist/components/block/block.js +94 -0
  81. package/dist/{sdk/components/render-block → components/block/components}/block-styles.d.ts +2 -3
  82. package/dist/{sdk/components/render-block → components/block/components}/block-styles.js +23 -24
  83. package/dist/components/block/components/block-wrapper.d.ts +16 -0
  84. package/dist/components/block/components/block-wrapper.js +36 -0
  85. package/dist/components/block/components/component-ref/component-ref.d.ts +3 -0
  86. package/dist/components/block/components/component-ref/component-ref.helpers.d.ts +28 -0
  87. package/dist/components/block/components/component-ref/component-ref.helpers.js +22 -0
  88. package/dist/components/block/components/component-ref/component-ref.js +23 -0
  89. package/dist/components/block/components/interactive-element.d.ts +11 -0
  90. package/dist/components/block/components/interactive-element.js +20 -0
  91. package/dist/components/block/components/repeated-block.d.ts +9 -0
  92. package/dist/components/block/components/repeated-block.js +11 -0
  93. package/dist/components/blocks/blocks-wrapper.d.ts +10 -0
  94. package/dist/{sdk/components/render-blocks.js → components/blocks/blocks-wrapper.js} +6 -13
  95. package/dist/components/blocks/blocks.d.ts +8 -0
  96. package/dist/components/blocks/blocks.js +11 -0
  97. package/dist/components/content/components/enable-editor.d.ts +9 -0
  98. package/dist/{sdk/components/render-content/render-content.js → components/content/components/enable-editor.js} +69 -140
  99. package/dist/components/content/components/styles.d.ts +8 -0
  100. package/dist/{sdk/components/render-content/components/render-styles.helpers.d.ts → components/content/components/styles.helpers.d.ts} +1 -1
  101. package/dist/{sdk/components/render-content/components/render-styles.helpers.js → components/content/components/styles.helpers.js} +3 -4
  102. package/dist/{sdk/components/render-content/components/render-styles.js → components/content/components/styles.js} +7 -7
  103. package/dist/components/content/content.d.ts +3 -0
  104. package/dist/components/content/content.helpers.d.ts +7 -0
  105. package/dist/components/content/content.helpers.js +30 -0
  106. package/dist/components/content/content.js +79 -0
  107. package/dist/components/content/content.types.d.ts +24 -0
  108. package/dist/components/content/index.d.ts +1 -0
  109. package/dist/components/content/index.js +1 -0
  110. package/dist/components/content-variants/content-variants.d.ts +9 -0
  111. package/dist/components/content-variants/content-variants.js +46 -0
  112. package/dist/components/content-variants/content-variants.types.d.ts +20 -0
  113. package/dist/components/content-variants/helpers.d.ts +41 -0
  114. package/dist/{sdk/components/render-content-variants → components/content-variants}/helpers.js +46 -41
  115. package/dist/components/inlined-script.d.ts +6 -0
  116. package/dist/components/inlined-script.js +6 -0
  117. package/dist/components/inlined-styles.d.ts +6 -0
  118. package/dist/{sdk/components/render-inlined-styles.js → components/inlined-styles.js} +3 -3
  119. package/dist/{sdk/constants → constants}/builder-registered-components.js +34 -13
  120. package/dist/{sdk/constants → constants}/device-sizes.js +9 -8
  121. package/dist/constants/sdk-version.d.ts +1 -0
  122. package/dist/constants/sdk-version.js +1 -0
  123. package/dist/{sdk/context → context}/builder.context.js +1 -1
  124. package/dist/{sdk/context → context}/types.d.ts +1 -1
  125. package/dist/functions/acorn_interpreter.d.ts +1 -0
  126. package/dist/functions/acorn_interpreter.js +3027 -0
  127. package/dist/functions/apply-patch-with-mutation.d.ts +10 -0
  128. package/dist/functions/apply-patch-with-mutation.js +54 -0
  129. package/dist/functions/apply-patch-with-mutation.test.js +53 -0
  130. package/dist/functions/evaluate/acorn.d.ts +0 -0
  131. package/dist/functions/evaluate/acorn.js +2432 -0
  132. package/dist/{sdk/functions → functions/evaluate}/evaluate.d.ts +5 -2
  133. package/dist/functions/evaluate/evaluate.js +70 -0
  134. package/dist/functions/evaluate/evaluate.test.js +23 -0
  135. package/dist/functions/evaluate/index.d.ts +1 -0
  136. package/dist/functions/evaluate/index.js +1 -0
  137. package/dist/functions/evaluate/interpreter.d.ts +2 -0
  138. package/dist/functions/evaluate/interpreter.js +3853 -0
  139. package/dist/functions/evaluate/non-node-runtime.d.ts +2 -0
  140. package/dist/functions/evaluate/non-node-runtime.js +84 -0
  141. package/dist/functions/evaluate/types.d.ts +10 -0
  142. package/dist/functions/evaluate.d.ts +23 -0
  143. package/dist/{sdk/functions → functions}/evaluate.js +28 -9
  144. package/dist/{sdk/functions → functions}/evaluate.test.js +11 -5
  145. package/dist/{sdk/functions → functions}/extract-text-styles.js +2 -14
  146. package/dist/{sdk/functions → functions}/get-block-actions-handler.js +3 -3
  147. package/dist/{sdk/functions → functions}/get-block-actions.d.ts +1 -0
  148. package/dist/functions/get-block-actions.js +28 -0
  149. package/dist/{sdk/functions → functions}/get-block-component-options.js +1 -1
  150. package/dist/functions/get-block-properties.d.ts +6 -0
  151. package/dist/{sdk/functions → functions}/get-block-properties.js +15 -9
  152. package/dist/{sdk/functions → functions}/get-builder-search-params/fn.test.js +1 -1
  153. package/dist/{sdk/functions → functions}/get-builder-search-params/index.js +3 -7
  154. package/dist/{sdk/functions → functions}/get-content/generate-content-url.js +7 -5
  155. package/dist/{sdk/functions → functions}/get-content/generate-content-url.test.js +31 -17
  156. package/dist/{sdk/functions → functions}/get-content/index.d.ts +2 -6
  157. package/dist/{sdk/functions → functions}/get-content/index.js +26 -6
  158. package/dist/functions/get-content/processCookies.d.ts +2 -0
  159. package/dist/functions/get-content/processCookies.js +3 -0
  160. package/dist/{sdk/functions → functions}/get-processed-block.d.ts +1 -1
  161. package/dist/{sdk/functions → functions}/get-processed-block.js +11 -7
  162. package/dist/{sdk/functions → functions}/get-processed-block.test.js +8 -6
  163. package/dist/{sdk/functions → functions}/get-react-native-block-styles.d.ts +1 -1
  164. package/dist/{sdk/functions → functions}/get-react-native-block-styles.js +2 -2
  165. package/dist/{sdk/functions → functions}/if-target.d.ts +1 -1
  166. package/dist/{sdk/functions → functions}/if-target.js +1 -1
  167. package/dist/functions/is-editing.js +5 -0
  168. package/dist/functions/is-non-node-server.d.ts +4 -0
  169. package/dist/functions/is-non-node-server.js +8 -0
  170. package/dist/{sdk/functions → functions}/on-change.js +1 -1
  171. package/dist/{sdk/functions → functions}/on-change.test.js +13 -3
  172. package/dist/{sdk/functions → functions}/register-component.d.ts +2 -1
  173. package/dist/functions/register-component.js +38 -0
  174. package/dist/{sdk/functions → functions}/register.js +2 -2
  175. package/dist/{sdk/functions → functions}/sanitize-react-native-block-styles.js +13 -5
  176. package/dist/{sdk/functions → functions}/set-editor-settings.js +1 -1
  177. package/dist/functions/set.js +14 -0
  178. package/dist/{sdk/functions → functions}/set.test.js +9 -3
  179. package/dist/{sdk/functions → functions}/track/helpers.js +6 -11
  180. package/dist/{sdk/functions → functions}/track/index.js +26 -14
  181. package/dist/{sdk/functions → functions}/track/interaction.js +15 -16
  182. package/dist/functions/transform-block-properties.d.ts +1 -0
  183. package/dist/{sdk/functions → functions}/transform-block-properties.js +2 -0
  184. package/dist/{sdk/helpers → helpers}/ab-tests.d.ts +2 -2
  185. package/dist/{sdk/helpers → helpers}/ab-tests.js +48 -30
  186. package/dist/{sdk/helpers → helpers}/canTrack.js +1 -1
  187. package/dist/{sdk/helpers → helpers}/cookie.d.ts +2 -2
  188. package/dist/{sdk/helpers → helpers}/cookie.js +13 -26
  189. package/dist/{sdk/helpers → helpers}/css.d.ts +1 -1
  190. package/dist/{sdk/helpers → helpers}/css.js +1 -1
  191. package/dist/{sdk/helpers → helpers}/flatten.js +8 -8
  192. package/dist/{sdk/helpers → helpers}/localStorage.d.ts +2 -2
  193. package/dist/{sdk/helpers → helpers}/localStorage.js +2 -2
  194. package/dist/{sdk/helpers → helpers}/logger.js +1 -1
  195. package/dist/helpers/preview-lru-cache/get.d.ts +1 -0
  196. package/dist/helpers/preview-lru-cache/get.js +7 -0
  197. package/dist/helpers/preview-lru-cache/helpers.d.ts +1 -0
  198. package/dist/helpers/preview-lru-cache/helpers.js +9 -0
  199. package/dist/helpers/preview-lru-cache/init.d.ts +6 -0
  200. package/dist/helpers/preview-lru-cache/init.js +15 -0
  201. package/dist/helpers/preview-lru-cache/set.d.ts +7 -0
  202. package/dist/helpers/preview-lru-cache/set.js +9 -0
  203. package/dist/helpers/preview-lru-cache/types.d.ts +12 -0
  204. package/dist/helpers/preview-lru-cache/types.js +6 -0
  205. package/dist/{sdk/helpers → helpers}/sessionId.d.ts +2 -2
  206. package/dist/{sdk/helpers → helpers}/sessionId.js +11 -4
  207. package/dist/{sdk/helpers → helpers}/uuid.js +1 -1
  208. package/dist/{sdk/helpers → helpers}/visitorId.d.ts +1 -1
  209. package/dist/{sdk/helpers → helpers}/visitorId.js +7 -4
  210. package/dist/{sdk/index-helpers → index-helpers}/blocks-exports.d.ts +2 -2
  211. package/dist/{sdk/index-helpers → index-helpers}/blocks-exports.js +2 -2
  212. package/dist/{sdk/index.d.ts → index.d.ts} +2 -2
  213. package/dist/{sdk/index.js → index.js} +1 -1
  214. package/dist/scripts/init-editing.js +110 -0
  215. package/dist/types/builder-props.d.ts +9 -0
  216. package/dist/{sdk/types → types}/components.d.ts +8 -2
  217. package/dist/types/enforced-partials.d.ts +21 -0
  218. package/dist/types/targets.d.ts +1 -0
  219. package/dist/{server/types → types}/typescript.d.ts +6 -0
  220. package/package.json +6 -13
  221. package/dist/sdk/blocks/button/component-info.d.ts +0 -2
  222. package/dist/sdk/blocks/columns/columns.d.ts +0 -16
  223. package/dist/sdk/blocks/columns/component-info.d.ts +0 -2
  224. package/dist/sdk/blocks/custom-code/component-info.d.ts +0 -2
  225. package/dist/sdk/blocks/embed/component-info.d.ts +0 -2
  226. package/dist/sdk/blocks/embed/helpers.js +0 -6
  227. package/dist/sdk/blocks/form/component-info.d.ts +0 -2
  228. package/dist/sdk/blocks/form/form.d.ts +0 -40
  229. package/dist/sdk/blocks/form/form.js +0 -203
  230. package/dist/sdk/blocks/fragment/component-info.d.ts +0 -2
  231. package/dist/sdk/blocks/image/component-info.d.ts +0 -2
  232. package/dist/sdk/blocks/img/component-info.d.ts +0 -2
  233. package/dist/sdk/blocks/input/component-info.d.ts +0 -2
  234. package/dist/sdk/blocks/raw-text/component-info.d.ts +0 -2
  235. package/dist/sdk/blocks/raw-text/raw-text.js +0 -6
  236. package/dist/sdk/blocks/section/component-info.d.ts +0 -2
  237. package/dist/sdk/blocks/select/component-info.d.ts +0 -2
  238. package/dist/sdk/blocks/submit-button/component-info.d.ts +0 -2
  239. package/dist/sdk/blocks/symbol/component-info.d.ts +0 -2
  240. package/dist/sdk/blocks/symbol/symbol.d.ts +0 -21
  241. package/dist/sdk/blocks/symbol/symbol.js +0 -69
  242. package/dist/sdk/blocks/text/component-info.d.ts +0 -2
  243. package/dist/sdk/blocks/textarea/component-info.d.ts +0 -2
  244. package/dist/sdk/blocks/util.d.ts +0 -4
  245. package/dist/sdk/blocks/util.js +0 -13
  246. package/dist/sdk/blocks/video/component-info.d.ts +0 -2
  247. package/dist/sdk/components/render-block/render-block.d.ts +0 -9
  248. package/dist/sdk/components/render-block/render-block.helpers.d.ts +0 -12
  249. package/dist/sdk/components/render-block/render-block.js +0 -115
  250. package/dist/sdk/components/render-block/render-component.d.ts +0 -17
  251. package/dist/sdk/components/render-block/render-component.js +0 -11
  252. package/dist/sdk/components/render-block/render-repeated-block.d.ts +0 -9
  253. package/dist/sdk/components/render-block/render-repeated-block.js +0 -11
  254. package/dist/sdk/components/render-blocks.d.ts +0 -10
  255. package/dist/sdk/components/render-content/builder-editing.d.ts +0 -3
  256. package/dist/sdk/components/render-content/builder-editing.js +0 -6
  257. package/dist/sdk/components/render-content/components/render-styles.d.ts +0 -9
  258. package/dist/sdk/components/render-content/index.d.ts +0 -1
  259. package/dist/sdk/components/render-content/index.js +0 -1
  260. package/dist/sdk/components/render-content/render-content.d.ts +0 -4
  261. package/dist/sdk/components/render-content/render-content.helpers.d.ts +0 -7
  262. package/dist/sdk/components/render-content/render-content.helpers.js +0 -30
  263. package/dist/sdk/components/render-content/render-content.types.d.ts +0 -38
  264. package/dist/sdk/components/render-content-variants/helpers.d.ts +0 -17
  265. package/dist/sdk/components/render-content-variants/render-content-variants.d.ts +0 -5
  266. package/dist/sdk/components/render-content-variants/render-content-variants.js +0 -37
  267. package/dist/sdk/components/render-inlined-styles.d.ts +0 -7
  268. package/dist/sdk/constants/sdk-version.d.ts +0 -1
  269. package/dist/sdk/constants/sdk-version.js +0 -1
  270. package/dist/sdk/functions/get-block-actions.js +0 -15
  271. package/dist/sdk/functions/get-block-properties.d.ts +0 -7
  272. package/dist/sdk/functions/get-content/ab-testing.d.ts +0 -5
  273. package/dist/sdk/functions/get-content/ab-testing.js +0 -78
  274. package/dist/sdk/functions/is-editing.js +0 -7
  275. package/dist/sdk/functions/register-component.js +0 -26
  276. package/dist/sdk/functions/set.js +0 -21
  277. package/dist/sdk/functions/transform-block-properties.d.ts +0 -1
  278. package/dist/sdk/scripts/init-editing.js +0 -102
  279. package/dist/sdk/types/targets.d.ts +0 -3
  280. package/dist/sdk/types/typescript.d.ts +0 -5
  281. package/dist/server/functions/get-builder-search-params/index.d.ts +0 -6
  282. package/dist/server/functions/get-builder-search-params/index.js +0 -36
  283. package/dist/server/functions/get-content/ab-testing.d.ts +0 -5
  284. package/dist/server/functions/get-content/ab-testing.js +0 -78
  285. package/dist/server/functions/get-content/generate-content-url.d.ts +0 -2
  286. package/dist/server/functions/get-content/generate-content-url.js +0 -31
  287. package/dist/server/functions/get-content/generate-content-url.test.js +0 -82
  288. package/dist/server/functions/get-content/index.d.ts +0 -11
  289. package/dist/server/functions/get-content/index.js +0 -40
  290. package/dist/server/functions/get-content/types.d.ts +0 -45
  291. package/dist/server/functions/get-fetch.d.ts +0 -1
  292. package/dist/server/functions/get-fetch.js +0 -11
  293. package/dist/server/functions/get-global-this.d.ts +0 -4
  294. package/dist/server/functions/get-global-this.js +0 -15
  295. package/dist/server/functions/is-browser.d.ts +0 -1
  296. package/dist/server/functions/is-browser.js +0 -3
  297. package/dist/server/helpers/ab-tests.d.ts +0 -8
  298. package/dist/server/helpers/ab-tests.js +0 -5
  299. package/dist/server/helpers/cookie.d.ts +0 -15
  300. package/dist/server/helpers/cookie.js +0 -65
  301. package/dist/server/helpers/flatten.d.ts +0 -6
  302. package/dist/server/helpers/flatten.js +0 -19
  303. package/dist/server/helpers/logger.d.ts +0 -5
  304. package/dist/server/helpers/logger.js +0 -6
  305. package/dist/server/helpers/nullable.d.ts +0 -2
  306. package/dist/server/helpers/nullable.js +0 -1
  307. package/dist/server/helpers/url.d.ts +0 -6
  308. package/dist/server/helpers/url.js +0 -15
  309. package/dist/server/types/api-version.d.ts +0 -2
  310. package/dist/server/types/api-version.js +0 -1
  311. package/dist/server/types/builder-block.d.ts +0 -66
  312. package/dist/server/types/builder-content.d.ts +0 -46
  313. package/dist/server/types/can-track.d.ts +0 -3
  314. package/dist/server/types/input.d.ts +0 -121
  315. package/dist/server/types/typescript.js +0 -1
  316. /package/dist/{sdk/blocks → blocks}/embed/helpers.d.ts +0 -0
  317. /package/dist/{sdk/blocks → blocks}/image/image.helpers.d.ts +0 -0
  318. /package/dist/{sdk/components/render-block → components/block}/types.d.ts +0 -0
  319. /package/dist/{sdk/components/render-block → components/block}/types.js +0 -0
  320. /package/dist/{sdk/context/types.js → components/content/content.types.js} +0 -0
  321. /package/dist/{sdk/components/render-content → components/content}/wrap-component-ref.d.ts +0 -0
  322. /package/dist/{sdk/components/render-content → components/content}/wrap-component-ref.js +0 -0
  323. /package/dist/{sdk/components/render-content/render-content.types.js → components/content-variants/content-variants.types.js} +0 -0
  324. /package/dist/{sdk/constants → constants}/builder-registered-components.d.ts +0 -0
  325. /package/dist/{sdk/constants → constants}/device-sizes.d.ts +0 -0
  326. /package/dist/{sdk/constants → constants}/target.d.ts +0 -0
  327. /package/dist/{sdk/constants → constants}/target.js +0 -0
  328. /package/dist/{sdk/context → context}/builder.context.d.ts +0 -0
  329. /package/dist/{sdk/functions/get-content → context}/types.js +0 -0
  330. /package/dist/{sdk/functions/evaluate.test.d.ts → functions/apply-patch-with-mutation.test.d.ts} +0 -0
  331. /package/dist/{sdk/functions → functions}/camel-to-kebab-case.d.ts +0 -0
  332. /package/dist/{sdk/functions → functions}/camel-to-kebab-case.js +0 -0
  333. /package/dist/{sdk/functions/get-content/generate-content-url.test.d.ts → functions/evaluate/evaluate.test.d.ts} +0 -0
  334. /package/dist/{server/functions/get-content → functions/evaluate}/types.js +0 -0
  335. /package/dist/{sdk/functions/get-builder-search-params/fn.test.d.ts → functions/evaluate.test.d.ts} +0 -0
  336. /package/dist/{sdk/functions → functions}/event-handler-name.d.ts +0 -0
  337. /package/dist/{sdk/functions → functions}/event-handler-name.js +0 -0
  338. /package/dist/{sdk/functions → functions}/extract-text-styles.d.ts +0 -0
  339. /package/dist/{sdk/functions → functions}/fast-clone.d.ts +0 -0
  340. /package/dist/{sdk/functions → functions}/fast-clone.js +0 -0
  341. /package/dist/{sdk/functions → functions}/get-block-actions-handler.d.ts +0 -0
  342. /package/dist/{sdk/functions → functions}/get-block-component-options.d.ts +0 -0
  343. /package/dist/{sdk/functions/get-processed-block.test.d.ts → functions/get-builder-search-params/fn.test.d.ts} +0 -0
  344. /package/dist/{sdk/functions → functions}/get-builder-search-params/index.d.ts +0 -0
  345. /package/dist/{sdk/functions → functions}/get-content/generate-content-url.d.ts +0 -0
  346. /package/dist/{server/functions → functions}/get-content/generate-content-url.test.d.ts +0 -0
  347. /package/dist/{sdk/functions → functions}/get-content/types.d.ts +0 -0
  348. /package/dist/{sdk/functions/on-change.test.d.ts → functions/get-content/types.js} +0 -0
  349. /package/dist/{sdk/functions → functions}/get-fetch.d.ts +0 -0
  350. /package/dist/{sdk/functions → functions}/get-fetch.js +0 -0
  351. /package/dist/{sdk/functions → functions}/get-global-this.d.ts +0 -0
  352. /package/dist/{sdk/functions → functions}/get-global-this.js +0 -0
  353. /package/dist/{sdk/functions/set.test.d.ts → functions/get-processed-block.test.d.ts} +0 -0
  354. /package/dist/{sdk/functions → functions}/is-browser.d.ts +0 -0
  355. /package/dist/{sdk/functions → functions}/is-browser.js +0 -0
  356. /package/dist/{sdk/functions → functions}/is-editing.d.ts +0 -0
  357. /package/dist/{sdk/functions → functions}/is-iframe.d.ts +0 -0
  358. /package/dist/{sdk/functions → functions}/is-iframe.js +0 -0
  359. /package/dist/{sdk/functions → functions}/is-previewing.d.ts +0 -0
  360. /package/dist/{sdk/functions → functions}/is-previewing.js +0 -0
  361. /package/dist/{sdk/functions → functions}/on-change.d.ts +0 -0
  362. /package/dist/{sdk/helpers/url.test.d.ts → functions/on-change.test.d.ts} +0 -0
  363. /package/dist/{sdk/functions → functions}/register.d.ts +0 -0
  364. /package/dist/{sdk/functions → functions}/sanitize-react-native-block-styles.d.ts +0 -0
  365. /package/dist/{sdk/functions → functions}/set-editor-settings.d.ts +0 -0
  366. /package/dist/{sdk/functions → functions}/set.d.ts +0 -0
  367. /package/dist/{sdk/types/builder-block.js → functions/set.test.d.ts} +0 -0
  368. /package/dist/{sdk/functions → functions}/track/helpers.d.ts +0 -0
  369. /package/dist/{sdk/functions → functions}/track/index.d.ts +0 -0
  370. /package/dist/{sdk/functions → functions}/track/interaction.d.ts +0 -0
  371. /package/dist/{sdk/functions → functions}/transform-block.d.ts +0 -0
  372. /package/dist/{sdk/functions → functions}/transform-block.js +0 -0
  373. /package/dist/{sdk/helpers → helpers}/canTrack.d.ts +0 -0
  374. /package/dist/{sdk/helpers → helpers}/flatten.d.ts +0 -0
  375. /package/dist/{sdk/helpers → helpers}/logger.d.ts +0 -0
  376. /package/dist/{sdk/helpers → helpers}/nullable.d.ts +0 -0
  377. /package/dist/{sdk/helpers → helpers}/nullable.js +0 -0
  378. /package/dist/{sdk/helpers → helpers}/time.d.ts +0 -0
  379. /package/dist/{sdk/helpers → helpers}/time.js +0 -0
  380. /package/dist/{sdk/helpers → helpers}/url.d.ts +0 -0
  381. /package/dist/{sdk/helpers → helpers}/url.js +0 -0
  382. /package/dist/{sdk/types/builder-content.js → helpers/url.test.d.ts} +0 -0
  383. /package/dist/{sdk/helpers → helpers}/url.test.js +0 -0
  384. /package/dist/{sdk/helpers → helpers}/uuid.d.ts +0 -0
  385. /package/dist/{sdk/index-helpers → index-helpers}/top-of-file.d.ts +0 -0
  386. /package/dist/{sdk/index-helpers → index-helpers}/top-of-file.js +0 -0
  387. /package/dist/{sdk/scripts → scripts}/init-editing.d.ts +0 -0
  388. /package/dist/{sdk/types → types}/api-version.d.ts +0 -0
  389. /package/dist/{sdk/types → types}/api-version.js +0 -0
  390. /package/dist/{sdk/types → types}/builder-block.d.ts +0 -0
  391. /package/dist/{server/types → types}/builder-block.js +0 -0
  392. /package/dist/{sdk/types → types}/builder-content.d.ts +0 -0
  393. /package/dist/{server/types → types}/builder-content.js +0 -0
  394. /package/dist/{sdk/types/can-track.js → types/builder-props.js} +0 -0
  395. /package/dist/{sdk/types → types}/can-track.d.ts +0 -0
  396. /package/dist/{server/types → types}/can-track.js +0 -0
  397. /package/dist/{sdk/types → types}/components.js +0 -0
  398. /package/dist/{sdk/types → types}/deep-partial.d.ts +0 -0
  399. /package/dist/{sdk/types → types}/deep-partial.js +0 -0
  400. /package/dist/{sdk/types → types}/element.d.ts +0 -0
  401. /package/dist/{sdk/types → types}/element.js +0 -0
  402. /package/dist/{sdk/types/input.js → types/enforced-partials.js} +0 -0
  403. /package/dist/{sdk/types → types}/input.d.ts +0 -0
  404. /package/dist/{server/types → types}/input.js +0 -0
  405. /package/dist/{sdk/types → types}/targets.js +0 -0
  406. /package/dist/{sdk/types → types}/typescript.js +0 -0
@@ -1,4 +1,4 @@
1
- 'use client';
1
+ "use client";
2
2
  import * as React from "react";
3
3
  import { getSrcSet } from "./image.helpers.js";
4
4
  function Image(props) {
@@ -52,23 +52,23 @@ function Image(props) {
52
52
  ...aspectRatioCss(),
53
53
  }, className: "builder-image" +
54
54
  (props.className ? " " + props.className : "") +
55
- " img-3c135cd4", src: props.image, srcSet: srcSetToUse(), sizes: props.sizes })),
55
+ " img-7c5f6b46", src: props.image, srcSet: srcSetToUse(), sizes: props.sizes })),
56
56
  props.aspectRatio &&
57
57
  !(props.builderBlock?.children?.length && props.fitContent) ? (React.createElement(React.Fragment, null,
58
- React.createElement("div", { className: "builder-image-sizer div-3c135cd4", style: {
58
+ React.createElement("div", { className: "builder-image-sizer div-7c5f6b46", style: {
59
59
  paddingTop: props.aspectRatio * 100 + "%",
60
60
  } }))) : null,
61
61
  props.builderBlock?.children?.length && props.fitContent ? (React.createElement(React.Fragment, null, props.children)) : null,
62
62
  !props.fitContent && props.children ? (React.createElement(React.Fragment, null,
63
- React.createElement("div", { className: "div-3c135cd4-2" }, props.children))) : null),
64
- React.createElement("style", null, `.img-3c135cd4 {
63
+ React.createElement("div", { className: "div-7c5f6b46-2" }, props.children))) : null),
64
+ React.createElement("style", null, `.img-7c5f6b46 {
65
65
  opacity: 1;
66
66
  transition: opacity 0.2s ease-in-out;
67
- }.div-3c135cd4 {
67
+ }.div-7c5f6b46 {
68
68
  width: 100%;
69
69
  pointer-events: none;
70
70
  font-size: 0;
71
- }.div-3c135cd4-2 {
71
+ }.div-7c5f6b46-2 {
72
72
  display: flex;
73
73
  flex-direction: column;
74
74
  align-items: stretch;
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -3,15 +3,13 @@ export const componentInfo = {
3
3
  name: 'Raw:Img',
4
4
  hideFromInsertMenu: true,
5
5
  image: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4',
6
- inputs: [
7
- {
6
+ inputs: [{
8
7
  name: 'image',
9
8
  bubble: true,
10
9
  type: 'file',
11
10
  allowedFileTypes: ['jpeg', 'jpg', 'png', 'svg', 'gif', 'webp'],
12
- required: true,
13
- },
14
- ],
11
+ required: true
12
+ }],
15
13
  noWrap: true,
16
- static: true,
14
+ static: true
17
15
  };
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
2
- export interface ImgProps {
1
+ /**
2
+ * This import is used by the Svelte SDK. Do not remove.
3
+ */ export interface ImgProps {
3
4
  attributes?: any;
4
5
  imgSrc?: string;
5
6
  image?: string;
@@ -1,4 +1,4 @@
1
- 'use client';
1
+ "use client";
2
2
  import * as React from "react";
3
3
  import { isEditing } from "../../functions/is-editing.js";
4
4
  function ImgComponent(props) {
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -1,61 +1,36 @@
1
1
  export const componentInfo = {
2
2
  name: 'Form:Input',
3
3
  image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca',
4
- inputs: [
5
- {
4
+ inputs: [{
6
5
  name: 'type',
7
6
  type: 'text',
8
- enum: [
9
- 'text',
10
- 'number',
11
- 'email',
12
- 'url',
13
- 'checkbox',
14
- 'radio',
15
- 'range',
16
- 'date',
17
- 'datetime-local',
18
- 'search',
19
- 'tel',
20
- 'time',
21
- 'file',
22
- 'month',
23
- 'week',
24
- 'password',
25
- 'color',
26
- 'hidden',
27
- ],
28
- defaultValue: 'text',
29
- },
30
- {
7
+ enum: ['text', 'number', 'email', 'url', 'checkbox', 'radio', 'range', 'date', 'datetime-local', 'search', 'tel', 'time', 'file', 'month', 'week', 'password', 'color', 'hidden'],
8
+ defaultValue: 'text'
9
+ }, {
31
10
  name: 'name',
32
11
  type: 'string',
33
12
  required: true,
34
- helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"',
35
- },
36
- {
13
+ helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
14
+ }, {
37
15
  name: 'placeholder',
38
16
  type: 'string',
39
17
  defaultValue: 'Hello there',
40
- helperText: 'Text to display when there is no value',
18
+ helperText: 'Text to display when there is no value'
41
19
  },
42
20
  // TODO: handle value vs default value automatically like ng-model
43
21
  {
44
22
  name: 'defaultValue',
45
- type: 'string',
46
- },
47
- {
23
+ type: 'string'
24
+ }, {
48
25
  name: 'value',
49
26
  type: 'string',
50
- advanced: true,
51
- },
52
- {
27
+ advanced: true
28
+ }, {
53
29
  name: 'required',
54
30
  type: 'boolean',
55
31
  helperText: 'Is this input required to be filled out to submit a form',
56
- defaultValue: false,
57
- },
58
- ],
32
+ defaultValue: false
33
+ }],
59
34
  noWrap: true,
60
35
  static: true,
61
36
  defaultStyles: {
@@ -66,6 +41,6 @@ export const componentInfo = {
66
41
  borderRadius: '3px',
67
42
  borderWidth: '1px',
68
43
  borderStyle: 'solid',
69
- borderColor: '#ccc',
70
- },
44
+ borderColor: '#ccc'
45
+ }
71
46
  };
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
2
- export interface FormInputProps {
1
+ /**
2
+ * This import is used by the Svelte SDK. Do not remove.
3
+ */ export interface FormInputProps {
3
4
  type?: string;
4
5
  attributes?: any;
5
6
  name?: string;
@@ -1,4 +1,4 @@
1
- 'use client';
1
+ "use client";
2
2
  import * as React from "react";
3
3
  import { isEditing } from "../../functions/is-editing.js";
4
4
  function FormInputComponent(props) {
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -1,12 +1,10 @@
1
1
  export const componentInfo = {
2
2
  name: 'Builder:RawText',
3
3
  hideFromInsertMenu: true,
4
- inputs: [
5
- {
4
+ inputs: [{
6
5
  name: 'text',
7
6
  bubble: true,
8
7
  type: 'longText',
9
- required: true,
10
- },
11
- ],
8
+ required: true
9
+ }]
12
10
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface RawTextProps {
3
2
  attributes?: any;
4
3
  text?: string;
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ function RawText(props) {
4
+ return (React.createElement("span", { dangerouslySetInnerHTML: { __html: props.text?.toString() || "" }, className: props.attributes.className }));
5
+ }
6
+ export default RawText;
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -2,20 +2,17 @@ export const componentInfo = {
2
2
  name: 'Core:Section',
3
3
  static: true,
4
4
  image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a',
5
- inputs: [
6
- {
5
+ inputs: [{
7
6
  name: 'maxWidth',
8
7
  type: 'number',
9
- defaultValue: 1200,
10
- },
11
- {
8
+ defaultValue: 1200
9
+ }, {
12
10
  name: 'lazyLoad',
13
11
  type: 'boolean',
14
12
  defaultValue: false,
15
13
  advanced: true,
16
- description: 'Only render this section when in view',
17
- },
18
- ],
14
+ description: 'Only render this section when in view'
15
+ }],
19
16
  defaultStyles: {
20
17
  paddingLeft: '20px',
21
18
  paddingRight: '20px',
@@ -23,23 +20,21 @@ export const componentInfo = {
23
20
  paddingBottom: '50px',
24
21
  marginTop: '0px',
25
22
  width: '100vw',
26
- marginLeft: 'calc(50% - 50vw)',
23
+ marginLeft: 'calc(50% - 50vw)'
27
24
  },
28
25
  canHaveChildren: true,
29
- defaultChildren: [
30
- {
26
+ defaultChildren: [{
31
27
  '@type': '@builder.io/sdk:Element',
32
28
  responsiveStyles: {
33
29
  large: {
34
- textAlign: 'center',
35
- },
30
+ textAlign: 'center'
31
+ }
36
32
  },
37
33
  component: {
38
34
  name: 'Text',
39
35
  options: {
40
- text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>",
41
- },
42
- },
43
- },
44
- ],
36
+ text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
37
+ }
38
+ }
39
+ }]
45
40
  };
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
2
- export interface SectionProps {
1
+ /**
2
+ * This import is used by the Svelte SDK. Do not remove.
3
+ */ export interface SectionProps {
3
4
  maxWidth?: number;
4
5
  attributes?: any;
5
6
  children?: any;
@@ -1,4 +1,4 @@
1
- 'use client';
1
+ "use client";
2
2
  import * as React from "react";
3
3
  function SectionComponent(props) {
4
4
  return (React.createElement("section", { ...props.attributes, style: {
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -2,54 +2,42 @@ export const componentInfo = {
2
2
  name: 'Form:Select',
3
3
  image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045',
4
4
  defaultStyles: {
5
- alignSelf: 'flex-start',
5
+ alignSelf: 'flex-start'
6
6
  },
7
- inputs: [
8
- {
7
+ inputs: [{
9
8
  name: 'options',
10
9
  type: 'list',
11
10
  required: true,
12
- subFields: [
13
- {
11
+ subFields: [{
14
12
  name: 'value',
15
13
  type: 'text',
16
- required: true,
17
- },
18
- {
14
+ required: true
15
+ }, {
19
16
  name: 'name',
20
- type: 'text',
21
- },
22
- ],
23
- defaultValue: [
24
- {
25
- value: 'option 1',
26
- },
27
- {
28
- value: 'option 2',
29
- },
30
- ],
31
- },
32
- {
17
+ type: 'text'
18
+ }],
19
+ defaultValue: [{
20
+ value: 'option 1'
21
+ }, {
22
+ value: 'option 2'
23
+ }]
24
+ }, {
33
25
  name: 'name',
34
26
  type: 'string',
35
27
  required: true,
36
- helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"',
37
- },
38
- {
28
+ helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
29
+ }, {
39
30
  name: 'defaultValue',
40
- type: 'string',
41
- },
42
- {
31
+ type: 'string'
32
+ }, {
43
33
  name: 'value',
44
34
  type: 'string',
45
- advanced: true,
46
- },
47
- {
35
+ advanced: true
36
+ }, {
48
37
  name: 'required',
49
38
  type: 'boolean',
50
- defaultValue: false,
51
- },
52
- ],
39
+ defaultValue: false
40
+ }],
53
41
  static: true,
54
- noWrap: true,
42
+ noWrap: true
55
43
  };
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
2
- export interface FormSelectProps {
1
+ /**
2
+ * This import is used by the Svelte SDK. Do not remove.
3
+ */ export interface FormSelectProps {
3
4
  options?: {
4
5
  name?: string;
5
6
  value: string;
@@ -1,4 +1,4 @@
1
- 'use client';
1
+ "use client";
2
2
  import * as React from "react";
3
3
  import { isEditing } from "../../functions/is-editing.js";
4
4
  function SelectComponent(props) {
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -10,17 +10,15 @@ export const componentInfo = {
10
10
  backgroundColor: '#3898EC',
11
11
  color: 'white',
12
12
  borderRadius: '4px',
13
- cursor: 'pointer',
13
+ cursor: 'pointer'
14
14
  },
15
- inputs: [
16
- {
15
+ inputs: [{
17
16
  name: 'text',
18
17
  type: 'text',
19
- defaultValue: 'Click me',
20
- },
21
- ],
18
+ defaultValue: 'Click me'
19
+ }],
22
20
  static: true,
23
- noWrap: true,
21
+ noWrap: true
24
22
  // TODO: optional children? maybe as optional form input
25
23
  // that only shows if advanced setting is flipped
26
24
  // TODO: defaultChildren
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
2
- export interface ButtonProps {
1
+ /**
2
+ * This import is used by the Svelte SDK. Do not remove.
3
+ */ export interface ButtonProps {
3
4
  attributes?: any;
4
5
  text?: string;
5
6
  }
@@ -1,4 +1,4 @@
1
- 'use client';
1
+ "use client";
2
2
  import * as React from "react";
3
3
  function SubmitButton(props) {
4
4
  return (React.createElement("button", { type: "submit", ...props.attributes }, props.text));
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -2,38 +2,33 @@ export const componentInfo = {
2
2
  name: 'Symbol',
3
3
  noWrap: true,
4
4
  static: true,
5
- inputs: [
6
- {
5
+ isRSC: true,
6
+ inputs: [{
7
7
  name: 'symbol',
8
- type: 'uiSymbol',
9
- },
10
- {
8
+ type: 'uiSymbol'
9
+ }, {
11
10
  name: 'dataOnly',
12
11
  helperText: "Make this a data symbol that doesn't display any UI",
13
12
  type: 'boolean',
14
13
  defaultValue: false,
15
14
  advanced: true,
16
- hideFromUI: true,
17
- },
18
- {
15
+ hideFromUI: true
16
+ }, {
19
17
  name: 'inheritState',
20
18
  helperText: 'Inherit the parent component state and data',
21
19
  type: 'boolean',
22
20
  defaultValue: false,
23
- advanced: true,
24
- },
25
- {
21
+ advanced: true
22
+ }, {
26
23
  name: 'renderToLiquid',
27
24
  helperText: 'Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting',
28
25
  type: 'boolean',
29
26
  defaultValue: false,
30
27
  advanced: true,
31
- hideFromUI: true,
32
- },
33
- {
28
+ hideFromUI: true
29
+ }, {
34
30
  name: 'useChildren',
35
31
  hideFromUI: true,
36
- type: 'boolean',
37
- },
38
- ],
32
+ type: 'boolean'
33
+ }]
39
34
  };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This import is used by the Svelte SDK. Do not remove.
3
+ */ export interface SymbolInfo {
4
+ model?: string;
5
+ entry?: string;
6
+ data?: any;
7
+ content?: BuilderContent;
8
+ inline?: boolean;
9
+ dynamic?: boolean;
10
+ }
11
+ /**
12
+ * This import is used by the Svelte SDK. Do not remove.
13
+ */ export interface SymbolProps extends BuilderComponentsProp {
14
+ symbol?: SymbolInfo;
15
+ dataOnly?: boolean;
16
+ dynamic?: boolean;
17
+ attributes?: any;
18
+ inheritState?: boolean;
19
+ }
20
+ import type { BuilderContent } from "../../types/builder-content.js";
21
+ import type { BuilderComponentsProp, PropsWithBuilderData } from "../../types/builder-props.js";
22
+ declare function Symbol(props: PropsWithBuilderData<SymbolProps>): JSX.Element;
23
+ export default Symbol;
@@ -0,0 +1,14 @@
1
+ import type { BuilderContextInterface } from '../../context/types.js';
2
+ import type { BuilderContent } from '../../types/builder-content.js';
3
+ export interface SymbolInfo {
4
+ model?: string;
5
+ entry?: string;
6
+ data?: any;
7
+ content?: BuilderContent;
8
+ inline?: boolean;
9
+ dynamic?: boolean;
10
+ }
11
+ export declare const fetchContent: ({ builderContextValue, symbol }: {
12
+ symbol: SymbolInfo | undefined;
13
+ builderContextValue: BuilderContextInterface;
14
+ }) => Promise<any>;
@@ -0,0 +1,31 @@
1
+ import { getContent } from '../../functions/get-content/index.js';
2
+ import { logger } from '../../helpers/logger.js';
3
+ export const fetchContent = async ({ builderContextValue, symbol }) => {
4
+ /**
5
+ * If:
6
+ * - we have a symbol prop
7
+ * - yet it does not have any content
8
+ * - and we have not already stored content from before
9
+ * - and it has a model name
10
+ *
11
+ * then we want to re-fetch the symbol content.
12
+ */
13
+ if (symbol?.model &&
14
+ // This is a hack, we should not need to check for this, but it is needed for Svelte.
15
+ builderContextValue?.apiKey) {
16
+ return getContent({
17
+ model: symbol.model,
18
+ apiKey: builderContextValue.apiKey,
19
+ apiVersion: builderContextValue.apiVersion,
20
+ ...(symbol?.entry && {
21
+ query: {
22
+ id: symbol.entry
23
+ }
24
+ })
25
+ }).catch(err => {
26
+ logger.error('Could not fetch symbol content: ', err);
27
+ return undefined;
28
+ });
29
+ }
30
+ return undefined;
31
+ };
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import { useState, useEffect } from "react";
4
+ import ContentVariants from "../../components/content-variants/content-variants";
5
+ import { fetchContent } from "./symbol.helpers.js";
6
+ function Symbol(props) {
7
+ function className() {
8
+ return [
9
+ ...[props.attributes.className],
10
+ "builder-symbol",
11
+ props.symbol?.inline ? "builder-inline-symbol" : undefined,
12
+ props.symbol?.dynamic || props.dynamic
13
+ ? "builder-dynamic-symbol"
14
+ : undefined,
15
+ ]
16
+ .filter(Boolean)
17
+ .join(" ");
18
+ }
19
+ const [contentToUse, setContentToUse] = useState(() => props.symbol?.content);
20
+ function setContent() {
21
+ if (contentToUse)
22
+ return;
23
+ fetchContent({
24
+ symbol: props.symbol,
25
+ builderContextValue: props.builderContext,
26
+ }).then((newContent) => {
27
+ if (newContent) {
28
+ setContentToUse(newContent);
29
+ }
30
+ });
31
+ }
32
+ useEffect(() => {
33
+ setContent();
34
+ }, []);
35
+ useEffect(() => {
36
+ setContent();
37
+ }, [props.symbol]);
38
+ return (React.createElement("div", { ...props.attributes, className: className() },
39
+ React.createElement(ContentVariants, { __isNestedRender: true, apiVersion: props.builderContext.apiVersion, apiKey: props.builderContext.apiKey, context: props.builderContext.context, customComponents: Object.values(props.builderComponents), data: {
40
+ ...props.symbol?.data,
41
+ ...props.builderContext.localState,
42
+ ...contentToUse?.data?.state,
43
+ }, model: props.symbol?.model, content: contentToUse })));
44
+ }
45
+ export default Symbol;
@@ -0,0 +1,2 @@
1
+ import type { ComponentInfo } from '../../types/components.js';
2
+ export declare const componentInfo: ComponentInfo;
@@ -1,20 +1,19 @@
1
1
  export const componentInfo = {
2
2
  name: 'Text',
3
3
  static: true,
4
+ isRSC: true,
4
5
  image: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929',
5
- inputs: [
6
- {
6
+ inputs: [{
7
7
  name: 'text',
8
8
  type: 'html',
9
9
  required: true,
10
10
  autoFocus: true,
11
11
  bubble: true,
12
- defaultValue: 'Enter some text...',
13
- },
14
- ],
12
+ defaultValue: 'Enter some text...'
13
+ }],
15
14
  defaultStyles: {
16
15
  lineHeight: 'normal',
17
16
  height: 'auto',
18
- textAlign: 'center',
19
- },
17
+ textAlign: 'center'
18
+ }
20
19
  };