@builder.io/sdk-qwik 0.6.5-4 → 0.7.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 (316) hide show
  1. package/lib/browser/index.qwik.cjs +48 -61
  2. package/lib/browser/index.qwik.mjs +49 -62
  3. package/lib/edge/index.qwik.cjs +48 -61
  4. package/lib/edge/index.qwik.mjs +49 -62
  5. package/lib/node/index.qwik.cjs +48 -61
  6. package/lib/node/index.qwik.mjs +49 -62
  7. package/package.json +1 -1
  8. package/lib/index.qwik.cjs +0 -8790
  9. package/lib/index.qwik.mjs +0 -8790
  10. package/types/blocks/BaseText.d.ts +0 -5
  11. package/types/blocks/button/button.d.ts +0 -11
  12. package/types/blocks/button/component-info.d.ts +0 -2
  13. package/types/blocks/columns/columns.d.ts +0 -32
  14. package/types/blocks/columns/component-info.d.ts +0 -2
  15. package/types/blocks/custom-code/component-info.d.ts +0 -2
  16. package/types/blocks/custom-code/custom-code.d.ts +0 -7
  17. package/types/blocks/embed/component-info.d.ts +0 -2
  18. package/types/blocks/embed/embed.d.ts +0 -6
  19. package/types/blocks/embed/helpers.d.ts +0 -1
  20. package/types/blocks/form/component-info.d.ts +0 -2
  21. package/types/blocks/fragment/component-info.d.ts +0 -2
  22. package/types/blocks/fragment/fragment.d.ts +0 -7
  23. package/types/blocks/helpers.d.ts +0 -13
  24. package/types/blocks/image/component-info.d.ts +0 -2
  25. package/types/blocks/image/image.d.ts +0 -23
  26. package/types/blocks/image/image.helpers.d.ts +0 -1
  27. package/types/blocks/img/component-info.d.ts +0 -2
  28. package/types/blocks/img/img.d.ts +0 -12
  29. package/types/blocks/input/component-info.d.ts +0 -2
  30. package/types/blocks/input/input.d.ts +0 -13
  31. package/types/blocks/raw-text/component-info.d.ts +0 -2
  32. package/types/blocks/raw-text/raw-text.d.ts +0 -6
  33. package/types/blocks/section/component-info.d.ts +0 -2
  34. package/types/blocks/section/section.d.ts +0 -10
  35. package/types/blocks/select/component-info.d.ts +0 -2
  36. package/types/blocks/select/select.d.ts +0 -14
  37. package/types/blocks/submit-button/component-info.d.ts +0 -2
  38. package/types/blocks/submit-button/submit-button.d.ts +0 -8
  39. package/types/blocks/symbol/component-info.d.ts +0 -2
  40. package/types/blocks/symbol/symbol.d.ts +0 -24
  41. package/types/blocks/symbol/symbol.helpers.d.ts +0 -14
  42. package/types/blocks/text/component-info.d.ts +0 -2
  43. package/types/blocks/text/text.d.ts +0 -5
  44. package/types/blocks/textarea/component-info.d.ts +0 -2
  45. package/types/blocks/textarea/textarea.d.ts +0 -11
  46. package/types/blocks/video/component-info.d.ts +0 -2
  47. package/types/blocks/video/video.d.ts +0 -19
  48. package/types/components/block/block.d.ts +0 -9
  49. package/types/components/block/block.helpers.d.ts +0 -13
  50. package/types/components/block/components/block-styles.d.ts +0 -8
  51. package/types/components/block/components/block-wrapper.d.ts +0 -20
  52. package/types/components/block/components/component-ref/component-ref.d.ts +0 -3
  53. package/types/components/block/components/component-ref/component-ref.helpers.d.ts +0 -35
  54. package/types/components/block/components/interactive-element.d.ts +0 -11
  55. package/types/components/block/components/repeated-block.d.ts +0 -9
  56. package/types/components/block/types.d.ts +0 -6
  57. package/types/components/blocks/blocks-wrapper.d.ts +0 -13
  58. package/types/components/blocks/blocks.d.ts +0 -8
  59. package/types/components/blocks/deopt.d.ts +0 -4
  60. package/types/components/content/components/enable-editor.d.ts +0 -21
  61. package/types/components/content/components/styles.d.ts +0 -8
  62. package/types/components/content/components/styles.helpers.d.ts +0 -15
  63. package/types/components/content/content.d.ts +0 -5
  64. package/types/components/content/content.helpers.d.ts +0 -7
  65. package/types/components/content/content.types.d.ts +0 -24
  66. package/types/components/content/index.d.ts +0 -1
  67. package/types/components/content/wrap-component-ref.d.ts +0 -6
  68. package/types/components/content-variants/content-variants.d.ts +0 -9
  69. package/types/components/content-variants/content-variants.types.d.ts +0 -20
  70. package/types/components/content-variants/helpers.d.ts +0 -41
  71. package/types/components/inlined-script.d.ts +0 -6
  72. package/types/components/inlined-styles.d.ts +0 -6
  73. package/types/constants/builder-registered-components.d.ts +0 -6
  74. package/types/constants/device-sizes.d.ts +0 -13
  75. package/types/constants/sdk-version.d.ts +0 -1
  76. package/types/constants/target.d.ts +0 -2
  77. package/types/context/builder.context.d.ts +0 -2
  78. package/types/context/components.context.d.ts +0 -2
  79. package/types/context/types.d.ts +0 -35
  80. package/types/functions/apply-patch-with-mutation.d.ts +0 -10
  81. package/types/functions/camel-to-kebab-case.d.ts +0 -1
  82. package/types/functions/evaluate/browser-runtime/browser.d.ts +0 -4
  83. package/types/functions/evaluate/browser-runtime/index.d.ts +0 -1
  84. package/types/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +0 -2
  85. package/types/functions/evaluate/edge-runtime/edge-runtime.d.ts +0 -2
  86. package/types/functions/evaluate/edge-runtime/index.d.ts +0 -1
  87. package/types/functions/evaluate/evaluate.d.ts +0 -6
  88. package/types/functions/evaluate/helpers.d.ts +0 -18
  89. package/types/functions/evaluate/index.d.ts +0 -1
  90. package/types/functions/evaluate/node-runtime/index.d.ts +0 -1
  91. package/types/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
  92. package/types/functions/evaluate/non-node-runtime/index.d.ts +0 -1
  93. package/types/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
  94. package/types/functions/evaluate/placeholder-runtime.d.ts +0 -2
  95. package/types/functions/event-handler-name.d.ts +0 -1
  96. package/types/functions/extract-text-styles.d.ts +0 -4
  97. package/types/functions/fast-clone.d.ts +0 -4
  98. package/types/functions/fetch-builder-props.d.ts +0 -40
  99. package/types/functions/get-block-actions-handler.d.ts +0 -5
  100. package/types/functions/get-block-actions.d.ts +0 -10
  101. package/types/functions/get-block-component-options.d.ts +0 -2
  102. package/types/functions/get-block-properties.d.ts +0 -11
  103. package/types/functions/get-builder-search-params/index.d.ts +0 -12
  104. package/types/functions/get-content/generate-content-url.d.ts +0 -2
  105. package/types/functions/get-content/index.d.ts +0 -28
  106. package/types/functions/get-content/types.d.ts +0 -51
  107. package/types/functions/get-fetch.d.ts +0 -1
  108. package/types/functions/get-global-this.d.ts +0 -4
  109. package/types/functions/get-processed-block.d.ts +0 -10
  110. package/types/functions/get-react-native-block-styles.d.ts +0 -7
  111. package/types/functions/is-browser.d.ts +0 -1
  112. package/types/functions/is-edge-runtime.d.ts +0 -4
  113. package/types/functions/is-editing.d.ts +0 -1
  114. package/types/functions/is-iframe.d.ts +0 -1
  115. package/types/functions/is-non-node-server.d.ts +0 -4
  116. package/types/functions/is-previewing.d.ts +0 -1
  117. package/types/functions/on-change.d.ts +0 -7
  118. package/types/functions/register-component.d.ts +0 -15
  119. package/types/functions/register.d.ts +0 -16
  120. package/types/functions/sanitize-react-native-block-styles.d.ts +0 -3
  121. package/types/functions/set-editor-settings.d.ts +0 -4
  122. package/types/functions/set.d.ts +0 -7
  123. package/types/functions/track/helpers.d.ts +0 -5
  124. package/types/functions/track/index.d.ts +0 -51
  125. package/types/functions/track/interaction.d.ts +0 -13
  126. package/types/functions/transform-block-properties.d.ts +0 -1
  127. package/types/functions/transform-block.d.ts +0 -2
  128. package/types/helpers/ab-tests.d.ts +0 -9
  129. package/types/helpers/canTrack.d.ts +0 -1
  130. package/types/helpers/cookie.d.ts +0 -19
  131. package/types/helpers/css.d.ts +0 -7
  132. package/types/helpers/flatten.d.ts +0 -6
  133. package/types/helpers/localStorage.d.ts +0 -9
  134. package/types/helpers/logger.d.ts +0 -6
  135. package/types/helpers/nullable.d.ts +0 -2
  136. package/types/helpers/preview-lru-cache/get.d.ts +0 -2
  137. package/types/helpers/preview-lru-cache/helpers.d.ts +0 -0
  138. package/types/helpers/preview-lru-cache/init.d.ts +0 -6
  139. package/types/helpers/preview-lru-cache/set.d.ts +0 -7
  140. package/types/helpers/preview-lru-cache/types.d.ts +0 -0
  141. package/types/helpers/sessionId.d.ts +0 -6
  142. package/types/helpers/time.d.ts +0 -1
  143. package/types/helpers/url.d.ts +0 -6
  144. package/types/helpers/uuid.d.ts +0 -8
  145. package/types/helpers/visitorId.d.ts +0 -6
  146. package/types/index-helpers/blocks-exports.d.ts +0 -21
  147. package/types/index-helpers/top-of-file.d.ts +0 -1
  148. package/types/index.d.ts +0 -7
  149. package/types/scripts/init-editing.d.ts +0 -6
  150. package/types/server-index.d.ts +0 -15
  151. package/types/src/blocks/BaseText.d.ts +0 -5
  152. package/types/src/blocks/button/button.d.ts +0 -11
  153. package/types/src/blocks/button/component-info.d.ts +0 -2
  154. package/types/src/blocks/columns/columns.d.ts +0 -32
  155. package/types/src/blocks/columns/component-info.d.ts +0 -2
  156. package/types/src/blocks/custom-code/component-info.d.ts +0 -2
  157. package/types/src/blocks/custom-code/custom-code.d.ts +0 -7
  158. package/types/src/blocks/embed/component-info.d.ts +0 -2
  159. package/types/src/blocks/embed/embed.d.ts +0 -6
  160. package/types/src/blocks/embed/helpers.d.ts +0 -1
  161. package/types/src/blocks/form/component-info.d.ts +0 -2
  162. package/types/src/blocks/fragment/component-info.d.ts +0 -2
  163. package/types/src/blocks/fragment/fragment.d.ts +0 -7
  164. package/types/src/blocks/helpers.d.ts +0 -13
  165. package/types/src/blocks/image/component-info.d.ts +0 -2
  166. package/types/src/blocks/image/image.d.ts +0 -22
  167. package/types/src/blocks/image/image.helpers.d.ts +0 -1
  168. package/types/src/blocks/img/component-info.d.ts +0 -2
  169. package/types/src/blocks/img/img.d.ts +0 -12
  170. package/types/src/blocks/input/component-info.d.ts +0 -2
  171. package/types/src/blocks/input/input.d.ts +0 -13
  172. package/types/src/blocks/raw-text/component-info.d.ts +0 -2
  173. package/types/src/blocks/raw-text/raw-text.d.ts +0 -6
  174. package/types/src/blocks/section/component-info.d.ts +0 -2
  175. package/types/src/blocks/section/section.d.ts +0 -10
  176. package/types/src/blocks/select/component-info.d.ts +0 -2
  177. package/types/src/blocks/select/select.d.ts +0 -14
  178. package/types/src/blocks/submit-button/component-info.d.ts +0 -2
  179. package/types/src/blocks/submit-button/submit-button.d.ts +0 -8
  180. package/types/src/blocks/symbol/component-info.d.ts +0 -2
  181. package/types/src/blocks/symbol/symbol.d.ts +0 -24
  182. package/types/src/blocks/symbol/symbol.helpers.d.ts +0 -14
  183. package/types/src/blocks/text/component-info.d.ts +0 -2
  184. package/types/src/blocks/text/text.d.ts +0 -5
  185. package/types/src/blocks/textarea/component-info.d.ts +0 -2
  186. package/types/src/blocks/textarea/textarea.d.ts +0 -11
  187. package/types/src/blocks/video/component-info.d.ts +0 -2
  188. package/types/src/blocks/video/video.d.ts +0 -19
  189. package/types/src/components/block/block.d.ts +0 -9
  190. package/types/src/components/block/block.helpers.d.ts +0 -13
  191. package/types/src/components/block/components/block-styles.d.ts +0 -8
  192. package/types/src/components/block/components/block-wrapper.d.ts +0 -20
  193. package/types/src/components/block/components/component-ref/component-ref.d.ts +0 -3
  194. package/types/src/components/block/components/component-ref/component-ref.helpers.d.ts +0 -35
  195. package/types/src/components/block/components/interactive-element.d.ts +0 -11
  196. package/types/src/components/block/components/repeated-block.d.ts +0 -9
  197. package/types/src/components/block/types.d.ts +0 -6
  198. package/types/src/components/blocks/blocks-wrapper.d.ts +0 -13
  199. package/types/src/components/blocks/blocks.d.ts +0 -8
  200. package/types/src/components/blocks/deopt.d.ts +0 -4
  201. package/types/src/components/content/components/enable-editor.d.ts +0 -25
  202. package/types/src/components/content/components/styles.d.ts +0 -8
  203. package/types/src/components/content/components/styles.helpers.d.ts +0 -15
  204. package/types/src/components/content/content.d.ts +0 -5
  205. package/types/src/components/content/content.helpers.d.ts +0 -7
  206. package/types/src/components/content/content.types.d.ts +0 -24
  207. package/types/src/components/content/index.d.ts +0 -1
  208. package/types/src/components/content/wrap-component-ref.d.ts +0 -6
  209. package/types/src/components/content-variants/content-variants.d.ts +0 -9
  210. package/types/src/components/content-variants/content-variants.types.d.ts +0 -20
  211. package/types/src/components/content-variants/helpers.d.ts +0 -41
  212. package/types/src/components/inlined-script.d.ts +0 -6
  213. package/types/src/components/inlined-styles.d.ts +0 -6
  214. package/types/src/constants/builder-registered-components.d.ts +0 -6
  215. package/types/src/constants/device-sizes.d.ts +0 -13
  216. package/types/src/constants/sdk-version.d.ts +0 -1
  217. package/types/src/constants/target.d.ts +0 -2
  218. package/types/src/context/builder.context.d.ts +0 -2
  219. package/types/src/context/components.context.d.ts +0 -2
  220. package/types/src/context/types.d.ts +0 -35
  221. package/types/src/functions/apply-patch-with-mutation.d.ts +0 -10
  222. package/types/src/functions/camel-to-kebab-case.d.ts +0 -1
  223. package/types/src/functions/deopt.d.ts +0 -4
  224. package/types/src/functions/evaluate/browser-runtime/browser.d.ts +0 -4
  225. package/types/src/functions/evaluate/browser-runtime/index.d.ts +0 -1
  226. package/types/src/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +0 -2
  227. package/types/src/functions/evaluate/edge-runtime/edge-runtime.d.ts +0 -2
  228. package/types/src/functions/evaluate/edge-runtime/index.d.ts +0 -1
  229. package/types/src/functions/evaluate/evaluate.d.ts +0 -6
  230. package/types/src/functions/evaluate/helpers.d.ts +0 -18
  231. package/types/src/functions/evaluate/index.d.ts +0 -1
  232. package/types/src/functions/evaluate/node-runtime/index.d.ts +0 -1
  233. package/types/src/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
  234. package/types/src/functions/evaluate/non-node-runtime/index.d.ts +0 -1
  235. package/types/src/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
  236. package/types/src/functions/evaluate/placeholder-runtime.d.ts +0 -2
  237. package/types/src/functions/event-handler-name.d.ts +0 -1
  238. package/types/src/functions/extract-text-styles.d.ts +0 -4
  239. package/types/src/functions/fast-clone.d.ts +0 -4
  240. package/types/src/functions/fetch-builder-props.d.ts +0 -53
  241. package/types/src/functions/get-block-actions-handler.d.ts +0 -5
  242. package/types/src/functions/get-block-actions.d.ts +0 -10
  243. package/types/src/functions/get-block-component-options.d.ts +0 -2
  244. package/types/src/functions/get-block-properties.d.ts +0 -11
  245. package/types/src/functions/get-builder-search-params/index.d.ts +0 -12
  246. package/types/src/functions/get-content/generate-content-url.d.ts +0 -2
  247. package/types/src/functions/get-content/index.d.ts +0 -28
  248. package/types/src/functions/get-content/types.d.ts +0 -51
  249. package/types/src/functions/get-fetch.d.ts +0 -1
  250. package/types/src/functions/get-global-this.d.ts +0 -4
  251. package/types/src/functions/get-processed-block.d.ts +0 -10
  252. package/types/src/functions/get-react-native-block-styles.d.ts +0 -7
  253. package/types/src/functions/is-browser.d.ts +0 -1
  254. package/types/src/functions/is-edge-runtime.d.ts +0 -4
  255. package/types/src/functions/is-editing.d.ts +0 -1
  256. package/types/src/functions/is-iframe.d.ts +0 -1
  257. package/types/src/functions/is-non-node-server.d.ts +0 -4
  258. package/types/src/functions/is-previewing.d.ts +0 -1
  259. package/types/src/functions/on-change.d.ts +0 -7
  260. package/types/src/functions/register-component.d.ts +0 -15
  261. package/types/src/functions/register.d.ts +0 -16
  262. package/types/src/functions/sanitize-react-native-block-styles.d.ts +0 -3
  263. package/types/src/functions/set-editor-settings.d.ts +0 -4
  264. package/types/src/functions/set.d.ts +0 -7
  265. package/types/src/functions/track/helpers.d.ts +0 -5
  266. package/types/src/functions/track/index.d.ts +0 -51
  267. package/types/src/functions/track/interaction.d.ts +0 -13
  268. package/types/src/functions/transform-block-properties.d.ts +0 -1
  269. package/types/src/functions/transform-block.d.ts +0 -2
  270. package/types/src/helpers/ab-tests.d.ts +0 -9
  271. package/types/src/helpers/canTrack.d.ts +0 -1
  272. package/types/src/helpers/cookie.d.ts +0 -19
  273. package/types/src/helpers/css.d.ts +0 -7
  274. package/types/src/helpers/flatten.d.ts +0 -6
  275. package/types/src/helpers/localStorage.d.ts +0 -9
  276. package/types/src/helpers/logger.d.ts +0 -6
  277. package/types/src/helpers/nullable.d.ts +0 -2
  278. package/types/src/helpers/preview-lru-cache/get.d.ts +0 -2
  279. package/types/src/helpers/preview-lru-cache/helpers.d.ts +0 -0
  280. package/types/src/helpers/preview-lru-cache/init.d.ts +0 -6
  281. package/types/src/helpers/preview-lru-cache/set.d.ts +0 -7
  282. package/types/src/helpers/preview-lru-cache/types.d.ts +0 -0
  283. package/types/src/helpers/sessionId.d.ts +0 -6
  284. package/types/src/helpers/time.d.ts +0 -1
  285. package/types/src/helpers/url.d.ts +0 -6
  286. package/types/src/helpers/uuid.d.ts +0 -8
  287. package/types/src/helpers/visitorId.d.ts +0 -6
  288. package/types/src/index-helpers/blocks-exports.d.ts +0 -21
  289. package/types/src/index-helpers/top-of-file.d.ts +0 -1
  290. package/types/src/index.d.ts +0 -7
  291. package/types/src/scripts/init-editing.d.ts +0 -6
  292. package/types/src/server-index.d.ts +0 -15
  293. package/types/src/types/api-version.d.ts +0 -2
  294. package/types/src/types/builder-block.d.ts +0 -66
  295. package/types/src/types/builder-content.d.ts +0 -44
  296. package/types/src/types/builder-props.d.ts +0 -9
  297. package/types/src/types/can-track.d.ts +0 -3
  298. package/types/src/types/components.d.ts +0 -110
  299. package/types/src/types/deep-partial.d.ts +0 -3
  300. package/types/src/types/element.d.ts +0 -59
  301. package/types/src/types/enforced-partials.d.ts +0 -21
  302. package/types/src/types/input.d.ts +0 -121
  303. package/types/src/types/targets.d.ts +0 -1
  304. package/types/src/types/typescript.d.ts +0 -11
  305. package/types/types/api-version.d.ts +0 -2
  306. package/types/types/builder-block.d.ts +0 -66
  307. package/types/types/builder-content.d.ts +0 -44
  308. package/types/types/builder-props.d.ts +0 -9
  309. package/types/types/can-track.d.ts +0 -3
  310. package/types/types/components.d.ts +0 -111
  311. package/types/types/deep-partial.d.ts +0 -3
  312. package/types/types/element.d.ts +0 -59
  313. package/types/types/enforced-partials.d.ts +0 -21
  314. package/types/types/input.d.ts +0 -121
  315. package/types/types/targets.d.ts +0 -1
  316. package/types/types/typescript.d.ts +0 -11
@@ -2815,7 +2815,8 @@ const getBuilderSearchParamsFromWindow = () => {
2815
2815
  const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
2816
2816
  const DEFAULT_API_VERSION = "v3";
2817
2817
  const generateContentUrl = (options) => {
2818
- const { limit = 30, userAttributes, query, noTraverse = false, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
2818
+ let { noTraverse = false } = options;
2819
+ const { limit = 30, userAttributes, query, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
2819
2820
  if (!apiKey)
2820
2821
  throw new Error("Missing API key");
2821
2822
  if (![
@@ -2823,6 +2824,8 @@ const generateContentUrl = (options) => {
2823
2824
  "v3"
2824
2825
  ].includes(apiVersion))
2825
2826
  throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${apiVersion}'`);
2827
+ if ((options.limit === void 0 || options.limit > 1) && !("noTraverse" in options))
2828
+ noTraverse = true;
2826
2829
  const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}&includeRefs=${includeRefs}${locale ? `&locale=${locale}` : ""}${enrich ? `&enrich=${enrich}` : ""}`);
2827
2830
  const queryOptions = {
2828
2831
  ...getBuilderSearchParamsFromWindow(),
@@ -3097,7 +3100,7 @@ const getInteractionPropertiesForEvent = (event) => {
3097
3100
  }
3098
3101
  };
3099
3102
  };
3100
- const SDK_VERSION = "0.6.5-4";
3103
+ const SDK_VERSION = "0.7.0";
3101
3104
  const registry = {};
3102
3105
  function register(type, info) {
3103
3106
  let typeList = registry[type];
@@ -3354,43 +3357,6 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
3354
3357
  }
3355
3358
  }));
3356
3359
  };
3357
- const initEditing = function initEditing2(props, state, elementRef, _event) {
3358
- state.forceReRenderCount = state.forceReRenderCount + 1;
3359
- window.addEventListener("message", processMessage.bind(null, props, state, elementRef));
3360
- registerInsertMenu();
3361
- setupBrowserForEditing({
3362
- ...props.locale ? {
3363
- locale: props.locale
3364
- } : {},
3365
- ...props.includeRefs ? {
3366
- includeRefs: props.includeRefs
3367
- } : {},
3368
- ...props.enrich ? {
3369
- enrich: props.enrich
3370
- } : {}
3371
- });
3372
- Object.values(props.builderContextSignal.componentInfos).forEach((registeredComponent) => {
3373
- var _a;
3374
- const message = createRegisterComponentMessage(registeredComponent);
3375
- (_a = window.parent) == null ? void 0 : _a.postMessage(message, "*");
3376
- });
3377
- window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props, state, elementRef));
3378
- };
3379
- const initPreview = function initPreview2(props, state, elementRef, _event) {
3380
- const searchParams = new URL(location.href).searchParams;
3381
- const searchParamPreviewModel = searchParams.get("builder.preview");
3382
- const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
3383
- const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
3384
- if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id))
3385
- fetchOneEntry({
3386
- model: props.model,
3387
- apiKey: props.apiKey,
3388
- apiVersion: props.builderContextSignal.apiVersion
3389
- }).then((content) => {
3390
- if (content)
3391
- mergeNewContent(props, state, elementRef, content);
3392
- });
3393
- };
3394
3360
  const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
3395
3361
  qwik._jsxBranch();
3396
3362
  const elementRef = qwik.useSignal();
@@ -3403,31 +3369,35 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
3403
3369
  }, {
3404
3370
  deep: true
3405
3371
  });
3406
- qwik.useOn("initEditingBldr", /* @__PURE__ */ qwik.inlinedQrl((event) => {
3407
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
3408
- initEditing(props2, state2, elementRef2);
3409
- }, "EnableEditor_component_useOn_Qs8c0yql2i0", [
3410
- elementRef,
3411
- props,
3412
- state
3413
- ]));
3414
- qwik.useOn("initPreviewingBldr", /* @__PURE__ */ qwik.inlinedQrl((event) => {
3415
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
3416
- initPreview(props2, state2, elementRef2);
3417
- }, "EnableEditor_component_useOn_1_F94YipmknvI", [
3418
- elementRef,
3419
- props,
3420
- state
3421
- ]));
3422
3372
  qwik.useContextProvider(builderContext, props.builderContextSignal);
3423
3373
  qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
3424
3374
  var _a, _b;
3425
- const [elementRef2, props2] = qwik.useLexicalScope();
3375
+ const [elementRef2, props2, state2] = qwik.useLexicalScope();
3426
3376
  if (!props2.apiKey)
3427
3377
  logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
3428
3378
  if (isBrowser()) {
3429
- if (isEditing() && elementRef2.value)
3430
- elementRef2.value.dispatchEvent(new CustomEvent("initEditingBldr"));
3379
+ if (isEditing()) {
3380
+ state2.forceReRenderCount = state2.forceReRenderCount + 1;
3381
+ window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
3382
+ registerInsertMenu();
3383
+ setupBrowserForEditing({
3384
+ ...props2.locale ? {
3385
+ locale: props2.locale
3386
+ } : {},
3387
+ ...props2.includeRefs ? {
3388
+ includeRefs: props2.includeRefs
3389
+ } : {},
3390
+ ...props2.enrich ? {
3391
+ enrich: props2.enrich
3392
+ } : {}
3393
+ });
3394
+ Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
3395
+ var _a2;
3396
+ const message = createRegisterComponentMessage(registeredComponent);
3397
+ (_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
3398
+ });
3399
+ window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
3400
+ }
3431
3401
  if (props2.builderContextSignal.content) {
3432
3402
  const variationId = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
3433
3403
  const contentId = (_b = props2.builderContextSignal.content) == null ? void 0 : _b.id;
@@ -3439,12 +3409,29 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
3439
3409
  variationId: variationId !== contentId ? variationId : void 0
3440
3410
  });
3441
3411
  }
3442
- if (isPreviewing() && elementRef2.value)
3443
- elementRef2.value.dispatchEvent(new CustomEvent("initPreviewingBldr"));
3412
+ if (isPreviewing()) {
3413
+ const searchParams = new URL(location.href).searchParams;
3414
+ const searchParamPreviewModel = searchParams.get("builder.preview");
3415
+ const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
3416
+ const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
3417
+ if (searchParamPreviewModel === props2.model && previewApiKey === props2.apiKey && (!props2.content || searchParamPreviewId === props2.content.id))
3418
+ fetchOneEntry({
3419
+ model: props2.model,
3420
+ apiKey: props2.apiKey,
3421
+ apiVersion: props2.builderContextSignal.apiVersion
3422
+ }).then((content) => {
3423
+ if (content)
3424
+ mergeNewContent(props2, state2, elementRef2, content);
3425
+ });
3426
+ }
3427
+ evaluateJsCode(props2);
3428
+ runHttpRequests(props2, state2, elementRef2);
3429
+ emitStateUpdate(props2);
3444
3430
  }
3445
3431
  }, "EnableEditor_component_useVisibleTask_Olaxc9jCOFk", [
3446
3432
  elementRef,
3447
- props
3433
+ props,
3434
+ state
3448
3435
  ]));
3449
3436
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
3450
3437
  const [elementRef2, props2, state2] = qwik.useLexicalScope();
@@ -1,4 +1,4 @@
1
- import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl, useOn } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4
4
  useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
@@ -2813,7 +2813,8 @@ const getBuilderSearchParamsFromWindow = () => {
2813
2813
  const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
2814
2814
  const DEFAULT_API_VERSION = "v3";
2815
2815
  const generateContentUrl = (options) => {
2816
- const { limit = 30, userAttributes, query, noTraverse = false, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
2816
+ let { noTraverse = false } = options;
2817
+ const { limit = 30, userAttributes, query, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
2817
2818
  if (!apiKey)
2818
2819
  throw new Error("Missing API key");
2819
2820
  if (![
@@ -2821,6 +2822,8 @@ const generateContentUrl = (options) => {
2821
2822
  "v3"
2822
2823
  ].includes(apiVersion))
2823
2824
  throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${apiVersion}'`);
2825
+ if ((options.limit === void 0 || options.limit > 1) && !("noTraverse" in options))
2826
+ noTraverse = true;
2824
2827
  const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}&includeRefs=${includeRefs}${locale ? `&locale=${locale}` : ""}${enrich ? `&enrich=${enrich}` : ""}`);
2825
2828
  const queryOptions = {
2826
2829
  ...getBuilderSearchParamsFromWindow(),
@@ -3095,7 +3098,7 @@ const getInteractionPropertiesForEvent = (event) => {
3095
3098
  }
3096
3099
  };
3097
3100
  };
3098
- const SDK_VERSION = "0.6.5-4";
3101
+ const SDK_VERSION = "0.7.0";
3099
3102
  const registry = {};
3100
3103
  function register(type, info) {
3101
3104
  let typeList = registry[type];
@@ -3352,43 +3355,6 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
3352
3355
  }
3353
3356
  }));
3354
3357
  };
3355
- const initEditing = function initEditing2(props, state, elementRef, _event) {
3356
- state.forceReRenderCount = state.forceReRenderCount + 1;
3357
- window.addEventListener("message", processMessage.bind(null, props, state, elementRef));
3358
- registerInsertMenu();
3359
- setupBrowserForEditing({
3360
- ...props.locale ? {
3361
- locale: props.locale
3362
- } : {},
3363
- ...props.includeRefs ? {
3364
- includeRefs: props.includeRefs
3365
- } : {},
3366
- ...props.enrich ? {
3367
- enrich: props.enrich
3368
- } : {}
3369
- });
3370
- Object.values(props.builderContextSignal.componentInfos).forEach((registeredComponent) => {
3371
- var _a;
3372
- const message = createRegisterComponentMessage(registeredComponent);
3373
- (_a = window.parent) == null ? void 0 : _a.postMessage(message, "*");
3374
- });
3375
- window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props, state, elementRef));
3376
- };
3377
- const initPreview = function initPreview2(props, state, elementRef, _event) {
3378
- const searchParams = new URL(location.href).searchParams;
3379
- const searchParamPreviewModel = searchParams.get("builder.preview");
3380
- const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
3381
- const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
3382
- if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id))
3383
- fetchOneEntry({
3384
- model: props.model,
3385
- apiKey: props.apiKey,
3386
- apiVersion: props.builderContextSignal.apiVersion
3387
- }).then((content) => {
3388
- if (content)
3389
- mergeNewContent(props, state, elementRef, content);
3390
- });
3391
- };
3392
3358
  const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
3393
3359
  _jsxBranch();
3394
3360
  const elementRef = useSignal();
@@ -3401,31 +3367,35 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3401
3367
  }, {
3402
3368
  deep: true
3403
3369
  });
3404
- useOn("initEditingBldr", /* @__PURE__ */ inlinedQrl((event) => {
3405
- const [elementRef2, props2, state2] = useLexicalScope();
3406
- initEditing(props2, state2, elementRef2);
3407
- }, "EnableEditor_component_useOn_Qs8c0yql2i0", [
3408
- elementRef,
3409
- props,
3410
- state
3411
- ]));
3412
- useOn("initPreviewingBldr", /* @__PURE__ */ inlinedQrl((event) => {
3413
- const [elementRef2, props2, state2] = useLexicalScope();
3414
- initPreview(props2, state2, elementRef2);
3415
- }, "EnableEditor_component_useOn_1_F94YipmknvI", [
3416
- elementRef,
3417
- props,
3418
- state
3419
- ]));
3420
3370
  useContextProvider(builderContext, props.builderContextSignal);
3421
3371
  useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
3422
3372
  var _a, _b;
3423
- const [elementRef2, props2] = useLexicalScope();
3373
+ const [elementRef2, props2, state2] = useLexicalScope();
3424
3374
  if (!props2.apiKey)
3425
3375
  logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
3426
3376
  if (isBrowser()) {
3427
- if (isEditing() && elementRef2.value)
3428
- elementRef2.value.dispatchEvent(new CustomEvent("initEditingBldr"));
3377
+ if (isEditing()) {
3378
+ state2.forceReRenderCount = state2.forceReRenderCount + 1;
3379
+ window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
3380
+ registerInsertMenu();
3381
+ setupBrowserForEditing({
3382
+ ...props2.locale ? {
3383
+ locale: props2.locale
3384
+ } : {},
3385
+ ...props2.includeRefs ? {
3386
+ includeRefs: props2.includeRefs
3387
+ } : {},
3388
+ ...props2.enrich ? {
3389
+ enrich: props2.enrich
3390
+ } : {}
3391
+ });
3392
+ Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
3393
+ var _a2;
3394
+ const message = createRegisterComponentMessage(registeredComponent);
3395
+ (_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
3396
+ });
3397
+ window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
3398
+ }
3429
3399
  if (props2.builderContextSignal.content) {
3430
3400
  const variationId = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
3431
3401
  const contentId = (_b = props2.builderContextSignal.content) == null ? void 0 : _b.id;
@@ -3437,12 +3407,29 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3437
3407
  variationId: variationId !== contentId ? variationId : void 0
3438
3408
  });
3439
3409
  }
3440
- if (isPreviewing() && elementRef2.value)
3441
- elementRef2.value.dispatchEvent(new CustomEvent("initPreviewingBldr"));
3410
+ if (isPreviewing()) {
3411
+ const searchParams = new URL(location.href).searchParams;
3412
+ const searchParamPreviewModel = searchParams.get("builder.preview");
3413
+ const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
3414
+ const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
3415
+ if (searchParamPreviewModel === props2.model && previewApiKey === props2.apiKey && (!props2.content || searchParamPreviewId === props2.content.id))
3416
+ fetchOneEntry({
3417
+ model: props2.model,
3418
+ apiKey: props2.apiKey,
3419
+ apiVersion: props2.builderContextSignal.apiVersion
3420
+ }).then((content) => {
3421
+ if (content)
3422
+ mergeNewContent(props2, state2, elementRef2, content);
3423
+ });
3424
+ }
3425
+ evaluateJsCode(props2);
3426
+ runHttpRequests(props2, state2, elementRef2);
3427
+ emitStateUpdate(props2);
3442
3428
  }
3443
3429
  }, "EnableEditor_component_useVisibleTask_Olaxc9jCOFk", [
3444
3430
  elementRef,
3445
- props
3431
+ props,
3432
+ state
3446
3433
  ]));
3447
3434
  useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
3448
3435
  const [elementRef2, props2, state2] = useLexicalScope();
@@ -6019,7 +6019,8 @@ const getBuilderSearchParamsFromWindow = () => {
6019
6019
  const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
6020
6020
  const DEFAULT_API_VERSION = "v3";
6021
6021
  const generateContentUrl = (options) => {
6022
- const { limit = 30, userAttributes, query, noTraverse = false, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
6022
+ let { noTraverse = false } = options;
6023
+ const { limit = 30, userAttributes, query, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
6023
6024
  if (!apiKey)
6024
6025
  throw new Error("Missing API key");
6025
6026
  if (![
@@ -6027,6 +6028,8 @@ const generateContentUrl = (options) => {
6027
6028
  "v3"
6028
6029
  ].includes(apiVersion))
6029
6030
  throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${apiVersion}'`);
6031
+ if ((options.limit === void 0 || options.limit > 1) && !("noTraverse" in options))
6032
+ noTraverse = true;
6030
6033
  const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}&includeRefs=${includeRefs}${locale ? `&locale=${locale}` : ""}${enrich ? `&enrich=${enrich}` : ""}`);
6031
6034
  const queryOptions = {
6032
6035
  ...getBuilderSearchParamsFromWindow(),
@@ -6301,7 +6304,7 @@ const getInteractionPropertiesForEvent = (event) => {
6301
6304
  }
6302
6305
  };
6303
6306
  };
6304
- const SDK_VERSION = "0.6.5-4";
6307
+ const SDK_VERSION = "0.7.0";
6305
6308
  const registry = {};
6306
6309
  function register(type, info) {
6307
6310
  let typeList = registry[type];
@@ -6558,43 +6561,6 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
6558
6561
  }
6559
6562
  }));
6560
6563
  };
6561
- const initEditing = function initEditing2(props, state, elementRef, _event) {
6562
- state.forceReRenderCount = state.forceReRenderCount + 1;
6563
- window.addEventListener("message", processMessage.bind(null, props, state, elementRef));
6564
- registerInsertMenu();
6565
- setupBrowserForEditing({
6566
- ...props.locale ? {
6567
- locale: props.locale
6568
- } : {},
6569
- ...props.includeRefs ? {
6570
- includeRefs: props.includeRefs
6571
- } : {},
6572
- ...props.enrich ? {
6573
- enrich: props.enrich
6574
- } : {}
6575
- });
6576
- Object.values(props.builderContextSignal.componentInfos).forEach((registeredComponent) => {
6577
- var _a;
6578
- const message = createRegisterComponentMessage(registeredComponent);
6579
- (_a = window.parent) == null ? void 0 : _a.postMessage(message, "*");
6580
- });
6581
- window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props, state, elementRef));
6582
- };
6583
- const initPreview = function initPreview2(props, state, elementRef, _event) {
6584
- const searchParams = new URL(location.href).searchParams;
6585
- const searchParamPreviewModel = searchParams.get("builder.preview");
6586
- const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
6587
- const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
6588
- if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id))
6589
- fetchOneEntry({
6590
- model: props.model,
6591
- apiKey: props.apiKey,
6592
- apiVersion: props.builderContextSignal.apiVersion
6593
- }).then((content) => {
6594
- if (content)
6595
- mergeNewContent(props, state, elementRef, content);
6596
- });
6597
- };
6598
6564
  const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
6599
6565
  qwik._jsxBranch();
6600
6566
  const elementRef = qwik.useSignal();
@@ -6607,31 +6573,35 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
6607
6573
  }, {
6608
6574
  deep: true
6609
6575
  });
6610
- qwik.useOn("initEditingBldr", /* @__PURE__ */ qwik.inlinedQrl((event) => {
6611
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
6612
- initEditing(props2, state2, elementRef2);
6613
- }, "EnableEditor_component_useOn_Qs8c0yql2i0", [
6614
- elementRef,
6615
- props,
6616
- state
6617
- ]));
6618
- qwik.useOn("initPreviewingBldr", /* @__PURE__ */ qwik.inlinedQrl((event) => {
6619
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
6620
- initPreview(props2, state2, elementRef2);
6621
- }, "EnableEditor_component_useOn_1_F94YipmknvI", [
6622
- elementRef,
6623
- props,
6624
- state
6625
- ]));
6626
6576
  qwik.useContextProvider(builderContext, props.builderContextSignal);
6627
6577
  qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
6628
6578
  var _a, _b;
6629
- const [elementRef2, props2] = qwik.useLexicalScope();
6579
+ const [elementRef2, props2, state2] = qwik.useLexicalScope();
6630
6580
  if (!props2.apiKey)
6631
6581
  logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
6632
6582
  if (isBrowser()) {
6633
- if (isEditing() && elementRef2.value)
6634
- elementRef2.value.dispatchEvent(new CustomEvent("initEditingBldr"));
6583
+ if (isEditing()) {
6584
+ state2.forceReRenderCount = state2.forceReRenderCount + 1;
6585
+ window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
6586
+ registerInsertMenu();
6587
+ setupBrowserForEditing({
6588
+ ...props2.locale ? {
6589
+ locale: props2.locale
6590
+ } : {},
6591
+ ...props2.includeRefs ? {
6592
+ includeRefs: props2.includeRefs
6593
+ } : {},
6594
+ ...props2.enrich ? {
6595
+ enrich: props2.enrich
6596
+ } : {}
6597
+ });
6598
+ Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
6599
+ var _a2;
6600
+ const message = createRegisterComponentMessage(registeredComponent);
6601
+ (_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
6602
+ });
6603
+ window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
6604
+ }
6635
6605
  if (props2.builderContextSignal.content) {
6636
6606
  const variationId = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
6637
6607
  const contentId = (_b = props2.builderContextSignal.content) == null ? void 0 : _b.id;
@@ -6643,12 +6613,29 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
6643
6613
  variationId: variationId !== contentId ? variationId : void 0
6644
6614
  });
6645
6615
  }
6646
- if (isPreviewing() && elementRef2.value)
6647
- elementRef2.value.dispatchEvent(new CustomEvent("initPreviewingBldr"));
6616
+ if (isPreviewing()) {
6617
+ const searchParams = new URL(location.href).searchParams;
6618
+ const searchParamPreviewModel = searchParams.get("builder.preview");
6619
+ const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
6620
+ const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
6621
+ if (searchParamPreviewModel === props2.model && previewApiKey === props2.apiKey && (!props2.content || searchParamPreviewId === props2.content.id))
6622
+ fetchOneEntry({
6623
+ model: props2.model,
6624
+ apiKey: props2.apiKey,
6625
+ apiVersion: props2.builderContextSignal.apiVersion
6626
+ }).then((content) => {
6627
+ if (content)
6628
+ mergeNewContent(props2, state2, elementRef2, content);
6629
+ });
6630
+ }
6631
+ evaluateJsCode(props2);
6632
+ runHttpRequests(props2, state2, elementRef2);
6633
+ emitStateUpdate(props2);
6648
6634
  }
6649
6635
  }, "EnableEditor_component_useVisibleTask_Olaxc9jCOFk", [
6650
6636
  elementRef,
6651
- props
6637
+ props,
6638
+ state
6652
6639
  ]));
6653
6640
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
6654
6641
  const [elementRef2, props2, state2] = qwik.useLexicalScope();
@@ -1,4 +1,4 @@
1
- import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl, useOn } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4
4
  useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
@@ -6017,7 +6017,8 @@ const getBuilderSearchParamsFromWindow = () => {
6017
6017
  const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
6018
6018
  const DEFAULT_API_VERSION = "v3";
6019
6019
  const generateContentUrl = (options) => {
6020
- const { limit = 30, userAttributes, query, noTraverse = false, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
6020
+ let { noTraverse = false } = options;
6021
+ const { limit = 30, userAttributes, query, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
6021
6022
  if (!apiKey)
6022
6023
  throw new Error("Missing API key");
6023
6024
  if (![
@@ -6025,6 +6026,8 @@ const generateContentUrl = (options) => {
6025
6026
  "v3"
6026
6027
  ].includes(apiVersion))
6027
6028
  throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${apiVersion}'`);
6029
+ if ((options.limit === void 0 || options.limit > 1) && !("noTraverse" in options))
6030
+ noTraverse = true;
6028
6031
  const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}&includeRefs=${includeRefs}${locale ? `&locale=${locale}` : ""}${enrich ? `&enrich=${enrich}` : ""}`);
6029
6032
  const queryOptions = {
6030
6033
  ...getBuilderSearchParamsFromWindow(),
@@ -6299,7 +6302,7 @@ const getInteractionPropertiesForEvent = (event) => {
6299
6302
  }
6300
6303
  };
6301
6304
  };
6302
- const SDK_VERSION = "0.6.5-4";
6305
+ const SDK_VERSION = "0.7.0";
6303
6306
  const registry = {};
6304
6307
  function register(type, info) {
6305
6308
  let typeList = registry[type];
@@ -6556,43 +6559,6 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
6556
6559
  }
6557
6560
  }));
6558
6561
  };
6559
- const initEditing = function initEditing2(props, state, elementRef, _event) {
6560
- state.forceReRenderCount = state.forceReRenderCount + 1;
6561
- window.addEventListener("message", processMessage.bind(null, props, state, elementRef));
6562
- registerInsertMenu();
6563
- setupBrowserForEditing({
6564
- ...props.locale ? {
6565
- locale: props.locale
6566
- } : {},
6567
- ...props.includeRefs ? {
6568
- includeRefs: props.includeRefs
6569
- } : {},
6570
- ...props.enrich ? {
6571
- enrich: props.enrich
6572
- } : {}
6573
- });
6574
- Object.values(props.builderContextSignal.componentInfos).forEach((registeredComponent) => {
6575
- var _a;
6576
- const message = createRegisterComponentMessage(registeredComponent);
6577
- (_a = window.parent) == null ? void 0 : _a.postMessage(message, "*");
6578
- });
6579
- window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props, state, elementRef));
6580
- };
6581
- const initPreview = function initPreview2(props, state, elementRef, _event) {
6582
- const searchParams = new URL(location.href).searchParams;
6583
- const searchParamPreviewModel = searchParams.get("builder.preview");
6584
- const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
6585
- const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
6586
- if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id))
6587
- fetchOneEntry({
6588
- model: props.model,
6589
- apiKey: props.apiKey,
6590
- apiVersion: props.builderContextSignal.apiVersion
6591
- }).then((content) => {
6592
- if (content)
6593
- mergeNewContent(props, state, elementRef, content);
6594
- });
6595
- };
6596
6562
  const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6597
6563
  _jsxBranch();
6598
6564
  const elementRef = useSignal();
@@ -6605,31 +6571,35 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
6605
6571
  }, {
6606
6572
  deep: true
6607
6573
  });
6608
- useOn("initEditingBldr", /* @__PURE__ */ inlinedQrl((event) => {
6609
- const [elementRef2, props2, state2] = useLexicalScope();
6610
- initEditing(props2, state2, elementRef2);
6611
- }, "EnableEditor_component_useOn_Qs8c0yql2i0", [
6612
- elementRef,
6613
- props,
6614
- state
6615
- ]));
6616
- useOn("initPreviewingBldr", /* @__PURE__ */ inlinedQrl((event) => {
6617
- const [elementRef2, props2, state2] = useLexicalScope();
6618
- initPreview(props2, state2, elementRef2);
6619
- }, "EnableEditor_component_useOn_1_F94YipmknvI", [
6620
- elementRef,
6621
- props,
6622
- state
6623
- ]));
6624
6574
  useContextProvider(builderContext, props.builderContextSignal);
6625
6575
  useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
6626
6576
  var _a, _b;
6627
- const [elementRef2, props2] = useLexicalScope();
6577
+ const [elementRef2, props2, state2] = useLexicalScope();
6628
6578
  if (!props2.apiKey)
6629
6579
  logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
6630
6580
  if (isBrowser()) {
6631
- if (isEditing() && elementRef2.value)
6632
- elementRef2.value.dispatchEvent(new CustomEvent("initEditingBldr"));
6581
+ if (isEditing()) {
6582
+ state2.forceReRenderCount = state2.forceReRenderCount + 1;
6583
+ window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
6584
+ registerInsertMenu();
6585
+ setupBrowserForEditing({
6586
+ ...props2.locale ? {
6587
+ locale: props2.locale
6588
+ } : {},
6589
+ ...props2.includeRefs ? {
6590
+ includeRefs: props2.includeRefs
6591
+ } : {},
6592
+ ...props2.enrich ? {
6593
+ enrich: props2.enrich
6594
+ } : {}
6595
+ });
6596
+ Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
6597
+ var _a2;
6598
+ const message = createRegisterComponentMessage(registeredComponent);
6599
+ (_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
6600
+ });
6601
+ window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
6602
+ }
6633
6603
  if (props2.builderContextSignal.content) {
6634
6604
  const variationId = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
6635
6605
  const contentId = (_b = props2.builderContextSignal.content) == null ? void 0 : _b.id;
@@ -6641,12 +6611,29 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
6641
6611
  variationId: variationId !== contentId ? variationId : void 0
6642
6612
  });
6643
6613
  }
6644
- if (isPreviewing() && elementRef2.value)
6645
- elementRef2.value.dispatchEvent(new CustomEvent("initPreviewingBldr"));
6614
+ if (isPreviewing()) {
6615
+ const searchParams = new URL(location.href).searchParams;
6616
+ const searchParamPreviewModel = searchParams.get("builder.preview");
6617
+ const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
6618
+ const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
6619
+ if (searchParamPreviewModel === props2.model && previewApiKey === props2.apiKey && (!props2.content || searchParamPreviewId === props2.content.id))
6620
+ fetchOneEntry({
6621
+ model: props2.model,
6622
+ apiKey: props2.apiKey,
6623
+ apiVersion: props2.builderContextSignal.apiVersion
6624
+ }).then((content) => {
6625
+ if (content)
6626
+ mergeNewContent(props2, state2, elementRef2, content);
6627
+ });
6628
+ }
6629
+ evaluateJsCode(props2);
6630
+ runHttpRequests(props2, state2, elementRef2);
6631
+ emitStateUpdate(props2);
6646
6632
  }
6647
6633
  }, "EnableEditor_component_useVisibleTask_Olaxc9jCOFk", [
6648
6634
  elementRef,
6649
- props
6635
+ props,
6636
+ state
6650
6637
  ]));
6651
6638
  useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
6652
6639
  const [elementRef2, props2, state2] = useLexicalScope();