@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/dev.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
|
|
@@ -943,56 +944,33 @@ var getRepeatItemData = ({
|
|
|
943
944
|
}));
|
|
944
945
|
return repeatArray;
|
|
945
946
|
};
|
|
946
|
-
var applyDefaults = (shouldReceiveBuilderProps) => {
|
|
947
|
-
return {
|
|
948
|
-
// once we bump to a major version, toggle this to `false`.
|
|
949
|
-
builderBlock: true,
|
|
950
|
-
// once we bump to a major version, toggle this to `false`.
|
|
951
|
-
builderContext: true,
|
|
952
|
-
builderComponents: false,
|
|
953
|
-
builderLinkComponent: false,
|
|
954
|
-
...shouldReceiveBuilderProps
|
|
955
|
-
};
|
|
956
|
-
};
|
|
957
947
|
var provideLinkComponent = (block, linkComponent) => {
|
|
958
|
-
if (
|
|
959
|
-
return {
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
return {
|
|
964
|
-
builderLinkComponent: linkComponent
|
|
965
|
-
};
|
|
948
|
+
if (block?.shouldReceiveBuilderProps?.builderLinkComponent)
|
|
949
|
+
return {
|
|
950
|
+
builderLinkComponent: linkComponent
|
|
951
|
+
};
|
|
952
|
+
return {};
|
|
966
953
|
};
|
|
967
954
|
var provideRegisteredComponents = (block, registeredComponents) => {
|
|
968
|
-
if (
|
|
969
|
-
return {
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
return {
|
|
974
|
-
builderComponents: registeredComponents
|
|
975
|
-
};
|
|
955
|
+
if (block?.shouldReceiveBuilderProps?.builderComponents)
|
|
956
|
+
return {
|
|
957
|
+
builderComponents: registeredComponents
|
|
958
|
+
};
|
|
959
|
+
return {};
|
|
976
960
|
};
|
|
977
961
|
var provideBuilderBlock = (block, builderBlock) => {
|
|
978
|
-
if (
|
|
979
|
-
return {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
return {
|
|
984
|
-
builderBlock
|
|
985
|
-
};
|
|
962
|
+
if (block?.shouldReceiveBuilderProps?.builderBlock)
|
|
963
|
+
return {
|
|
964
|
+
builderBlock
|
|
965
|
+
};
|
|
966
|
+
return {};
|
|
986
967
|
};
|
|
987
968
|
var provideBuilderContext = (block, context) => {
|
|
988
|
-
if (
|
|
989
|
-
return {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
return {
|
|
994
|
-
builderContext: context
|
|
995
|
-
};
|
|
969
|
+
if (block?.shouldReceiveBuilderProps?.builderContext)
|
|
970
|
+
return {
|
|
971
|
+
builderContext: context
|
|
972
|
+
};
|
|
973
|
+
return {};
|
|
996
974
|
};
|
|
997
975
|
|
|
998
976
|
// src/components/block/components/block-styles.tsx
|
|
@@ -1049,7 +1027,11 @@ var getSizesForBreakpoints = ({
|
|
|
1049
1027
|
|
|
1050
1028
|
// src/components/inlined-styles.tsx
|
|
1051
1029
|
function InlinedStyles(props) {
|
|
1052
|
-
return <><style
|
|
1030
|
+
return <><style
|
|
1031
|
+
innerHTML={props.styles}
|
|
1032
|
+
data-id={props.id}
|
|
1033
|
+
nonce={props.nonce}
|
|
1034
|
+
/></>;
|
|
1053
1035
|
}
|
|
1054
1036
|
var Inlined_styles_default = InlinedStyles;
|
|
1055
1037
|
|
|
@@ -1135,7 +1117,11 @@ function BlockStyles(props) {
|
|
|
1135
1117
|
hoverStylesClass
|
|
1136
1118
|
].join(" ");
|
|
1137
1119
|
});
|
|
1138
|
-
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
1120
|
+
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
1121
|
+
id="builderio-block"
|
|
1122
|
+
styles={css()}
|
|
1123
|
+
nonce={props.context.nonce}
|
|
1124
|
+
/></Show2></>;
|
|
1139
1125
|
}
|
|
1140
1126
|
var Block_styles_default = BlockStyles;
|
|
1141
1127
|
|
|
@@ -1584,8 +1570,9 @@ function Columns(props) {
|
|
|
1584
1570
|
return cols()[index]?.width || 100 / cols().length;
|
|
1585
1571
|
}
|
|
1586
1572
|
function getColumnCssWidth(index) {
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1573
|
+
const width = getWidth(index);
|
|
1574
|
+
const subtractWidth = gutterSize() * (cols().length - 1) * (width / 100);
|
|
1575
|
+
return `calc(${width}% - ${subtractWidth}px)`;
|
|
1589
1576
|
}
|
|
1590
1577
|
function getTabletStyle({
|
|
1591
1578
|
stackedStyle,
|
|
@@ -1687,13 +1674,14 @@ function Columns(props) {
|
|
|
1687
1674
|
}
|
|
1688
1675
|
return <>
|
|
1689
1676
|
<div
|
|
1690
|
-
class={getColumnsClass(props.builderBlock?.id) + " div-
|
|
1677
|
+
class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
|
|
1691
1678
|
style={columnsCssVars()}
|
|
1692
1679
|
{...{}}
|
|
1693
1680
|
>
|
|
1694
1681
|
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default
|
|
1695
1682
|
id="builderio-columns"
|
|
1696
1683
|
styles={columnsStyles()}
|
|
1684
|
+
nonce={props.builderContext.nonce}
|
|
1697
1685
|
/></Show6>
|
|
1698
1686
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1699
1687
|
const index = _index();
|
|
@@ -1715,7 +1703,7 @@ function Columns(props) {
|
|
|
1715
1703
|
/></Dynamic_renderer_default>;
|
|
1716
1704
|
}}</For4>
|
|
1717
1705
|
</div>
|
|
1718
|
-
<style>{`.div-
|
|
1706
|
+
<style>{`.div-5b8fb3ac {
|
|
1719
1707
|
display: flex;
|
|
1720
1708
|
line-height: normal;
|
|
1721
1709
|
}`}</style>
|
|
@@ -2413,9 +2401,6 @@ var componentInfo2 = {
|
|
|
2413
2401
|
static: true,
|
|
2414
2402
|
noWrap: true,
|
|
2415
2403
|
shouldReceiveBuilderProps: {
|
|
2416
|
-
builderBlock: false,
|
|
2417
|
-
builderContext: false,
|
|
2418
|
-
builderComponents: false,
|
|
2419
2404
|
builderLinkComponent: true
|
|
2420
2405
|
}
|
|
2421
2406
|
};
|
|
@@ -2648,12 +2633,6 @@ var componentInfo3 = {
|
|
|
2648
2633
|
|
|
2649
2634
|
// src/blocks/fragment/component-info.ts
|
|
2650
2635
|
var componentInfo4 = {
|
|
2651
|
-
shouldReceiveBuilderProps: {
|
|
2652
|
-
builderBlock: false,
|
|
2653
|
-
builderContext: false,
|
|
2654
|
-
builderComponents: false,
|
|
2655
|
-
builderLinkComponent: false
|
|
2656
|
-
},
|
|
2657
2636
|
name: "Fragment",
|
|
2658
2637
|
static: true,
|
|
2659
2638
|
hidden: true,
|
|
@@ -2788,21 +2767,12 @@ var componentInfo5 = {
|
|
|
2788
2767
|
defaultValue: 0.7041
|
|
2789
2768
|
}],
|
|
2790
2769
|
shouldReceiveBuilderProps: {
|
|
2791
|
-
builderBlock: true
|
|
2792
|
-
builderContext: false,
|
|
2793
|
-
builderComponents: false,
|
|
2794
|
-
builderLinkComponent: false
|
|
2770
|
+
builderBlock: true
|
|
2795
2771
|
}
|
|
2796
2772
|
};
|
|
2797
2773
|
|
|
2798
2774
|
// src/blocks/section/component-info.ts
|
|
2799
2775
|
var componentInfo6 = {
|
|
2800
|
-
shouldReceiveBuilderProps: {
|
|
2801
|
-
builderBlock: false,
|
|
2802
|
-
builderContext: false,
|
|
2803
|
-
builderComponents: false,
|
|
2804
|
-
builderLinkComponent: false
|
|
2805
|
-
},
|
|
2806
2776
|
name: "Core:Section",
|
|
2807
2777
|
static: true,
|
|
2808
2778
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2858,10 +2828,7 @@ var componentInfo7 = {
|
|
|
2858
2828
|
defaultValue: "children"
|
|
2859
2829
|
}],
|
|
2860
2830
|
shouldReceiveBuilderProps: {
|
|
2861
|
-
|
|
2862
|
-
builderContext: true,
|
|
2863
|
-
builderComponents: false,
|
|
2864
|
-
builderLinkComponent: false
|
|
2831
|
+
builderContext: true
|
|
2865
2832
|
}
|
|
2866
2833
|
};
|
|
2867
2834
|
|
|
@@ -3129,10 +3096,7 @@ var tabs_default = Tabs;
|
|
|
3129
3096
|
// src/blocks/text/component-info.ts
|
|
3130
3097
|
var componentInfo10 = {
|
|
3131
3098
|
shouldReceiveBuilderProps: {
|
|
3132
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
3133
|
-
builderContext: false,
|
|
3134
|
-
builderComponents: false,
|
|
3135
|
-
builderLinkComponent: false
|
|
3099
|
+
builderBlock: TARGET === "reactNative" ? true : false
|
|
3136
3100
|
},
|
|
3137
3101
|
name: "Text",
|
|
3138
3102
|
static: true,
|
|
@@ -3167,12 +3131,6 @@ var text_default = Text;
|
|
|
3167
3131
|
|
|
3168
3132
|
// src/blocks/custom-code/component-info.ts
|
|
3169
3133
|
var componentInfo11 = {
|
|
3170
|
-
shouldReceiveBuilderProps: {
|
|
3171
|
-
builderBlock: false,
|
|
3172
|
-
builderContext: false,
|
|
3173
|
-
builderComponents: false,
|
|
3174
|
-
builderLinkComponent: false
|
|
3175
|
-
},
|
|
3176
3134
|
name: "Custom Code",
|
|
3177
3135
|
static: true,
|
|
3178
3136
|
requiredPermissions: ["editCode"],
|
|
@@ -3245,12 +3203,6 @@ var custom_code_default = CustomCode;
|
|
|
3245
3203
|
|
|
3246
3204
|
// src/blocks/embed/component-info.ts
|
|
3247
3205
|
var componentInfo12 = {
|
|
3248
|
-
shouldReceiveBuilderProps: {
|
|
3249
|
-
builderBlock: false,
|
|
3250
|
-
builderContext: false,
|
|
3251
|
-
builderComponents: false,
|
|
3252
|
-
builderLinkComponent: false
|
|
3253
|
-
},
|
|
3254
3206
|
name: "Embed",
|
|
3255
3207
|
static: true,
|
|
3256
3208
|
inputs: [{
|
|
@@ -3811,12 +3763,6 @@ var form_default = FormComponent;
|
|
|
3811
3763
|
|
|
3812
3764
|
// src/blocks/form/input/component-info.ts
|
|
3813
3765
|
var componentInfo14 = {
|
|
3814
|
-
shouldReceiveBuilderProps: {
|
|
3815
|
-
builderBlock: false,
|
|
3816
|
-
builderContext: false,
|
|
3817
|
-
builderComponents: false,
|
|
3818
|
-
builderLinkComponent: false
|
|
3819
|
-
},
|
|
3820
3766
|
name: "Form:Input",
|
|
3821
3767
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3822
3768
|
inputs: [
|
|
@@ -3887,12 +3833,6 @@ var input_default = FormInputComponent;
|
|
|
3887
3833
|
|
|
3888
3834
|
// src/blocks/form/select/component-info.ts
|
|
3889
3835
|
var componentInfo15 = {
|
|
3890
|
-
shouldReceiveBuilderProps: {
|
|
3891
|
-
builderBlock: false,
|
|
3892
|
-
builderContext: false,
|
|
3893
|
-
builderComponents: false,
|
|
3894
|
-
builderLinkComponent: false
|
|
3895
|
-
},
|
|
3896
3836
|
name: "Form:Select",
|
|
3897
3837
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3898
3838
|
defaultStyles: {
|
|
@@ -3956,12 +3896,6 @@ var select_default = SelectComponent;
|
|
|
3956
3896
|
|
|
3957
3897
|
// src/blocks/form/submit-button/component-info.ts
|
|
3958
3898
|
var componentInfo16 = {
|
|
3959
|
-
shouldReceiveBuilderProps: {
|
|
3960
|
-
builderBlock: false,
|
|
3961
|
-
builderContext: false,
|
|
3962
|
-
builderComponents: false,
|
|
3963
|
-
builderLinkComponent: false
|
|
3964
|
-
},
|
|
3965
3899
|
name: "Form:SubmitButton",
|
|
3966
3900
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3967
3901
|
defaultStyles: {
|
|
@@ -3996,12 +3930,6 @@ var submit_button_default = SubmitButton;
|
|
|
3996
3930
|
|
|
3997
3931
|
// src/blocks/form/textarea/component-info.ts
|
|
3998
3932
|
var componentInfo17 = {
|
|
3999
|
-
shouldReceiveBuilderProps: {
|
|
4000
|
-
builderBlock: false,
|
|
4001
|
-
builderContext: false,
|
|
4002
|
-
builderComponents: false,
|
|
4003
|
-
builderLinkComponent: false
|
|
4004
|
-
},
|
|
4005
3933
|
name: "Form:TextArea",
|
|
4006
3934
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
4007
3935
|
inputs: [{
|
|
@@ -4055,12 +3983,6 @@ var textarea_default = Textarea;
|
|
|
4055
3983
|
|
|
4056
3984
|
// src/blocks/img/component-info.ts
|
|
4057
3985
|
var componentInfo18 = {
|
|
4058
|
-
shouldReceiveBuilderProps: {
|
|
4059
|
-
builderBlock: false,
|
|
4060
|
-
builderContext: false,
|
|
4061
|
-
builderComponents: false,
|
|
4062
|
-
builderLinkComponent: false
|
|
4063
|
-
},
|
|
4064
3986
|
// friendlyName?
|
|
4065
3987
|
name: "Raw:Img",
|
|
4066
3988
|
hideFromInsertMenu: true,
|
|
@@ -4175,10 +4097,7 @@ var componentInfo19 = {
|
|
|
4175
4097
|
advanced: true
|
|
4176
4098
|
}],
|
|
4177
4099
|
shouldReceiveBuilderProps: {
|
|
4178
|
-
builderBlock: true
|
|
4179
|
-
builderContext: false,
|
|
4180
|
-
builderComponents: false,
|
|
4181
|
-
builderLinkComponent: false
|
|
4100
|
+
builderBlock: true
|
|
4182
4101
|
}
|
|
4183
4102
|
};
|
|
4184
4103
|
|
|
@@ -4402,7 +4321,11 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4402
4321
|
|
|
4403
4322
|
// src/components/inlined-script.tsx
|
|
4404
4323
|
function InlinedScript(props) {
|
|
4405
|
-
return <><script
|
|
4324
|
+
return <><script
|
|
4325
|
+
innerHTML={props.scriptStr}
|
|
4326
|
+
data-id={props.id}
|
|
4327
|
+
nonce={props.nonce || ""}
|
|
4328
|
+
/></>;
|
|
4406
4329
|
}
|
|
4407
4330
|
var Inlined_script_default = InlinedScript;
|
|
4408
4331
|
|
|
@@ -4916,7 +4839,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4916
4839
|
}
|
|
4917
4840
|
|
|
4918
4841
|
// src/constants/sdk-version.ts
|
|
4919
|
-
var SDK_VERSION = "
|
|
4842
|
+
var SDK_VERSION = "2.0.1";
|
|
4920
4843
|
|
|
4921
4844
|
// src/functions/register.ts
|
|
4922
4845
|
var registry = {};
|
|
@@ -5516,6 +5439,7 @@ ${getDefaultStyles(props.isNestedRender)}
|
|
|
5516
5439
|
return <><Inlined_styles_default
|
|
5517
5440
|
id="builderio-content"
|
|
5518
5441
|
styles={injectedStyles()}
|
|
5442
|
+
nonce={props.nonce}
|
|
5519
5443
|
/></>;
|
|
5520
5444
|
}
|
|
5521
5445
|
var Styles_default = ContentStyles;
|
|
@@ -5609,7 +5533,8 @@ function ContentComponent(props) {
|
|
|
5609
5533
|
),
|
|
5610
5534
|
inheritedStyles: {},
|
|
5611
5535
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
5612
|
-
BlocksWrapperProps: props.blocksWrapperProps || {}
|
|
5536
|
+
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
5537
|
+
nonce: props.nonce || ""
|
|
5613
5538
|
});
|
|
5614
5539
|
function contentSetState(newRootState) {
|
|
5615
5540
|
setBuilderContextSignal((PREVIOUS_VALUE) => ({
|
|
@@ -5622,6 +5547,7 @@ function ContentComponent(props) {
|
|
|
5622
5547
|
registeredComponents: registeredComponents()
|
|
5623
5548
|
}}
|
|
5624
5549
|
><Enable_editor_default
|
|
5550
|
+
nonce={props.nonce}
|
|
5625
5551
|
content={props.content}
|
|
5626
5552
|
data={props.data}
|
|
5627
5553
|
model={props.model}
|
|
@@ -5642,8 +5568,10 @@ function ContentComponent(props) {
|
|
|
5642
5568
|
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
5643
5569
|
id="builderio-variant-visibility"
|
|
5644
5570
|
scriptStr={scriptStr()}
|
|
5571
|
+
nonce={props.nonce || ""}
|
|
5645
5572
|
/></Show13>
|
|
5646
5573
|
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
5574
|
+
nonce={props.nonce || ""}
|
|
5647
5575
|
isNestedRender={props.isNestedRender}
|
|
5648
5576
|
contentId={builderContextSignal().content?.id}
|
|
5649
5577
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
@@ -5695,21 +5623,25 @@ function ContentVariants(props) {
|
|
|
5695
5623
|
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5696
5624
|
id="builderio-init-variants-fns"
|
|
5697
5625
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5626
|
+
nonce={props.nonce || ""}
|
|
5698
5627
|
/></Show14>
|
|
5699
5628
|
<Show14 when={shouldRenderVariants()}>
|
|
5700
5629
|
<Inlined_styles_default
|
|
5701
5630
|
id="builderio-variants"
|
|
5702
5631
|
styles={hideVariantsStyleString()}
|
|
5632
|
+
nonce={props.nonce || ""}
|
|
5703
5633
|
/>
|
|
5704
5634
|
<Inlined_script_default
|
|
5705
5635
|
id="builderio-variants-visibility"
|
|
5706
5636
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5637
|
+
nonce={props.nonce || ""}
|
|
5707
5638
|
/>
|
|
5708
5639
|
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5709
5640
|
const index = _index();
|
|
5710
5641
|
return <Content_default
|
|
5711
5642
|
isNestedRender={props.isNestedRender}
|
|
5712
5643
|
key={variant.testVariationId}
|
|
5644
|
+
nonce={props.nonce}
|
|
5713
5645
|
content={variant}
|
|
5714
5646
|
showContent={false}
|
|
5715
5647
|
model={props.model}
|
|
@@ -5732,6 +5664,7 @@ function ContentVariants(props) {
|
|
|
5732
5664
|
}}</For9>
|
|
5733
5665
|
</Show14>
|
|
5734
5666
|
<Content_default
|
|
5667
|
+
nonce={props.nonce}
|
|
5735
5668
|
isNestedRender={props.isNestedRender}
|
|
5736
5669
|
{...{}}
|
|
5737
5670
|
content={defaultContent()}
|
|
@@ -5818,6 +5751,7 @@ function Symbol(props) {
|
|
|
5818
5751
|
}
|
|
5819
5752
|
createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5820
5753
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
5754
|
+
nonce={props.builderContext.nonce}
|
|
5821
5755
|
isNestedRender={true}
|
|
5822
5756
|
apiVersion={props.builderContext.apiVersion}
|
|
5823
5757
|
apiKey={props.builderContext.apiKey}
|