@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
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const qwik = require("@builder.io/qwik");
4
4
  const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
5
- const nodeEvaluate = require("./node-evaluate-fc9f27d1.cjs");
5
+ const nodeEvaluate = require("./node-evaluate-1a278bf5.cjs");
6
6
  const build = require("@builder.io/qwik/build");
7
7
  require("node:module");
8
8
  const Button = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
@@ -61,6 +61,14 @@ const logger = {
61
61
  warn: (...message) => console.warn(MSG_PREFIX, ...message),
62
62
  debug: (...message) => console.debug(MSG_PREFIX, ...message)
63
63
  };
64
+ const fastClone = (obj) => JSON.parse(JSON.stringify(obj));
65
+ const set = (obj, _path, value) => {
66
+ if (Object(obj) !== obj)
67
+ return obj;
68
+ const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
69
+ path.slice(0, -1).reduce((a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {}, obj)[path[path.length - 1]] = value;
70
+ return obj;
71
+ };
64
72
  function isBrowser() {
65
73
  return typeof window !== "undefined" && typeof document !== "undefined";
66
74
  }
@@ -137,14 +145,6 @@ const parseCode = (code, { isExpression = true }) => {
137
145
  const useCode = useReturn ? `return (${code});` : code;
138
146
  return useCode;
139
147
  };
140
- const fastClone = (obj) => JSON.parse(JSON.stringify(obj));
141
- const set = (obj, _path, value) => {
142
- if (Object(obj) !== obj)
143
- return obj;
144
- const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
145
- path.slice(0, -1).reduce((a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {}, obj)[path[path.length - 1]] = value;
146
- return obj;
147
- };
148
148
  const ivm = nodeEvaluate.safeDynamicRequire("isolated-vm");
149
149
  const getSyncValName = (key) => `bldr_${key}_sync`;
150
150
  const BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE";
@@ -943,8 +943,57 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
943
943
  },
944
944
  children: [
945
945
  /* @__PURE__ */ qwik._jsxC(ComponentRef, {
946
- ...componentRefProps.value
947
- }, 0, "jN_1"),
946
+ get componentRef() {
947
+ return componentRefProps.value.componentRef;
948
+ },
949
+ get componentOptions() {
950
+ return componentRefProps.value.componentOptions;
951
+ },
952
+ get blockChildren() {
953
+ return componentRefProps.value.blockChildren;
954
+ },
955
+ get context() {
956
+ return componentRefProps.value.context;
957
+ },
958
+ get registeredComponents() {
959
+ return componentRefProps.value.registeredComponents;
960
+ },
961
+ get builderBlock() {
962
+ return componentRefProps.value.builderBlock;
963
+ },
964
+ get includeBlockProps() {
965
+ return componentRefProps.value.includeBlockProps;
966
+ },
967
+ get isInteractive() {
968
+ return componentRefProps.value.isInteractive;
969
+ },
970
+ [qwik._IMMUTABLE]: {
971
+ blockChildren: qwik._fnSignal((p0) => p0.value.blockChildren, [
972
+ componentRefProps
973
+ ], "p0.value.blockChildren"),
974
+ builderBlock: qwik._fnSignal((p0) => p0.value.builderBlock, [
975
+ componentRefProps
976
+ ], "p0.value.builderBlock"),
977
+ componentOptions: qwik._fnSignal((p0) => p0.value.componentOptions, [
978
+ componentRefProps
979
+ ], "p0.value.componentOptions"),
980
+ componentRef: qwik._fnSignal((p0) => p0.value.componentRef, [
981
+ componentRefProps
982
+ ], "p0.value.componentRef"),
983
+ context: qwik._fnSignal((p0) => p0.value.context, [
984
+ componentRefProps
985
+ ], "p0.value.context"),
986
+ includeBlockProps: qwik._fnSignal((p0) => p0.value.includeBlockProps, [
987
+ componentRefProps
988
+ ], "p0.value.includeBlockProps"),
989
+ isInteractive: qwik._fnSignal((p0) => p0.value.isInteractive, [
990
+ componentRefProps
991
+ ], "p0.value.isInteractive"),
992
+ registeredComponents: qwik._fnSignal((p0) => p0.value.registeredComponents, [
993
+ componentRefProps
994
+ ], "p0.value.registeredComponents")
995
+ }
996
+ }, 3, "jN_1"),
948
997
  (childrenWithoutParentComponent.value || []).map((child) => {
949
998
  return /* @__PURE__ */ qwik._jsxC(Block, {
950
999
  block: child,
@@ -994,8 +1043,57 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
994
1043
  }, 1, "jN_2") : null
995
1044
  ]
996
1045
  }, 1, "jN_3") : /* @__PURE__ */ qwik._jsxC(ComponentRef, {
997
- ...componentRefProps.value
998
- }, 0, "jN_4") : null
1046
+ get componentRef() {
1047
+ return componentRefProps.value.componentRef;
1048
+ },
1049
+ get componentOptions() {
1050
+ return componentRefProps.value.componentOptions;
1051
+ },
1052
+ get blockChildren() {
1053
+ return componentRefProps.value.blockChildren;
1054
+ },
1055
+ get context() {
1056
+ return componentRefProps.value.context;
1057
+ },
1058
+ get registeredComponents() {
1059
+ return componentRefProps.value.registeredComponents;
1060
+ },
1061
+ get builderBlock() {
1062
+ return componentRefProps.value.builderBlock;
1063
+ },
1064
+ get includeBlockProps() {
1065
+ return componentRefProps.value.includeBlockProps;
1066
+ },
1067
+ get isInteractive() {
1068
+ return componentRefProps.value.isInteractive;
1069
+ },
1070
+ [qwik._IMMUTABLE]: {
1071
+ blockChildren: qwik._fnSignal((p0) => p0.value.blockChildren, [
1072
+ componentRefProps
1073
+ ], "p0.value.blockChildren"),
1074
+ builderBlock: qwik._fnSignal((p0) => p0.value.builderBlock, [
1075
+ componentRefProps
1076
+ ], "p0.value.builderBlock"),
1077
+ componentOptions: qwik._fnSignal((p0) => p0.value.componentOptions, [
1078
+ componentRefProps
1079
+ ], "p0.value.componentOptions"),
1080
+ componentRef: qwik._fnSignal((p0) => p0.value.componentRef, [
1081
+ componentRefProps
1082
+ ], "p0.value.componentRef"),
1083
+ context: qwik._fnSignal((p0) => p0.value.context, [
1084
+ componentRefProps
1085
+ ], "p0.value.context"),
1086
+ includeBlockProps: qwik._fnSignal((p0) => p0.value.includeBlockProps, [
1087
+ componentRefProps
1088
+ ], "p0.value.includeBlockProps"),
1089
+ isInteractive: qwik._fnSignal((p0) => p0.value.isInteractive, [
1090
+ componentRefProps
1091
+ ], "p0.value.isInteractive"),
1092
+ registeredComponents: qwik._fnSignal((p0) => p0.value.registeredComponents, [
1093
+ componentRefProps
1094
+ ], "p0.value.registeredComponents")
1095
+ }
1096
+ }, 3, "jN_4") : null
999
1097
  }, 1, "jN_5");
1000
1098
  }, "Block_component_nnPv0RY0U0k"));
1001
1099
  const onClick$1 = function onClick2(props, state) {
@@ -1967,13 +2065,185 @@ const componentInfo$9 = {
1967
2065
  ]
1968
2066
  };
1969
2067
  const componentInfo$8 = {
2068
+ name: "Custom Code",
2069
+ static: true,
2070
+ requiredPermissions: [
2071
+ "editCode"
2072
+ ],
2073
+ inputs: [
2074
+ {
2075
+ name: "code",
2076
+ type: "html",
2077
+ required: true,
2078
+ defaultValue: "<p>Hello there, I am custom HTML code!</p>",
2079
+ code: true
2080
+ },
2081
+ {
2082
+ name: "replaceNodes",
2083
+ type: "boolean",
2084
+ helperText: "Preserve server rendered dom nodes",
2085
+ advanced: true
2086
+ },
2087
+ {
2088
+ name: "scriptsClientOnly",
2089
+ type: "boolean",
2090
+ defaultValue: false,
2091
+ helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
2092
+ advanced: true
2093
+ }
2094
+ ]
2095
+ };
2096
+ const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2097
+ const elementRef = qwik.useSignal();
2098
+ const state = qwik.useStore({
2099
+ scriptsInserted: [],
2100
+ scriptsRun: []
2101
+ });
2102
+ qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
2103
+ const [state2] = qwik.useLexicalScope();
2104
+ if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
2105
+ return;
2106
+ const scripts = element.getElementsByTagName("script");
2107
+ for (let i = 0; i < scripts.length; i++) {
2108
+ const script = scripts[i];
2109
+ if (script.src) {
2110
+ if (state2.scriptsInserted.includes(script.src))
2111
+ continue;
2112
+ state2.scriptsInserted.push(script.src);
2113
+ const newScript = document.createElement("script");
2114
+ newScript.async = true;
2115
+ newScript.src = script.src;
2116
+ document.head.appendChild(newScript);
2117
+ } else if (!script.type || [
2118
+ "text/javascript",
2119
+ "application/javascript",
2120
+ "application/ecmascript"
2121
+ ].includes(script.type)) {
2122
+ if (state2.scriptsRun.includes(script.innerText))
2123
+ continue;
2124
+ try {
2125
+ state2.scriptsRun.push(script.innerText);
2126
+ new Function(script.innerText)();
2127
+ } catch (error) {
2128
+ console.warn("`CustomCode`: Error running script:", error);
2129
+ }
2130
+ }
2131
+ }
2132
+ }, "CustomCode_component_useOn_zjAgBhFOiCs", [
2133
+ state
2134
+ ]));
2135
+ return /* @__PURE__ */ qwik._jsxQ("div", {
2136
+ ref: elementRef
2137
+ }, {
2138
+ class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
2139
+ props
2140
+ ], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
2141
+ dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.code, [
2142
+ props
2143
+ ], "p0.code")
2144
+ }, null, 3, "bY_0");
2145
+ }, "CustomCode_component_uYOSy7w7Zqw"));
2146
+ const componentInfo$7 = {
2147
+ name: "Embed",
2148
+ static: true,
2149
+ inputs: [
2150
+ {
2151
+ name: "url",
2152
+ type: "url",
2153
+ required: true,
2154
+ defaultValue: "",
2155
+ helperText: "e.g. enter a youtube url, google map, etc",
2156
+ onChange: (options) => {
2157
+ const url = options.get("url");
2158
+ if (url) {
2159
+ options.set("content", "Loading...");
2160
+ const apiKey = "ae0e60e78201a3f2b0de4b";
2161
+ return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
2162
+ if (options.get("url") === url) {
2163
+ if (data.html)
2164
+ options.set("content", data.html);
2165
+ else
2166
+ options.set("content", "Invalid url, please try another");
2167
+ }
2168
+ }).catch((_err) => {
2169
+ options.set("content", "There was an error embedding this URL, please try again or another URL");
2170
+ });
2171
+ } else
2172
+ options.delete("content");
2173
+ }
2174
+ },
2175
+ {
2176
+ name: "content",
2177
+ type: "html",
2178
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
2179
+ hideFromUI: true
2180
+ }
2181
+ ]
2182
+ };
2183
+ const SCRIPT_MIME_TYPES = [
2184
+ "text/javascript",
2185
+ "application/javascript",
2186
+ "application/ecmascript"
2187
+ ];
2188
+ const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2189
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
2190
+ if (!elem.value || !elem.value.getElementsByTagName)
2191
+ return;
2192
+ const scripts = elem.value.getElementsByTagName("script");
2193
+ for (let i = 0; i < scripts.length; i++) {
2194
+ const script = scripts[i];
2195
+ if (script.src && !state.scriptsInserted.includes(script.src)) {
2196
+ state.scriptsInserted.push(script.src);
2197
+ const newScript = document.createElement("script");
2198
+ newScript.async = true;
2199
+ newScript.src = script.src;
2200
+ document.head.appendChild(newScript);
2201
+ } else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
2202
+ try {
2203
+ state.scriptsRun.push(script.innerText);
2204
+ new Function(script.innerText)();
2205
+ } catch (error) {
2206
+ console.warn("`Embed`: Error running script:", error);
2207
+ }
2208
+ }
2209
+ };
2210
+ const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2211
+ const elem = qwik.useSignal();
2212
+ const state = qwik.useStore({
2213
+ ranInitFn: false,
2214
+ scriptsInserted: [],
2215
+ scriptsRun: []
2216
+ });
2217
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
2218
+ const [elem2, props2, state2] = qwik.useLexicalScope();
2219
+ track2(() => elem2.value);
2220
+ track2(() => state2.ranInitFn);
2221
+ if (elem2.value && !state2.ranInitFn) {
2222
+ state2.ranInitFn = true;
2223
+ findAndRunScripts(props2, state2, elem2);
2224
+ }
2225
+ }, "Embed_component_useTask_bg7ez0XUtiM", [
2226
+ elem,
2227
+ props,
2228
+ state
2229
+ ]));
2230
+ return /* @__PURE__ */ qwik._jsxQ("div", {
2231
+ ref: elem
2232
+ }, {
2233
+ class: "builder-embed",
2234
+ dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.content, [
2235
+ props
2236
+ ], "p0.content")
2237
+ }, null, 3, "9r_0");
2238
+ }, "Embed_component_Uji08ORjXbE"));
2239
+ const componentInfo$6 = {
1970
2240
  name: "Fragment",
1971
2241
  static: true,
1972
2242
  hidden: true,
1973
2243
  canHaveChildren: true,
1974
2244
  noWrap: true
1975
2245
  };
1976
- const componentInfo$7 = {
2246
+ const componentInfo$5 = {
1977
2247
  name: "Image",
1978
2248
  static: true,
1979
2249
  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",
@@ -2121,7 +2391,49 @@ const componentInfo$7 = {
2121
2391
  }
2122
2392
  ]
2123
2393
  };
2124
- const componentInfo$6 = {
2394
+ const componentInfo$4 = {
2395
+ // friendlyName?
2396
+ name: "Raw:Img",
2397
+ hideFromInsertMenu: true,
2398
+ 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",
2399
+ inputs: [
2400
+ {
2401
+ name: "image",
2402
+ bubble: true,
2403
+ type: "file",
2404
+ allowedFileTypes: [
2405
+ "jpeg",
2406
+ "jpg",
2407
+ "png",
2408
+ "svg",
2409
+ "gif",
2410
+ "webp"
2411
+ ],
2412
+ required: true
2413
+ }
2414
+ ],
2415
+ noWrap: true,
2416
+ static: true
2417
+ };
2418
+ const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2419
+ return /* @__PURE__ */ qwik._jsxS("img", {
2420
+ ...props.attributes
2421
+ }, {
2422
+ alt: qwik._fnSignal((p0) => p0.altText, [
2423
+ props
2424
+ ], "p0.altText"),
2425
+ src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
2426
+ props
2427
+ ], "p0.imgSrc||p0.image"),
2428
+ style: qwik._fnSignal((p0) => ({
2429
+ objectFit: p0.backgroundSize || "cover",
2430
+ objectPosition: p0.backgroundPosition || "center"
2431
+ }), [
2432
+ props
2433
+ ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
2434
+ }, 0, isEditing() && props.imgSrc || "default-key");
2435
+ }, "ImgComponent_component_FXvIDBSffO8"));
2436
+ const componentInfo$3 = {
2125
2437
  name: "Core:Section",
2126
2438
  static: true,
2127
2439
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2166,7 +2478,7 @@ const componentInfo$6 = {
2166
2478
  }
2167
2479
  ]
2168
2480
  };
2169
- const componentInfo$5 = {
2481
+ const componentInfo$2 = {
2170
2482
  name: "Symbol",
2171
2483
  noWrap: true,
2172
2484
  static: true,
@@ -2206,7 +2518,7 @@ const componentInfo$5 = {
2206
2518
  }
2207
2519
  ]
2208
2520
  };
2209
- const componentInfo$4 = {
2521
+ const componentInfo$1 = {
2210
2522
  name: "Text",
2211
2523
  static: true,
2212
2524
  isRSC: true,
@@ -2241,7 +2553,7 @@ const Text = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
2241
2553
  }
2242
2554
  }, null, 3, "yO_0");
2243
2555
  }, "Text_component_15p0cKUxgIE"));
2244
- const componentInfo$3 = {
2556
+ const componentInfo = {
2245
2557
  name: "Video",
2246
2558
  canHaveChildren: true,
2247
2559
  defaultStyles: {
@@ -2425,220 +2737,6 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
2425
2737
  ], '{width:"100%",height:"100%",...p0.attributes?.style,objectFit:p0.fit,objectPosition:p0.position,borderRadius:1}')
2426
2738
  }, 0, "j7_0");
2427
2739
  }, "Video_component_qdcTZflYyoQ"));
2428
- const componentInfo$2 = {
2429
- name: "Embed",
2430
- static: true,
2431
- inputs: [
2432
- {
2433
- name: "url",
2434
- type: "url",
2435
- required: true,
2436
- defaultValue: "",
2437
- helperText: "e.g. enter a youtube url, google map, etc",
2438
- onChange: (options) => {
2439
- const url = options.get("url");
2440
- if (url) {
2441
- options.set("content", "Loading...");
2442
- const apiKey = "ae0e60e78201a3f2b0de4b";
2443
- return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
2444
- if (options.get("url") === url) {
2445
- if (data.html)
2446
- options.set("content", data.html);
2447
- else
2448
- options.set("content", "Invalid url, please try another");
2449
- }
2450
- }).catch((_err) => {
2451
- options.set("content", "There was an error embedding this URL, please try again or another URL");
2452
- });
2453
- } else
2454
- options.delete("content");
2455
- }
2456
- },
2457
- {
2458
- name: "content",
2459
- type: "html",
2460
- defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
2461
- hideFromUI: true
2462
- }
2463
- ]
2464
- };
2465
- const SCRIPT_MIME_TYPES = [
2466
- "text/javascript",
2467
- "application/javascript",
2468
- "application/ecmascript"
2469
- ];
2470
- const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2471
- const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
2472
- if (!elem.value || !elem.value.getElementsByTagName)
2473
- return;
2474
- const scripts = elem.value.getElementsByTagName("script");
2475
- for (let i = 0; i < scripts.length; i++) {
2476
- const script = scripts[i];
2477
- if (script.src && !state.scriptsInserted.includes(script.src)) {
2478
- state.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 (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
2484
- try {
2485
- state.scriptsRun.push(script.innerText);
2486
- new Function(script.innerText)();
2487
- } catch (error) {
2488
- console.warn("`Embed`: Error running script:", error);
2489
- }
2490
- }
2491
- };
2492
- const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2493
- const elem = qwik.useSignal();
2494
- const state = qwik.useStore({
2495
- ranInitFn: false,
2496
- scriptsInserted: [],
2497
- scriptsRun: []
2498
- });
2499
- qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
2500
- const [elem2, props2, state2] = qwik.useLexicalScope();
2501
- track2(() => elem2.value);
2502
- track2(() => state2.ranInitFn);
2503
- if (elem2.value && !state2.ranInitFn) {
2504
- state2.ranInitFn = true;
2505
- findAndRunScripts(props2, state2, elem2);
2506
- }
2507
- }, "Embed_component_useTask_bg7ez0XUtiM", [
2508
- elem,
2509
- props,
2510
- state
2511
- ]));
2512
- return /* @__PURE__ */ qwik._jsxQ("div", {
2513
- ref: elem
2514
- }, {
2515
- class: "builder-embed",
2516
- dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.content, [
2517
- props
2518
- ], "p0.content")
2519
- }, null, 3, "9r_0");
2520
- }, "Embed_component_Uji08ORjXbE"));
2521
- const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2522
- return /* @__PURE__ */ qwik._jsxS("img", {
2523
- ...props.attributes
2524
- }, {
2525
- alt: qwik._fnSignal((p0) => p0.altText, [
2526
- props
2527
- ], "p0.altText"),
2528
- src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
2529
- props
2530
- ], "p0.imgSrc||p0.image"),
2531
- style: qwik._fnSignal((p0) => ({
2532
- objectFit: p0.backgroundSize || "cover",
2533
- objectPosition: p0.backgroundPosition || "center"
2534
- }), [
2535
- props
2536
- ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
2537
- }, 0, isEditing() && props.imgSrc || "default-key");
2538
- }, "ImgComponent_component_FXvIDBSffO8"));
2539
- const componentInfo$1 = {
2540
- // friendlyName?
2541
- name: "Raw:Img",
2542
- hideFromInsertMenu: true,
2543
- 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",
2544
- inputs: [
2545
- {
2546
- name: "image",
2547
- bubble: true,
2548
- type: "file",
2549
- allowedFileTypes: [
2550
- "jpeg",
2551
- "jpg",
2552
- "png",
2553
- "svg",
2554
- "gif",
2555
- "webp"
2556
- ],
2557
- required: true
2558
- }
2559
- ],
2560
- noWrap: true,
2561
- static: true
2562
- };
2563
- const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2564
- const elementRef = qwik.useSignal();
2565
- const state = qwik.useStore({
2566
- scriptsInserted: [],
2567
- scriptsRun: []
2568
- });
2569
- qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
2570
- const [state2] = qwik.useLexicalScope();
2571
- if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
2572
- return;
2573
- const scripts = element.getElementsByTagName("script");
2574
- for (let i = 0; i < scripts.length; i++) {
2575
- const script = scripts[i];
2576
- if (script.src) {
2577
- if (state2.scriptsInserted.includes(script.src))
2578
- continue;
2579
- state2.scriptsInserted.push(script.src);
2580
- const newScript = document.createElement("script");
2581
- newScript.async = true;
2582
- newScript.src = script.src;
2583
- document.head.appendChild(newScript);
2584
- } else if (!script.type || [
2585
- "text/javascript",
2586
- "application/javascript",
2587
- "application/ecmascript"
2588
- ].includes(script.type)) {
2589
- if (state2.scriptsRun.includes(script.innerText))
2590
- continue;
2591
- try {
2592
- state2.scriptsRun.push(script.innerText);
2593
- new Function(script.innerText)();
2594
- } catch (error) {
2595
- console.warn("`CustomCode`: Error running script:", error);
2596
- }
2597
- }
2598
- }
2599
- }, "CustomCode_component_useOn_zjAgBhFOiCs", [
2600
- state
2601
- ]));
2602
- return /* @__PURE__ */ qwik._jsxQ("div", {
2603
- ref: elementRef
2604
- }, {
2605
- class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
2606
- props
2607
- ], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
2608
- dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.code, [
2609
- props
2610
- ], "p0.code")
2611
- }, null, 3, "bY_0");
2612
- }, "CustomCode_component_uYOSy7w7Zqw"));
2613
- const componentInfo = {
2614
- name: "Custom Code",
2615
- static: true,
2616
- requiredPermissions: [
2617
- "editCode"
2618
- ],
2619
- inputs: [
2620
- {
2621
- name: "code",
2622
- type: "html",
2623
- required: true,
2624
- defaultValue: "<p>Hello there, I am custom HTML code!</p>",
2625
- code: true
2626
- },
2627
- {
2628
- name: "replaceNodes",
2629
- type: "boolean",
2630
- helperText: "Preserve server rendered dom nodes",
2631
- advanced: true
2632
- },
2633
- {
2634
- name: "scriptsClientOnly",
2635
- type: "boolean",
2636
- defaultValue: false,
2637
- helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
2638
- advanced: true
2639
- }
2640
- ]
2641
- };
2642
2740
  const getDefaultRegisteredComponents = () => [
2643
2741
  {
2644
2742
  component: Button,
@@ -2650,39 +2748,39 @@ const getDefaultRegisteredComponents = () => [
2650
2748
  },
2651
2749
  {
2652
2750
  component: CustomCode,
2653
- ...componentInfo
2751
+ ...componentInfo$8
2654
2752
  },
2655
2753
  {
2656
2754
  component: Embed,
2657
- ...componentInfo$2
2755
+ ...componentInfo$7
2658
2756
  },
2659
2757
  {
2660
2758
  component: FragmentComponent,
2661
- ...componentInfo$8
2759
+ ...componentInfo$6
2662
2760
  },
2663
2761
  {
2664
2762
  component: Image,
2665
- ...componentInfo$7
2763
+ ...componentInfo$5
2666
2764
  },
2667
2765
  {
2668
2766
  component: ImgComponent,
2669
- ...componentInfo$1
2767
+ ...componentInfo$4
2670
2768
  },
2671
2769
  {
2672
2770
  component: SectionComponent,
2673
- ...componentInfo$6
2771
+ ...componentInfo$3
2674
2772
  },
2675
2773
  {
2676
2774
  component: Symbol$1,
2677
- ...componentInfo$5
2775
+ ...componentInfo$2
2678
2776
  },
2679
2777
  {
2680
2778
  component: Text,
2681
- ...componentInfo$4
2779
+ ...componentInfo$1
2682
2780
  },
2683
2781
  {
2684
2782
  component: Video,
2685
- ...componentInfo$3
2783
+ ...componentInfo
2686
2784
  }
2687
2785
  ];
2688
2786
  const components = [];
@@ -2887,6 +2985,7 @@ function flatten(object, path = null, separator = ".") {
2887
2985
  };
2888
2986
  }, {});
2889
2987
  }
2988
+ const DEFAULT_API_VERSION = "v3";
2890
2989
  const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
2891
2990
  const BUILDER_OPTIONS_PREFIX = "options.";
2892
2991
  const convertSearchParamsToQueryObject = (searchParams) => {
@@ -2916,7 +3015,6 @@ const getBuilderSearchParamsFromWindow = () => {
2916
3015
  return getBuilderSearchParams(searchParams);
2917
3016
  };
2918
3017
  const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
2919
- const DEFAULT_API_VERSION = "v3";
2920
3018
  const isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
2921
3019
  const generateContentUrl = (options) => {
2922
3020
  let { noTraverse = false } = options;
@@ -3222,7 +3320,7 @@ const getInteractionPropertiesForEvent = (event) => {
3222
3320
  }
3223
3321
  };
3224
3322
  };
3225
- const SDK_VERSION = "0.7.1-4";
3323
+ const SDK_VERSION = "0.7.1";
3226
3324
  const registry = {};
3227
3325
  function register(type, info) {
3228
3326
  let typeList = registry[type];