@builder.io/sdk-qwik 0.0.16 → 0.0.18

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 (347) hide show
  1. package/lib/index.qwik.cjs +243 -518
  2. package/lib/index.qwik.mjs +225 -518
  3. package/package.json +6 -5
  4. package/types/blocks/button/button.d.ts +9 -0
  5. package/types/blocks/button/component-info.d.ts +2 -0
  6. package/types/blocks/columns/columns.d.ts +32 -0
  7. package/types/blocks/columns/component-info.d.ts +2 -0
  8. package/types/blocks/custom-code/component-info.d.ts +2 -0
  9. package/types/blocks/custom-code/custom-code.d.ts +7 -0
  10. package/types/blocks/embed/component-info.d.ts +2 -0
  11. package/types/blocks/embed/embed.d.ts +6 -0
  12. package/types/blocks/embed/helpers.d.ts +1 -0
  13. package/types/blocks/form/component-info.d.ts +2 -0
  14. package/types/blocks/form/form.d.ts +5 -0
  15. package/types/blocks/fragment/component-info.d.ts +2 -0
  16. package/types/blocks/fragment/fragment.d.ts +7 -0
  17. package/types/blocks/image/component-info.d.ts +2 -0
  18. package/types/blocks/image/image.d.ts +25 -0
  19. package/types/blocks/image/image.helpers.d.ts +1 -0
  20. package/types/blocks/img/component-info.d.ts +2 -0
  21. package/types/blocks/img/img.d.ts +10 -0
  22. package/types/blocks/input/component-info.d.ts +2 -0
  23. package/types/blocks/input/input.d.ts +11 -0
  24. package/types/blocks/raw-text/component-info.d.ts +2 -0
  25. package/types/blocks/raw-text/raw-text.d.ts +6 -0
  26. package/types/blocks/section/component-info.d.ts +2 -0
  27. package/types/blocks/section/section.d.ts +8 -0
  28. package/types/blocks/select/component-info.d.ts +2 -0
  29. package/types/blocks/select/select.d.ts +12 -0
  30. package/types/blocks/submit-button/component-info.d.ts +2 -0
  31. package/types/blocks/submit-button/submit-button.d.ts +6 -0
  32. package/types/blocks/symbol/component-info.d.ts +2 -0
  33. package/types/blocks/symbol/symbol.d.ts +20 -0
  34. package/types/blocks/text/component-info.d.ts +2 -0
  35. package/types/blocks/text/text.d.ts +5 -0
  36. package/types/blocks/textarea/component-info.d.ts +2 -0
  37. package/types/blocks/textarea/textarea.d.ts +9 -0
  38. package/types/blocks/util.d.ts +1 -0
  39. package/types/blocks/video/component-info.d.ts +2 -0
  40. package/types/blocks/video/video.d.ts +25 -0
  41. package/types/components/render-block/block-styles.d.ts +12 -0
  42. package/types/components/render-block/render-block.d.ts +32 -0
  43. package/types/components/render-block/render-block.helpers.d.ts +1 -0
  44. package/types/components/render-block/render-component.d.ts +12 -0
  45. package/types/components/render-block/render-repeated-block.d.ts +17 -0
  46. package/types/components/render-block/types.d.ts +6 -0
  47. package/types/components/render-blocks.d.ts +12 -0
  48. package/types/components/render-content/components/render-styles.d.ts +19 -0
  49. package/types/components/render-content/index.d.ts +1 -0
  50. package/types/components/render-content/render-content.d.ts +33 -0
  51. package/types/components/render-inlined-styles.d.ts +9 -0
  52. package/types/constants/builder-registered-components.d.ts +6 -0
  53. package/types/constants/device-sizes.d.ts +2 -0
  54. package/types/constants/target.d.ts +2 -0
  55. package/types/context/builder.context.d.ts +2 -0
  56. package/types/context/types.d.ts +16 -0
  57. package/types/functions/camel-to-kebab-case.d.ts +1 -0
  58. package/types/functions/convert-style-object.d.ts +1 -0
  59. package/types/functions/evaluate.d.ts +5 -0
  60. package/types/functions/event-handler-name.d.ts +1 -0
  61. package/types/functions/get-block-actions.d.ts +9 -0
  62. package/types/functions/get-block-component-options.d.ts +2 -0
  63. package/types/functions/get-block-properties.d.ts +5 -0
  64. package/types/functions/get-block-styles.d.ts +2 -0
  65. package/types/functions/get-block-tag.d.ts +10 -0
  66. package/types/functions/get-builder-search-params/fn.test.d.ts +1 -0
  67. package/types/functions/get-builder-search-params/index.d.ts +6 -0
  68. package/types/functions/get-content/ab-testing.d.ts +3 -0
  69. package/types/functions/get-content/fn.test.d.ts +1 -0
  70. package/types/functions/get-content/index.d.ts +9 -0
  71. package/types/functions/get-content/types.d.ts +26 -0
  72. package/types/functions/get-fetch.d.ts +1 -0
  73. package/types/functions/get-global-this.d.ts +1 -0
  74. package/types/functions/get-processed-block.d.ts +10 -0
  75. package/types/functions/get-processed-block.test.d.ts +1 -0
  76. package/types/functions/if-target.d.ts +7 -0
  77. package/types/functions/is-browser.d.ts +1 -0
  78. package/types/functions/is-editing.d.ts +1 -0
  79. package/types/functions/is-iframe.d.ts +1 -0
  80. package/types/functions/is-previewing.d.ts +1 -0
  81. package/types/functions/mark-mutable.d.ts +2 -0
  82. package/types/functions/on-change.d.ts +7 -0
  83. package/types/functions/on-change.test.d.ts +1 -0
  84. package/types/functions/register-component.d.ts +14 -0
  85. package/types/functions/register.d.ts +16 -0
  86. package/types/functions/sanitize-styles.d.ts +4 -0
  87. package/types/functions/set-editor-settings.d.ts +4 -0
  88. package/types/functions/set.d.ts +7 -0
  89. package/types/functions/set.test.d.ts +1 -0
  90. package/types/functions/track.d.ts +21 -0
  91. package/types/functions/transform-block.d.ts +2 -0
  92. package/types/helpers/cookie.d.ts +9 -0
  93. package/types/helpers/css.d.ts +1 -0
  94. package/types/helpers/flatten.d.ts +6 -0
  95. package/types/helpers/localStorage.d.ts +9 -0
  96. package/types/helpers/nullable.d.ts +2 -0
  97. package/types/helpers/sessionId.d.ts +7 -0
  98. package/types/helpers/time.d.ts +1 -0
  99. package/types/helpers/url.d.ts +6 -0
  100. package/types/helpers/url.test.d.ts +1 -0
  101. package/types/helpers/uuid.d.ts +8 -0
  102. package/types/helpers/visitorId.d.ts +8 -0
  103. package/types/index-helpers/blocks-exports.d.ts +10 -0
  104. package/types/index-helpers/top-of-file.d.ts +1 -0
  105. package/types/index.d.ts +10 -0
  106. package/types/scripts/init-editing.d.ts +2 -0
  107. package/types/types/builder-block.d.ts +57 -0
  108. package/types/types/builder-content.d.ts +38 -0
  109. package/types/types/can-track.d.ts +3 -0
  110. package/types/types/components.d.ts +177 -0
  111. package/types/types/deep-partial.d.ts +3 -0
  112. package/types/types/element.d.ts +59 -0
  113. package/types/types/targets.d.ts +3 -0
  114. package/types/types/typescript.d.ts +4 -0
  115. package/.yarn/cache/@builder.io-qwik-npm-0.0.103-bdc7786a46-98363e9103.zip +0 -0
  116. package/.yarn/cache/@gar-promisify-npm-1.1.3-ac1a325862-4059f790e2.zip +0 -0
  117. package/.yarn/cache/@npmcli-fs-npm-2.1.2-08d434e77b-405074965e.zip +0 -0
  118. package/.yarn/cache/@npmcli-move-file-npm-2.0.1-b593d8f741-52dc02259d.zip +0 -0
  119. package/.yarn/cache/@tootallnate-once-npm-2.0.0-e36cf4f140-ad87447820.zip +0 -0
  120. package/.yarn/cache/@types-node-npm-18.7.6-c1eafa3d9a-5122988c32.zip +0 -0
  121. package/.yarn/cache/abbrev-npm-1.1.1-3659247eab-a4a97ec07d.zip +0 -0
  122. package/.yarn/cache/agent-base-npm-6.0.2-428f325a93-f52b6872cc.zip +0 -0
  123. package/.yarn/cache/agentkeepalive-npm-4.2.1-b86a9fb343-39cb49ed8c.zip +0 -0
  124. package/.yarn/cache/aggregate-error-npm-3.1.0-415a406f4e-1101a33f21.zip +0 -0
  125. package/.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip +0 -0
  126. package/.yarn/cache/aproba-npm-2.0.0-8716bcfde6-5615cadcfb.zip +0 -0
  127. package/.yarn/cache/are-we-there-yet-npm-3.0.1-3395b1512f-52590c2486.zip +0 -0
  128. package/.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip +0 -0
  129. package/.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip +0 -0
  130. package/.yarn/cache/brace-expansion-npm-2.0.1-17aa2616f9-a61e7cd2e8.zip +0 -0
  131. package/.yarn/cache/cacache-npm-16.1.2-0d36d1aaf1-defe1d6f55.zip +0 -0
  132. package/.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip +0 -0
  133. package/.yarn/cache/clean-stack-npm-2.2.0-a8ce435a5c-2ac8cd2b2f.zip +0 -0
  134. package/.yarn/cache/color-support-npm-1.1.3-3be5c53455-9b73568176.zip +0 -0
  135. package/.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-902a9f5d89.zip +0 -0
  136. package/.yarn/cache/console-control-strings-npm-1.1.0-e3160e5275-8755d76787.zip +0 -0
  137. package/.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip +0 -0
  138. package/.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip +0 -0
  139. package/.yarn/cache/depd-npm-1.1.2-b0c8414da7-6b406620d2.zip +0 -0
  140. package/.yarn/cache/emoji-regex-npm-8.0.0-213764015c-d4c5c39d5a.zip +0 -0
  141. package/.yarn/cache/encoding-npm-0.1.13-82a1837d30-bb98632f8f.zip +0 -0
  142. package/.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip +0 -0
  143. package/.yarn/cache/err-code-npm-2.0.3-082e0ff9a7-8b7b1be20d.zip +0 -0
  144. package/.yarn/cache/esbuild-darwin-arm64-npm-0.14.54-ec53803fa6-8.zip +0 -0
  145. package/.yarn/cache/esbuild-npm-0.14.54-b3dcd8a41e-49e360b118.zip +0 -0
  146. package/.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip +0 -0
  147. package/.yarn/cache/fs.realpath-npm-1.0.0-c8f05d8126-99ddea01a7.zip +0 -0
  148. package/.yarn/cache/fsevents-npm-2.3.2-a881d6ac9f-97ade64e75.zip +0 -0
  149. package/.yarn/cache/fsevents-patch-3340e2eb10-8.zip +0 -0
  150. package/.yarn/cache/function-bind-npm-1.1.1-b56b322ae9-b32fbaebb3.zip +0 -0
  151. package/.yarn/cache/gauge-npm-4.0.4-8f878385e9-788b6bfe52.zip +0 -0
  152. package/.yarn/cache/glob-npm-7.2.3-2d866d17a5-29452e97b3.zip +0 -0
  153. package/.yarn/cache/glob-npm-8.0.3-750f909025-50bcdea19d.zip +0 -0
  154. package/.yarn/cache/graceful-fs-npm-4.2.10-79c70989ca-3f109d70ae.zip +0 -0
  155. package/.yarn/cache/has-npm-1.0.3-b7f00631c1-b9ad53d53b.zip +0 -0
  156. package/.yarn/cache/has-unicode-npm-2.0.1-893adb4747-1eab07a743.zip +0 -0
  157. package/.yarn/cache/http-cache-semantics-npm-4.1.0-860520a31f-974de94a81.zip +0 -0
  158. package/.yarn/cache/http-proxy-agent-npm-5.0.0-7f1f121b83-e2ee1ff165.zip +0 -0
  159. package/.yarn/cache/https-proxy-agent-npm-5.0.1-42d65f358e-571fccdf38.zip +0 -0
  160. package/.yarn/cache/humanize-ms-npm-1.2.1-e942bd7329-9c7a74a282.zip +0 -0
  161. package/.yarn/cache/iconv-lite-npm-0.6.3-24b8aae27e-3f60d47a5c.zip +0 -0
  162. package/.yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-7cae75c8cd.zip +0 -0
  163. package/.yarn/cache/indent-string-npm-4.0.0-7b717435b2-824cfb9929.zip +0 -0
  164. package/.yarn/cache/infer-owner-npm-1.0.4-685ac3d2af-181e732764.zip +0 -0
  165. package/.yarn/cache/inflight-npm-1.0.6-ccedb4b908-f4f76aa072.zip +0 -0
  166. package/.yarn/cache/inherits-npm-2.0.4-c66b3957a0-4a48a73384.zip +0 -0
  167. package/.yarn/cache/ip-npm-2.0.0-204facb3cc-cfcfac6b87.zip +0 -0
  168. package/.yarn/cache/is-core-module-npm-2.10.0-6dff9310aa-0f3f77811f.zip +0 -0
  169. package/.yarn/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-44a30c2945.zip +0 -0
  170. package/.yarn/cache/is-lambda-npm-1.0.1-7ab55bc8a8-93a32f0194.zip +0 -0
  171. package/.yarn/cache/isexe-npm-2.0.0-b58870bd2e-26bf6c5480.zip +0 -0
  172. package/.yarn/cache/lru-cache-npm-6.0.0-b4c8668fe1-f97f499f89.zip +0 -0
  173. package/.yarn/cache/lru-cache-npm-7.14.0-354cf654ec-efdd329f2c.zip +0 -0
  174. package/.yarn/cache/make-fetch-happen-npm-10.2.1-f1cc7cd2df-2332eb9a8e.zip +0 -0
  175. package/.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip +0 -0
  176. package/.yarn/cache/minimatch-npm-5.1.0-34f6240621-15ce53d31a.zip +0 -0
  177. package/.yarn/cache/minipass-collect-npm-1.0.2-3b4676eab5-14df761028.zip +0 -0
  178. package/.yarn/cache/minipass-fetch-npm-2.1.1-c4a8efdb09-1aae0c2240.zip +0 -0
  179. package/.yarn/cache/minipass-flush-npm-1.0.5-efe79d9826-56269a0b22.zip +0 -0
  180. package/.yarn/cache/minipass-npm-3.3.5-a555b091e7-f89f02bcaa.zip +0 -0
  181. package/.yarn/cache/minipass-pipeline-npm-1.2.4-5924cb077f-b14240dac0.zip +0 -0
  182. package/.yarn/cache/minipass-sized-npm-1.0.3-306d86f432-79076749fc.zip +0 -0
  183. package/.yarn/cache/minizlib-npm-2.1.2-ea89cd0cfb-f1fdeac0b0.zip +0 -0
  184. package/.yarn/cache/mkdirp-npm-1.0.4-37f6ef56b9-a96865108c.zip +0 -0
  185. package/.yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip +0 -0
  186. package/.yarn/cache/ms-npm-2.1.3-81ff3cfac1-aa92de6080.zip +0 -0
  187. package/.yarn/cache/nanoid-npm-3.3.4-3d250377d6-2fddd6dee9.zip +0 -0
  188. package/.yarn/cache/negotiator-npm-0.6.3-9d50e36171-b8ffeb1e26.zip +0 -0
  189. package/.yarn/cache/node-gyp-npm-9.1.0-2091059b31-1437fa4a87.zip +0 -0
  190. package/.yarn/cache/nopt-npm-5.0.0-304b40fbfe-d35fdec187.zip +0 -0
  191. package/.yarn/cache/npmlog-npm-6.0.2-e0e69455c7-ae238cd264.zip +0 -0
  192. package/.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip +0 -0
  193. package/.yarn/cache/p-map-npm-4.0.0-4677ae07c7-cb0ab21ec0.zip +0 -0
  194. package/.yarn/cache/path-is-absolute-npm-1.0.1-31bc695ffd-060840f92c.zip +0 -0
  195. package/.yarn/cache/path-parse-npm-1.0.7-09564527b7-49abf3d811.zip +0 -0
  196. package/.yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip +0 -0
  197. package/.yarn/cache/postcss-npm-8.4.16-7367383579-10eee25efd.zip +0 -0
  198. package/.yarn/cache/promise-inflight-npm-1.0.1-5bb925afac-2274948309.zip +0 -0
  199. package/.yarn/cache/promise-retry-npm-2.0.1-871f0b01b7-f96a3f6d90.zip +0 -0
  200. package/.yarn/cache/readable-stream-npm-3.6.0-23a4a5eb56-d4ea81502d.zip +0 -0
  201. package/.yarn/cache/resolve-npm-1.22.1-3980488690-07af5fc1e8.zip +0 -0
  202. package/.yarn/cache/resolve-patch-46f9469d0d-5656f4d0be.zip +0 -0
  203. package/.yarn/cache/retry-npm-0.12.0-72ac7fb4cc-623bd7d2e5.zip +0 -0
  204. package/.yarn/cache/rimraf-npm-3.0.2-2cb7dac69a-87f4164e39.zip +0 -0
  205. package/.yarn/cache/rollup-npm-2.78.0-09284f4c78-01b5a7ae08.zip +0 -0
  206. package/.yarn/cache/safe-buffer-npm-5.2.1-3481c8aa9b-b99c4b41fd.zip +0 -0
  207. package/.yarn/cache/safer-buffer-npm-2.1.2-8d5c0b705e-cab8f25ae6.zip +0 -0
  208. package/.yarn/cache/semver-npm-7.3.7-3bfe704194-2fa3e87756.zip +0 -0
  209. package/.yarn/cache/set-blocking-npm-2.0.0-49e2cffa24-6e65a05f7c.zip +0 -0
  210. package/.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip +0 -0
  211. package/.yarn/cache/smart-buffer-npm-4.2.0-5ac3f668bb-b5167a7142.zip +0 -0
  212. package/.yarn/cache/socks-npm-2.7.0-cc1cb019db-0b5d94e2b3.zip +0 -0
  213. package/.yarn/cache/socks-proxy-agent-npm-7.0.0-7aacf32ea0-7205543701.zip +0 -0
  214. package/.yarn/cache/source-map-js-npm-1.0.2-ee4f9f9b30-c049a7fc4d.zip +0 -0
  215. package/.yarn/cache/ssri-npm-9.0.1-33ce27f4f8-fb58f5e46b.zip +0 -0
  216. package/.yarn/cache/string-width-npm-4.2.3-2c27177bae-e52c10dc3f.zip +0 -0
  217. package/.yarn/cache/string_decoder-npm-1.3.0-2422117fd0-8417646695.zip +0 -0
  218. package/.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip +0 -0
  219. package/.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-53b1e247e6.zip +0 -0
  220. package/.yarn/cache/tar-npm-6.1.11-e6ac3cba9c-a04c07bb9e.zip +0 -0
  221. package/.yarn/cache/typescript-npm-4.7.4-65aa6ffb42-5750181b1c.zip +0 -0
  222. package/.yarn/cache/typescript-patch-ae154b3216-96d3030cb0.zip +0 -0
  223. package/.yarn/cache/unique-filename-npm-1.1.1-c885c5095b-cf4998c922.zip +0 -0
  224. package/.yarn/cache/unique-slug-npm-2.0.2-f6ba1ddeb7-5b6876a645.zip +0 -0
  225. package/.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip +0 -0
  226. package/.yarn/cache/vite-npm-3.0.2-a17ab24a12-10aebec0df.zip +0 -0
  227. package/.yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip +0 -0
  228. package/.yarn/cache/wide-align-npm-1.1.5-889d77e592-d5fc37cd56.zip +0 -0
  229. package/.yarn/cache/wrappy-npm-1.0.2-916de4d4b3-159da4805f.zip +0 -0
  230. package/.yarn/cache/yallist-npm-4.0.0-b493d9e907-343617202a.zip +0 -0
  231. package/.yarn/install-state.gz +0 -0
  232. package/DEVELOPER.md +0 -118
  233. package/lib/index.97024df8.js +0 -80165
  234. package/lib/index.d8c1e37f.cjs +0 -80165
  235. package/src/blocks/button/button.jsx +0 -27
  236. package/src/blocks/button/component-info.js +0 -41
  237. package/src/blocks/columns/columns.jsx +0 -102
  238. package/src/blocks/columns/component-info.js +0 -242
  239. package/src/blocks/custom-code/component-info.js +0 -31
  240. package/src/blocks/custom-code/custom-code.jsx +0 -71
  241. package/src/blocks/embed/component-info.js +0 -44
  242. package/src/blocks/embed/embed.jsx +0 -63
  243. package/src/blocks/embed/helpers.js +0 -9
  244. package/src/blocks/form/component-info.js +0 -262
  245. package/src/blocks/form/form.jsx +0 -303
  246. package/src/blocks/fragment/component-info.js +0 -11
  247. package/src/blocks/fragment/fragment.jsx +0 -11
  248. package/src/blocks/image/component-info.js +0 -151
  249. package/src/blocks/image/image.helpers.js +0 -48
  250. package/src/blocks/image/image.jsx +0 -110
  251. package/src/blocks/img/component-info.js +0 -20
  252. package/src/blocks/img/img.jsx +0 -19
  253. package/src/blocks/input/component-info.js +0 -74
  254. package/src/blocks/input/input.jsx +0 -21
  255. package/src/blocks/raw-text/component-info.js +0 -16
  256. package/src/blocks/raw-text/raw-text.jsx +0 -12
  257. package/src/blocks/section/component-info.js +0 -49
  258. package/src/blocks/section/section.jsx +0 -20
  259. package/src/blocks/select/component-info.js +0 -59
  260. package/src/blocks/select/select.jsx +0 -24
  261. package/src/blocks/submit-button/component-info.js +0 -28
  262. package/src/blocks/submit-button/submit-button.jsx +0 -11
  263. package/src/blocks/symbol/component-info.js +0 -43
  264. package/src/blocks/symbol/symbol.jsx +0 -78
  265. package/src/blocks/text/component-info.js +0 -24
  266. package/src/blocks/text/text.jsx +0 -7
  267. package/src/blocks/textarea/component-info.js +0 -47
  268. package/src/blocks/textarea/textarea.jsx +0 -15
  269. package/src/blocks/util.js +0 -7
  270. package/src/blocks/video/component-info.js +0 -106
  271. package/src/blocks/video/video.jsx +0 -53
  272. package/src/components/render-block/block-styles.jsx +0 -60
  273. package/src/components/render-block/render-block.helpers.js +0 -23
  274. package/src/components/render-block/render-block.jsx +0 -220
  275. package/src/components/render-block/render-component.jsx +0 -35
  276. package/src/components/render-block/render-repeated-block.jsx +0 -40
  277. package/src/components/render-block/types.js +0 -0
  278. package/src/components/render-blocks.jsx +0 -93
  279. package/src/components/render-content/components/render-styles.jsx +0 -76
  280. package/src/components/render-content/index.js +0 -4
  281. package/src/components/render-content/render-content.jsx +0 -368
  282. package/src/components/render-inlined-styles.jsx +0 -26
  283. package/src/constants/builder-registered-components.js +0 -51
  284. package/src/constants/device-sizes.js +0 -21
  285. package/src/constants/target.js +0 -4
  286. package/src/context/builder.context.js +0 -5
  287. package/src/functions/camel-to-kebab-case.js +0 -4
  288. package/src/functions/convert-style-object.js +0 -6
  289. package/src/functions/evaluate.js +0 -28
  290. package/src/functions/event-handler-name.js +0 -7
  291. package/src/functions/get-block-actions.js +0 -23
  292. package/src/functions/get-block-component-options.js +0 -28
  293. package/src/functions/get-block-properties.js +0 -29
  294. package/src/functions/get-block-styles.js +0 -34
  295. package/src/functions/get-block-tag.js +0 -6
  296. package/src/functions/get-builder-search-params/fn.test.js +0 -13
  297. package/src/functions/get-builder-search-params/index.js +0 -33
  298. package/src/functions/get-content/ab-testing.js +0 -38
  299. package/src/functions/get-content/fn.test.js +0 -31
  300. package/src/functions/get-content/index.js +0 -96
  301. package/src/functions/get-content/types.js +0 -0
  302. package/src/functions/get-fetch.js +0 -34
  303. package/src/functions/get-global-this.js +0 -18
  304. package/src/functions/get-processed-block.js +0 -57
  305. package/src/functions/get-processed-block.test.js +0 -32
  306. package/src/functions/if-target.js +0 -15
  307. package/src/functions/is-browser.js +0 -6
  308. package/src/functions/is-editing.js +0 -7
  309. package/src/functions/is-iframe.js +0 -7
  310. package/src/functions/is-previewing.js +0 -14
  311. package/src/functions/mark-mutable.js +0 -14
  312. package/src/functions/on-change.js +0 -27
  313. package/src/functions/on-change.test.js +0 -19
  314. package/src/functions/register-component.js +0 -72
  315. package/src/functions/register.js +0 -29
  316. package/src/functions/sanitize-styles.js +0 -5
  317. package/src/functions/set-editor-settings.js +0 -15
  318. package/src/functions/set.js +0 -11
  319. package/src/functions/set.test.js +0 -16
  320. package/src/functions/track.js +0 -115
  321. package/src/functions/transform-block.js +0 -6
  322. package/src/helpers/cookie.js +0 -59
  323. package/src/helpers/css.js +0 -12
  324. package/src/helpers/flatten.js +0 -34
  325. package/src/helpers/localStorage.js +0 -34
  326. package/src/helpers/nullable.js +0 -4
  327. package/src/helpers/sessionId.js +0 -26
  328. package/src/helpers/time.js +0 -5
  329. package/src/helpers/url.js +0 -10
  330. package/src/helpers/url.test.js +0 -15
  331. package/src/helpers/uuid.js +0 -13
  332. package/src/helpers/visitorId.js +0 -33
  333. package/src/index-helpers/blocks-exports.js +0 -22
  334. package/src/index-helpers/top-of-file.js +0 -4
  335. package/src/index.js +0 -10
  336. package/src/scripts/init-editing.js +0 -79
  337. package/src/types/builder-block.js +0 -0
  338. package/src/types/builder-content.js +0 -0
  339. package/src/types/can-track.js +0 -0
  340. package/src/types/components.js +0 -0
  341. package/src/types/deep-partial.js +0 -0
  342. package/src/types/element.js +0 -0
  343. package/src/types/targets.js +0 -0
  344. package/src/types/typescript.js +0 -0
  345. package/tsconfig.json +0 -110
  346. package/types.d.ts +0 -8
  347. package/vite.config.ts +0 -17
@@ -62,9 +62,8 @@ const registerInsertMenu = () => {
62
62
  });
63
63
  };
64
64
  const setupBrowserForEditing = () => {
65
- var _a;
66
65
  if (isBrowser()) {
67
- (_a = window.parent) == null || _a.postMessage({
66
+ window.parent?.postMessage({
68
67
  type: "builder.sdkInfo",
69
68
  data: {
70
69
  target: TARGET,
@@ -72,7 +71,6 @@ const setupBrowserForEditing = () => {
72
71
  }
73
72
  }, "*");
74
73
  window.addEventListener("message", ({ data }) => {
75
- var _a2, _b;
76
74
  if (data)
77
75
  switch (data.type) {
78
76
  case "builder.evaluate": {
@@ -88,7 +86,7 @@ const setupBrowserForEditing = () => {
88
86
  error = err;
89
87
  }
90
88
  if (error)
91
- (_a2 = window.parent) == null || _a2.postMessage({
89
+ window.parent?.postMessage({
92
90
  type: "builder.evaluateError",
93
91
  data: {
94
92
  id,
@@ -97,8 +95,7 @@ const setupBrowserForEditing = () => {
97
95
  }, "*");
98
96
  else if (result && typeof result.then === "function")
99
97
  result.then((finalResult) => {
100
- var _a3;
101
- (_a3 = window.parent) == null || _a3.postMessage({
98
+ window.parent?.postMessage({
102
99
  type: "builder.evaluateResult",
103
100
  data: {
104
101
  id,
@@ -107,7 +104,7 @@ const setupBrowserForEditing = () => {
107
104
  }, "*");
108
105
  }).catch(console.error);
109
106
  else
110
- (_b = window.parent) == null || _b.postMessage({
107
+ window.parent?.postMessage({
111
108
  type: "builder.evaluateResult",
112
109
  data: {
113
110
  result,
@@ -120,7 +117,7 @@ const setupBrowserForEditing = () => {
120
117
  });
121
118
  }
122
119
  };
123
- var stdin_default = createContext("Builder");
120
+ const BuilderContext = createContext("Builder");
124
121
  function isIframe() {
125
122
  return isBrowser() && window.self !== window.top;
126
123
  }
@@ -173,37 +170,18 @@ const set = (obj, _path, value) => {
173
170
  function transformBlock(block) {
174
171
  return block;
175
172
  }
176
- var __defProp$8 = Object.defineProperty;
177
- var __defProps$6 = Object.defineProperties;
178
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
179
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
180
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
181
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
182
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, {
183
- enumerable: true,
184
- configurable: true,
185
- writable: true,
186
- value
187
- }) : obj[key] = value;
188
- var __spreadValues$8 = (a, b) => {
189
- for (var prop in b || (b = {}))
190
- if (__hasOwnProp$8.call(b, prop))
191
- __defNormalProp$8(a, prop, b[prop]);
192
- if (__getOwnPropSymbols$8) {
193
- for (var prop of __getOwnPropSymbols$8(b))
194
- if (__propIsEnum$8.call(b, prop))
195
- __defNormalProp$8(a, prop, b[prop]);
196
- }
197
- return a;
198
- };
199
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
200
173
  const evaluateBindings = ({ block, context, state }) => {
201
174
  if (!block.bindings)
202
175
  return block;
203
- const copied = __spreadProps$6(__spreadValues$8({}, block), {
204
- properties: __spreadValues$8({}, block.properties),
205
- actions: __spreadValues$8({}, block.actions)
206
- });
176
+ const copied = {
177
+ ...block,
178
+ properties: {
179
+ ...block.properties
180
+ },
181
+ actions: {
182
+ ...block.actions
183
+ }
184
+ };
207
185
  for (const binding in block.bindings) {
208
186
  const expression = block.bindings[binding];
209
187
  const value = evaluate({
@@ -238,7 +216,9 @@ const tagName$1 = function tagName(props, state) {
238
216
  return "style";
239
217
  };
240
218
  const RenderInlinedStyles = (props) => {
241
- const state = {};
219
+ const state = {
220
+ tagName: ""
221
+ };
242
222
  state.tagName = tagName$1();
243
223
  return /* @__PURE__ */ jsx(Fragment$1, {
244
224
  children: /* @__PURE__ */ jsx(state.tagName, {
@@ -283,9 +263,8 @@ function capitalizeFirstLetter(string) {
283
263
  }
284
264
  const getEventHandlerName = (key) => `on${capitalizeFirstLetter(key)}`;
285
265
  function getBlockActions(options) {
286
- var _a;
287
266
  const obj = {};
288
- const optionActions = (_a = options.block.actions) != null ? _a : {};
267
+ const optionActions = options.block.actions ?? {};
289
268
  for (const key in optionActions) {
290
269
  if (!optionActions.hasOwnProperty(key))
291
270
  continue;
@@ -299,105 +278,39 @@ function getBlockActions(options) {
299
278
  }
300
279
  return obj;
301
280
  }
302
- var __defProp$7 = Object.defineProperty;
303
- var __defProps$5 = Object.defineProperties;
304
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
305
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
306
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
307
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
308
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, {
309
- enumerable: true,
310
- configurable: true,
311
- writable: true,
312
- value
313
- }) : obj[key] = value;
314
- var __spreadValues$7 = (a, b) => {
315
- for (var prop in b || (b = {}))
316
- if (__hasOwnProp$7.call(b, prop))
317
- __defNormalProp$7(a, prop, b[prop]);
318
- if (__getOwnPropSymbols$7) {
319
- for (var prop of __getOwnPropSymbols$7(b))
320
- if (__propIsEnum$7.call(b, prop))
321
- __defNormalProp$7(a, prop, b[prop]);
322
- }
323
- return a;
324
- };
325
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
326
281
  function getBlockComponentOptions(block) {
327
- var _a;
328
- return __spreadProps$5(__spreadValues$7(__spreadValues$7({}, (_a = block.component) == null ? void 0 : _a.options), block.options), {
282
+ return {
283
+ ...block.component?.options,
284
+ ...block.options,
329
285
  builderBlock: block
330
- });
286
+ };
331
287
  }
332
- var __defProp$6 = Object.defineProperty;
333
- var __defProps$4 = Object.defineProperties;
334
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
335
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
336
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
337
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
338
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
339
- enumerable: true,
340
- configurable: true,
341
- writable: true,
342
- value
343
- }) : obj[key] = value;
344
- var __spreadValues$6 = (a, b) => {
345
- for (var prop in b || (b = {}))
346
- if (__hasOwnProp$6.call(b, prop))
347
- __defNormalProp$6(a, prop, b[prop]);
348
- if (__getOwnPropSymbols$6) {
349
- for (var prop of __getOwnPropSymbols$6(b))
350
- if (__propIsEnum$6.call(b, prop))
351
- __defNormalProp$6(a, prop, b[prop]);
352
- }
353
- return a;
354
- };
355
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
356
288
  function getBlockProperties(block) {
357
- var _a;
358
- return __spreadProps$4(__spreadValues$6({}, block.properties), {
289
+ return {
290
+ ...block.properties,
359
291
  "builder-id": block.id,
360
292
  class: [
361
293
  block.id,
362
294
  "builder-block",
363
295
  block.class,
364
- (_a = block.properties) == null ? void 0 : _a.class
296
+ block.properties?.class
365
297
  ].filter(Boolean).join(" ")
366
- });
298
+ };
367
299
  }
368
300
  const convertStyleObject = (obj) => {
369
301
  return obj;
370
302
  };
371
303
  const sanitizeBlockStyles = (_styles) => {
372
304
  };
373
- var __defProp$5 = Object.defineProperty;
374
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
375
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
376
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
377
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, {
378
- enumerable: true,
379
- configurable: true,
380
- writable: true,
381
- value
382
- }) : obj[key] = value;
383
- var __spreadValues$5 = (a, b) => {
384
- for (var prop in b || (b = {}))
385
- if (__hasOwnProp$5.call(b, prop))
386
- __defNormalProp$5(a, prop, b[prop]);
387
- if (__getOwnPropSymbols$5) {
388
- for (var prop of __getOwnPropSymbols$5(b))
389
- if (__propIsEnum$5.call(b, prop))
390
- __defNormalProp$5(a, prop, b[prop]);
391
- }
392
- return a;
393
- };
394
305
  function getBlockStyles(block) {
395
- var _a, _b, _c, _d, _e;
396
- const styles = __spreadValues$5(__spreadValues$5({}, convertStyleObject((_a = block.responsiveStyles) == null ? void 0 : _a.large)), block.styles);
397
- if ((_b = block.responsiveStyles) == null ? void 0 : _b.medium)
398
- styles[getMaxWidthQueryForSize("medium")] = convertStyleObject((_c = block.responsiveStyles) == null ? void 0 : _c.medium);
399
- if ((_d = block.responsiveStyles) == null ? void 0 : _d.small)
400
- styles[getMaxWidthQueryForSize("small")] = convertStyleObject((_e = block.responsiveStyles) == null ? void 0 : _e.small);
306
+ const styles = {
307
+ ...convertStyleObject(block.responsiveStyles?.large),
308
+ ...block.styles
309
+ };
310
+ if (block.responsiveStyles?.medium)
311
+ styles[getMaxWidthQueryForSize("medium")] = convertStyleObject(block.responsiveStyles?.medium);
312
+ if (block.responsiveStyles?.small)
313
+ styles[getMaxWidthQueryForSize("small")] = convertStyleObject(block.responsiveStyles?.small);
401
314
  sanitizeBlockStyles();
402
315
  return styles;
403
316
  }
@@ -438,13 +351,13 @@ const RenderComponent = (props) => {
438
351
  children: props.componentRef ? /* @__PURE__ */ jsxs(props.componentRef, {
439
352
  ...markPropsMutable(props.componentOptions),
440
353
  children: [
441
- (props.blockChildren || []).map((child) => {
354
+ (props.blockChildren || []).map(function(child) {
442
355
  return /* @__PURE__ */ jsx(RenderBlock$1, {
443
356
  block: child,
444
357
  context: props.context
445
358
  }, "render-block-" + child.id);
446
359
  }),
447
- (props.blockChildren || []).map((child) => {
360
+ (props.blockChildren || []).map(function(child) {
448
361
  return /* @__PURE__ */ jsx(BlockStyles$1, {
449
362
  block: child,
450
363
  context: props.context
@@ -456,7 +369,7 @@ const RenderComponent = (props) => {
456
369
  };
457
370
  const RenderComponent$1 = RenderComponent;
458
371
  const RenderRepeatedBlock = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
459
- useContextProvider(stdin_default, useStore({
372
+ useContextProvider(BuilderContext, useStore({
460
373
  content: (() => {
461
374
  return props.repeatContext.content;
462
375
  })(),
@@ -477,7 +390,7 @@ const RenderRepeatedBlock = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
477
390
  block: props.block,
478
391
  context: props.repeatContext
479
392
  });
480
- }, "RenderRepeatedBlock_component_fV0PdmPN990"));
393
+ }, "RenderRepeatedBlock_component_nRyVBtbGKc8"));
481
394
  const RenderRepeatedBlock$1 = RenderRepeatedBlock;
482
395
  const component = function component2(props, state) {
483
396
  const componentName = getProcessedBlock({
@@ -584,13 +497,15 @@ const repeatItemData = function repeatItemData2(props, state) {
584
497
  return repeatArray;
585
498
  };
586
499
  const RenderBlock = (props) => {
587
- const state = {};
500
+ const state = {
501
+ tagName: ""
502
+ };
588
503
  state.tagName = tagName2(props);
589
504
  return /* @__PURE__ */ jsx(Fragment$1, {
590
505
  children: shouldWrap(props) ? !isEmptyHtmlElement(tagName2(props)) ? /* @__PURE__ */ jsxs(state.tagName, {
591
506
  ...attributes(props),
592
507
  children: [
593
- repeatItemData(props) ? (repeatItemData(props) || []).map((data, index) => {
508
+ repeatItemData(props) ? (repeatItemData(props) || []).map(function(data, index) {
594
509
  return /* @__PURE__ */ jsx(RenderRepeatedBlock$1, {
595
510
  repeatContext: data.context,
596
511
  block: data.block
@@ -599,13 +514,13 @@ const RenderBlock = (props) => {
599
514
  !repeatItemData(props) ? /* @__PURE__ */ jsx(RenderComponent$1, {
600
515
  ...renderComponentProps(props)
601
516
  }) : null,
602
- (childrenWithoutParentComponent(props) || []).map((child) => {
517
+ (childrenWithoutParentComponent(props) || []).map(function(child) {
603
518
  return /* @__PURE__ */ jsx(RenderBlock, {
604
519
  block: child,
605
520
  context: props.context
606
521
  }, "render-block-" + child.id);
607
522
  }),
608
- (childrenWithoutParentComponent(props) || []).map((child) => {
523
+ (childrenWithoutParentComponent(props) || []).map(function(child) {
609
524
  return /* @__PURE__ */ jsx(BlockStyles$1, {
610
525
  block: child,
611
526
  context: props.context
@@ -645,20 +560,19 @@ const onMouseEnter = function onMouseEnter2(props, state, builderContext) {
645
560
  }, "*");
646
561
  };
647
562
  const RenderBlocks = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
648
- useStylesScopedQrl(inlinedQrl(STYLES$3, "RenderBlocks_component_useStylesScoped_QNti2s7juQc"));
649
- const builderContext = useContext(stdin_default);
650
- const state = {};
563
+ useStylesScopedQrl(inlinedQrl(STYLES$3, "RenderBlocks_component_useStylesScoped_0XKYzaR059E"));
564
+ const builderContext = useContext(BuilderContext);
565
+ const state = {
566
+ tagName: ""
567
+ };
651
568
  return /* @__PURE__ */ jsxs("div", {
652
569
  class: className(props) + " div-RenderBlocks",
653
570
  "builder-path": props.path,
654
571
  "builder-parent-id": props.parent,
655
- dataSet: {
656
- class: className(props)
657
- },
658
572
  onClick$: inlinedQrl((event) => {
659
573
  const [builderContext2, props2, state2] = useLexicalScope();
660
574
  return onClick$1(props2);
661
- }, "RenderBlocks_component_div_onClick_IHSfVTIKyxE", [
575
+ }, "RenderBlocks_component_div_onClick_RzhhZa265Yg", [
662
576
  builderContext,
663
577
  props,
664
578
  state
@@ -666,19 +580,19 @@ const RenderBlocks = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
666
580
  onMouseEnter$: inlinedQrl((event) => {
667
581
  const [builderContext2, props2, state2] = useLexicalScope();
668
582
  return onMouseEnter(props2);
669
- }, "RenderBlocks_component_div_onMouseEnter_qLiEh4n9ugw", [
583
+ }, "RenderBlocks_component_div_onMouseEnter_nG7I7RYG3JQ", [
670
584
  builderContext,
671
585
  props,
672
586
  state
673
587
  ]),
674
588
  children: [
675
- props.blocks ? (props.blocks || []).map((block) => {
589
+ props.blocks ? (props.blocks || []).map(function(block) {
676
590
  return /* @__PURE__ */ jsx(RenderBlock$1, {
677
591
  block,
678
592
  context: builderContext
679
593
  }, "render-block-" + block.id);
680
594
  }) : null,
681
- props.blocks ? (props.blocks || []).map((block) => {
595
+ props.blocks ? (props.blocks || []).map(function(block) {
682
596
  return /* @__PURE__ */ jsx(BlockStyles$1, {
683
597
  block,
684
598
  context: builderContext
@@ -686,7 +600,7 @@ const RenderBlocks = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
686
600
  }) : null
687
601
  ]
688
602
  });
689
- }, "RenderBlocks_component_SXGwmVyEM0s"));
603
+ }, "RenderBlocks_component_MYUZ0j1uLsw"));
690
604
  const RenderBlocks$1 = RenderBlocks;
691
605
  const STYLES$3 = `.div-RenderBlocks {
692
606
  display: flex;
@@ -730,12 +644,14 @@ const columnCssVars = function columnCssVars2(props, state) {
730
644
  };
731
645
  };
732
646
  const Columns = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
733
- useStylesScopedQrl(inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_704fWXyHORo"));
734
- const state = {};
647
+ useStylesScopedQrl(inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
648
+ const state = {
649
+ tagName: ""
650
+ };
735
651
  return /* @__PURE__ */ jsx("div", {
736
652
  class: "builder-columns div-Columns",
737
653
  style: columnsCssVars(props, state),
738
- children: (props.columns || []).map((column, index) => {
654
+ children: (props.columns || []).map(function(column, index) {
739
655
  return /* @__PURE__ */ jsx("div", {
740
656
  class: "builder-column div-Columns-2",
741
657
  style: {
@@ -751,7 +667,7 @@ const Columns = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
751
667
  }, index);
752
668
  })
753
669
  });
754
- }, "Columns_component_0PeVQGTMczc"));
670
+ }, "Columns_component_7yLj4bxdI6c"));
755
671
  const Columns$1 = Columns;
756
672
  const STYLES$2 = `.div-Columns {
757
673
  display: flex;
@@ -775,7 +691,7 @@ function updateQueryParam(uri = "", key, value) {
775
691
  return uri + separator + key + "=" + encodeURIComponent(value);
776
692
  }
777
693
  function getShopifyImageUrl(src, size) {
778
- if (!src || !(src == null ? void 0 : src.match(/cdn\.shopify\.com/)) || !size)
694
+ if (!src || !src?.match(/cdn\.shopify\.com/) || !size)
779
695
  return src;
780
696
  if (size === "master")
781
697
  return removeProtocol(src);
@@ -839,7 +755,7 @@ const webpSrcSet = function webpSrcSet2(props, state) {
839
755
  return "";
840
756
  };
841
757
  const Image = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
842
- useStylesScopedQrl(inlinedQrl(STYLES$1, "Image_component_useStylesScoped_gRbO7w7SeZA"));
758
+ useStylesScopedQrl(inlinedQrl(STYLES$1, "Image_component_useStylesScoped_fBMYiVf9fuU"));
843
759
  return /* @__PURE__ */ jsxs("div", {
844
760
  class: "div-Image",
845
761
  children: [
@@ -847,7 +763,7 @@ const Image = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
847
763
  children: [
848
764
  webpSrcSet(props) ? /* @__PURE__ */ jsx("source", {
849
765
  type: "image/webp",
850
- srcset: webpSrcSet(props)
766
+ srcSet: webpSrcSet(props)
851
767
  }) : null,
852
768
  /* @__PURE__ */ jsx("img", {
853
769
  loading: "lazy",
@@ -859,11 +775,11 @@ const Image = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
859
775
  },
860
776
  class: "builder-image" + (props.className ? " " + props.className : "") + " img-Image",
861
777
  src: props.image,
862
- srcset: srcSetToUse(props),
778
+ srcSet: srcSetToUse(props),
863
779
  sizes: props.sizes
864
780
  }),
865
781
  /* @__PURE__ */ jsx("source", {
866
- srcset: srcSetToUse(props)
782
+ srcSet: srcSetToUse(props)
867
783
  })
868
784
  ]
869
785
  }),
@@ -880,7 +796,7 @@ const Image = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
880
796
  }) : null
881
797
  ]
882
798
  });
883
- }, "Image_component_y3S3Zox9wEo"));
799
+ }, "Image_component_LRxDkFa1EfU"));
884
800
  const Image$1 = Image;
885
801
  const STYLES$1 = `.div-Image {
886
802
  position: relative; }.img-Image {
@@ -903,11 +819,11 @@ left: 0;
903
819
  width: 100%;
904
820
  height: 100%; }`;
905
821
  const Text = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
906
- return /* @__PURE__ */ jsx("div", {
822
+ return /* @__PURE__ */ jsx("span", {
907
823
  class: "builder-text",
908
824
  dangerouslySetInnerHTML: props.text
909
825
  });
910
- }, "Text_component_ci0NVEdoK0Q"));
826
+ }, "Text_component_15p0cKUxgIE"));
911
827
  const Text$1 = Text;
912
828
  const videoProps = function videoProps2(props, state) {
913
829
  return {
@@ -942,10 +858,10 @@ const Video = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
942
858
  src: props.video || "no-src",
943
859
  poster: props.posterImage
944
860
  });
945
- }, "Video_component_O5sPuWlrTvk"));
861
+ }, "Video_component_qdcTZflYyoQ"));
946
862
  const Video$1 = Video;
947
863
  const Button = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
948
- useStylesScopedQrl(inlinedQrl(STYLES, "Button_component_useStylesScoped_vN61mfeURXY"));
864
+ useStylesScopedQrl(inlinedQrl(STYLES, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
949
865
  return /* @__PURE__ */ jsx(Fragment$2, {
950
866
  children: props.link ? /* @__PURE__ */ jsx("a", {
951
867
  role: "button",
@@ -959,7 +875,7 @@ const Button = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
959
875
  children: props.text
960
876
  })
961
877
  });
962
- }, "Button_component_FtjCELjtKF4"));
878
+ }, "Button_component_gJoMUICXoUQ"));
963
879
  const Button$1 = Button;
964
880
  const STYLES = `.button-Button {
965
881
  all: unset; }`;
@@ -1258,7 +1174,7 @@ const FragmentComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1258
1174
  return /* @__PURE__ */ jsx("span", {
1259
1175
  children: /* @__PURE__ */ jsx(Slot, {})
1260
1176
  });
1261
- }, "FragmentComponent_component_FJmqlA66Rjg"));
1177
+ }, "FragmentComponent_component_T0AypnadAK0"));
1262
1178
  const Fragment = FragmentComponent;
1263
1179
  const componentInfo$6 = {
1264
1180
  name: "Image",
@@ -1463,7 +1379,7 @@ const SectionComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1463
1379
  })(),
1464
1380
  children: /* @__PURE__ */ jsx(Slot, {})
1465
1381
  });
1466
- }, "SectionComponent_component_m1CcjCwgHug"));
1382
+ }, "SectionComponent_component_ZWF9iD5WeLg"));
1467
1383
  const Section = SectionComponent;
1468
1384
  const componentInfo$4 = {
1469
1385
  name: "Symbol",
@@ -1705,9 +1621,9 @@ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
1705
1621
  const Embed = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1706
1622
  const elem = useRef();
1707
1623
  const state = useStore({
1624
+ ranInitFn: false,
1708
1625
  scriptsInserted: [],
1709
- scriptsRun: [],
1710
- ranInitFn: false
1626
+ scriptsRun: []
1711
1627
  });
1712
1628
  useWatchQrl(inlinedQrl(({ track: track2 }) => {
1713
1629
  const [elem2, props2, state2] = useLexicalScope();
@@ -1716,7 +1632,7 @@ const Embed = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1716
1632
  state2.ranInitFn = true;
1717
1633
  findAndRunScripts(props2, state2, elem2);
1718
1634
  }
1719
- }, "Embed_component_useWatch_XE41s3iNuto", [
1635
+ }, "Embed_component_useWatch_AxgWjrHdlAI", [
1720
1636
  elem,
1721
1637
  props,
1722
1638
  state
@@ -1726,7 +1642,7 @@ const Embed = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1726
1642
  ref: elem,
1727
1643
  dangerouslySetInnerHTML: props.content
1728
1644
  });
1729
- }, "Embed_component_CP6B8Y76ylw"));
1645
+ }, "Embed_component_Uji08ORjXbE"));
1730
1646
  const embed = Embed;
1731
1647
  const ImgComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1732
1648
  return /* @__PURE__ */ jsx("img", {
@@ -1738,7 +1654,7 @@ const ImgComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1738
1654
  src: props.imgSrc || props.image,
1739
1655
  ...props.attributes
1740
1656
  }, isEditing() && props.imgSrc || "default-key");
1741
- }, "ImgComponent_component_b8FkE9OcVN8"));
1657
+ }, "ImgComponent_component_FXvIDBSffO8"));
1742
1658
  const Img = ImgComponent;
1743
1659
  const componentInfo2 = {
1744
1660
  name: "Raw:Img",
@@ -1762,83 +1678,48 @@ const componentInfo2 = {
1762
1678
  noWrap: true,
1763
1679
  static: true
1764
1680
  };
1765
- var __defProp$4 = Object.defineProperty;
1766
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1767
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1768
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1769
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {
1770
- enumerable: true,
1771
- configurable: true,
1772
- writable: true,
1773
- value
1774
- }) : obj[key] = value;
1775
- var __spreadValues$4 = (a, b) => {
1776
- for (var prop in b || (b = {}))
1777
- if (__hasOwnProp$4.call(b, prop))
1778
- __defNormalProp$4(a, prop, b[prop]);
1779
- if (__getOwnPropSymbols$4) {
1780
- for (var prop of __getOwnPropSymbols$4(b))
1781
- if (__propIsEnum$4.call(b, prop))
1782
- __defNormalProp$4(a, prop, b[prop]);
1783
- }
1784
- return a;
1785
- };
1786
1681
  const getDefaultRegisteredComponents = () => [
1787
- __spreadValues$4({
1788
- component: Columns$1
1789
- }, componentInfo$8),
1790
- __spreadValues$4({
1791
- component: Image$1
1792
- }, componentInfo$6),
1793
- __spreadValues$4({
1794
- component: Img
1795
- }, componentInfo2),
1796
- __spreadValues$4({
1797
- component: Text$1
1798
- }, componentInfo$3),
1799
- __spreadValues$4({
1800
- component: Video$1
1801
- }, componentInfo$2),
1802
- __spreadValues$4({
1803
- component: Symbol$2
1804
- }, componentInfo$4),
1805
- __spreadValues$4({
1806
- component: Button$1
1807
- }, componentInfo$9),
1808
- __spreadValues$4({
1809
- component: Section
1810
- }, componentInfo$5),
1811
- __spreadValues$4({
1812
- component: Fragment
1813
- }, componentInfo$7),
1814
- __spreadValues$4({
1815
- component: embed
1816
- }, componentInfo$1)
1817
- ];
1818
- var __defProp$3 = Object.defineProperty;
1819
- var __defProps$3 = Object.defineProperties;
1820
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1821
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1822
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1823
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1824
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
1825
- enumerable: true,
1826
- configurable: true,
1827
- writable: true,
1828
- value
1829
- }) : obj[key] = value;
1830
- var __spreadValues$3 = (a, b) => {
1831
- for (var prop in b || (b = {}))
1832
- if (__hasOwnProp$3.call(b, prop))
1833
- __defNormalProp$3(a, prop, b[prop]);
1834
- if (__getOwnPropSymbols$3) {
1835
- for (var prop of __getOwnPropSymbols$3(b))
1836
- if (__propIsEnum$3.call(b, prop))
1837
- __defNormalProp$3(a, prop, b[prop]);
1682
+ {
1683
+ component: Columns$1,
1684
+ ...componentInfo$8
1685
+ },
1686
+ {
1687
+ component: Image$1,
1688
+ ...componentInfo$6
1689
+ },
1690
+ {
1691
+ component: Img,
1692
+ ...componentInfo2
1693
+ },
1694
+ {
1695
+ component: Text$1,
1696
+ ...componentInfo$3
1697
+ },
1698
+ {
1699
+ component: Video$1,
1700
+ ...componentInfo$2
1701
+ },
1702
+ {
1703
+ component: Symbol$2,
1704
+ ...componentInfo$4
1705
+ },
1706
+ {
1707
+ component: Button$1,
1708
+ ...componentInfo$9
1709
+ },
1710
+ {
1711
+ component: Section,
1712
+ ...componentInfo$5
1713
+ },
1714
+ {
1715
+ component: Fragment,
1716
+ ...componentInfo$7
1717
+ },
1718
+ {
1719
+ component: embed,
1720
+ ...componentInfo$1
1838
1721
  }
1839
- return a;
1840
- };
1841
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1722
+ ];
1842
1723
  function flatten(object, path = null, separator = ".") {
1843
1724
  return Object.keys(object).reduce((acc, key) => {
1844
1725
  const value = object[key];
@@ -1851,9 +1732,13 @@ function flatten(object, path = null, separator = ".") {
1851
1732
  value !== null,
1852
1733
  !(Array.isArray(value) && value.length === 0)
1853
1734
  ].every(Boolean);
1854
- return isObject ? __spreadValues$3(__spreadValues$3({}, acc), flatten(value, newPath, separator)) : __spreadProps$3(__spreadValues$3({}, acc), {
1735
+ return isObject ? {
1736
+ ...acc,
1737
+ ...flatten(value, newPath, separator)
1738
+ } : {
1739
+ ...acc,
1855
1740
  [newPath]: value
1856
- });
1741
+ };
1857
1742
  }, {});
1858
1743
  }
1859
1744
  const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
@@ -1892,35 +1777,14 @@ function getGlobalThis() {
1892
1777
  return self;
1893
1778
  return null;
1894
1779
  }
1895
- var __async$2 = (__this, __arguments, generator) => {
1896
- return new Promise((resolve, reject) => {
1897
- var fulfilled = (value) => {
1898
- try {
1899
- step(generator.next(value));
1900
- } catch (e) {
1901
- reject(e);
1902
- }
1903
- };
1904
- var rejected = (value) => {
1905
- try {
1906
- step(generator.throw(value));
1907
- } catch (e) {
1908
- reject(e);
1909
- }
1910
- };
1911
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1912
- step((generator = generator.apply(__this, __arguments)).next());
1913
- });
1914
- };
1915
- function getFetch() {
1916
- return __async$2(this, null, function* () {
1917
- const globalFetch = getGlobalThis().fetch;
1918
- if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
1919
- const nodeFetch = import("./index.97024df8.js").then((d) => d.default);
1920
- return nodeFetch.default || nodeFetch;
1921
- }
1922
- return globalFetch.default || globalFetch;
1923
- });
1780
+ const NODE_FETCH_URL = () => "node-fetch";
1781
+ async function getFetch() {
1782
+ const globalFetch = getGlobalThis().fetch;
1783
+ if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
1784
+ const nodeFetch = import(NODE_FETCH_URL()).then((d) => d.default);
1785
+ return nodeFetch.default || nodeFetch;
1786
+ }
1787
+ return globalFetch.default || globalFetch;
1924
1788
  }
1925
1789
  const handleABTesting = (item, testGroups) => {
1926
1790
  if (item.variations && Object.keys(item.variations).length) {
@@ -1956,86 +1820,42 @@ const handleABTesting = (item, testGroups) => {
1956
1820
  }
1957
1821
  }
1958
1822
  };
1959
- var __defProp$2 = Object.defineProperty;
1960
- var __defProps$2 = Object.defineProperties;
1961
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1962
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1963
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1964
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1965
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
1966
- enumerable: true,
1967
- configurable: true,
1968
- writable: true,
1969
- value
1970
- }) : obj[key] = value;
1971
- var __spreadValues$2 = (a, b) => {
1972
- for (var prop in b || (b = {}))
1973
- if (__hasOwnProp$2.call(b, prop))
1974
- __defNormalProp$2(a, prop, b[prop]);
1975
- if (__getOwnPropSymbols$2) {
1976
- for (var prop of __getOwnPropSymbols$2(b))
1977
- if (__propIsEnum$2.call(b, prop))
1978
- __defNormalProp$2(a, prop, b[prop]);
1979
- }
1980
- return a;
1981
- };
1982
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1983
- var __async$1 = (__this, __arguments, generator) => {
1984
- return new Promise((resolve, reject) => {
1985
- var fulfilled = (value) => {
1986
- try {
1987
- step(generator.next(value));
1988
- } catch (e) {
1989
- reject(e);
1990
- }
1991
- };
1992
- var rejected = (value) => {
1993
- try {
1994
- step(generator.throw(value));
1995
- } catch (e) {
1996
- reject(e);
1997
- }
1998
- };
1999
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
2000
- step((generator = generator.apply(__this, __arguments)).next());
2001
- });
2002
- };
2003
1823
  const fetch$ = getFetch();
2004
- function getContent(options) {
2005
- return __async$1(this, null, function* () {
2006
- return (yield getAllContent(__spreadProps$2(__spreadValues$2({}, options), {
2007
- limit: 1
2008
- }))).results[0] || null;
2009
- });
1824
+ async function getContent(options) {
1825
+ return (await getAllContent({
1826
+ ...options,
1827
+ limit: 1
1828
+ })).results[0] || null;
2010
1829
  }
2011
1830
  const generateContentUrl = (options) => {
2012
1831
  const { limit = 30, userAttributes, query, noTraverse = false, model, apiKey } = options;
2013
1832
  const url = new URL(`https://cdn.builder.io/api/v2/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}`);
2014
- const queryOptions = __spreadValues$2(__spreadValues$2({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
1833
+ const queryOptions = {
1834
+ ...getBuilderSearchParamsFromWindow(),
1835
+ ...normalizeSearchParams(options.options || {})
1836
+ };
2015
1837
  const flattened = flatten(queryOptions);
2016
1838
  for (const key in flattened)
2017
1839
  url.searchParams.set(key, String(flattened[key]));
2018
1840
  if (userAttributes)
2019
1841
  url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
2020
1842
  if (query) {
2021
- const flattened2 = flatten({
1843
+ const flattened1 = flatten({
2022
1844
  query
2023
1845
  });
2024
- for (const key1 in flattened2)
2025
- url.searchParams.set(key1, JSON.stringify(flattened2[key1]));
1846
+ for (const key1 in flattened1)
1847
+ url.searchParams.set(key1, JSON.stringify(flattened1[key1]));
2026
1848
  }
2027
1849
  return url;
2028
1850
  };
2029
- function getAllContent(options) {
2030
- return __async$1(this, null, function* () {
2031
- const url = generateContentUrl(options);
2032
- const fetch2 = yield fetch$;
2033
- const content = yield fetch2(url.href).then((res) => res.json());
2034
- if (options.testGroups)
2035
- for (const item of content.results)
2036
- handleABTesting(item, options.testGroups);
2037
- return content;
2038
- });
1851
+ async function getAllContent(options) {
1852
+ const url = generateContentUrl(options);
1853
+ const fetch2 = await fetch$;
1854
+ const content = await fetch2(url.href).then((res) => res.json());
1855
+ if (options.testGroups)
1856
+ for (const item of content.results)
1857
+ handleABTesting(item, options.testGroups);
1858
+ return content;
2039
1859
  }
2040
1860
  function isPreviewing() {
2041
1861
  if (!isBrowser())
@@ -2044,59 +1864,19 @@ function isPreviewing() {
2044
1864
  return false;
2045
1865
  return Boolean(location.search.indexOf("builder.preview=") !== -1);
2046
1866
  }
2047
- var __defProp$1 = Object.defineProperty;
2048
- var __defProps$1 = Object.defineProperties;
2049
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
2050
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
2051
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
2052
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
2053
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
2054
- enumerable: true,
2055
- configurable: true,
2056
- writable: true,
2057
- value
2058
- }) : obj[key] = value;
2059
- var __spreadValues$1 = (a, b) => {
2060
- for (var prop in b || (b = {}))
2061
- if (__hasOwnProp$1.call(b, prop))
2062
- __defNormalProp$1(a, prop, b[prop]);
2063
- if (__getOwnPropSymbols$1) {
2064
- for (var prop of __getOwnPropSymbols$1(b))
2065
- if (__propIsEnum$1.call(b, prop))
2066
- __defNormalProp$1(a, prop, b[prop]);
2067
- }
2068
- return a;
2069
- };
2070
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
2071
- var __objRest$1 = (source, exclude) => {
2072
- var target = {};
2073
- for (var prop in source)
2074
- if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
2075
- target[prop] = source[prop];
2076
- if (source != null && __getOwnPropSymbols$1) {
2077
- for (var prop of __getOwnPropSymbols$1(source))
2078
- if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
2079
- target[prop] = source[prop];
2080
- }
2081
- return target;
2082
- };
2083
1867
  const components = [];
2084
1868
  function registerComponent(component3, info) {
2085
- components.push(__spreadValues$1({
2086
- component: component3
2087
- }, info));
1869
+ components.push({
1870
+ component: component3,
1871
+ ...info
1872
+ });
2088
1873
  console.warn("registerComponent is deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.");
2089
1874
  return component3;
2090
1875
  }
2091
- const createRegisterComponentMessage = (_a) => {
2092
- var info = __objRest$1(_a, [
2093
- "component"
2094
- ]);
2095
- return {
2096
- type: "builder.registerComponent",
2097
- data: prepareComponentInfoToSend(info)
2098
- };
2099
- };
1876
+ const createRegisterComponentMessage = ({ component: _, ...info }) => ({
1877
+ type: "builder.registerComponent",
1878
+ data: prepareComponentInfoToSend(info)
1879
+ });
2100
1880
  const fastClone = (obj) => JSON.parse(JSON.stringify(obj));
2101
1881
  const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
2102
1882
  const serializeFn = (fnValue) => {
@@ -2104,16 +1884,13 @@ const serializeFn = (fnValue) => {
2104
1884
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
2105
1885
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
2106
1886
  };
2107
- const prepareComponentInfoToSend = (_c) => {
2108
- var { inputs } = _c, info = __objRest$1(_c, [
2109
- "inputs"
2110
- ]);
2111
- return __spreadProps$1(__spreadValues$1({}, fastClone(info)), {
2112
- inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => __spreadProps$1(__spreadValues$1({}, acc), {
2113
- [key]: serializeValue(value)
2114
- }), {}))
2115
- });
2116
- };
1887
+ const prepareComponentInfoToSend = ({ inputs, ...info }) => ({
1888
+ ...fastClone(info),
1889
+ inputs: inputs?.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
1890
+ ...acc,
1891
+ [key]: serializeValue(value)
1892
+ }), {}))
1893
+ });
2117
1894
  const getTopLevelDomain = (host) => {
2118
1895
  const parts = host.split(".");
2119
1896
  if (parts.length > 2)
@@ -2121,11 +1898,10 @@ const getTopLevelDomain = (host) => {
2121
1898
  return host;
2122
1899
  };
2123
1900
  const getCookie = ({ name, canTrack }) => {
2124
- var _a;
2125
1901
  try {
2126
1902
  if (!canTrack)
2127
1903
  return void 0;
2128
- return (_a = document.cookie.split("; ").find((row) => row.startsWith(`${name}=`))) == null ? void 0 : _a.split("=")[1];
1904
+ return document.cookie.split("; ").find((row) => row.startsWith(`${name}=`))?.split("=")[1];
2129
1905
  } catch (err) {
2130
1906
  console.debug("[COOKIE] GET error: ", err);
2131
1907
  }
@@ -2223,20 +1999,18 @@ const setSessionId = ({ id, canTrack }) => setCookie({
2223
1999
  });
2224
2000
  const getLocalStorage = () => isBrowser() && typeof localStorage !== "undefined" ? localStorage : void 0;
2225
2001
  const getLocalStorageItem = ({ key, canTrack }) => {
2226
- var _a;
2227
2002
  try {
2228
2003
  if (canTrack)
2229
- return (_a = getLocalStorage()) == null ? void 0 : _a.getItem(key);
2004
+ return getLocalStorage()?.getItem(key);
2230
2005
  return void 0;
2231
2006
  } catch (err) {
2232
2007
  console.debug("[LocalStorage] GET error: ", err);
2233
2008
  }
2234
2009
  };
2235
2010
  const setLocalStorageItem = ({ key, canTrack, value }) => {
2236
- var _a;
2237
2011
  try {
2238
2012
  if (canTrack)
2239
- (_a = getLocalStorage()) == null || _a.setItem(key, value);
2013
+ getLocalStorage()?.setItem(key, value);
2240
2014
  } catch (err) {
2241
2015
  console.debug("[LocalStorage] SET error: ", err);
2242
2016
  }
@@ -2265,62 +2039,6 @@ const setVisitorId = ({ id, canTrack }) => setLocalStorageItem({
2265
2039
  value: id,
2266
2040
  canTrack
2267
2041
  });
2268
- var __defProp = Object.defineProperty;
2269
- var __defProps = Object.defineProperties;
2270
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2271
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2272
- var __hasOwnProp = Object.prototype.hasOwnProperty;
2273
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
2274
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
2275
- enumerable: true,
2276
- configurable: true,
2277
- writable: true,
2278
- value
2279
- }) : obj[key] = value;
2280
- var __spreadValues = (a, b) => {
2281
- for (var prop in b || (b = {}))
2282
- if (__hasOwnProp.call(b, prop))
2283
- __defNormalProp(a, prop, b[prop]);
2284
- if (__getOwnPropSymbols) {
2285
- for (var prop of __getOwnPropSymbols(b))
2286
- if (__propIsEnum.call(b, prop))
2287
- __defNormalProp(a, prop, b[prop]);
2288
- }
2289
- return a;
2290
- };
2291
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2292
- var __objRest = (source, exclude) => {
2293
- var target = {};
2294
- for (var prop in source)
2295
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
2296
- target[prop] = source[prop];
2297
- if (source != null && __getOwnPropSymbols) {
2298
- for (var prop of __getOwnPropSymbols(source))
2299
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
2300
- target[prop] = source[prop];
2301
- }
2302
- return target;
2303
- };
2304
- var __async = (__this, __arguments, generator) => {
2305
- return new Promise((resolve, reject) => {
2306
- var fulfilled = (value) => {
2307
- try {
2308
- step(generator.next(value));
2309
- } catch (e) {
2310
- reject(e);
2311
- }
2312
- };
2313
- var rejected = (value) => {
2314
- try {
2315
- step(generator.throw(value));
2316
- } catch (e) {
2317
- reject(e);
2318
- }
2319
- };
2320
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
2321
- step((generator = generator.apply(__this, __arguments)).next());
2322
- });
2323
- };
2324
2042
  const getTrackingEventData = ({ canTrack }) => {
2325
2043
  if (!canTrack)
2326
2044
  return {
@@ -2338,45 +2056,37 @@ const getTrackingEventData = ({ canTrack }) => {
2338
2056
  visitorId
2339
2057
  };
2340
2058
  };
2341
- const createEvent = (_a) => {
2342
- var { type: eventType, canTrack, orgId, contentId } = _a, properties = __objRest(_a, [
2343
- "type",
2344
- "canTrack",
2345
- "orgId",
2346
- "contentId"
2347
- ]);
2348
- return {
2349
- type: eventType,
2350
- data: __spreadProps(__spreadValues(__spreadValues({}, properties), getTrackingEventData({
2059
+ const createEvent = ({ type: eventType, canTrack, orgId, contentId, ...properties }) => ({
2060
+ type: eventType,
2061
+ data: {
2062
+ ...properties,
2063
+ ...getTrackingEventData({
2351
2064
  canTrack
2352
- })), {
2353
- ownerId: orgId,
2354
- contentId
2355
- })
2356
- };
2357
- };
2358
- function track(eventProps) {
2359
- return __async(this, null, function* () {
2360
- if (!eventProps.canTrack)
2361
- return;
2362
- if (isEditing())
2363
- return;
2364
- if (!(isBrowser() || TARGET === "reactNative"))
2365
- return;
2366
- return fetch(`https://builder.io/api/v1/track`, {
2367
- method: "POST",
2368
- body: JSON.stringify({
2369
- events: [
2370
- createEvent(eventProps)
2371
- ]
2372
- }),
2373
- headers: {
2374
- "content-type": "application/json"
2375
- },
2376
- mode: "cors"
2377
- }).catch((err) => {
2378
- console.error("Failed to track: ", err);
2379
- });
2065
+ }),
2066
+ ownerId: orgId,
2067
+ contentId
2068
+ }
2069
+ });
2070
+ async function track(eventProps) {
2071
+ if (!eventProps.canTrack)
2072
+ return;
2073
+ if (isEditing())
2074
+ return;
2075
+ if (!(isBrowser() || TARGET === "reactNative"))
2076
+ return;
2077
+ return fetch(`https://builder.io/api/v1/track`, {
2078
+ method: "POST",
2079
+ body: JSON.stringify({
2080
+ events: [
2081
+ createEvent(eventProps)
2082
+ ]
2083
+ }),
2084
+ headers: {
2085
+ "content-type": "application/json"
2086
+ },
2087
+ mode: "cors"
2088
+ }).catch((err) => {
2089
+ console.error("Failed to track: ", err);
2380
2090
  });
2381
2091
  }
2382
2092
  const getCssFromFont = function getCssFromFont2(props, state, font) {
@@ -2422,11 +2132,13 @@ ${getFontCss(props, state, {
2422
2132
  })}`;
2423
2133
  };
2424
2134
  const RenderContentStyles = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2425
- const state = {};
2135
+ const state = {
2136
+ tagName: ""
2137
+ };
2426
2138
  return /* @__PURE__ */ jsx(RenderInlinedStyles$1, {
2427
2139
  styles: injectedStyles(props, state)
2428
2140
  });
2429
- }, "RenderContentStyles_component_32XAr483K2o"));
2141
+ }, "RenderContentStyles_component_Og0xL34Zbvc"));
2430
2142
  const RenderContentStyles$1 = RenderContentStyles;
2431
2143
  const useContent = function useContent2(props, state, elementRef) {
2432
2144
  if (!props.content && !state.overrideContent)
@@ -2500,7 +2212,7 @@ const onClick2 = function onClick3(props, state, elementRef, _event) {
2500
2212
  track({
2501
2213
  type: "click",
2502
2214
  canTrack: canTrackToUse(props),
2503
- contentId: useContent(props, state).id,
2215
+ contentId: useContent(props, state)?.id,
2504
2216
  orgId: props.apiKey
2505
2217
  });
2506
2218
  };
@@ -2512,17 +2224,15 @@ const evalExpression = function evalExpression2(props, state, elementRef, expres
2512
2224
  }));
2513
2225
  };
2514
2226
  const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
2515
- const fetchAndSetState = async () => {
2516
- const fetch2 = await getFetch();
2517
- const response = await fetch2(url);
2518
- const json = await response.json();
2227
+ getFetch().then((fetch2) => fetch2(url)).then((response) => response.json()).then((json) => {
2519
2228
  const newOverrideState = {
2520
2229
  ...state.overrideState,
2521
2230
  [key]: json
2522
2231
  };
2523
2232
  state.overrideState = newOverrideState;
2524
- };
2525
- fetchAndSetState();
2233
+ }).catch((err) => {
2234
+ console.log("error fetching dynamic data", url, err);
2235
+ });
2526
2236
  };
2527
2237
  const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
2528
2238
  const requests = useContent(props, state)?.data?.httpRequests ?? {};
@@ -2555,10 +2265,10 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2555
2265
  const state = useStore({
2556
2266
  forceReRenderCount: 0,
2557
2267
  overrideContent: null,
2558
- update: 0,
2559
- overrideState: {}
2268
+ overrideState: {},
2269
+ update: 0
2560
2270
  });
2561
- useContextProvider(stdin_default, useStore({
2271
+ useContextProvider(BuilderContext, useStore({
2562
2272
  content: (() => {
2563
2273
  return useContent(props, state);
2564
2274
  })(),
@@ -2580,7 +2290,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2580
2290
  if (isBrowser()) {
2581
2291
  if (isEditing()) {
2582
2292
  state2.forceReRenderCount = state2.forceReRenderCount + 1;
2583
- _useMutableProps(elementRef2.current, true);
2293
+ elementRef2.current && _useMutableProps(elementRef2.current, true);
2584
2294
  registerInsertMenu();
2585
2295
  setupBrowserForEditing();
2586
2296
  Object.values(allRegisteredComponents(props2)).forEach((registeredComponent) => {
@@ -2594,7 +2304,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2594
2304
  track({
2595
2305
  type: "impression",
2596
2306
  canTrack: canTrackToUse(props2),
2597
- contentId: useContent(props2, state2).id,
2307
+ contentId: useContent(props2, state2)?.id,
2598
2308
  orgId: props2.apiKey
2599
2309
  });
2600
2310
  if (isPreviewing()) {
@@ -2615,7 +2325,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2615
2325
  runHttpRequests(props2, state2, elementRef2);
2616
2326
  emitStateUpdate(props2, state2);
2617
2327
  }
2618
- }, "RenderContent_component_useClientEffect_ntruwSC9lSo", [
2328
+ }, "RenderContent_component_useClientEffect_cA0sVHIkr5g", [
2619
2329
  elementRef,
2620
2330
  props,
2621
2331
  state
@@ -2624,7 +2334,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2624
2334
  const [elementRef2, props2, state2] = useLexicalScope();
2625
2335
  state2.useContent?.data && track2(state2.useContent?.data, "jsCode");
2626
2336
  evaluateJsCode(props2, state2);
2627
- }, "RenderContent_component_useWatch_1P0ujLQOmzc", [
2337
+ }, "RenderContent_component_useWatch_OIBatobA0hE", [
2628
2338
  elementRef,
2629
2339
  props,
2630
2340
  state
@@ -2633,7 +2343,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2633
2343
  const [elementRef2, props2, state2] = useLexicalScope();
2634
2344
  state2.useContent?.data && track2(state2.useContent?.data, "httpRequests");
2635
2345
  runHttpRequests(props2, state2, elementRef2);
2636
- }, "RenderContent_component_useWatch_1_0hAcn4V2AZw", [
2346
+ }, "RenderContent_component_useWatch_1_LQM67VNl14k", [
2637
2347
  elementRef,
2638
2348
  props,
2639
2349
  state
@@ -2642,7 +2352,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2642
2352
  const [elementRef2, props2, state2] = useLexicalScope();
2643
2353
  state2 && track2(state2, "contentState");
2644
2354
  emitStateUpdate(props2, state2);
2645
- }, "RenderContent_component_useWatch_2_t2n8zpl4mRs", [
2355
+ }, "RenderContent_component_useWatch_2_aGi0RpYNBO0", [
2646
2356
  elementRef,
2647
2357
  props,
2648
2358
  state
@@ -2653,7 +2363,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2653
2363
  window.removeEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
2654
2364
  window.removeEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
2655
2365
  }
2656
- }, "RenderContent_component_useCleanup_sGf1npb03WA", [
2366
+ }, "RenderContent_component_useCleanup_FwcO310HVAI", [
2657
2367
  elementRef,
2658
2368
  props,
2659
2369
  state
@@ -2664,7 +2374,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2664
2374
  onClick$: inlinedQrl((event) => {
2665
2375
  const [elementRef2, props2, state2] = useLexicalScope();
2666
2376
  return onClick2(props2, state2);
2667
- }, "RenderContent_component__Fragment_div_onClick_76e3rL00UYE", [
2377
+ }, "RenderContent_component__Fragment_div_onClick_wLg5o3ZkpC0", [
2668
2378
  elementRef,
2669
2379
  props,
2670
2380
  state
@@ -2681,10 +2391,10 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2681
2391
  ]
2682
2392
  }) : null
2683
2393
  });
2684
- }, "RenderContent_component_I00xF3zGD1I"));
2394
+ }, "RenderContent_component_hEAI0ahViXM"));
2685
2395
  const RenderContent$1 = RenderContent;
2686
2396
  const Symbol$1 = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2687
- const builderContext = useContext(stdin_default);
2397
+ const builderContext = useContext(BuilderContext);
2688
2398
  const state = useStore({
2689
2399
  className: "builder-symbol",
2690
2400
  content: null
@@ -2692,7 +2402,7 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2692
2402
  useClientEffectQrl(inlinedQrl(() => {
2693
2403
  const [props2, state2] = useLexicalScope();
2694
2404
  state2.content = props2.symbol?.content;
2695
- }, "Symbol_component_useClientEffect_nexfMR52XGY", [
2405
+ }, "Symbol_component_useClientEffect_Kfc9q3nzeSQ", [
2696
2406
  props,
2697
2407
  state
2698
2408
  ]));
@@ -2711,16 +2421,13 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2711
2421
  }).then((response) => {
2712
2422
  state2.content = response;
2713
2423
  });
2714
- }, "Symbol_component_useWatch_cKXWtr2eEjY", [
2424
+ }, "Symbol_component_useWatch_9HNT04zd0Dk", [
2715
2425
  builderContext,
2716
2426
  props,
2717
2427
  state
2718
2428
  ]));
2719
2429
  return /* @__PURE__ */ jsx("div", {
2720
2430
  ...props.attributes,
2721
- dataSet: {
2722
- class: state.className
2723
- },
2724
2431
  class: state.className,
2725
2432
  children: /* @__PURE__ */ jsx(RenderContent$1, {
2726
2433
  apiKey: builderContext.apiKey,
@@ -2735,7 +2442,7 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2735
2442
  content: markMutable(state.content)
2736
2443
  })
2737
2444
  });
2738
- }, "Symbol_component_Dn8mGpai87I"));
2445
+ }, "Symbol_component_WVvggdkUPdk"));
2739
2446
  const Symbol$2 = Symbol$1;
2740
2447
  const settings = {};
2741
2448
  function setEditorSettings(newSettings) {