@builder.io/sdk-qwik 0.0.9 → 0.0.12

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 (31) hide show
  1. package/README.md +13 -14
  2. package/lib/index.qwik.cjs +212 -229
  3. package/lib/index.qwik.mjs +213 -230
  4. package/package.json +4 -4
  5. package/src/blocks/button/button.jsx +0 -175
  6. package/src/blocks/columns/columns.jsx +27 -197
  7. package/src/blocks/custom-code/custom-code.jsx +16 -75
  8. package/src/blocks/embed/embed.jsx +20 -87
  9. package/src/blocks/form/builder-blocks.jsx +0 -75
  10. package/src/blocks/form/form.jsx +57 -536
  11. package/src/blocks/fragment/fragment.jsx +8 -56
  12. package/src/blocks/image/image.jsx +49 -493
  13. package/src/blocks/img/img.jsx +15 -72
  14. package/src/blocks/input/input.jsx +17 -83
  15. package/src/blocks/raw-text/raw-text.jsx +9 -50
  16. package/src/blocks/section/section.jsx +17 -94
  17. package/src/blocks/select/select.jsx +20 -145
  18. package/src/blocks/submit-button/submit-button.jsx +8 -84
  19. package/src/blocks/symbol/symbol.jsx +60 -194
  20. package/src/blocks/text/text.jsx +4 -43
  21. package/src/blocks/textarea/textarea.jsx +12 -62
  22. package/src/blocks/video/video.jsx +21 -71
  23. package/src/components/render-block/block-styles.jsx +0 -114
  24. package/src/components/render-block/render-block.jsx +2 -514
  25. package/src/components/render-block/render-component.jsx +0 -211
  26. package/src/components/render-block/render-repeated-block.jsx +0 -67
  27. package/src/components/render-blocks.jsx +40 -334
  28. package/src/components/render-content/components/render-styles.jsx +0 -50
  29. package/src/components/render-content/render-content.jsx +86 -385
  30. package/src/components/render-inlined-styles.jsx +0 -116
  31. package/src/constants/builder-registered-components.js +3 -0
@@ -1,4 +1,4 @@
1
- import { createContext, componentQrl, inlinedQrl, useContextProvider, useStore, useStylesScopedQrl, useContext, Host, useLexicalScope, Slot, Fragment as Fragment$2, useRef, useWatchQrl, useHostElement, useClientEffectQrl, _useMutableProps, useCleanupQrl } from "@builder.io/qwik";
1
+ import { createContext, componentQrl, inlinedQrl, useContextProvider, useStore, useStylesScopedQrl, useContext, useLexicalScope, Slot, Fragment as Fragment$2, useRef, useWatchQrl, useClientEffectQrl, _useMutableProps, useCleanupQrl } from "@builder.io/qwik";
2
2
  import { jsx, Fragment as Fragment$1, jsxs } from "@builder.io/qwik/jsx-runtime";
3
3
  const TARGET = "qwik";
4
4
  function isBrowser() {
@@ -167,10 +167,7 @@ const set = (obj, _path, value) => {
167
167
  if (Object(obj) !== obj)
168
168
  return obj;
169
169
  const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
170
- path.slice(0, -1).reduce(
171
- (a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {},
172
- obj
173
- )[path[path.length - 1]] = value;
170
+ 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;
174
171
  return obj;
175
172
  };
176
173
  function transformBlock(block) {
@@ -488,7 +485,7 @@ const component = function component2(props, state) {
488
485
  } else
489
486
  return ref;
490
487
  };
491
- const componentInfo$9 = function componentInfo(props, state) {
488
+ const componentInfo$a = function componentInfo(props, state) {
492
489
  if (component(props)) {
493
490
  const { component: _, ...info } = component(props);
494
491
  return info;
@@ -521,7 +518,7 @@ const attributes = function attributes2(props, state) {
521
518
  };
522
519
  };
523
520
  const shouldWrap = function shouldWrap2(props, state) {
524
- return !componentInfo$9(props)?.noWrap;
521
+ return !componentInfo$a(props)?.noWrap;
525
522
  };
526
523
  const componentOptions = function componentOptions2(props, state) {
527
524
  return {
@@ -535,7 +532,8 @@ const renderComponentProps = function renderComponentProps2(props, state) {
535
532
  return {
536
533
  blockChildren: children(props),
537
534
  componentRef: componentRef(props),
538
- componentOptions: componentOptions(props)
535
+ componentOptions: componentOptions(props),
536
+ context: props.context
539
537
  };
540
538
  };
541
539
  const children = function children2(props, state) {
@@ -558,21 +556,19 @@ const repeatItemData = function repeatItemData2(props, state) {
558
556
  return void 0;
559
557
  const collectionName = repeat.collection.split(".").pop();
560
558
  const itemNameToUse = repeat.itemName || (collectionName ? collectionName + "Item" : "item");
561
- const repeatArray = itemsArray.map(
562
- (item, index) => ({
563
- context: {
564
- ...props.context,
565
- state: {
566
- ...props.context.state,
567
- $index: index,
568
- $item: item,
569
- [itemNameToUse]: item,
570
- [`$${itemNameToUse}Index`]: index
571
- }
572
- },
573
- block: blockWithoutRepeat
574
- })
575
- );
559
+ const repeatArray = itemsArray.map((item, index) => ({
560
+ context: {
561
+ ...props.context,
562
+ state: {
563
+ ...props.context.state,
564
+ $index: index,
565
+ $item: item,
566
+ [itemNameToUse]: item,
567
+ [`$${itemNameToUse}Index`]: index
568
+ }
569
+ },
570
+ block: blockWithoutRepeat
571
+ }));
576
572
  return repeatArray;
577
573
  };
578
574
  const RenderBlock = (props) => {
@@ -585,7 +581,8 @@ const RenderBlock = (props) => {
585
581
  repeatItemData(props) ? (repeatItemData(props) || []).map((data, index) => {
586
582
  return /* @__PURE__ */ jsx(RenderRepeatedBlock$1, {
587
583
  repeatContext: data.context,
588
- block: data.block
584
+ block: data.block,
585
+ context: props.context
589
586
  }, index);
590
587
  }) : null,
591
588
  !repeatItemData(props) ? /* @__PURE__ */ jsx(RenderComponent$1, {
@@ -640,7 +637,7 @@ const RenderBlocks = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
640
637
  useStylesScopedQrl(inlinedQrl(STYLES$2, "RenderBlocks_component_useStylesScoped_QNti2s7juQc"));
641
638
  const builderContext = useContext(stdin_default);
642
639
  const state = {};
643
- return /* @__PURE__ */ jsx(Host, {
640
+ return /* @__PURE__ */ jsxs("div", {
644
641
  class: className(props) + " div-RenderBlocks",
645
642
  "builder-path": props.path,
646
643
  "builder-parent-id": props.parent,
@@ -650,7 +647,7 @@ const RenderBlocks = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
650
647
  onClick$: inlinedQrl((event) => {
651
648
  const [builderContext2, props2, state2] = useLexicalScope();
652
649
  return onClick$1(props2);
653
- }, "RenderBlocks_component_Host_onClick_81ErKSpyspw", [
650
+ }, "RenderBlocks_component_div_onClick_IHSfVTIKyxE", [
654
651
  builderContext,
655
652
  props,
656
653
  state
@@ -658,31 +655,27 @@ const RenderBlocks = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
658
655
  onMouseEnter$: inlinedQrl((event) => {
659
656
  const [builderContext2, props2, state2] = useLexicalScope();
660
657
  return onMouseEnter(props2);
661
- }, "RenderBlocks_component_Host_onMouseEnter_h6rWG6KLkHE", [
658
+ }, "RenderBlocks_component_div_onMouseEnter_qLiEh4n9ugw", [
662
659
  builderContext,
663
660
  props,
664
661
  state
665
662
  ]),
666
- children: /* @__PURE__ */ jsxs(Fragment$1, {
667
- children: [
668
- props.blocks ? (props.blocks || []).map((block) => {
669
- return /* @__PURE__ */ jsx(RenderBlock$1, {
670
- block,
671
- context: builderContext
672
- }, "render-block-" + block.id);
673
- }) : null,
674
- props.blocks ? (props.blocks || []).map((block) => {
675
- return /* @__PURE__ */ jsx(BlockStyles$1, {
676
- block,
677
- context: builderContext
678
- }, "block-style-" + block.id);
679
- }) : null
680
- ]
681
- })
663
+ children: [
664
+ props.blocks ? (props.blocks || []).map((block) => {
665
+ return /* @__PURE__ */ jsx(RenderBlock$1, {
666
+ block,
667
+ context: builderContext
668
+ }, "render-block-" + block.id);
669
+ }) : null,
670
+ props.blocks ? (props.blocks || []).map((block) => {
671
+ return /* @__PURE__ */ jsx(BlockStyles$1, {
672
+ block,
673
+ context: builderContext
674
+ }, "block-style-" + block.id);
675
+ }) : null
676
+ ]
682
677
  });
683
- }, "RenderBlocks_component_SXGwmVyEM0s"), {
684
- tagName: "div"
685
- });
678
+ }, "RenderBlocks_component_SXGwmVyEM0s"));
686
679
  const RenderBlocks$1 = RenderBlocks;
687
680
  const STYLES$2 = `.div-RenderBlocks {
688
681
  display: flex;
@@ -728,7 +721,7 @@ const columnCssVars = function columnCssVars2(props, state) {
728
721
  const Columns = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
729
722
  useStylesScopedQrl(inlinedQrl(STYLES$1, "Columns_component_useStylesScoped_704fWXyHORo"));
730
723
  const state = {};
731
- return /* @__PURE__ */ jsx(Host, {
724
+ return /* @__PURE__ */ jsx("div", {
732
725
  class: "builder-columns div-Columns",
733
726
  style: columnsCssVars(props, state),
734
727
  children: (props.columns || []).map((column, index) => {
@@ -745,9 +738,7 @@ const Columns = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
745
738
  }, index);
746
739
  })
747
740
  });
748
- }, "Columns_component_0PeVQGTMczc"), {
749
- tagName: "div"
750
- });
741
+ }, "Columns_component_0PeVQGTMczc"));
751
742
  const Columns$1 = Columns;
752
743
  const STYLES$1 = `.div-Columns {
753
744
  display: flex;
@@ -801,25 +792,15 @@ function getSrcSet(url) {
801
792
  const widthInSrc = Number(url.split("?width=")[1]);
802
793
  if (!isNaN(widthInSrc))
803
794
  srcUrl = `${srcUrl} ${widthInSrc}w`;
804
- return sizes.filter(
805
- (size) => size !== widthInSrc
806
- ).map(
807
- (size) => `${updateQueryParam(url, "width", size)} ${size}w`
808
- ).concat([
795
+ return sizes.filter((size) => size !== widthInSrc).map((size) => `${updateQueryParam(url, "width", size)} ${size}w`).concat([
809
796
  srcUrl
810
797
  ]).join(", ");
811
798
  }
812
799
  if (url.match(/cdn\.shopify\.com/))
813
- return sizes.map(
814
- (size) => [
815
- getShopifyImageUrl(url, `${size}x${size}`),
816
- size
817
- ]
818
- ).filter(
819
- ([sizeUrl]) => !!sizeUrl
820
- ).map(
821
- ([sizeUrl, size]) => `${sizeUrl} ${size}w`
822
- ).concat([
800
+ return sizes.map((size) => [
801
+ getShopifyImageUrl(url, `${size}x${size}`),
802
+ size
803
+ ]).filter(([sizeUrl]) => !!sizeUrl).map(([sizeUrl, size]) => `${sizeUrl} ${size}w`).concat([
823
804
  url
824
805
  ]).join(", ");
825
806
  return url;
@@ -846,51 +827,47 @@ const webpSrcSet = function webpSrcSet2(props, state) {
846
827
  };
847
828
  const Image = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
848
829
  useStylesScopedQrl(inlinedQrl(STYLES, "Image_component_useStylesScoped_gRbO7w7SeZA"));
849
- return /* @__PURE__ */ jsx(Host, {
830
+ return /* @__PURE__ */ jsxs("div", {
850
831
  class: "div-Image",
851
- children: /* @__PURE__ */ jsxs(Fragment$1, {
852
- children: [
853
- /* @__PURE__ */ jsxs("picture", {
854
- children: [
855
- webpSrcSet(props) ? /* @__PURE__ */ jsx("source", {
856
- type: "image/webp",
857
- srcset: webpSrcSet(props)
858
- }) : null,
859
- /* @__PURE__ */ jsx("img", {
860
- loading: "lazy",
861
- alt: props.altText,
862
- role: props.altText ? "presentation" : void 0,
863
- style: {
864
- objectPosition: props.backgroundSize || "center",
865
- objectFit: props.backgroundSize || "cover"
866
- },
867
- class: "builder-image" + (props.className ? " " + props.className : "") + " img-Image",
868
- src: props.image,
869
- srcset: srcSetToUse(props),
870
- sizes: props.sizes
871
- }),
872
- /* @__PURE__ */ jsx("source", {
873
- srcset: srcSetToUse(props)
874
- })
875
- ]
876
- }),
877
- props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length) ? /* @__PURE__ */ jsx("div", {
878
- class: "builder-image-sizer div-Image-2",
879
- style: {
880
- paddingTop: props.aspectRatio * 100 + "%"
881
- }
882
- }) : null,
883
- props.builderBlock?.children?.length && props.fitContent ? /* @__PURE__ */ jsx(Slot, {}) : null,
884
- !props.fitContent ? /* @__PURE__ */ jsx("div", {
885
- class: "div-Image-3",
886
- children: /* @__PURE__ */ jsx(Slot, {})
887
- }) : null
888
- ]
889
- })
832
+ children: [
833
+ /* @__PURE__ */ jsxs("picture", {
834
+ children: [
835
+ webpSrcSet(props) ? /* @__PURE__ */ jsx("source", {
836
+ type: "image/webp",
837
+ srcset: webpSrcSet(props)
838
+ }) : null,
839
+ /* @__PURE__ */ jsx("img", {
840
+ loading: "lazy",
841
+ alt: props.altText,
842
+ role: props.altText ? "presentation" : void 0,
843
+ style: {
844
+ objectPosition: props.backgroundSize || "center",
845
+ objectFit: props.backgroundSize || "cover"
846
+ },
847
+ class: "builder-image" + (props.className ? " " + props.className : "") + " img-Image",
848
+ src: props.image,
849
+ srcset: srcSetToUse(props),
850
+ sizes: props.sizes
851
+ }),
852
+ /* @__PURE__ */ jsx("source", {
853
+ srcset: srcSetToUse(props)
854
+ })
855
+ ]
856
+ }),
857
+ props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length) ? /* @__PURE__ */ jsx("div", {
858
+ class: "builder-image-sizer div-Image-2",
859
+ style: {
860
+ paddingTop: props.aspectRatio * 100 + "%"
861
+ }
862
+ }) : null,
863
+ props.builderBlock?.children?.length && props.fitContent ? /* @__PURE__ */ jsx(Slot, {}) : null,
864
+ !props.fitContent ? /* @__PURE__ */ jsx("div", {
865
+ class: "div-Image-3",
866
+ children: /* @__PURE__ */ jsx(Slot, {})
867
+ }) : null
868
+ ]
890
869
  });
891
- }, "Image_component_y3S3Zox9wEo"), {
892
- tagName: "div"
893
- });
870
+ }, "Image_component_y3S3Zox9wEo"));
894
871
  const Image$1 = Image;
895
872
  const STYLES = `.div-Image {
896
873
  position: relative; }.img-Image {
@@ -913,13 +890,11 @@ left: 0;
913
890
  width: 100%;
914
891
  height: 100%; }`;
915
892
  const Text = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
916
- return /* @__PURE__ */ jsx(Host, {
893
+ return /* @__PURE__ */ jsx("div", {
917
894
  class: "builder-text",
918
895
  dangerouslySetInnerHTML: props.text
919
896
  });
920
- }, "Text_component_ci0NVEdoK0Q"), {
921
- tagName: "div"
922
- });
897
+ }, "Text_component_ci0NVEdoK0Q"));
923
898
  const Text$1 = Text;
924
899
  const videoProps = function videoProps2(props, state) {
925
900
  return {
@@ -941,7 +916,7 @@ const videoProps = function videoProps2(props, state) {
941
916
  };
942
917
  };
943
918
  const Video = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
944
- return /* @__PURE__ */ jsx(Host, {
919
+ return /* @__PURE__ */ jsx("video", {
945
920
  ...videoProps(props),
946
921
  style: {
947
922
  width: "100%",
@@ -954,9 +929,7 @@ const Video = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
954
929
  src: props.video || "no-src",
955
930
  poster: props.posterImage
956
931
  });
957
- }, "Video_component_O5sPuWlrTvk"), {
958
- tagName: "video"
959
- });
932
+ }, "Video_component_O5sPuWlrTvk"));
960
933
  const Video$1 = Video;
961
934
  const Button = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
962
935
  return /* @__PURE__ */ jsx(Fragment$2, {
@@ -973,7 +946,7 @@ const Button = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
973
946
  });
974
947
  }, "Button_component_FtjCELjtKF4"));
975
948
  const Button$1 = Button;
976
- const componentInfo$8 = {
949
+ const componentInfo$9 = {
977
950
  name: "Core:Button",
978
951
  builtIn: true,
979
952
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
@@ -1015,7 +988,7 @@ function markSerializable(fn) {
1015
988
  fn.__qwik_serializable__ = true;
1016
989
  return fn;
1017
990
  }
1018
- const componentInfo$7 = {
991
+ const componentInfo$8 = {
1019
992
  name: "Columns",
1020
993
  builtIn: true,
1021
994
  inputs: [
@@ -1211,13 +1184,9 @@ const componentInfo$7 = {
1211
1184
  }
1212
1185
  const columns = options.get("columns");
1213
1186
  if (Array.isArray(columns)) {
1214
- const containsColumnWithWidth = !!columns.find(
1215
- (col) => col.get("width")
1216
- );
1187
+ const containsColumnWithWidth = !!columns.find((col) => col.get("width"));
1217
1188
  if (containsColumnWithWidth) {
1218
- const containsColumnWithoutWidth = !!columns.find(
1219
- (col) => !col.get("width")
1220
- );
1189
+ const containsColumnWithoutWidth = !!columns.find((col) => !col.get("width"));
1221
1190
  if (containsColumnWithoutWidth)
1222
1191
  clearWidths();
1223
1192
  else {
@@ -1260,7 +1229,7 @@ const componentInfo$7 = {
1260
1229
  }
1261
1230
  ]
1262
1231
  };
1263
- const componentInfo$6 = {
1232
+ const componentInfo$7 = {
1264
1233
  name: "Fragment",
1265
1234
  static: true,
1266
1235
  hidden: true,
@@ -1269,14 +1238,12 @@ const componentInfo$6 = {
1269
1238
  noWrap: true
1270
1239
  };
1271
1240
  const FragmentComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1272
- return /* @__PURE__ */ jsx(Host, {
1241
+ return /* @__PURE__ */ jsx("span", {
1273
1242
  children: /* @__PURE__ */ jsx(Slot, {})
1274
1243
  });
1275
- }, "FragmentComponent_component_FJmqlA66Rjg"), {
1276
- tagName: "span"
1277
- });
1244
+ }, "FragmentComponent_component_FJmqlA66Rjg"));
1278
1245
  const Fragment = FragmentComponent;
1279
- const componentInfo$5 = {
1246
+ const componentInfo$6 = {
1280
1247
  name: "Image",
1281
1248
  static: true,
1282
1249
  builtIn: true,
@@ -1329,9 +1296,7 @@ const componentInfo$5 = {
1329
1296
  }
1330
1297
  const value = options.get("image");
1331
1298
  const aspectRatio = options.get("aspectRatio");
1332
- fetch(value).then(
1333
- (res) => res.blob()
1334
- ).then((blob) => {
1299
+ fetch(value).then((res) => res.blob()).then((blob) => {
1335
1300
  if (blob.type.includes("svg"))
1336
1301
  options.set("noWebp", true);
1337
1302
  });
@@ -1427,7 +1392,7 @@ const componentInfo$5 = {
1427
1392
  }
1428
1393
  ]
1429
1394
  };
1430
- const componentInfo$4 = {
1395
+ const componentInfo$5 = {
1431
1396
  name: "Core:Section",
1432
1397
  static: true,
1433
1398
  builtIn: true,
@@ -1474,18 +1439,16 @@ const componentInfo$4 = {
1474
1439
  ]
1475
1440
  };
1476
1441
  const SectionComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1477
- return /* @__PURE__ */ jsx(Host, {
1442
+ return /* @__PURE__ */ jsx("section", {
1478
1443
  ...props.attributes,
1479
1444
  style: (() => {
1480
1445
  props.maxWidth && typeof props.maxWidth === "number" ? props.maxWidth : void 0;
1481
1446
  })(),
1482
1447
  children: /* @__PURE__ */ jsx(Slot, {})
1483
1448
  });
1484
- }, "SectionComponent_component_m1CcjCwgHug"), {
1485
- tagName: "section"
1486
- });
1449
+ }, "SectionComponent_component_m1CcjCwgHug"));
1487
1450
  const Section = SectionComponent;
1488
- const componentInfo$3 = {
1451
+ const componentInfo$4 = {
1489
1452
  name: "Symbol",
1490
1453
  noWrap: true,
1491
1454
  static: true,
@@ -1525,7 +1488,7 @@ const componentInfo$3 = {
1525
1488
  }
1526
1489
  ]
1527
1490
  };
1528
- const componentInfo$2 = {
1491
+ const componentInfo$3 = {
1529
1492
  name: "Text",
1530
1493
  static: true,
1531
1494
  builtIn: true,
@@ -1546,7 +1509,7 @@ const componentInfo$2 = {
1546
1509
  textAlign: "center"
1547
1510
  }
1548
1511
  };
1549
- const componentInfo$1 = {
1512
+ const componentInfo$2 = {
1550
1513
  name: "Video",
1551
1514
  canHaveChildren: true,
1552
1515
  builtIn: true,
@@ -1659,7 +1622,7 @@ const componentInfo$1 = {
1659
1622
  }
1660
1623
  ]
1661
1624
  };
1662
- const componentInfo2 = {
1625
+ const componentInfo$1 = {
1663
1626
  name: "Embed",
1664
1627
  static: true,
1665
1628
  builtIn: true,
@@ -1675,9 +1638,7 @@ const componentInfo2 = {
1675
1638
  if (url) {
1676
1639
  options.set("content", "Loading...");
1677
1640
  const apiKey = "ae0e60e78201a3f2b0de4b";
1678
- return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then(
1679
- (res) => res.json()
1680
- ).then((data) => {
1641
+ return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
1681
1642
  if (options.get("url") === url) {
1682
1643
  if (data.html)
1683
1644
  options.set("content", data.html);
@@ -1743,15 +1704,47 @@ const Embed = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1743
1704
  props,
1744
1705
  state
1745
1706
  ]));
1746
- return /* @__PURE__ */ jsx(Host, {
1707
+ return /* @__PURE__ */ jsx("div", {
1747
1708
  class: "builder-embed",
1748
1709
  ref: elem,
1749
1710
  dangerouslySetInnerHTML: props.content
1750
1711
  });
1751
- }, "Embed_component_CP6B8Y76ylw"), {
1752
- tagName: "div"
1753
- });
1712
+ }, "Embed_component_CP6B8Y76ylw"));
1754
1713
  const embed = Embed;
1714
+ const ImgComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1715
+ return /* @__PURE__ */ jsx("img", {
1716
+ style: {
1717
+ objectFit: props.backgroundSize || "cover",
1718
+ objectPosition: props.backgroundPosition || "center"
1719
+ },
1720
+ alt: props.altText,
1721
+ src: props.imgSrc || props.image,
1722
+ ...props.attributes
1723
+ }, isEditing() && props.imgSrc || "default-key");
1724
+ }, "ImgComponent_component_b8FkE9OcVN8"));
1725
+ const Img = ImgComponent;
1726
+ const componentInfo2 = {
1727
+ name: "Raw:Img",
1728
+ hideFromInsertMenu: true,
1729
+ builtIn: true,
1730
+ 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",
1731
+ inputs: [
1732
+ {
1733
+ name: "image",
1734
+ bubble: true,
1735
+ type: "file",
1736
+ allowedFileTypes: [
1737
+ "jpeg",
1738
+ "jpg",
1739
+ "png",
1740
+ "svg"
1741
+ ],
1742
+ required: true
1743
+ }
1744
+ ],
1745
+ noWrap: true,
1746
+ static: true
1747
+ };
1755
1748
  var __defProp$3 = Object.defineProperty;
1756
1749
  var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1757
1750
  var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
@@ -1776,31 +1769,34 @@ var __spreadValues$3 = (a, b) => {
1776
1769
  const getDefaultRegisteredComponents = () => [
1777
1770
  __spreadValues$3({
1778
1771
  component: Columns$1
1779
- }, componentInfo$7),
1772
+ }, componentInfo$8),
1780
1773
  __spreadValues$3({
1781
1774
  component: Image$1
1782
- }, componentInfo$5),
1775
+ }, componentInfo$6),
1776
+ __spreadValues$3({
1777
+ component: Img
1778
+ }, componentInfo2),
1783
1779
  __spreadValues$3({
1784
1780
  component: Text$1
1785
- }, componentInfo$2),
1781
+ }, componentInfo$3),
1786
1782
  __spreadValues$3({
1787
1783
  component: Video$1
1788
- }, componentInfo$1),
1784
+ }, componentInfo$2),
1789
1785
  __spreadValues$3({
1790
1786
  component: Symbol$2
1791
- }, componentInfo$3),
1787
+ }, componentInfo$4),
1792
1788
  __spreadValues$3({
1793
1789
  component: Button$1
1794
- }, componentInfo$8),
1790
+ }, componentInfo$9),
1795
1791
  __spreadValues$3({
1796
1792
  component: Section
1797
- }, componentInfo$4),
1793
+ }, componentInfo$5),
1798
1794
  __spreadValues$3({
1799
1795
  component: Fragment
1800
- }, componentInfo$6),
1796
+ }, componentInfo$7),
1801
1797
  __spreadValues$3({
1802
1798
  component: embed
1803
- }, componentInfo2)
1799
+ }, componentInfo$1)
1804
1800
  ];
1805
1801
  var __defProp$2 = Object.defineProperty;
1806
1802
  var __defProps$2 = Object.defineProperties;
@@ -1903,9 +1899,7 @@ function getFetch() {
1903
1899
  return __async$1(this, null, function* () {
1904
1900
  const globalFetch = getGlobalThis().fetch;
1905
1901
  if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
1906
- const nodeFetch = import("./index.97024df8.js").then(
1907
- (d) => d.default
1908
- );
1902
+ const nodeFetch = import("./index.97024df8.js").then((d) => d.default);
1909
1903
  return nodeFetch.default || nodeFetch;
1910
1904
  }
1911
1905
  return globalFetch.default || globalFetch;
@@ -2010,8 +2004,8 @@ const generateContentUrl = (options) => {
2010
2004
  const flattened2 = flatten({
2011
2005
  query
2012
2006
  });
2013
- for (const key in flattened2)
2014
- url.searchParams.set(key, JSON.stringify(flattened2[key]));
2007
+ for (const key1 in flattened2)
2008
+ url.searchParams.set(key1, JSON.stringify(flattened2[key1]));
2015
2009
  }
2016
2010
  return url;
2017
2011
  };
@@ -2019,9 +2013,7 @@ function getAllContent(options) {
2019
2013
  return __async(this, null, function* () {
2020
2014
  const url = generateContentUrl(options);
2021
2015
  const fetch2 = yield fetch$;
2022
- const content = yield fetch2(url.href).then(
2023
- (res) => res.json()
2024
- );
2016
+ const content = yield fetch2(url.href).then((res) => res.json());
2025
2017
  if (options.testGroups)
2026
2018
  for (const item of content.results)
2027
2019
  handleABTesting(item, options.testGroups);
@@ -2100,14 +2092,9 @@ const prepareComponentInfoToSend = (_c) => {
2100
2092
  "inputs"
2101
2093
  ]);
2102
2094
  return __spreadProps(__spreadValues({}, fastClone(info)), {
2103
- inputs: inputs == null ? void 0 : inputs.map(
2104
- (input) => Object.entries(input).reduce(
2105
- (acc, [key, value]) => __spreadProps(__spreadValues({}, acc), {
2106
- [key]: serializeValue(value)
2107
- }),
2108
- {}
2109
- )
2110
- )
2095
+ inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => __spreadProps(__spreadValues({}, acc), {
2096
+ [key]: serializeValue(value)
2097
+ }), {}))
2111
2098
  });
2112
2099
  };
2113
2100
  function track(event, properties) {
@@ -2164,9 +2151,7 @@ const getCssFromFont = function getCssFromFont2(props, state, font) {
2164
2151
  return str;
2165
2152
  };
2166
2153
  const getFontCss = function getFontCss2(props, state, { customFonts }) {
2167
- return customFonts?.map(
2168
- (font) => getCssFromFont(props, state, font)
2169
- )?.join(" ") || "";
2154
+ return customFonts?.map((font) => getCssFromFont(props, state, font))?.join(" ") || "";
2170
2155
  };
2171
2156
  const injectedStyles = function injectedStyles2(props, state) {
2172
2157
  return `
@@ -2182,7 +2167,7 @@ const RenderContentStyles = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2182
2167
  });
2183
2168
  }, "RenderContentStyles_component_32XAr483K2o"));
2184
2169
  const RenderContentStyles$1 = RenderContentStyles;
2185
- const useContent = function useContent2(props, state) {
2170
+ const useContent = function useContent2(props, state, elementRef) {
2186
2171
  const mergedContent = {
2187
2172
  ...props.content,
2188
2173
  ...state.overrideContent,
@@ -2194,32 +2179,29 @@ const useContent = function useContent2(props, state) {
2194
2179
  };
2195
2180
  return mergedContent;
2196
2181
  };
2197
- const contentState = function contentState2(props, state) {
2182
+ const contentState = function contentState2(props, state, elementRef) {
2198
2183
  return {
2199
2184
  ...props.content?.data?.state,
2200
2185
  ...props.data,
2201
2186
  ...state.overrideState
2202
2187
  };
2203
2188
  };
2204
- const contextContext = function contextContext2(props, state) {
2189
+ const contextContext = function contextContext2(props, state, elementRef) {
2205
2190
  return props.context || {};
2206
2191
  };
2207
- const allRegisteredComponents = function allRegisteredComponents2(props, state) {
2192
+ const allRegisteredComponents = function allRegisteredComponents2(props, state, elementRef) {
2208
2193
  const allComponentsArray = [
2209
2194
  ...getDefaultRegisteredComponents(),
2210
2195
  ...components,
2211
2196
  ...props.customComponents || []
2212
2197
  ];
2213
- const allComponents = allComponentsArray.reduce(
2214
- (acc, curr) => ({
2215
- ...acc,
2216
- [curr.name]: curr
2217
- }),
2218
- {}
2219
- );
2198
+ const allComponents = allComponentsArray.reduce((acc, curr) => ({
2199
+ ...acc,
2200
+ [curr.name]: curr
2201
+ }), {});
2220
2202
  return allComponents;
2221
2203
  };
2222
- const processMessage = function processMessage2(props, state, event) {
2204
+ const processMessage = function processMessage2(props, state, elementRef, event) {
2223
2205
  const { data } = event;
2224
2206
  if (data)
2225
2207
  switch (data.type) {
@@ -2233,7 +2215,7 @@ const processMessage = function processMessage2(props, state, event) {
2233
2215
  }
2234
2216
  }
2235
2217
  };
2236
- const evaluateJsCode = function evaluateJsCode2(props, state) {
2218
+ const evaluateJsCode = function evaluateJsCode2(props, state, elementRef) {
2237
2219
  const jsCode = useContent(props, state)?.data?.jsCode;
2238
2220
  if (jsCode)
2239
2221
  evaluate({
@@ -2242,26 +2224,23 @@ const evaluateJsCode = function evaluateJsCode2(props, state) {
2242
2224
  state: contentState(props, state)
2243
2225
  });
2244
2226
  };
2245
- const httpReqsData = function httpReqsData2(props, state) {
2227
+ const httpReqsData = function httpReqsData2(props, state, elementRef) {
2246
2228
  return {};
2247
2229
  };
2248
- const onClick2 = function onClick3(props, state, _event) {
2230
+ const onClick2 = function onClick3(props, state, elementRef, _event) {
2249
2231
  if (useContent(props, state) && props.canTrack !== false)
2250
2232
  track("click", {
2251
2233
  contentId: useContent(props, state).id
2252
2234
  });
2253
2235
  };
2254
- const evalExpression = function evalExpression2(props, state, expression) {
2255
- return expression.replace(
2256
- /{{([^}]+)}}/g,
2257
- (_match, group) => evaluate({
2258
- code: group,
2259
- context: contextContext(props),
2260
- state: contentState(props, state)
2261
- })
2262
- );
2236
+ const evalExpression = function evalExpression2(props, state, elementRef, expression) {
2237
+ return expression.replace(/{{([^}]+)}}/g, (_match, group) => evaluate({
2238
+ code: group,
2239
+ context: contextContext(props),
2240
+ state: contentState(props, state)
2241
+ }));
2263
2242
  };
2264
- const handleRequest = function handleRequest2(props, state, { url, key }) {
2243
+ const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
2265
2244
  const fetchAndSetState = async () => {
2266
2245
  const fetch2 = await getFetch();
2267
2246
  const response = await fetch2(url);
@@ -2274,19 +2253,19 @@ const handleRequest = function handleRequest2(props, state, { url, key }) {
2274
2253
  };
2275
2254
  fetchAndSetState();
2276
2255
  };
2277
- const runHttpRequests = function runHttpRequests2(props, state) {
2256
+ const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
2278
2257
  const requests = useContent(props, state)?.data?.httpRequests ?? {};
2279
2258
  Object.entries(requests).forEach(([key, url]) => {
2280
2259
  if (url && (!httpReqsData()[key] || isEditing())) {
2281
- const evaluatedUrl = evalExpression(props, state, url);
2282
- handleRequest(props, state, {
2260
+ const evaluatedUrl = evalExpression(props, state, elementRef, url);
2261
+ handleRequest(props, state, elementRef, {
2283
2262
  url: evaluatedUrl,
2284
2263
  key
2285
2264
  });
2286
2265
  }
2287
2266
  });
2288
2267
  };
2289
- const emitStateUpdate = function emitStateUpdate2(props, state) {
2268
+ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
2290
2269
  if (isEditing())
2291
2270
  window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
2292
2271
  detail: {
@@ -2297,11 +2276,11 @@ const emitStateUpdate = function emitStateUpdate2(props, state) {
2297
2276
  }
2298
2277
  }));
2299
2278
  };
2300
- const shouldRenderContentStyles = function shouldRenderContentStyles2(props, state) {
2279
+ const shouldRenderContentStyles = function shouldRenderContentStyles2(props, state, elementRef) {
2301
2280
  return Boolean((useContent(props, state)?.data?.cssCode || useContent(props, state)?.data?.customFonts?.length) && TARGET !== "reactNative");
2302
2281
  };
2303
2282
  const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2304
- const hostElement = useHostElement();
2283
+ const elementRef = useRef();
2305
2284
  const state = useStore({
2306
2285
  forceReRenderCount: 0,
2307
2286
  overrideContent: null,
@@ -2326,19 +2305,19 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2326
2305
  })()
2327
2306
  }));
2328
2307
  useClientEffectQrl(inlinedQrl(() => {
2329
- const [hostElement2, props2, state2] = useLexicalScope();
2308
+ const [elementRef2, props2, state2] = useLexicalScope();
2330
2309
  if (isBrowser()) {
2331
2310
  if (isEditing()) {
2332
2311
  state2.forceReRenderCount++;
2333
- _useMutableProps(hostElement2, true);
2312
+ _useMutableProps(elementRef2.current, true);
2334
2313
  registerInsertMenu();
2335
2314
  setupBrowserForEditing();
2336
2315
  Object.values(allRegisteredComponents(props2)).forEach((registeredComponent) => {
2337
2316
  const message = createRegisterComponentMessage(registeredComponent);
2338
2317
  window.parent?.postMessage(message, "*");
2339
2318
  });
2340
- window.addEventListener("message", processMessage.bind(null, props2, state2));
2341
- window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2));
2319
+ window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
2320
+ window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
2342
2321
  }
2343
2322
  if (useContent(props2, state2) && props2.canTrack !== false)
2344
2323
  track("impression", {
@@ -2359,54 +2338,60 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2359
2338
  }
2360
2339
  }
2361
2340
  evaluateJsCode(props2, state2);
2362
- runHttpRequests(props2, state2);
2341
+ runHttpRequests(props2, state2, elementRef2);
2363
2342
  emitStateUpdate(props2, state2);
2364
2343
  }
2365
2344
  }, "RenderContent_component_useClientEffect_ntruwSC9lSo", [
2366
- hostElement,
2345
+ elementRef,
2367
2346
  props,
2368
2347
  state
2369
2348
  ]));
2370
- useWatchQrl(inlinedQrl(({ track: track1 }) => {
2371
- const [props2, state2] = useLexicalScope();
2372
- state2.useContent?.data && track1(state2.useContent?.data, "jsCode");
2349
+ useWatchQrl(inlinedQrl(({ track: track2 }) => {
2350
+ const [elementRef2, props2, state2] = useLexicalScope();
2351
+ state2.useContent?.data && track2(state2.useContent?.data, "jsCode");
2373
2352
  evaluateJsCode(props2, state2);
2374
2353
  }, "RenderContent_component_useWatch_1P0ujLQOmzc", [
2354
+ elementRef,
2375
2355
  props,
2376
2356
  state
2377
2357
  ]));
2378
2358
  useWatchQrl(inlinedQrl(({ track: track2 }) => {
2379
- const [props2, state2] = useLexicalScope();
2359
+ const [elementRef2, props2, state2] = useLexicalScope();
2380
2360
  state2.useContent?.data && track2(state2.useContent?.data, "httpRequests");
2381
- runHttpRequests(props2, state2);
2361
+ runHttpRequests(props2, state2, elementRef2);
2382
2362
  }, "RenderContent_component_useWatch_1_0hAcn4V2AZw", [
2363
+ elementRef,
2383
2364
  props,
2384
2365
  state
2385
2366
  ]));
2386
- useWatchQrl(inlinedQrl(({ track: track3 }) => {
2387
- const [props2, state2] = useLexicalScope();
2388
- state2 && track3(state2, "contentState");
2367
+ useWatchQrl(inlinedQrl(({ track: track2 }) => {
2368
+ const [elementRef2, props2, state2] = useLexicalScope();
2369
+ state2 && track2(state2, "contentState");
2389
2370
  emitStateUpdate(props2, state2);
2390
2371
  }, "RenderContent_component_useWatch_2_t2n8zpl4mRs", [
2372
+ elementRef,
2391
2373
  props,
2392
2374
  state
2393
2375
  ]));
2394
2376
  useCleanupQrl(inlinedQrl(() => {
2395
- const [props2, state2] = useLexicalScope();
2377
+ const [elementRef2, props2, state2] = useLexicalScope();
2396
2378
  if (isBrowser()) {
2397
- window.removeEventListener("message", processMessage.bind(null, props2, state2));
2398
- window.removeEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2));
2379
+ window.removeEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
2380
+ window.removeEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
2399
2381
  }
2400
2382
  }, "RenderContent_component_useCleanup_sGf1npb03WA", [
2383
+ elementRef,
2401
2384
  props,
2402
2385
  state
2403
2386
  ]));
2404
2387
  return /* @__PURE__ */ jsx(Fragment$1, {
2405
2388
  children: useContent(props, state) ? /* @__PURE__ */ jsxs("div", {
2389
+ ref: elementRef,
2406
2390
  onClick$: inlinedQrl((event) => {
2407
- const [props2, state2] = useLexicalScope();
2391
+ const [elementRef2, props2, state2] = useLexicalScope();
2408
2392
  return onClick2(props2, state2);
2409
2393
  }, "RenderContent_component__Fragment_div_onClick_76e3rL00UYE", [
2394
+ elementRef,
2410
2395
  props,
2411
2396
  state
2412
2397
  ]),
@@ -2459,7 +2444,7 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2459
2444
  props,
2460
2445
  state
2461
2446
  ]));
2462
- return /* @__PURE__ */ jsx(Host, {
2447
+ return /* @__PURE__ */ jsx("div", {
2463
2448
  ...props.attributes,
2464
2449
  dataSet: {
2465
2450
  class: state.className
@@ -2478,9 +2463,7 @@ const Symbol$1 = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2478
2463
  content: state.content
2479
2464
  })
2480
2465
  });
2481
- }, "Symbol_component_Dn8mGpai87I"), {
2482
- tagName: "div"
2483
- });
2466
+ }, "Symbol_component_Dn8mGpai87I"));
2484
2467
  const Symbol$2 = Symbol$1;
2485
2468
  const settings = {};
2486
2469
  function setEditorSettings(newSettings) {