@builder.io/sdk-solid 1.1.2 → 2.0.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.
- package/dist/index.d.ts +6 -0
- package/lib/browser/dev.js +78 -127
- package/lib/browser/dev.jsx +60 -126
- package/lib/browser/index.js +78 -127
- package/lib/browser/index.jsx +60 -126
- package/lib/edge/dev.js +78 -127
- package/lib/edge/dev.jsx +60 -126
- package/lib/edge/index.js +78 -127
- package/lib/edge/index.jsx +60 -126
- package/lib/node/dev.js +78 -127
- package/lib/node/dev.jsx +60 -126
- package/lib/node/index.js +78 -127
- package/lib/node/index.jsx +60 -126
- package/package.json +1 -1
package/lib/browser/index.jsx
CHANGED
|
@@ -94,7 +94,8 @@ var builder_context_default = createContext({
|
|
|
94
94
|
componentInfos: {},
|
|
95
95
|
inheritedStyles: {},
|
|
96
96
|
BlocksWrapper: "div",
|
|
97
|
-
BlocksWrapperProps: {}
|
|
97
|
+
BlocksWrapperProps: {},
|
|
98
|
+
nonce: ""
|
|
98
99
|
});
|
|
99
100
|
|
|
100
101
|
// src/context/components.context.ts
|
|
@@ -765,56 +766,33 @@ var getRepeatItemData = ({
|
|
|
765
766
|
}));
|
|
766
767
|
return repeatArray;
|
|
767
768
|
};
|
|
768
|
-
var applyDefaults = (shouldReceiveBuilderProps) => {
|
|
769
|
-
return {
|
|
770
|
-
// once we bump to a major version, toggle this to `false`.
|
|
771
|
-
builderBlock: true,
|
|
772
|
-
// once we bump to a major version, toggle this to `false`.
|
|
773
|
-
builderContext: true,
|
|
774
|
-
builderComponents: false,
|
|
775
|
-
builderLinkComponent: false,
|
|
776
|
-
...shouldReceiveBuilderProps
|
|
777
|
-
};
|
|
778
|
-
};
|
|
779
769
|
var provideLinkComponent = (block, linkComponent) => {
|
|
780
|
-
if (
|
|
781
|
-
return {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
return {
|
|
786
|
-
builderLinkComponent: linkComponent
|
|
787
|
-
};
|
|
770
|
+
if (block?.shouldReceiveBuilderProps?.builderLinkComponent)
|
|
771
|
+
return {
|
|
772
|
+
builderLinkComponent: linkComponent
|
|
773
|
+
};
|
|
774
|
+
return {};
|
|
788
775
|
};
|
|
789
776
|
var provideRegisteredComponents = (block, registeredComponents) => {
|
|
790
|
-
if (
|
|
791
|
-
return {
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
return {
|
|
796
|
-
builderComponents: registeredComponents
|
|
797
|
-
};
|
|
777
|
+
if (block?.shouldReceiveBuilderProps?.builderComponents)
|
|
778
|
+
return {
|
|
779
|
+
builderComponents: registeredComponents
|
|
780
|
+
};
|
|
781
|
+
return {};
|
|
798
782
|
};
|
|
799
783
|
var provideBuilderBlock = (block, builderBlock) => {
|
|
800
|
-
if (
|
|
801
|
-
return {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
return {
|
|
806
|
-
builderBlock
|
|
807
|
-
};
|
|
784
|
+
if (block?.shouldReceiveBuilderProps?.builderBlock)
|
|
785
|
+
return {
|
|
786
|
+
builderBlock
|
|
787
|
+
};
|
|
788
|
+
return {};
|
|
808
789
|
};
|
|
809
790
|
var provideBuilderContext = (block, context) => {
|
|
810
|
-
if (
|
|
811
|
-
return {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
return {
|
|
816
|
-
builderContext: context
|
|
817
|
-
};
|
|
791
|
+
if (block?.shouldReceiveBuilderProps?.builderContext)
|
|
792
|
+
return {
|
|
793
|
+
builderContext: context
|
|
794
|
+
};
|
|
795
|
+
return {};
|
|
818
796
|
};
|
|
819
797
|
|
|
820
798
|
// src/components/block/components/block-styles.tsx
|
|
@@ -871,7 +849,11 @@ var getSizesForBreakpoints = ({
|
|
|
871
849
|
|
|
872
850
|
// src/components/inlined-styles.tsx
|
|
873
851
|
function InlinedStyles(props) {
|
|
874
|
-
return <><style
|
|
852
|
+
return <><style
|
|
853
|
+
innerHTML={props.styles}
|
|
854
|
+
data-id={props.id}
|
|
855
|
+
nonce={props.nonce}
|
|
856
|
+
/></>;
|
|
875
857
|
}
|
|
876
858
|
var Inlined_styles_default = InlinedStyles;
|
|
877
859
|
|
|
@@ -957,7 +939,11 @@ function BlockStyles(props) {
|
|
|
957
939
|
hoverStylesClass
|
|
958
940
|
].join(" ");
|
|
959
941
|
});
|
|
960
|
-
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
942
|
+
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
943
|
+
id="builderio-block"
|
|
944
|
+
styles={css()}
|
|
945
|
+
nonce={props.context.nonce}
|
|
946
|
+
/></Show2></>;
|
|
961
947
|
}
|
|
962
948
|
var Block_styles_default = BlockStyles;
|
|
963
949
|
|
|
@@ -1406,8 +1392,9 @@ function Columns(props) {
|
|
|
1406
1392
|
return cols()[index]?.width || 100 / cols().length;
|
|
1407
1393
|
}
|
|
1408
1394
|
function getColumnCssWidth(index) {
|
|
1409
|
-
const
|
|
1410
|
-
|
|
1395
|
+
const width = getWidth(index);
|
|
1396
|
+
const subtractWidth = gutterSize() * (cols().length - 1) * (width / 100);
|
|
1397
|
+
return `calc(${width}% - ${subtractWidth}px)`;
|
|
1411
1398
|
}
|
|
1412
1399
|
function getTabletStyle({
|
|
1413
1400
|
stackedStyle,
|
|
@@ -1509,13 +1496,14 @@ function Columns(props) {
|
|
|
1509
1496
|
}
|
|
1510
1497
|
return <>
|
|
1511
1498
|
<div
|
|
1512
|
-
class={getColumnsClass(props.builderBlock?.id) + " div-
|
|
1499
|
+
class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
|
|
1513
1500
|
style={columnsCssVars()}
|
|
1514
1501
|
{...{}}
|
|
1515
1502
|
>
|
|
1516
1503
|
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default
|
|
1517
1504
|
id="builderio-columns"
|
|
1518
1505
|
styles={columnsStyles()}
|
|
1506
|
+
nonce={props.builderContext.nonce}
|
|
1519
1507
|
/></Show6>
|
|
1520
1508
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1521
1509
|
const index = _index();
|
|
@@ -1537,7 +1525,7 @@ function Columns(props) {
|
|
|
1537
1525
|
/></Dynamic_renderer_default>;
|
|
1538
1526
|
}}</For4>
|
|
1539
1527
|
</div>
|
|
1540
|
-
<style>{`.div-
|
|
1528
|
+
<style>{`.div-5b8fb3ac {
|
|
1541
1529
|
display: flex;
|
|
1542
1530
|
line-height: normal;
|
|
1543
1531
|
}`}</style>
|
|
@@ -2234,9 +2222,6 @@ var componentInfo2 = {
|
|
|
2234
2222
|
static: true,
|
|
2235
2223
|
noWrap: true,
|
|
2236
2224
|
shouldReceiveBuilderProps: {
|
|
2237
|
-
builderBlock: false,
|
|
2238
|
-
builderContext: false,
|
|
2239
|
-
builderComponents: false,
|
|
2240
2225
|
builderLinkComponent: true
|
|
2241
2226
|
}
|
|
2242
2227
|
};
|
|
@@ -2469,12 +2454,6 @@ var componentInfo3 = {
|
|
|
2469
2454
|
|
|
2470
2455
|
// src/blocks/fragment/component-info.ts
|
|
2471
2456
|
var componentInfo4 = {
|
|
2472
|
-
shouldReceiveBuilderProps: {
|
|
2473
|
-
builderBlock: false,
|
|
2474
|
-
builderContext: false,
|
|
2475
|
-
builderComponents: false,
|
|
2476
|
-
builderLinkComponent: false
|
|
2477
|
-
},
|
|
2478
2457
|
name: "Fragment",
|
|
2479
2458
|
static: true,
|
|
2480
2459
|
hidden: true,
|
|
@@ -2608,21 +2587,12 @@ var componentInfo5 = {
|
|
|
2608
2587
|
defaultValue: 0.7041
|
|
2609
2588
|
}],
|
|
2610
2589
|
shouldReceiveBuilderProps: {
|
|
2611
|
-
builderBlock: true
|
|
2612
|
-
builderContext: false,
|
|
2613
|
-
builderComponents: false,
|
|
2614
|
-
builderLinkComponent: false
|
|
2590
|
+
builderBlock: true
|
|
2615
2591
|
}
|
|
2616
2592
|
};
|
|
2617
2593
|
|
|
2618
2594
|
// src/blocks/section/component-info.ts
|
|
2619
2595
|
var componentInfo6 = {
|
|
2620
|
-
shouldReceiveBuilderProps: {
|
|
2621
|
-
builderBlock: false,
|
|
2622
|
-
builderContext: false,
|
|
2623
|
-
builderComponents: false,
|
|
2624
|
-
builderLinkComponent: false
|
|
2625
|
-
},
|
|
2626
2596
|
name: "Core:Section",
|
|
2627
2597
|
static: true,
|
|
2628
2598
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2678,10 +2648,7 @@ var componentInfo7 = {
|
|
|
2678
2648
|
defaultValue: "children"
|
|
2679
2649
|
}],
|
|
2680
2650
|
shouldReceiveBuilderProps: {
|
|
2681
|
-
|
|
2682
|
-
builderContext: true,
|
|
2683
|
-
builderComponents: false,
|
|
2684
|
-
builderLinkComponent: false
|
|
2651
|
+
builderContext: true
|
|
2685
2652
|
}
|
|
2686
2653
|
};
|
|
2687
2654
|
|
|
@@ -2949,10 +2916,7 @@ var tabs_default = Tabs;
|
|
|
2949
2916
|
// src/blocks/text/component-info.ts
|
|
2950
2917
|
var componentInfo10 = {
|
|
2951
2918
|
shouldReceiveBuilderProps: {
|
|
2952
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
2953
|
-
builderContext: false,
|
|
2954
|
-
builderComponents: false,
|
|
2955
|
-
builderLinkComponent: false
|
|
2919
|
+
builderBlock: TARGET === "reactNative" ? true : false
|
|
2956
2920
|
},
|
|
2957
2921
|
name: "Text",
|
|
2958
2922
|
static: true,
|
|
@@ -2987,12 +2951,6 @@ var text_default = Text;
|
|
|
2987
2951
|
|
|
2988
2952
|
// src/blocks/custom-code/component-info.ts
|
|
2989
2953
|
var componentInfo11 = {
|
|
2990
|
-
shouldReceiveBuilderProps: {
|
|
2991
|
-
builderBlock: false,
|
|
2992
|
-
builderContext: false,
|
|
2993
|
-
builderComponents: false,
|
|
2994
|
-
builderLinkComponent: false
|
|
2995
|
-
},
|
|
2996
2954
|
name: "Custom Code",
|
|
2997
2955
|
static: true,
|
|
2998
2956
|
requiredPermissions: ["editCode"],
|
|
@@ -3064,12 +3022,6 @@ var custom_code_default = CustomCode;
|
|
|
3064
3022
|
|
|
3065
3023
|
// src/blocks/embed/component-info.ts
|
|
3066
3024
|
var componentInfo12 = {
|
|
3067
|
-
shouldReceiveBuilderProps: {
|
|
3068
|
-
builderBlock: false,
|
|
3069
|
-
builderContext: false,
|
|
3070
|
-
builderComponents: false,
|
|
3071
|
-
builderLinkComponent: false
|
|
3072
|
-
},
|
|
3073
3025
|
name: "Embed",
|
|
3074
3026
|
static: true,
|
|
3075
3027
|
inputs: [{
|
|
@@ -3629,12 +3581,6 @@ var form_default = FormComponent;
|
|
|
3629
3581
|
|
|
3630
3582
|
// src/blocks/form/input/component-info.ts
|
|
3631
3583
|
var componentInfo14 = {
|
|
3632
|
-
shouldReceiveBuilderProps: {
|
|
3633
|
-
builderBlock: false,
|
|
3634
|
-
builderContext: false,
|
|
3635
|
-
builderComponents: false,
|
|
3636
|
-
builderLinkComponent: false
|
|
3637
|
-
},
|
|
3638
3584
|
name: "Form:Input",
|
|
3639
3585
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3640
3586
|
inputs: [
|
|
@@ -3705,12 +3651,6 @@ var input_default = FormInputComponent;
|
|
|
3705
3651
|
|
|
3706
3652
|
// src/blocks/form/select/component-info.ts
|
|
3707
3653
|
var componentInfo15 = {
|
|
3708
|
-
shouldReceiveBuilderProps: {
|
|
3709
|
-
builderBlock: false,
|
|
3710
|
-
builderContext: false,
|
|
3711
|
-
builderComponents: false,
|
|
3712
|
-
builderLinkComponent: false
|
|
3713
|
-
},
|
|
3714
3654
|
name: "Form:Select",
|
|
3715
3655
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3716
3656
|
defaultStyles: {
|
|
@@ -3774,12 +3714,6 @@ var select_default = SelectComponent;
|
|
|
3774
3714
|
|
|
3775
3715
|
// src/blocks/form/submit-button/component-info.ts
|
|
3776
3716
|
var componentInfo16 = {
|
|
3777
|
-
shouldReceiveBuilderProps: {
|
|
3778
|
-
builderBlock: false,
|
|
3779
|
-
builderContext: false,
|
|
3780
|
-
builderComponents: false,
|
|
3781
|
-
builderLinkComponent: false
|
|
3782
|
-
},
|
|
3783
3717
|
name: "Form:SubmitButton",
|
|
3784
3718
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3785
3719
|
defaultStyles: {
|
|
@@ -3814,12 +3748,6 @@ var submit_button_default = SubmitButton;
|
|
|
3814
3748
|
|
|
3815
3749
|
// src/blocks/form/textarea/component-info.ts
|
|
3816
3750
|
var componentInfo17 = {
|
|
3817
|
-
shouldReceiveBuilderProps: {
|
|
3818
|
-
builderBlock: false,
|
|
3819
|
-
builderContext: false,
|
|
3820
|
-
builderComponents: false,
|
|
3821
|
-
builderLinkComponent: false
|
|
3822
|
-
},
|
|
3823
3751
|
name: "Form:TextArea",
|
|
3824
3752
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
3825
3753
|
inputs: [{
|
|
@@ -3873,12 +3801,6 @@ var textarea_default = Textarea;
|
|
|
3873
3801
|
|
|
3874
3802
|
// src/blocks/img/component-info.ts
|
|
3875
3803
|
var componentInfo18 = {
|
|
3876
|
-
shouldReceiveBuilderProps: {
|
|
3877
|
-
builderBlock: false,
|
|
3878
|
-
builderContext: false,
|
|
3879
|
-
builderComponents: false,
|
|
3880
|
-
builderLinkComponent: false
|
|
3881
|
-
},
|
|
3882
3804
|
// friendlyName?
|
|
3883
3805
|
name: "Raw:Img",
|
|
3884
3806
|
hideFromInsertMenu: true,
|
|
@@ -3993,10 +3915,7 @@ var componentInfo19 = {
|
|
|
3993
3915
|
advanced: true
|
|
3994
3916
|
}],
|
|
3995
3917
|
shouldReceiveBuilderProps: {
|
|
3996
|
-
builderBlock: true
|
|
3997
|
-
builderContext: false,
|
|
3998
|
-
builderComponents: false,
|
|
3999
|
-
builderLinkComponent: false
|
|
3918
|
+
builderBlock: true
|
|
4000
3919
|
}
|
|
4001
3920
|
};
|
|
4002
3921
|
|
|
@@ -4220,7 +4139,11 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4220
4139
|
|
|
4221
4140
|
// src/components/inlined-script.tsx
|
|
4222
4141
|
function InlinedScript(props) {
|
|
4223
|
-
return <><script
|
|
4142
|
+
return <><script
|
|
4143
|
+
innerHTML={props.scriptStr}
|
|
4144
|
+
data-id={props.id}
|
|
4145
|
+
nonce={props.nonce || ""}
|
|
4146
|
+
/></>;
|
|
4224
4147
|
}
|
|
4225
4148
|
var Inlined_script_default = InlinedScript;
|
|
4226
4149
|
|
|
@@ -4729,7 +4652,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4729
4652
|
}
|
|
4730
4653
|
|
|
4731
4654
|
// src/constants/sdk-version.ts
|
|
4732
|
-
var SDK_VERSION = "
|
|
4655
|
+
var SDK_VERSION = "2.0.1";
|
|
4733
4656
|
|
|
4734
4657
|
// src/functions/register.ts
|
|
4735
4658
|
var registry = {};
|
|
@@ -5327,6 +5250,7 @@ ${getDefaultStyles(props.isNestedRender)}
|
|
|
5327
5250
|
return <><Inlined_styles_default
|
|
5328
5251
|
id="builderio-content"
|
|
5329
5252
|
styles={injectedStyles()}
|
|
5253
|
+
nonce={props.nonce}
|
|
5330
5254
|
/></>;
|
|
5331
5255
|
}
|
|
5332
5256
|
var Styles_default = ContentStyles;
|
|
@@ -5420,7 +5344,8 @@ function ContentComponent(props) {
|
|
|
5420
5344
|
),
|
|
5421
5345
|
inheritedStyles: {},
|
|
5422
5346
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
5423
|
-
BlocksWrapperProps: props.blocksWrapperProps || {}
|
|
5347
|
+
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
5348
|
+
nonce: props.nonce || ""
|
|
5424
5349
|
});
|
|
5425
5350
|
function contentSetState(newRootState) {
|
|
5426
5351
|
setBuilderContextSignal((PREVIOUS_VALUE) => ({
|
|
@@ -5433,6 +5358,7 @@ function ContentComponent(props) {
|
|
|
5433
5358
|
registeredComponents: registeredComponents()
|
|
5434
5359
|
}}
|
|
5435
5360
|
><Enable_editor_default
|
|
5361
|
+
nonce={props.nonce}
|
|
5436
5362
|
content={props.content}
|
|
5437
5363
|
data={props.data}
|
|
5438
5364
|
model={props.model}
|
|
@@ -5453,8 +5379,10 @@ function ContentComponent(props) {
|
|
|
5453
5379
|
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
5454
5380
|
id="builderio-variant-visibility"
|
|
5455
5381
|
scriptStr={scriptStr()}
|
|
5382
|
+
nonce={props.nonce || ""}
|
|
5456
5383
|
/></Show13>
|
|
5457
5384
|
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
5385
|
+
nonce={props.nonce || ""}
|
|
5458
5386
|
isNestedRender={props.isNestedRender}
|
|
5459
5387
|
contentId={builderContextSignal().content?.id}
|
|
5460
5388
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
@@ -5506,21 +5434,25 @@ function ContentVariants(props) {
|
|
|
5506
5434
|
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5507
5435
|
id="builderio-init-variants-fns"
|
|
5508
5436
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5437
|
+
nonce={props.nonce || ""}
|
|
5509
5438
|
/></Show14>
|
|
5510
5439
|
<Show14 when={shouldRenderVariants()}>
|
|
5511
5440
|
<Inlined_styles_default
|
|
5512
5441
|
id="builderio-variants"
|
|
5513
5442
|
styles={hideVariantsStyleString()}
|
|
5443
|
+
nonce={props.nonce || ""}
|
|
5514
5444
|
/>
|
|
5515
5445
|
<Inlined_script_default
|
|
5516
5446
|
id="builderio-variants-visibility"
|
|
5517
5447
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5448
|
+
nonce={props.nonce || ""}
|
|
5518
5449
|
/>
|
|
5519
5450
|
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5520
5451
|
const index = _index();
|
|
5521
5452
|
return <Content_default
|
|
5522
5453
|
isNestedRender={props.isNestedRender}
|
|
5523
5454
|
key={variant.testVariationId}
|
|
5455
|
+
nonce={props.nonce}
|
|
5524
5456
|
content={variant}
|
|
5525
5457
|
showContent={false}
|
|
5526
5458
|
model={props.model}
|
|
@@ -5543,6 +5475,7 @@ function ContentVariants(props) {
|
|
|
5543
5475
|
}}</For9>
|
|
5544
5476
|
</Show14>
|
|
5545
5477
|
<Content_default
|
|
5478
|
+
nonce={props.nonce}
|
|
5546
5479
|
isNestedRender={props.isNestedRender}
|
|
5547
5480
|
{...{}}
|
|
5548
5481
|
content={defaultContent()}
|
|
@@ -5629,6 +5562,7 @@ function Symbol(props) {
|
|
|
5629
5562
|
}
|
|
5630
5563
|
createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5631
5564
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
5565
|
+
nonce={props.builderContext.nonce}
|
|
5632
5566
|
isNestedRender={true}
|
|
5633
5567
|
apiVersion={props.builderContext.apiVersion}
|
|
5634
5568
|
apiKey={props.builderContext.apiKey}
|