@builder.io/sdk-qwik 0.7.1-5 → 0.7.1

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 (181) hide show
  1. package/lib/browser/index.qwik.cjs +332 -234
  2. package/lib/browser/index.qwik.mjs +333 -235
  3. package/lib/edge/index.qwik.cjs +339 -241
  4. package/lib/edge/index.qwik.mjs +340 -242
  5. package/lib/node/index.qwik.cjs +341 -243
  6. package/lib/node/index.qwik.mjs +341 -243
  7. package/lib/node/{node-evaluate-fc9f27d1.cjs → node-evaluate-1a278bf5.cjs} +2 -1
  8. package/package.json +5 -4
  9. package/types/src/blocks/button/button.d.ts +2 -1
  10. package/types/src/blocks/img/img.d.ts +2 -1
  11. package/types/src/blocks/input/input.d.ts +2 -1
  12. package/types/src/blocks/section/section.d.ts +2 -1
  13. package/types/src/blocks/select/select.d.ts +2 -1
  14. package/types/src/blocks/submit-button/submit-button.d.ts +2 -1
  15. package/types/src/blocks/symbol/symbol.d.ts +4 -2
  16. package/types/src/blocks/textarea/textarea.d.ts +2 -1
  17. package/types/src/components/block/components/block-wrapper.d.ts +2 -1
  18. package/types/src/constants/sdk-version.d.ts +1 -1
  19. package/types/src/context/types.d.ts +1 -1
  20. package/types/src/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +2 -4
  21. package/types/src/helpers/ab-tests.d.ts +1 -1
  22. package/types/src/server-index.d.ts +2 -2
  23. package/lib/index.qwik.js +0 -7609
  24. package/types/blocks/BaseText.d.ts +0 -5
  25. package/types/blocks/button/button.d.ts +0 -11
  26. package/types/blocks/button/component-info.d.ts +0 -2
  27. package/types/blocks/columns/columns.d.ts +0 -32
  28. package/types/blocks/columns/component-info.d.ts +0 -2
  29. package/types/blocks/custom-code/component-info.d.ts +0 -2
  30. package/types/blocks/custom-code/custom-code.d.ts +0 -7
  31. package/types/blocks/embed/component-info.d.ts +0 -2
  32. package/types/blocks/embed/embed.d.ts +0 -6
  33. package/types/blocks/embed/helpers.d.ts +0 -1
  34. package/types/blocks/form/component-info.d.ts +0 -2
  35. package/types/blocks/fragment/component-info.d.ts +0 -2
  36. package/types/blocks/fragment/fragment.d.ts +0 -7
  37. package/types/blocks/helpers.d.ts +0 -13
  38. package/types/blocks/image/component-info.d.ts +0 -2
  39. package/types/blocks/image/image.d.ts +0 -23
  40. package/types/blocks/image/image.helpers.d.ts +0 -1
  41. package/types/blocks/img/component-info.d.ts +0 -2
  42. package/types/blocks/img/img.d.ts +0 -12
  43. package/types/blocks/input/component-info.d.ts +0 -2
  44. package/types/blocks/input/input.d.ts +0 -13
  45. package/types/blocks/raw-text/component-info.d.ts +0 -2
  46. package/types/blocks/raw-text/raw-text.d.ts +0 -6
  47. package/types/blocks/section/component-info.d.ts +0 -2
  48. package/types/blocks/section/section.d.ts +0 -10
  49. package/types/blocks/select/component-info.d.ts +0 -2
  50. package/types/blocks/select/select.d.ts +0 -14
  51. package/types/blocks/submit-button/component-info.d.ts +0 -2
  52. package/types/blocks/submit-button/submit-button.d.ts +0 -8
  53. package/types/blocks/symbol/component-info.d.ts +0 -2
  54. package/types/blocks/symbol/symbol.d.ts +0 -24
  55. package/types/blocks/symbol/symbol.helpers.d.ts +0 -14
  56. package/types/blocks/text/component-info.d.ts +0 -2
  57. package/types/blocks/text/text.d.ts +0 -5
  58. package/types/blocks/textarea/component-info.d.ts +0 -2
  59. package/types/blocks/textarea/textarea.d.ts +0 -11
  60. package/types/blocks/video/component-info.d.ts +0 -2
  61. package/types/blocks/video/video.d.ts +0 -19
  62. package/types/components/block/block.d.ts +0 -9
  63. package/types/components/block/block.helpers.d.ts +0 -13
  64. package/types/components/block/components/block-styles.d.ts +0 -8
  65. package/types/components/block/components/block-wrapper.d.ts +0 -20
  66. package/types/components/block/components/component-ref/component-ref.d.ts +0 -3
  67. package/types/components/block/components/component-ref/component-ref.helpers.d.ts +0 -35
  68. package/types/components/block/components/interactive-element.d.ts +0 -11
  69. package/types/components/block/components/repeated-block.d.ts +0 -9
  70. package/types/components/block/types.d.ts +0 -6
  71. package/types/components/blocks/blocks-wrapper.d.ts +0 -13
  72. package/types/components/blocks/blocks.d.ts +0 -8
  73. package/types/components/blocks/deopt.d.ts +0 -4
  74. package/types/components/content/components/enable-editor.d.ts +0 -21
  75. package/types/components/content/components/styles.d.ts +0 -8
  76. package/types/components/content/components/styles.helpers.d.ts +0 -15
  77. package/types/components/content/content.d.ts +0 -5
  78. package/types/components/content/content.helpers.d.ts +0 -7
  79. package/types/components/content/content.types.d.ts +0 -24
  80. package/types/components/content/index.d.ts +0 -1
  81. package/types/components/content/wrap-component-ref.d.ts +0 -6
  82. package/types/components/content-variants/content-variants.d.ts +0 -9
  83. package/types/components/content-variants/content-variants.types.d.ts +0 -20
  84. package/types/components/content-variants/helpers.d.ts +0 -41
  85. package/types/components/inlined-script.d.ts +0 -6
  86. package/types/components/inlined-styles.d.ts +0 -6
  87. package/types/constants/builder-registered-components.d.ts +0 -6
  88. package/types/constants/device-sizes.d.ts +0 -13
  89. package/types/constants/sdk-version.d.ts +0 -1
  90. package/types/constants/target.d.ts +0 -2
  91. package/types/context/builder.context.d.ts +0 -2
  92. package/types/context/components.context.d.ts +0 -2
  93. package/types/context/types.d.ts +0 -35
  94. package/types/functions/apply-patch-with-mutation.d.ts +0 -10
  95. package/types/functions/camel-to-kebab-case.d.ts +0 -1
  96. package/types/functions/evaluate/browser-runtime/browser.d.ts +0 -4
  97. package/types/functions/evaluate/browser-runtime/index.d.ts +0 -1
  98. package/types/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +0 -2
  99. package/types/functions/evaluate/edge-runtime/edge-runtime.d.ts +0 -2
  100. package/types/functions/evaluate/edge-runtime/index.d.ts +0 -1
  101. package/types/functions/evaluate/evaluate.d.ts +0 -6
  102. package/types/functions/evaluate/helpers.d.ts +0 -18
  103. package/types/functions/evaluate/index.d.ts +0 -1
  104. package/types/functions/evaluate/node-runtime/index.d.ts +0 -1
  105. package/types/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
  106. package/types/functions/evaluate/non-node-runtime/index.d.ts +0 -1
  107. package/types/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
  108. package/types/functions/evaluate/placeholder-runtime.d.ts +0 -2
  109. package/types/functions/event-handler-name.d.ts +0 -1
  110. package/types/functions/extract-text-styles.d.ts +0 -4
  111. package/types/functions/fast-clone.d.ts +0 -4
  112. package/types/functions/fetch-builder-props.d.ts +0 -40
  113. package/types/functions/get-block-actions-handler.d.ts +0 -5
  114. package/types/functions/get-block-actions.d.ts +0 -10
  115. package/types/functions/get-block-component-options.d.ts +0 -2
  116. package/types/functions/get-block-properties.d.ts +0 -11
  117. package/types/functions/get-builder-search-params/index.d.ts +0 -12
  118. package/types/functions/get-content/generate-content-url.d.ts +0 -2
  119. package/types/functions/get-content/index.d.ts +0 -28
  120. package/types/functions/get-content/types.d.ts +0 -51
  121. package/types/functions/get-fetch.d.ts +0 -1
  122. package/types/functions/get-global-this.d.ts +0 -4
  123. package/types/functions/get-processed-block.d.ts +0 -10
  124. package/types/functions/get-react-native-block-styles.d.ts +0 -7
  125. package/types/functions/is-browser.d.ts +0 -1
  126. package/types/functions/is-edge-runtime.d.ts +0 -4
  127. package/types/functions/is-editing.d.ts +0 -1
  128. package/types/functions/is-iframe.d.ts +0 -1
  129. package/types/functions/is-non-node-server.d.ts +0 -4
  130. package/types/functions/is-previewing.d.ts +0 -1
  131. package/types/functions/on-change.d.ts +0 -7
  132. package/types/functions/register-component.d.ts +0 -15
  133. package/types/functions/register.d.ts +0 -16
  134. package/types/functions/sanitize-react-native-block-styles.d.ts +0 -3
  135. package/types/functions/set-editor-settings.d.ts +0 -4
  136. package/types/functions/set.d.ts +0 -7
  137. package/types/functions/track/helpers.d.ts +0 -5
  138. package/types/functions/track/index.d.ts +0 -51
  139. package/types/functions/track/interaction.d.ts +0 -13
  140. package/types/functions/transform-block-properties.d.ts +0 -1
  141. package/types/functions/transform-block.d.ts +0 -2
  142. package/types/helpers/ab-tests.d.ts +0 -9
  143. package/types/helpers/canTrack.d.ts +0 -1
  144. package/types/helpers/cookie.d.ts +0 -19
  145. package/types/helpers/css.d.ts +0 -7
  146. package/types/helpers/flatten.d.ts +0 -6
  147. package/types/helpers/localStorage.d.ts +0 -9
  148. package/types/helpers/logger.d.ts +0 -6
  149. package/types/helpers/nullable.d.ts +0 -2
  150. package/types/helpers/preview-lru-cache/get.d.ts +0 -2
  151. package/types/helpers/preview-lru-cache/helpers.d.ts +0 -0
  152. package/types/helpers/preview-lru-cache/init.d.ts +0 -6
  153. package/types/helpers/preview-lru-cache/set.d.ts +0 -7
  154. package/types/helpers/preview-lru-cache/types.d.ts +0 -0
  155. package/types/helpers/sessionId.d.ts +0 -6
  156. package/types/helpers/time.d.ts +0 -1
  157. package/types/helpers/url.d.ts +0 -6
  158. package/types/helpers/uuid.d.ts +0 -8
  159. package/types/helpers/visitorId.d.ts +0 -6
  160. package/types/index-helpers/blocks-exports.d.ts +0 -21
  161. package/types/index-helpers/top-of-file.d.ts +0 -1
  162. package/types/index.d.ts +0 -7
  163. package/types/scripts/init-editing.d.ts +0 -6
  164. package/types/server-index.d.ts +0 -15
  165. package/types/src/components/blocks/deopt.d.ts +0 -4
  166. package/types/src/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
  167. package/types/src/functions/evaluate/non-node-runtime/index.d.ts +0 -1
  168. package/types/src/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
  169. package/types/src/functions/is-non-node-server.d.ts +0 -4
  170. package/types/types/api-version.d.ts +0 -2
  171. package/types/types/builder-block.d.ts +0 -66
  172. package/types/types/builder-content.d.ts +0 -44
  173. package/types/types/builder-props.d.ts +0 -9
  174. package/types/types/can-track.d.ts +0 -3
  175. package/types/types/components.d.ts +0 -111
  176. package/types/types/deep-partial.d.ts +0 -3
  177. package/types/types/element.d.ts +0 -59
  178. package/types/types/enforced-partials.d.ts +0 -21
  179. package/types/types/input.d.ts +0 -121
  180. package/types/types/targets.d.ts +0 -1
  181. package/types/types/typescript.d.ts +0 -11
@@ -842,8 +842,57 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
842
842
  },
843
843
  children: [
844
844
  /* @__PURE__ */ qwik._jsxC(ComponentRef, {
845
- ...componentRefProps.value
846
- }, 0, "jN_1"),
845
+ get componentRef() {
846
+ return componentRefProps.value.componentRef;
847
+ },
848
+ get componentOptions() {
849
+ return componentRefProps.value.componentOptions;
850
+ },
851
+ get blockChildren() {
852
+ return componentRefProps.value.blockChildren;
853
+ },
854
+ get context() {
855
+ return componentRefProps.value.context;
856
+ },
857
+ get registeredComponents() {
858
+ return componentRefProps.value.registeredComponents;
859
+ },
860
+ get builderBlock() {
861
+ return componentRefProps.value.builderBlock;
862
+ },
863
+ get includeBlockProps() {
864
+ return componentRefProps.value.includeBlockProps;
865
+ },
866
+ get isInteractive() {
867
+ return componentRefProps.value.isInteractive;
868
+ },
869
+ [qwik._IMMUTABLE]: {
870
+ blockChildren: qwik._fnSignal((p0) => p0.value.blockChildren, [
871
+ componentRefProps
872
+ ], "p0.value.blockChildren"),
873
+ builderBlock: qwik._fnSignal((p0) => p0.value.builderBlock, [
874
+ componentRefProps
875
+ ], "p0.value.builderBlock"),
876
+ componentOptions: qwik._fnSignal((p0) => p0.value.componentOptions, [
877
+ componentRefProps
878
+ ], "p0.value.componentOptions"),
879
+ componentRef: qwik._fnSignal((p0) => p0.value.componentRef, [
880
+ componentRefProps
881
+ ], "p0.value.componentRef"),
882
+ context: qwik._fnSignal((p0) => p0.value.context, [
883
+ componentRefProps
884
+ ], "p0.value.context"),
885
+ includeBlockProps: qwik._fnSignal((p0) => p0.value.includeBlockProps, [
886
+ componentRefProps
887
+ ], "p0.value.includeBlockProps"),
888
+ isInteractive: qwik._fnSignal((p0) => p0.value.isInteractive, [
889
+ componentRefProps
890
+ ], "p0.value.isInteractive"),
891
+ registeredComponents: qwik._fnSignal((p0) => p0.value.registeredComponents, [
892
+ componentRefProps
893
+ ], "p0.value.registeredComponents")
894
+ }
895
+ }, 3, "jN_1"),
847
896
  (childrenWithoutParentComponent.value || []).map((child) => {
848
897
  return /* @__PURE__ */ qwik._jsxC(Block, {
849
898
  block: child,
@@ -893,8 +942,57 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
893
942
  }, 1, "jN_2") : null
894
943
  ]
895
944
  }, 1, "jN_3") : /* @__PURE__ */ qwik._jsxC(ComponentRef, {
896
- ...componentRefProps.value
897
- }, 0, "jN_4") : null
945
+ get componentRef() {
946
+ return componentRefProps.value.componentRef;
947
+ },
948
+ get componentOptions() {
949
+ return componentRefProps.value.componentOptions;
950
+ },
951
+ get blockChildren() {
952
+ return componentRefProps.value.blockChildren;
953
+ },
954
+ get context() {
955
+ return componentRefProps.value.context;
956
+ },
957
+ get registeredComponents() {
958
+ return componentRefProps.value.registeredComponents;
959
+ },
960
+ get builderBlock() {
961
+ return componentRefProps.value.builderBlock;
962
+ },
963
+ get includeBlockProps() {
964
+ return componentRefProps.value.includeBlockProps;
965
+ },
966
+ get isInteractive() {
967
+ return componentRefProps.value.isInteractive;
968
+ },
969
+ [qwik._IMMUTABLE]: {
970
+ blockChildren: qwik._fnSignal((p0) => p0.value.blockChildren, [
971
+ componentRefProps
972
+ ], "p0.value.blockChildren"),
973
+ builderBlock: qwik._fnSignal((p0) => p0.value.builderBlock, [
974
+ componentRefProps
975
+ ], "p0.value.builderBlock"),
976
+ componentOptions: qwik._fnSignal((p0) => p0.value.componentOptions, [
977
+ componentRefProps
978
+ ], "p0.value.componentOptions"),
979
+ componentRef: qwik._fnSignal((p0) => p0.value.componentRef, [
980
+ componentRefProps
981
+ ], "p0.value.componentRef"),
982
+ context: qwik._fnSignal((p0) => p0.value.context, [
983
+ componentRefProps
984
+ ], "p0.value.context"),
985
+ includeBlockProps: qwik._fnSignal((p0) => p0.value.includeBlockProps, [
986
+ componentRefProps
987
+ ], "p0.value.includeBlockProps"),
988
+ isInteractive: qwik._fnSignal((p0) => p0.value.isInteractive, [
989
+ componentRefProps
990
+ ], "p0.value.isInteractive"),
991
+ registeredComponents: qwik._fnSignal((p0) => p0.value.registeredComponents, [
992
+ componentRefProps
993
+ ], "p0.value.registeredComponents")
994
+ }
995
+ }, 3, "jN_4") : null
898
996
  }, 1, "jN_5");
899
997
  }, "Block_component_nnPv0RY0U0k"));
900
998
  const onClick$1 = function onClick2(props, state) {
@@ -1866,13 +1964,185 @@ const componentInfo$9 = {
1866
1964
  ]
1867
1965
  };
1868
1966
  const componentInfo$8 = {
1967
+ name: "Custom Code",
1968
+ static: true,
1969
+ requiredPermissions: [
1970
+ "editCode"
1971
+ ],
1972
+ inputs: [
1973
+ {
1974
+ name: "code",
1975
+ type: "html",
1976
+ required: true,
1977
+ defaultValue: "<p>Hello there, I am custom HTML code!</p>",
1978
+ code: true
1979
+ },
1980
+ {
1981
+ name: "replaceNodes",
1982
+ type: "boolean",
1983
+ helperText: "Preserve server rendered dom nodes",
1984
+ advanced: true
1985
+ },
1986
+ {
1987
+ name: "scriptsClientOnly",
1988
+ type: "boolean",
1989
+ defaultValue: false,
1990
+ helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1991
+ advanced: true
1992
+ }
1993
+ ]
1994
+ };
1995
+ const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
1996
+ const elementRef = qwik.useSignal();
1997
+ const state = qwik.useStore({
1998
+ scriptsInserted: [],
1999
+ scriptsRun: []
2000
+ });
2001
+ qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
2002
+ const [state2] = qwik.useLexicalScope();
2003
+ if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
2004
+ return;
2005
+ const scripts = element.getElementsByTagName("script");
2006
+ for (let i = 0; i < scripts.length; i++) {
2007
+ const script = scripts[i];
2008
+ if (script.src) {
2009
+ if (state2.scriptsInserted.includes(script.src))
2010
+ continue;
2011
+ state2.scriptsInserted.push(script.src);
2012
+ const newScript = document.createElement("script");
2013
+ newScript.async = true;
2014
+ newScript.src = script.src;
2015
+ document.head.appendChild(newScript);
2016
+ } else if (!script.type || [
2017
+ "text/javascript",
2018
+ "application/javascript",
2019
+ "application/ecmascript"
2020
+ ].includes(script.type)) {
2021
+ if (state2.scriptsRun.includes(script.innerText))
2022
+ continue;
2023
+ try {
2024
+ state2.scriptsRun.push(script.innerText);
2025
+ new Function(script.innerText)();
2026
+ } catch (error) {
2027
+ console.warn("`CustomCode`: Error running script:", error);
2028
+ }
2029
+ }
2030
+ }
2031
+ }, "CustomCode_component_useOn_zjAgBhFOiCs", [
2032
+ state
2033
+ ]));
2034
+ return /* @__PURE__ */ qwik._jsxQ("div", {
2035
+ ref: elementRef
2036
+ }, {
2037
+ class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
2038
+ props
2039
+ ], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
2040
+ dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.code, [
2041
+ props
2042
+ ], "p0.code")
2043
+ }, null, 3, "bY_0");
2044
+ }, "CustomCode_component_uYOSy7w7Zqw"));
2045
+ const componentInfo$7 = {
2046
+ name: "Embed",
2047
+ static: true,
2048
+ inputs: [
2049
+ {
2050
+ name: "url",
2051
+ type: "url",
2052
+ required: true,
2053
+ defaultValue: "",
2054
+ helperText: "e.g. enter a youtube url, google map, etc",
2055
+ onChange: (options) => {
2056
+ const url = options.get("url");
2057
+ if (url) {
2058
+ options.set("content", "Loading...");
2059
+ const apiKey = "ae0e60e78201a3f2b0de4b";
2060
+ return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
2061
+ if (options.get("url") === url) {
2062
+ if (data.html)
2063
+ options.set("content", data.html);
2064
+ else
2065
+ options.set("content", "Invalid url, please try another");
2066
+ }
2067
+ }).catch((_err) => {
2068
+ options.set("content", "There was an error embedding this URL, please try again or another URL");
2069
+ });
2070
+ } else
2071
+ options.delete("content");
2072
+ }
2073
+ },
2074
+ {
2075
+ name: "content",
2076
+ type: "html",
2077
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
2078
+ hideFromUI: true
2079
+ }
2080
+ ]
2081
+ };
2082
+ const SCRIPT_MIME_TYPES = [
2083
+ "text/javascript",
2084
+ "application/javascript",
2085
+ "application/ecmascript"
2086
+ ];
2087
+ const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2088
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
2089
+ if (!elem.value || !elem.value.getElementsByTagName)
2090
+ return;
2091
+ const scripts = elem.value.getElementsByTagName("script");
2092
+ for (let i = 0; i < scripts.length; i++) {
2093
+ const script = scripts[i];
2094
+ if (script.src && !state.scriptsInserted.includes(script.src)) {
2095
+ state.scriptsInserted.push(script.src);
2096
+ const newScript = document.createElement("script");
2097
+ newScript.async = true;
2098
+ newScript.src = script.src;
2099
+ document.head.appendChild(newScript);
2100
+ } else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
2101
+ try {
2102
+ state.scriptsRun.push(script.innerText);
2103
+ new Function(script.innerText)();
2104
+ } catch (error) {
2105
+ console.warn("`Embed`: Error running script:", error);
2106
+ }
2107
+ }
2108
+ };
2109
+ const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2110
+ const elem = qwik.useSignal();
2111
+ const state = qwik.useStore({
2112
+ ranInitFn: false,
2113
+ scriptsInserted: [],
2114
+ scriptsRun: []
2115
+ });
2116
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
2117
+ const [elem2, props2, state2] = qwik.useLexicalScope();
2118
+ track2(() => elem2.value);
2119
+ track2(() => state2.ranInitFn);
2120
+ if (elem2.value && !state2.ranInitFn) {
2121
+ state2.ranInitFn = true;
2122
+ findAndRunScripts(props2, state2, elem2);
2123
+ }
2124
+ }, "Embed_component_useTask_bg7ez0XUtiM", [
2125
+ elem,
2126
+ props,
2127
+ state
2128
+ ]));
2129
+ return /* @__PURE__ */ qwik._jsxQ("div", {
2130
+ ref: elem
2131
+ }, {
2132
+ class: "builder-embed",
2133
+ dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.content, [
2134
+ props
2135
+ ], "p0.content")
2136
+ }, null, 3, "9r_0");
2137
+ }, "Embed_component_Uji08ORjXbE"));
2138
+ const componentInfo$6 = {
1869
2139
  name: "Fragment",
1870
2140
  static: true,
1871
2141
  hidden: true,
1872
2142
  canHaveChildren: true,
1873
2143
  noWrap: true
1874
2144
  };
1875
- const componentInfo$7 = {
2145
+ const componentInfo$5 = {
1876
2146
  name: "Image",
1877
2147
  static: true,
1878
2148
  image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
@@ -2020,7 +2290,49 @@ const componentInfo$7 = {
2020
2290
  }
2021
2291
  ]
2022
2292
  };
2023
- const componentInfo$6 = {
2293
+ const componentInfo$4 = {
2294
+ // friendlyName?
2295
+ name: "Raw:Img",
2296
+ hideFromInsertMenu: true,
2297
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
2298
+ inputs: [
2299
+ {
2300
+ name: "image",
2301
+ bubble: true,
2302
+ type: "file",
2303
+ allowedFileTypes: [
2304
+ "jpeg",
2305
+ "jpg",
2306
+ "png",
2307
+ "svg",
2308
+ "gif",
2309
+ "webp"
2310
+ ],
2311
+ required: true
2312
+ }
2313
+ ],
2314
+ noWrap: true,
2315
+ static: true
2316
+ };
2317
+ const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2318
+ return /* @__PURE__ */ qwik._jsxS("img", {
2319
+ ...props.attributes
2320
+ }, {
2321
+ alt: qwik._fnSignal((p0) => p0.altText, [
2322
+ props
2323
+ ], "p0.altText"),
2324
+ src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
2325
+ props
2326
+ ], "p0.imgSrc||p0.image"),
2327
+ style: qwik._fnSignal((p0) => ({
2328
+ objectFit: p0.backgroundSize || "cover",
2329
+ objectPosition: p0.backgroundPosition || "center"
2330
+ }), [
2331
+ props
2332
+ ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
2333
+ }, 0, isEditing() && props.imgSrc || "default-key");
2334
+ }, "ImgComponent_component_FXvIDBSffO8"));
2335
+ const componentInfo$3 = {
2024
2336
  name: "Core:Section",
2025
2337
  static: true,
2026
2338
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2065,7 +2377,7 @@ const componentInfo$6 = {
2065
2377
  }
2066
2378
  ]
2067
2379
  };
2068
- const componentInfo$5 = {
2380
+ const componentInfo$2 = {
2069
2381
  name: "Symbol",
2070
2382
  noWrap: true,
2071
2383
  static: true,
@@ -2105,7 +2417,7 @@ const componentInfo$5 = {
2105
2417
  }
2106
2418
  ]
2107
2419
  };
2108
- const componentInfo$4 = {
2420
+ const componentInfo$1 = {
2109
2421
  name: "Text",
2110
2422
  static: true,
2111
2423
  isRSC: true,
@@ -2140,7 +2452,7 @@ const Text = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
2140
2452
  }
2141
2453
  }, null, 3, "yO_0");
2142
2454
  }, "Text_component_15p0cKUxgIE"));
2143
- const componentInfo$3 = {
2455
+ const componentInfo = {
2144
2456
  name: "Video",
2145
2457
  canHaveChildren: true,
2146
2458
  defaultStyles: {
@@ -2324,220 +2636,6 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
2324
2636
  ], '{width:"100%",height:"100%",...p0.attributes?.style,objectFit:p0.fit,objectPosition:p0.position,borderRadius:1}')
2325
2637
  }, 0, "j7_0");
2326
2638
  }, "Video_component_qdcTZflYyoQ"));
2327
- const componentInfo$2 = {
2328
- name: "Embed",
2329
- static: true,
2330
- inputs: [
2331
- {
2332
- name: "url",
2333
- type: "url",
2334
- required: true,
2335
- defaultValue: "",
2336
- helperText: "e.g. enter a youtube url, google map, etc",
2337
- onChange: (options) => {
2338
- const url = options.get("url");
2339
- if (url) {
2340
- options.set("content", "Loading...");
2341
- const apiKey = "ae0e60e78201a3f2b0de4b";
2342
- return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
2343
- if (options.get("url") === url) {
2344
- if (data.html)
2345
- options.set("content", data.html);
2346
- else
2347
- options.set("content", "Invalid url, please try another");
2348
- }
2349
- }).catch((_err) => {
2350
- options.set("content", "There was an error embedding this URL, please try again or another URL");
2351
- });
2352
- } else
2353
- options.delete("content");
2354
- }
2355
- },
2356
- {
2357
- name: "content",
2358
- type: "html",
2359
- defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
2360
- hideFromUI: true
2361
- }
2362
- ]
2363
- };
2364
- const SCRIPT_MIME_TYPES = [
2365
- "text/javascript",
2366
- "application/javascript",
2367
- "application/ecmascript"
2368
- ];
2369
- const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2370
- const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
2371
- if (!elem.value || !elem.value.getElementsByTagName)
2372
- return;
2373
- const scripts = elem.value.getElementsByTagName("script");
2374
- for (let i = 0; i < scripts.length; i++) {
2375
- const script = scripts[i];
2376
- if (script.src && !state.scriptsInserted.includes(script.src)) {
2377
- state.scriptsInserted.push(script.src);
2378
- const newScript = document.createElement("script");
2379
- newScript.async = true;
2380
- newScript.src = script.src;
2381
- document.head.appendChild(newScript);
2382
- } else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
2383
- try {
2384
- state.scriptsRun.push(script.innerText);
2385
- new Function(script.innerText)();
2386
- } catch (error) {
2387
- console.warn("`Embed`: Error running script:", error);
2388
- }
2389
- }
2390
- };
2391
- const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2392
- const elem = qwik.useSignal();
2393
- const state = qwik.useStore({
2394
- ranInitFn: false,
2395
- scriptsInserted: [],
2396
- scriptsRun: []
2397
- });
2398
- qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
2399
- const [elem2, props2, state2] = qwik.useLexicalScope();
2400
- track2(() => elem2.value);
2401
- track2(() => state2.ranInitFn);
2402
- if (elem2.value && !state2.ranInitFn) {
2403
- state2.ranInitFn = true;
2404
- findAndRunScripts(props2, state2, elem2);
2405
- }
2406
- }, "Embed_component_useTask_bg7ez0XUtiM", [
2407
- elem,
2408
- props,
2409
- state
2410
- ]));
2411
- return /* @__PURE__ */ qwik._jsxQ("div", {
2412
- ref: elem
2413
- }, {
2414
- class: "builder-embed",
2415
- dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.content, [
2416
- props
2417
- ], "p0.content")
2418
- }, null, 3, "9r_0");
2419
- }, "Embed_component_Uji08ORjXbE"));
2420
- const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2421
- return /* @__PURE__ */ qwik._jsxS("img", {
2422
- ...props.attributes
2423
- }, {
2424
- alt: qwik._fnSignal((p0) => p0.altText, [
2425
- props
2426
- ], "p0.altText"),
2427
- src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
2428
- props
2429
- ], "p0.imgSrc||p0.image"),
2430
- style: qwik._fnSignal((p0) => ({
2431
- objectFit: p0.backgroundSize || "cover",
2432
- objectPosition: p0.backgroundPosition || "center"
2433
- }), [
2434
- props
2435
- ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
2436
- }, 0, isEditing() && props.imgSrc || "default-key");
2437
- }, "ImgComponent_component_FXvIDBSffO8"));
2438
- const componentInfo$1 = {
2439
- // friendlyName?
2440
- name: "Raw:Img",
2441
- hideFromInsertMenu: true,
2442
- image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
2443
- inputs: [
2444
- {
2445
- name: "image",
2446
- bubble: true,
2447
- type: "file",
2448
- allowedFileTypes: [
2449
- "jpeg",
2450
- "jpg",
2451
- "png",
2452
- "svg",
2453
- "gif",
2454
- "webp"
2455
- ],
2456
- required: true
2457
- }
2458
- ],
2459
- noWrap: true,
2460
- static: true
2461
- };
2462
- const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2463
- const elementRef = qwik.useSignal();
2464
- const state = qwik.useStore({
2465
- scriptsInserted: [],
2466
- scriptsRun: []
2467
- });
2468
- qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
2469
- const [state2] = qwik.useLexicalScope();
2470
- if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
2471
- return;
2472
- const scripts = element.getElementsByTagName("script");
2473
- for (let i = 0; i < scripts.length; i++) {
2474
- const script = scripts[i];
2475
- if (script.src) {
2476
- if (state2.scriptsInserted.includes(script.src))
2477
- continue;
2478
- state2.scriptsInserted.push(script.src);
2479
- const newScript = document.createElement("script");
2480
- newScript.async = true;
2481
- newScript.src = script.src;
2482
- document.head.appendChild(newScript);
2483
- } else if (!script.type || [
2484
- "text/javascript",
2485
- "application/javascript",
2486
- "application/ecmascript"
2487
- ].includes(script.type)) {
2488
- if (state2.scriptsRun.includes(script.innerText))
2489
- continue;
2490
- try {
2491
- state2.scriptsRun.push(script.innerText);
2492
- new Function(script.innerText)();
2493
- } catch (error) {
2494
- console.warn("`CustomCode`: Error running script:", error);
2495
- }
2496
- }
2497
- }
2498
- }, "CustomCode_component_useOn_zjAgBhFOiCs", [
2499
- state
2500
- ]));
2501
- return /* @__PURE__ */ qwik._jsxQ("div", {
2502
- ref: elementRef
2503
- }, {
2504
- class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
2505
- props
2506
- ], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
2507
- dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.code, [
2508
- props
2509
- ], "p0.code")
2510
- }, null, 3, "bY_0");
2511
- }, "CustomCode_component_uYOSy7w7Zqw"));
2512
- const componentInfo = {
2513
- name: "Custom Code",
2514
- static: true,
2515
- requiredPermissions: [
2516
- "editCode"
2517
- ],
2518
- inputs: [
2519
- {
2520
- name: "code",
2521
- type: "html",
2522
- required: true,
2523
- defaultValue: "<p>Hello there, I am custom HTML code!</p>",
2524
- code: true
2525
- },
2526
- {
2527
- name: "replaceNodes",
2528
- type: "boolean",
2529
- helperText: "Preserve server rendered dom nodes",
2530
- advanced: true
2531
- },
2532
- {
2533
- name: "scriptsClientOnly",
2534
- type: "boolean",
2535
- defaultValue: false,
2536
- helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
2537
- advanced: true
2538
- }
2539
- ]
2540
- };
2541
2639
  const getDefaultRegisteredComponents = () => [
2542
2640
  {
2543
2641
  component: Button,
@@ -2549,39 +2647,39 @@ const getDefaultRegisteredComponents = () => [
2549
2647
  },
2550
2648
  {
2551
2649
  component: CustomCode,
2552
- ...componentInfo
2650
+ ...componentInfo$8
2553
2651
  },
2554
2652
  {
2555
2653
  component: Embed,
2556
- ...componentInfo$2
2654
+ ...componentInfo$7
2557
2655
  },
2558
2656
  {
2559
2657
  component: FragmentComponent,
2560
- ...componentInfo$8
2658
+ ...componentInfo$6
2561
2659
  },
2562
2660
  {
2563
2661
  component: Image,
2564
- ...componentInfo$7
2662
+ ...componentInfo$5
2565
2663
  },
2566
2664
  {
2567
2665
  component: ImgComponent,
2568
- ...componentInfo$1
2666
+ ...componentInfo$4
2569
2667
  },
2570
2668
  {
2571
2669
  component: SectionComponent,
2572
- ...componentInfo$6
2670
+ ...componentInfo$3
2573
2671
  },
2574
2672
  {
2575
2673
  component: Symbol$1,
2576
- ...componentInfo$5
2674
+ ...componentInfo$2
2577
2675
  },
2578
2676
  {
2579
2677
  component: Text,
2580
- ...componentInfo$4
2678
+ ...componentInfo$1
2581
2679
  },
2582
2680
  {
2583
2681
  component: Video,
2584
- ...componentInfo$3
2682
+ ...componentInfo
2585
2683
  }
2586
2684
  ];
2587
2685
  const components = [];
@@ -2786,6 +2884,7 @@ function flatten(object, path = null, separator = ".") {
2786
2884
  };
2787
2885
  }, {});
2788
2886
  }
2887
+ const DEFAULT_API_VERSION = "v3";
2789
2888
  const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
2790
2889
  const BUILDER_OPTIONS_PREFIX = "options.";
2791
2890
  const convertSearchParamsToQueryObject = (searchParams) => {
@@ -2815,7 +2914,6 @@ const getBuilderSearchParamsFromWindow = () => {
2815
2914
  return getBuilderSearchParams(searchParams);
2816
2915
  };
2817
2916
  const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
2818
- const DEFAULT_API_VERSION = "v3";
2819
2917
  const isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
2820
2918
  const generateContentUrl = (options) => {
2821
2919
  let { noTraverse = false } = options;
@@ -3121,7 +3219,7 @@ const getInteractionPropertiesForEvent = (event) => {
3121
3219
  }
3122
3220
  };
3123
3221
  };
3124
- const SDK_VERSION = "0.7.1-4";
3222
+ const SDK_VERSION = "0.7.1";
3125
3223
  const registry = {};
3126
3224
  function register(type, info) {
3127
3225
  let typeList = registry[type];