@builder.io/sdk-solid 1.0.31 → 1.0.33

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.
@@ -109,11 +109,7 @@ import { Show as Show4, For as For2, onMount, createMemo as createMemo5 } from "
109
109
  function getBlockComponentOptions(block) {
110
110
  return {
111
111
  ...block.component?.options,
112
- ...block.options,
113
- /**
114
- * Our built-in components frequently make use of the block, so we provide all of it under `builderBlock`
115
- */
116
- builderBlock: block
112
+ ...block.options
117
113
  };
118
114
  }
119
115
 
@@ -927,11 +923,25 @@ var getRepeatItemData = ({
927
923
  }));
928
924
  return repeatArray;
929
925
  };
930
- var shouldPassLinkComponent = (block) => {
931
- return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
926
+ var provideLinkComponent = (block, linkComponent) => {
927
+ return block && (block.isRSC && TARGET === "rsc" || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name)) ? {
928
+ builderLinkComponent: linkComponent
929
+ } : {};
930
+ };
931
+ var provideRegisteredComponents = (block, registeredComponents) => {
932
+ return block && (block.isRSC && TARGET === "rsc" || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name)) ? {
933
+ builderComponents: registeredComponents
934
+ } : {};
932
935
  };
933
- var shouldPassRegisteredComponents = (block) => {
934
- return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
936
+ var provideBuilderBlock = (block, builderBlock) => {
937
+ return block && (block.isRSC && TARGET === "rsc" || TARGET === "reactNative" && block.name === "Text" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Image", "Video"].includes(block.name)) ? {
938
+ builderBlock
939
+ } : {};
940
+ };
941
+ var provideBuilderContext = (block, context) => {
942
+ return block && (block.isRSC && TARGET === "rsc" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Slot"].includes(block.name)) ? {
943
+ builderContext: context
944
+ } : {};
935
945
  };
936
946
 
937
947
  // src/components/block/components/block-styles.tsx
@@ -1334,13 +1344,13 @@ function Block(props) {
1334
1344
  componentRef: blockComponent()?.component,
1335
1345
  componentOptions: {
1336
1346
  ...getBlockComponentOptions(processedBlock()),
1337
- builderContext: props.context,
1338
- ...shouldPassLinkComponent(blockComponent()) ? {
1339
- builderLinkComponent: props.linkComponent
1340
- } : {},
1341
- ...shouldPassRegisteredComponents(blockComponent()) ? {
1342
- builderComponents: props.registeredComponents
1343
- } : {}
1347
+ ...provideBuilderBlock(blockComponent(), processedBlock()),
1348
+ ...provideBuilderContext(blockComponent(), props.context),
1349
+ ...provideLinkComponent(blockComponent(), props.linkComponent),
1350
+ ...provideRegisteredComponents(
1351
+ blockComponent(),
1352
+ props.registeredComponents
1353
+ )
1344
1354
  },
1345
1355
  context: props.context,
1346
1356
  linkComponent: props.linkComponent,
@@ -1393,7 +1403,6 @@ function Block(props) {
1393
1403
  Wrapper={Tag()}
1394
1404
  block={processedBlock()}
1395
1405
  context={props.context}
1396
- linkComponent={props.linkComponent}
1397
1406
  >
1398
1407
  <Component_ref_default
1399
1408
  componentRef={componentRefProps().componentRef}
@@ -1760,7 +1769,8 @@ function Image(props) {
1760
1769
  opacity: "1",
1761
1770
  transition: "opacity 0.2s ease-in-out"
1762
1771
  })}
1763
- loading="lazy"
1772
+ loading={props.highPriority ? "eager" : "lazy"}
1773
+ fetchpriority={props.highPriority ? "high" : "auto"}
1764
1774
  alt={props.altText}
1765
1775
  role={props.altText ? void 0 : "presentation"}
1766
1776
  style={{
@@ -2677,6 +2687,11 @@ var componentInfo5 = {
2677
2687
  type: "boolean",
2678
2688
  helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
2679
2689
  defaultValue: true
2690
+ }, {
2691
+ name: "highPriority",
2692
+ type: "boolean",
2693
+ advanced: true,
2694
+ helperText: "Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."
2680
2695
  }, {
2681
2696
  name: "aspectRatio",
2682
2697
  type: "number",
@@ -4671,12 +4686,15 @@ var getInteractionPropertiesForEvent = (event) => {
4671
4686
  // src/functions/is-from-trusted-host.ts
4672
4687
  var DEFAULT_TRUSTED_HOSTS = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
4673
4688
  function isFromTrustedHost(trustedHosts, e) {
4689
+ if (!e.origin.startsWith("http") && !e.origin.startsWith("https")) {
4690
+ return false;
4691
+ }
4674
4692
  const url = new URL(e.origin), hostname = url.hostname;
4675
4693
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4676
4694
  }
4677
4695
 
4678
4696
  // src/constants/sdk-version.ts
4679
- var SDK_VERSION = "1.0.31";
4697
+ var SDK_VERSION = "1.0.33";
4680
4698
 
4681
4699
  // src/functions/register.ts
4682
4700
  var registry = {};
@@ -5392,7 +5410,6 @@ function ContentComponent(props) {
5392
5410
  builderContextSignal={builderContextSignal()}
5393
5411
  contentWrapper={props.contentWrapper}
5394
5412
  contentWrapperProps={props.contentWrapperProps}
5395
- linkComponent={props.linkComponent}
5396
5413
  trustedHosts={props.trustedHosts}
5397
5414
  {...{
5398
5415
  setBuilderContextSignal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-solid",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",