@builder.io/sdk-qwik 0.0.11 → 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.
package/README.md CHANGED
@@ -32,7 +32,7 @@ Add Qwik SDK code to a particular route (such as `src/routes/index.tsx`)
32
32
  ```typscript
33
33
  import { component$, Host, Resource, useResource$ } from "@builder.io/qwik";
34
34
  import { DocumentHead, useLocation } from "@builder.io/qwik-city";
35
- import { getContent, RenderContent } from "@builder.io/sdk-qwik";
35
+ import { getContent, RenderContent, getBuilderSearchParams } from "@builder.io/sdk-qwik";
36
36
 
37
37
  export const BUILDER_PUBLIC_API_KEY = "YOUR_API_KEY_GOES_HERE"; // ggignore
38
38
  export default component$(() => {
@@ -41,6 +41,7 @@ export default component$(() => {
41
41
  return getContent({
42
42
  model: "page",
43
43
  apiKey: BUILDER_PUBLIC_API_KEY,
44
+ options: getBuilderSearchParams(location.query),
44
45
  userAttributes: {
45
46
  urlPath: location.pathname || "/",
46
47
  },
@@ -48,19 +49,17 @@ export default component$(() => {
48
49
  });
49
50
 
50
51
  return (
51
- <Host>
52
- <Resource
53
- resource={builderContentRsrc}
54
- onPending={() => <div>Loading...</div>}
55
- onResolved={(content) => (
56
- <RenderContent
57
- model="page"
58
- content={content}
59
- apiKey={BUILDER_PUBLIC_API_KEY}
60
- />
61
- )}
62
- />
63
- </Host>
52
+ <Resource
53
+ resource={builderContentRsrc}
54
+ onPending={() => <div>Loading...</div>}
55
+ onResolved={(content) => (
56
+ <RenderContent
57
+ model="page"
58
+ content={content}
59
+ apiKey={BUILDER_PUBLIC_API_KEY}
60
+ />
61
+ )}
62
+ />
64
63
  );
65
64
  });
66
65
  ```
@@ -487,7 +487,7 @@ const component = function component2(props, state) {
487
487
  } else
488
488
  return ref;
489
489
  };
490
- const componentInfo$9 = function componentInfo(props, state) {
490
+ const componentInfo$a = function componentInfo(props, state) {
491
491
  if (component(props)) {
492
492
  const { component: _, ...info } = component(props);
493
493
  return info;
@@ -520,7 +520,7 @@ const attributes = function attributes2(props, state) {
520
520
  };
521
521
  };
522
522
  const shouldWrap = function shouldWrap2(props, state) {
523
- return !componentInfo$9(props)?.noWrap;
523
+ return !componentInfo$a(props)?.noWrap;
524
524
  };
525
525
  const componentOptions = function componentOptions2(props, state) {
526
526
  return {
@@ -948,7 +948,7 @@ const Button = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
948
948
  });
949
949
  }, "Button_component_FtjCELjtKF4"));
950
950
  const Button$1 = Button;
951
- const componentInfo$8 = {
951
+ const componentInfo$9 = {
952
952
  name: "Core:Button",
953
953
  builtIn: true,
954
954
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
@@ -990,7 +990,7 @@ function markSerializable(fn) {
990
990
  fn.__qwik_serializable__ = true;
991
991
  return fn;
992
992
  }
993
- const componentInfo$7 = {
993
+ const componentInfo$8 = {
994
994
  name: "Columns",
995
995
  builtIn: true,
996
996
  inputs: [
@@ -1231,7 +1231,7 @@ const componentInfo$7 = {
1231
1231
  }
1232
1232
  ]
1233
1233
  };
1234
- const componentInfo$6 = {
1234
+ const componentInfo$7 = {
1235
1235
  name: "Fragment",
1236
1236
  static: true,
1237
1237
  hidden: true,
@@ -1245,7 +1245,7 @@ const FragmentComponent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((pro
1245
1245
  });
1246
1246
  }, "FragmentComponent_component_FJmqlA66Rjg"));
1247
1247
  const Fragment = FragmentComponent;
1248
- const componentInfo$5 = {
1248
+ const componentInfo$6 = {
1249
1249
  name: "Image",
1250
1250
  static: true,
1251
1251
  builtIn: true,
@@ -1394,7 +1394,7 @@ const componentInfo$5 = {
1394
1394
  }
1395
1395
  ]
1396
1396
  };
1397
- const componentInfo$4 = {
1397
+ const componentInfo$5 = {
1398
1398
  name: "Core:Section",
1399
1399
  static: true,
1400
1400
  builtIn: true,
@@ -1450,7 +1450,7 @@ const SectionComponent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((prop
1450
1450
  });
1451
1451
  }, "SectionComponent_component_m1CcjCwgHug"));
1452
1452
  const Section = SectionComponent;
1453
- const componentInfo$3 = {
1453
+ const componentInfo$4 = {
1454
1454
  name: "Symbol",
1455
1455
  noWrap: true,
1456
1456
  static: true,
@@ -1490,7 +1490,7 @@ const componentInfo$3 = {
1490
1490
  }
1491
1491
  ]
1492
1492
  };
1493
- const componentInfo$2 = {
1493
+ const componentInfo$3 = {
1494
1494
  name: "Text",
1495
1495
  static: true,
1496
1496
  builtIn: true,
@@ -1511,7 +1511,7 @@ const componentInfo$2 = {
1511
1511
  textAlign: "center"
1512
1512
  }
1513
1513
  };
1514
- const componentInfo$1 = {
1514
+ const componentInfo$2 = {
1515
1515
  name: "Video",
1516
1516
  canHaveChildren: true,
1517
1517
  builtIn: true,
@@ -1624,7 +1624,7 @@ const componentInfo$1 = {
1624
1624
  }
1625
1625
  ]
1626
1626
  };
1627
- const componentInfo2 = {
1627
+ const componentInfo$1 = {
1628
1628
  name: "Embed",
1629
1629
  static: true,
1630
1630
  builtIn: true,
@@ -1713,6 +1713,40 @@ const Embed = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
1713
1713
  });
1714
1714
  }, "Embed_component_CP6B8Y76ylw"));
1715
1715
  const embed = Embed;
1716
+ const ImgComponent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
1717
+ return /* @__PURE__ */ jsxRuntime.jsx("img", {
1718
+ style: {
1719
+ objectFit: props.backgroundSize || "cover",
1720
+ objectPosition: props.backgroundPosition || "center"
1721
+ },
1722
+ alt: props.altText,
1723
+ src: props.imgSrc || props.image,
1724
+ ...props.attributes
1725
+ }, isEditing() && props.imgSrc || "default-key");
1726
+ }, "ImgComponent_component_b8FkE9OcVN8"));
1727
+ const Img = ImgComponent;
1728
+ const componentInfo2 = {
1729
+ name: "Raw:Img",
1730
+ hideFromInsertMenu: true,
1731
+ builtIn: true,
1732
+ 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",
1733
+ inputs: [
1734
+ {
1735
+ name: "image",
1736
+ bubble: true,
1737
+ type: "file",
1738
+ allowedFileTypes: [
1739
+ "jpeg",
1740
+ "jpg",
1741
+ "png",
1742
+ "svg"
1743
+ ],
1744
+ required: true
1745
+ }
1746
+ ],
1747
+ noWrap: true,
1748
+ static: true
1749
+ };
1716
1750
  var __defProp$3 = Object.defineProperty;
1717
1751
  var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1718
1752
  var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
@@ -1737,31 +1771,34 @@ var __spreadValues$3 = (a, b) => {
1737
1771
  const getDefaultRegisteredComponents = () => [
1738
1772
  __spreadValues$3({
1739
1773
  component: Columns$1
1740
- }, componentInfo$7),
1774
+ }, componentInfo$8),
1741
1775
  __spreadValues$3({
1742
1776
  component: Image$1
1743
- }, componentInfo$5),
1777
+ }, componentInfo$6),
1778
+ __spreadValues$3({
1779
+ component: Img
1780
+ }, componentInfo2),
1744
1781
  __spreadValues$3({
1745
1782
  component: Text$1
1746
- }, componentInfo$2),
1783
+ }, componentInfo$3),
1747
1784
  __spreadValues$3({
1748
1785
  component: Video$1
1749
- }, componentInfo$1),
1786
+ }, componentInfo$2),
1750
1787
  __spreadValues$3({
1751
1788
  component: Symbol$2
1752
- }, componentInfo$3),
1789
+ }, componentInfo$4),
1753
1790
  __spreadValues$3({
1754
1791
  component: Button$1
1755
- }, componentInfo$8),
1792
+ }, componentInfo$9),
1756
1793
  __spreadValues$3({
1757
1794
  component: Section
1758
- }, componentInfo$4),
1795
+ }, componentInfo$5),
1759
1796
  __spreadValues$3({
1760
1797
  component: Fragment
1761
- }, componentInfo$6),
1798
+ }, componentInfo$7),
1762
1799
  __spreadValues$3({
1763
1800
  component: embed
1764
- }, componentInfo2)
1801
+ }, componentInfo$1)
1765
1802
  ];
1766
1803
  var __defProp$2 = Object.defineProperty;
1767
1804
  var __defProps$2 = Object.defineProperties;
@@ -485,7 +485,7 @@ const component = function component2(props, state) {
485
485
  } else
486
486
  return ref;
487
487
  };
488
- const componentInfo$9 = function componentInfo(props, state) {
488
+ const componentInfo$a = function componentInfo(props, state) {
489
489
  if (component(props)) {
490
490
  const { component: _, ...info } = component(props);
491
491
  return info;
@@ -518,7 +518,7 @@ const attributes = function attributes2(props, state) {
518
518
  };
519
519
  };
520
520
  const shouldWrap = function shouldWrap2(props, state) {
521
- return !componentInfo$9(props)?.noWrap;
521
+ return !componentInfo$a(props)?.noWrap;
522
522
  };
523
523
  const componentOptions = function componentOptions2(props, state) {
524
524
  return {
@@ -946,7 +946,7 @@ const Button = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
946
946
  });
947
947
  }, "Button_component_FtjCELjtKF4"));
948
948
  const Button$1 = Button;
949
- const componentInfo$8 = {
949
+ const componentInfo$9 = {
950
950
  name: "Core:Button",
951
951
  builtIn: true,
952
952
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
@@ -988,7 +988,7 @@ function markSerializable(fn) {
988
988
  fn.__qwik_serializable__ = true;
989
989
  return fn;
990
990
  }
991
- const componentInfo$7 = {
991
+ const componentInfo$8 = {
992
992
  name: "Columns",
993
993
  builtIn: true,
994
994
  inputs: [
@@ -1229,7 +1229,7 @@ const componentInfo$7 = {
1229
1229
  }
1230
1230
  ]
1231
1231
  };
1232
- const componentInfo$6 = {
1232
+ const componentInfo$7 = {
1233
1233
  name: "Fragment",
1234
1234
  static: true,
1235
1235
  hidden: true,
@@ -1243,7 +1243,7 @@ const FragmentComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1243
1243
  });
1244
1244
  }, "FragmentComponent_component_FJmqlA66Rjg"));
1245
1245
  const Fragment = FragmentComponent;
1246
- const componentInfo$5 = {
1246
+ const componentInfo$6 = {
1247
1247
  name: "Image",
1248
1248
  static: true,
1249
1249
  builtIn: true,
@@ -1392,7 +1392,7 @@ const componentInfo$5 = {
1392
1392
  }
1393
1393
  ]
1394
1394
  };
1395
- const componentInfo$4 = {
1395
+ const componentInfo$5 = {
1396
1396
  name: "Core:Section",
1397
1397
  static: true,
1398
1398
  builtIn: true,
@@ -1448,7 +1448,7 @@ const SectionComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1448
1448
  });
1449
1449
  }, "SectionComponent_component_m1CcjCwgHug"));
1450
1450
  const Section = SectionComponent;
1451
- const componentInfo$3 = {
1451
+ const componentInfo$4 = {
1452
1452
  name: "Symbol",
1453
1453
  noWrap: true,
1454
1454
  static: true,
@@ -1488,7 +1488,7 @@ const componentInfo$3 = {
1488
1488
  }
1489
1489
  ]
1490
1490
  };
1491
- const componentInfo$2 = {
1491
+ const componentInfo$3 = {
1492
1492
  name: "Text",
1493
1493
  static: true,
1494
1494
  builtIn: true,
@@ -1509,7 +1509,7 @@ const componentInfo$2 = {
1509
1509
  textAlign: "center"
1510
1510
  }
1511
1511
  };
1512
- const componentInfo$1 = {
1512
+ const componentInfo$2 = {
1513
1513
  name: "Video",
1514
1514
  canHaveChildren: true,
1515
1515
  builtIn: true,
@@ -1622,7 +1622,7 @@ const componentInfo$1 = {
1622
1622
  }
1623
1623
  ]
1624
1624
  };
1625
- const componentInfo2 = {
1625
+ const componentInfo$1 = {
1626
1626
  name: "Embed",
1627
1627
  static: true,
1628
1628
  builtIn: true,
@@ -1711,6 +1711,40 @@ const Embed = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1711
1711
  });
1712
1712
  }, "Embed_component_CP6B8Y76ylw"));
1713
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
+ };
1714
1748
  var __defProp$3 = Object.defineProperty;
1715
1749
  var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1716
1750
  var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
@@ -1735,31 +1769,34 @@ var __spreadValues$3 = (a, b) => {
1735
1769
  const getDefaultRegisteredComponents = () => [
1736
1770
  __spreadValues$3({
1737
1771
  component: Columns$1
1738
- }, componentInfo$7),
1772
+ }, componentInfo$8),
1739
1773
  __spreadValues$3({
1740
1774
  component: Image$1
1741
- }, componentInfo$5),
1775
+ }, componentInfo$6),
1776
+ __spreadValues$3({
1777
+ component: Img
1778
+ }, componentInfo2),
1742
1779
  __spreadValues$3({
1743
1780
  component: Text$1
1744
- }, componentInfo$2),
1781
+ }, componentInfo$3),
1745
1782
  __spreadValues$3({
1746
1783
  component: Video$1
1747
- }, componentInfo$1),
1784
+ }, componentInfo$2),
1748
1785
  __spreadValues$3({
1749
1786
  component: Symbol$2
1750
- }, componentInfo$3),
1787
+ }, componentInfo$4),
1751
1788
  __spreadValues$3({
1752
1789
  component: Button$1
1753
- }, componentInfo$8),
1790
+ }, componentInfo$9),
1754
1791
  __spreadValues$3({
1755
1792
  component: Section
1756
- }, componentInfo$4),
1793
+ }, componentInfo$5),
1757
1794
  __spreadValues$3({
1758
1795
  component: Fragment
1759
- }, componentInfo$6),
1796
+ }, componentInfo$7),
1760
1797
  __spreadValues$3({
1761
1798
  component: embed
1762
- }, componentInfo2)
1799
+ }, componentInfo$1)
1763
1800
  ];
1764
1801
  var __defProp$2 = Object.defineProperty;
1765
1802
  var __defProps$2 = Object.defineProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Builder.io Qwik SDK",
5
5
  "type": "module",
6
6
  "main": "./lib/index.qwik.cjs",
@@ -9,10 +9,10 @@ export const ImgComponent = component$((props) => {
9
9
  objectFit: props.backgroundSize || "cover",
10
10
  objectPosition: props.backgroundPosition || "center",
11
11
  }}
12
- {...props.attributes}
13
12
  key={(isEditing() && props.imgSrc) || "default-key"}
14
13
  alt={props.altText}
15
- src={props.imgSrc}
14
+ src={props.imgSrc || props.image}
15
+ {...props.attributes}
16
16
  ></img>
17
17
  );
18
18
  });
@@ -32,9 +32,12 @@ import { componentInfo as videoComponentInfo } from "../blocks/video/component-i
32
32
  import { default as Video } from "../blocks/video/video.jsx";
33
33
  import { componentInfo as embedComponentInfo } from "../blocks/embed/component-info";
34
34
  import { default as embed } from "../blocks/embed/embed.jsx";
35
+ import { default as Img } from "../blocks/img/img.jsx";
36
+ import { componentInfo as imgComponentInfo } from "../blocks/img/component-info";
35
37
  const getDefaultRegisteredComponents = () => [
36
38
  __spreadValues({ component: Columns }, columnsComponentInfo),
37
39
  __spreadValues({ component: Image }, imageComponentInfo),
40
+ __spreadValues({ component: Img }, imgComponentInfo),
38
41
  __spreadValues({ component: Text }, textComponentInfo),
39
42
  __spreadValues({ component: Video }, videoComponentInfo),
40
43
  __spreadValues({ component: Symbol }, symbolComponentInfo),