@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/node/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
|
|
@@ -937,56 +938,33 @@ var getRepeatItemData = ({
|
|
|
937
938
|
}));
|
|
938
939
|
return repeatArray;
|
|
939
940
|
};
|
|
940
|
-
var applyDefaults = (shouldReceiveBuilderProps) => {
|
|
941
|
-
return {
|
|
942
|
-
// once we bump to a major version, toggle this to `false`.
|
|
943
|
-
builderBlock: true,
|
|
944
|
-
// once we bump to a major version, toggle this to `false`.
|
|
945
|
-
builderContext: true,
|
|
946
|
-
builderComponents: false,
|
|
947
|
-
builderLinkComponent: false,
|
|
948
|
-
...shouldReceiveBuilderProps
|
|
949
|
-
};
|
|
950
|
-
};
|
|
951
941
|
var provideLinkComponent = (block, linkComponent) => {
|
|
952
|
-
if (
|
|
953
|
-
return {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
return {
|
|
958
|
-
builderLinkComponent: linkComponent
|
|
959
|
-
};
|
|
942
|
+
if (block?.shouldReceiveBuilderProps?.builderLinkComponent)
|
|
943
|
+
return {
|
|
944
|
+
builderLinkComponent: linkComponent
|
|
945
|
+
};
|
|
946
|
+
return {};
|
|
960
947
|
};
|
|
961
948
|
var provideRegisteredComponents = (block, registeredComponents) => {
|
|
962
|
-
if (
|
|
963
|
-
return {
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
return {
|
|
968
|
-
builderComponents: registeredComponents
|
|
969
|
-
};
|
|
949
|
+
if (block?.shouldReceiveBuilderProps?.builderComponents)
|
|
950
|
+
return {
|
|
951
|
+
builderComponents: registeredComponents
|
|
952
|
+
};
|
|
953
|
+
return {};
|
|
970
954
|
};
|
|
971
955
|
var provideBuilderBlock = (block, builderBlock) => {
|
|
972
|
-
if (
|
|
973
|
-
return {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
return {
|
|
978
|
-
builderBlock
|
|
979
|
-
};
|
|
956
|
+
if (block?.shouldReceiveBuilderProps?.builderBlock)
|
|
957
|
+
return {
|
|
958
|
+
builderBlock
|
|
959
|
+
};
|
|
960
|
+
return {};
|
|
980
961
|
};
|
|
981
962
|
var provideBuilderContext = (block, context) => {
|
|
982
|
-
if (
|
|
983
|
-
return {
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
return {
|
|
988
|
-
builderContext: context
|
|
989
|
-
};
|
|
963
|
+
if (block?.shouldReceiveBuilderProps?.builderContext)
|
|
964
|
+
return {
|
|
965
|
+
builderContext: context
|
|
966
|
+
};
|
|
967
|
+
return {};
|
|
990
968
|
};
|
|
991
969
|
|
|
992
970
|
// src/components/block/components/block-styles.tsx
|
|
@@ -1043,7 +1021,11 @@ var getSizesForBreakpoints = ({
|
|
|
1043
1021
|
|
|
1044
1022
|
// src/components/inlined-styles.tsx
|
|
1045
1023
|
function InlinedStyles(props) {
|
|
1046
|
-
return <><style
|
|
1024
|
+
return <><style
|
|
1025
|
+
innerHTML={props.styles}
|
|
1026
|
+
data-id={props.id}
|
|
1027
|
+
nonce={props.nonce}
|
|
1028
|
+
/></>;
|
|
1047
1029
|
}
|
|
1048
1030
|
var Inlined_styles_default = InlinedStyles;
|
|
1049
1031
|
|
|
@@ -1129,7 +1111,11 @@ function BlockStyles(props) {
|
|
|
1129
1111
|
hoverStylesClass
|
|
1130
1112
|
].join(" ");
|
|
1131
1113
|
});
|
|
1132
|
-
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
1114
|
+
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
1115
|
+
id="builderio-block"
|
|
1116
|
+
styles={css()}
|
|
1117
|
+
nonce={props.context.nonce}
|
|
1118
|
+
/></Show2></>;
|
|
1133
1119
|
}
|
|
1134
1120
|
var Block_styles_default = BlockStyles;
|
|
1135
1121
|
|
|
@@ -1578,8 +1564,9 @@ function Columns(props) {
|
|
|
1578
1564
|
return cols()[index]?.width || 100 / cols().length;
|
|
1579
1565
|
}
|
|
1580
1566
|
function getColumnCssWidth(index) {
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1567
|
+
const width = getWidth(index);
|
|
1568
|
+
const subtractWidth = gutterSize() * (cols().length - 1) * (width / 100);
|
|
1569
|
+
return `calc(${width}% - ${subtractWidth}px)`;
|
|
1583
1570
|
}
|
|
1584
1571
|
function getTabletStyle({
|
|
1585
1572
|
stackedStyle,
|
|
@@ -1681,13 +1668,14 @@ function Columns(props) {
|
|
|
1681
1668
|
}
|
|
1682
1669
|
return <>
|
|
1683
1670
|
<div
|
|
1684
|
-
class={getColumnsClass(props.builderBlock?.id) + " div-
|
|
1671
|
+
class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
|
|
1685
1672
|
style={columnsCssVars()}
|
|
1686
1673
|
{...{}}
|
|
1687
1674
|
>
|
|
1688
1675
|
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default
|
|
1689
1676
|
id="builderio-columns"
|
|
1690
1677
|
styles={columnsStyles()}
|
|
1678
|
+
nonce={props.builderContext.nonce}
|
|
1691
1679
|
/></Show6>
|
|
1692
1680
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1693
1681
|
const index = _index();
|
|
@@ -1709,7 +1697,7 @@ function Columns(props) {
|
|
|
1709
1697
|
/></Dynamic_renderer_default>;
|
|
1710
1698
|
}}</For4>
|
|
1711
1699
|
</div>
|
|
1712
|
-
<style>{`.div-
|
|
1700
|
+
<style>{`.div-5b8fb3ac {
|
|
1713
1701
|
display: flex;
|
|
1714
1702
|
line-height: normal;
|
|
1715
1703
|
}`}</style>
|
|
@@ -2406,9 +2394,6 @@ var componentInfo2 = {
|
|
|
2406
2394
|
static: true,
|
|
2407
2395
|
noWrap: true,
|
|
2408
2396
|
shouldReceiveBuilderProps: {
|
|
2409
|
-
builderBlock: false,
|
|
2410
|
-
builderContext: false,
|
|
2411
|
-
builderComponents: false,
|
|
2412
2397
|
builderLinkComponent: true
|
|
2413
2398
|
}
|
|
2414
2399
|
};
|
|
@@ -2641,12 +2626,6 @@ var componentInfo3 = {
|
|
|
2641
2626
|
|
|
2642
2627
|
// src/blocks/fragment/component-info.ts
|
|
2643
2628
|
var componentInfo4 = {
|
|
2644
|
-
shouldReceiveBuilderProps: {
|
|
2645
|
-
builderBlock: false,
|
|
2646
|
-
builderContext: false,
|
|
2647
|
-
builderComponents: false,
|
|
2648
|
-
builderLinkComponent: false
|
|
2649
|
-
},
|
|
2650
2629
|
name: "Fragment",
|
|
2651
2630
|
static: true,
|
|
2652
2631
|
hidden: true,
|
|
@@ -2780,21 +2759,12 @@ var componentInfo5 = {
|
|
|
2780
2759
|
defaultValue: 0.7041
|
|
2781
2760
|
}],
|
|
2782
2761
|
shouldReceiveBuilderProps: {
|
|
2783
|
-
builderBlock: true
|
|
2784
|
-
builderContext: false,
|
|
2785
|
-
builderComponents: false,
|
|
2786
|
-
builderLinkComponent: false
|
|
2762
|
+
builderBlock: true
|
|
2787
2763
|
}
|
|
2788
2764
|
};
|
|
2789
2765
|
|
|
2790
2766
|
// src/blocks/section/component-info.ts
|
|
2791
2767
|
var componentInfo6 = {
|
|
2792
|
-
shouldReceiveBuilderProps: {
|
|
2793
|
-
builderBlock: false,
|
|
2794
|
-
builderContext: false,
|
|
2795
|
-
builderComponents: false,
|
|
2796
|
-
builderLinkComponent: false
|
|
2797
|
-
},
|
|
2798
2768
|
name: "Core:Section",
|
|
2799
2769
|
static: true,
|
|
2800
2770
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2850,10 +2820,7 @@ var componentInfo7 = {
|
|
|
2850
2820
|
defaultValue: "children"
|
|
2851
2821
|
}],
|
|
2852
2822
|
shouldReceiveBuilderProps: {
|
|
2853
|
-
|
|
2854
|
-
builderContext: true,
|
|
2855
|
-
builderComponents: false,
|
|
2856
|
-
builderLinkComponent: false
|
|
2823
|
+
builderContext: true
|
|
2857
2824
|
}
|
|
2858
2825
|
};
|
|
2859
2826
|
|
|
@@ -3121,10 +3088,7 @@ var tabs_default = Tabs;
|
|
|
3121
3088
|
// src/blocks/text/component-info.ts
|
|
3122
3089
|
var componentInfo10 = {
|
|
3123
3090
|
shouldReceiveBuilderProps: {
|
|
3124
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
3125
|
-
builderContext: false,
|
|
3126
|
-
builderComponents: false,
|
|
3127
|
-
builderLinkComponent: false
|
|
3091
|
+
builderBlock: TARGET === "reactNative" ? true : false
|
|
3128
3092
|
},
|
|
3129
3093
|
name: "Text",
|
|
3130
3094
|
static: true,
|
|
@@ -3159,12 +3123,6 @@ var text_default = Text;
|
|
|
3159
3123
|
|
|
3160
3124
|
// src/blocks/custom-code/component-info.ts
|
|
3161
3125
|
var componentInfo11 = {
|
|
3162
|
-
shouldReceiveBuilderProps: {
|
|
3163
|
-
builderBlock: false,
|
|
3164
|
-
builderContext: false,
|
|
3165
|
-
builderComponents: false,
|
|
3166
|
-
builderLinkComponent: false
|
|
3167
|
-
},
|
|
3168
3126
|
name: "Custom Code",
|
|
3169
3127
|
static: true,
|
|
3170
3128
|
requiredPermissions: ["editCode"],
|
|
@@ -3236,12 +3194,6 @@ var custom_code_default = CustomCode;
|
|
|
3236
3194
|
|
|
3237
3195
|
// src/blocks/embed/component-info.ts
|
|
3238
3196
|
var componentInfo12 = {
|
|
3239
|
-
shouldReceiveBuilderProps: {
|
|
3240
|
-
builderBlock: false,
|
|
3241
|
-
builderContext: false,
|
|
3242
|
-
builderComponents: false,
|
|
3243
|
-
builderLinkComponent: false
|
|
3244
|
-
},
|
|
3245
3197
|
name: "Embed",
|
|
3246
3198
|
static: true,
|
|
3247
3199
|
inputs: [{
|
|
@@ -3801,12 +3753,6 @@ var form_default = FormComponent;
|
|
|
3801
3753
|
|
|
3802
3754
|
// src/blocks/form/input/component-info.ts
|
|
3803
3755
|
var componentInfo14 = {
|
|
3804
|
-
shouldReceiveBuilderProps: {
|
|
3805
|
-
builderBlock: false,
|
|
3806
|
-
builderContext: false,
|
|
3807
|
-
builderComponents: false,
|
|
3808
|
-
builderLinkComponent: false
|
|
3809
|
-
},
|
|
3810
3756
|
name: "Form:Input",
|
|
3811
3757
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3812
3758
|
inputs: [
|
|
@@ -3877,12 +3823,6 @@ var input_default = FormInputComponent;
|
|
|
3877
3823
|
|
|
3878
3824
|
// src/blocks/form/select/component-info.ts
|
|
3879
3825
|
var componentInfo15 = {
|
|
3880
|
-
shouldReceiveBuilderProps: {
|
|
3881
|
-
builderBlock: false,
|
|
3882
|
-
builderContext: false,
|
|
3883
|
-
builderComponents: false,
|
|
3884
|
-
builderLinkComponent: false
|
|
3885
|
-
},
|
|
3886
3826
|
name: "Form:Select",
|
|
3887
3827
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3888
3828
|
defaultStyles: {
|
|
@@ -3946,12 +3886,6 @@ var select_default = SelectComponent;
|
|
|
3946
3886
|
|
|
3947
3887
|
// src/blocks/form/submit-button/component-info.ts
|
|
3948
3888
|
var componentInfo16 = {
|
|
3949
|
-
shouldReceiveBuilderProps: {
|
|
3950
|
-
builderBlock: false,
|
|
3951
|
-
builderContext: false,
|
|
3952
|
-
builderComponents: false,
|
|
3953
|
-
builderLinkComponent: false
|
|
3954
|
-
},
|
|
3955
3889
|
name: "Form:SubmitButton",
|
|
3956
3890
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3957
3891
|
defaultStyles: {
|
|
@@ -3986,12 +3920,6 @@ var submit_button_default = SubmitButton;
|
|
|
3986
3920
|
|
|
3987
3921
|
// src/blocks/form/textarea/component-info.ts
|
|
3988
3922
|
var componentInfo17 = {
|
|
3989
|
-
shouldReceiveBuilderProps: {
|
|
3990
|
-
builderBlock: false,
|
|
3991
|
-
builderContext: false,
|
|
3992
|
-
builderComponents: false,
|
|
3993
|
-
builderLinkComponent: false
|
|
3994
|
-
},
|
|
3995
3923
|
name: "Form:TextArea",
|
|
3996
3924
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
3997
3925
|
inputs: [{
|
|
@@ -4045,12 +3973,6 @@ var textarea_default = Textarea;
|
|
|
4045
3973
|
|
|
4046
3974
|
// src/blocks/img/component-info.ts
|
|
4047
3975
|
var componentInfo18 = {
|
|
4048
|
-
shouldReceiveBuilderProps: {
|
|
4049
|
-
builderBlock: false,
|
|
4050
|
-
builderContext: false,
|
|
4051
|
-
builderComponents: false,
|
|
4052
|
-
builderLinkComponent: false
|
|
4053
|
-
},
|
|
4054
3976
|
// friendlyName?
|
|
4055
3977
|
name: "Raw:Img",
|
|
4056
3978
|
hideFromInsertMenu: true,
|
|
@@ -4165,10 +4087,7 @@ var componentInfo19 = {
|
|
|
4165
4087
|
advanced: true
|
|
4166
4088
|
}],
|
|
4167
4089
|
shouldReceiveBuilderProps: {
|
|
4168
|
-
builderBlock: true
|
|
4169
|
-
builderContext: false,
|
|
4170
|
-
builderComponents: false,
|
|
4171
|
-
builderLinkComponent: false
|
|
4090
|
+
builderBlock: true
|
|
4172
4091
|
}
|
|
4173
4092
|
};
|
|
4174
4093
|
|
|
@@ -4392,7 +4311,11 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4392
4311
|
|
|
4393
4312
|
// src/components/inlined-script.tsx
|
|
4394
4313
|
function InlinedScript(props) {
|
|
4395
|
-
return <><script
|
|
4314
|
+
return <><script
|
|
4315
|
+
innerHTML={props.scriptStr}
|
|
4316
|
+
data-id={props.id}
|
|
4317
|
+
nonce={props.nonce || ""}
|
|
4318
|
+
/></>;
|
|
4396
4319
|
}
|
|
4397
4320
|
var Inlined_script_default = InlinedScript;
|
|
4398
4321
|
|
|
@@ -4901,7 +4824,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4901
4824
|
}
|
|
4902
4825
|
|
|
4903
4826
|
// src/constants/sdk-version.ts
|
|
4904
|
-
var SDK_VERSION = "
|
|
4827
|
+
var SDK_VERSION = "2.0.1";
|
|
4905
4828
|
|
|
4906
4829
|
// src/functions/register.ts
|
|
4907
4830
|
var registry = {};
|
|
@@ -5499,6 +5422,7 @@ ${getDefaultStyles(props.isNestedRender)}
|
|
|
5499
5422
|
return <><Inlined_styles_default
|
|
5500
5423
|
id="builderio-content"
|
|
5501
5424
|
styles={injectedStyles()}
|
|
5425
|
+
nonce={props.nonce}
|
|
5502
5426
|
/></>;
|
|
5503
5427
|
}
|
|
5504
5428
|
var Styles_default = ContentStyles;
|
|
@@ -5592,7 +5516,8 @@ function ContentComponent(props) {
|
|
|
5592
5516
|
),
|
|
5593
5517
|
inheritedStyles: {},
|
|
5594
5518
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
5595
|
-
BlocksWrapperProps: props.blocksWrapperProps || {}
|
|
5519
|
+
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
5520
|
+
nonce: props.nonce || ""
|
|
5596
5521
|
});
|
|
5597
5522
|
function contentSetState(newRootState) {
|
|
5598
5523
|
setBuilderContextSignal((PREVIOUS_VALUE) => ({
|
|
@@ -5605,6 +5530,7 @@ function ContentComponent(props) {
|
|
|
5605
5530
|
registeredComponents: registeredComponents()
|
|
5606
5531
|
}}
|
|
5607
5532
|
><Enable_editor_default
|
|
5533
|
+
nonce={props.nonce}
|
|
5608
5534
|
content={props.content}
|
|
5609
5535
|
data={props.data}
|
|
5610
5536
|
model={props.model}
|
|
@@ -5625,8 +5551,10 @@ function ContentComponent(props) {
|
|
|
5625
5551
|
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
5626
5552
|
id="builderio-variant-visibility"
|
|
5627
5553
|
scriptStr={scriptStr()}
|
|
5554
|
+
nonce={props.nonce || ""}
|
|
5628
5555
|
/></Show13>
|
|
5629
5556
|
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
5557
|
+
nonce={props.nonce || ""}
|
|
5630
5558
|
isNestedRender={props.isNestedRender}
|
|
5631
5559
|
contentId={builderContextSignal().content?.id}
|
|
5632
5560
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
@@ -5678,21 +5606,25 @@ function ContentVariants(props) {
|
|
|
5678
5606
|
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5679
5607
|
id="builderio-init-variants-fns"
|
|
5680
5608
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5609
|
+
nonce={props.nonce || ""}
|
|
5681
5610
|
/></Show14>
|
|
5682
5611
|
<Show14 when={shouldRenderVariants()}>
|
|
5683
5612
|
<Inlined_styles_default
|
|
5684
5613
|
id="builderio-variants"
|
|
5685
5614
|
styles={hideVariantsStyleString()}
|
|
5615
|
+
nonce={props.nonce || ""}
|
|
5686
5616
|
/>
|
|
5687
5617
|
<Inlined_script_default
|
|
5688
5618
|
id="builderio-variants-visibility"
|
|
5689
5619
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5620
|
+
nonce={props.nonce || ""}
|
|
5690
5621
|
/>
|
|
5691
5622
|
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5692
5623
|
const index = _index();
|
|
5693
5624
|
return <Content_default
|
|
5694
5625
|
isNestedRender={props.isNestedRender}
|
|
5695
5626
|
key={variant.testVariationId}
|
|
5627
|
+
nonce={props.nonce}
|
|
5696
5628
|
content={variant}
|
|
5697
5629
|
showContent={false}
|
|
5698
5630
|
model={props.model}
|
|
@@ -5715,6 +5647,7 @@ function ContentVariants(props) {
|
|
|
5715
5647
|
}}</For9>
|
|
5716
5648
|
</Show14>
|
|
5717
5649
|
<Content_default
|
|
5650
|
+
nonce={props.nonce}
|
|
5718
5651
|
isNestedRender={props.isNestedRender}
|
|
5719
5652
|
{...{}}
|
|
5720
5653
|
content={defaultContent()}
|
|
@@ -5801,6 +5734,7 @@ function Symbol(props) {
|
|
|
5801
5734
|
}
|
|
5802
5735
|
createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5803
5736
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
5737
|
+
nonce={props.builderContext.nonce}
|
|
5804
5738
|
isNestedRender={true}
|
|
5805
5739
|
apiVersion={props.builderContext.apiVersion}
|
|
5806
5740
|
apiKey={props.builderContext.apiKey}
|