@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/edge/dev.jsx
CHANGED
|
@@ -102,7 +102,8 @@ var builder_context_default = createContext({
|
|
|
102
102
|
componentInfos: {},
|
|
103
103
|
inheritedStyles: {},
|
|
104
104
|
BlocksWrapper: "div",
|
|
105
|
-
BlocksWrapperProps: {}
|
|
105
|
+
BlocksWrapperProps: {},
|
|
106
|
+
nonce: ""
|
|
106
107
|
});
|
|
107
108
|
|
|
108
109
|
// src/context/components.context.ts
|
|
@@ -3919,56 +3920,33 @@ var getRepeatItemData = ({
|
|
|
3919
3920
|
}));
|
|
3920
3921
|
return repeatArray;
|
|
3921
3922
|
};
|
|
3922
|
-
var applyDefaults = (shouldReceiveBuilderProps) => {
|
|
3923
|
-
return {
|
|
3924
|
-
// once we bump to a major version, toggle this to `false`.
|
|
3925
|
-
builderBlock: true,
|
|
3926
|
-
// once we bump to a major version, toggle this to `false`.
|
|
3927
|
-
builderContext: true,
|
|
3928
|
-
builderComponents: false,
|
|
3929
|
-
builderLinkComponent: false,
|
|
3930
|
-
...shouldReceiveBuilderProps
|
|
3931
|
-
};
|
|
3932
|
-
};
|
|
3933
3923
|
var provideLinkComponent = (block, linkComponent) => {
|
|
3934
|
-
if (
|
|
3935
|
-
return {
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
return {
|
|
3940
|
-
builderLinkComponent: linkComponent
|
|
3941
|
-
};
|
|
3924
|
+
if (block?.shouldReceiveBuilderProps?.builderLinkComponent)
|
|
3925
|
+
return {
|
|
3926
|
+
builderLinkComponent: linkComponent
|
|
3927
|
+
};
|
|
3928
|
+
return {};
|
|
3942
3929
|
};
|
|
3943
3930
|
var provideRegisteredComponents = (block, registeredComponents) => {
|
|
3944
|
-
if (
|
|
3945
|
-
return {
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
return {
|
|
3950
|
-
builderComponents: registeredComponents
|
|
3951
|
-
};
|
|
3931
|
+
if (block?.shouldReceiveBuilderProps?.builderComponents)
|
|
3932
|
+
return {
|
|
3933
|
+
builderComponents: registeredComponents
|
|
3934
|
+
};
|
|
3935
|
+
return {};
|
|
3952
3936
|
};
|
|
3953
3937
|
var provideBuilderBlock = (block, builderBlock) => {
|
|
3954
|
-
if (
|
|
3955
|
-
return {
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
return {
|
|
3960
|
-
builderBlock
|
|
3961
|
-
};
|
|
3938
|
+
if (block?.shouldReceiveBuilderProps?.builderBlock)
|
|
3939
|
+
return {
|
|
3940
|
+
builderBlock
|
|
3941
|
+
};
|
|
3942
|
+
return {};
|
|
3962
3943
|
};
|
|
3963
3944
|
var provideBuilderContext = (block, context) => {
|
|
3964
|
-
if (
|
|
3965
|
-
return {
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
return {
|
|
3970
|
-
builderContext: context
|
|
3971
|
-
};
|
|
3945
|
+
if (block?.shouldReceiveBuilderProps?.builderContext)
|
|
3946
|
+
return {
|
|
3947
|
+
builderContext: context
|
|
3948
|
+
};
|
|
3949
|
+
return {};
|
|
3972
3950
|
};
|
|
3973
3951
|
|
|
3974
3952
|
// src/components/block/components/block-styles.tsx
|
|
@@ -4025,7 +4003,11 @@ var getSizesForBreakpoints = ({
|
|
|
4025
4003
|
|
|
4026
4004
|
// src/components/inlined-styles.tsx
|
|
4027
4005
|
function InlinedStyles(props) {
|
|
4028
|
-
return <><style
|
|
4006
|
+
return <><style
|
|
4007
|
+
innerHTML={props.styles}
|
|
4008
|
+
data-id={props.id}
|
|
4009
|
+
nonce={props.nonce}
|
|
4010
|
+
/></>;
|
|
4029
4011
|
}
|
|
4030
4012
|
var Inlined_styles_default = InlinedStyles;
|
|
4031
4013
|
|
|
@@ -4111,7 +4093,11 @@ function BlockStyles(props) {
|
|
|
4111
4093
|
hoverStylesClass
|
|
4112
4094
|
].join(" ");
|
|
4113
4095
|
});
|
|
4114
|
-
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
4096
|
+
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
4097
|
+
id="builderio-block"
|
|
4098
|
+
styles={css()}
|
|
4099
|
+
nonce={props.context.nonce}
|
|
4100
|
+
/></Show2></>;
|
|
4115
4101
|
}
|
|
4116
4102
|
var Block_styles_default = BlockStyles;
|
|
4117
4103
|
|
|
@@ -4560,8 +4546,9 @@ function Columns(props) {
|
|
|
4560
4546
|
return cols()[index]?.width || 100 / cols().length;
|
|
4561
4547
|
}
|
|
4562
4548
|
function getColumnCssWidth(index) {
|
|
4563
|
-
const
|
|
4564
|
-
|
|
4549
|
+
const width = getWidth(index);
|
|
4550
|
+
const subtractWidth = gutterSize() * (cols().length - 1) * (width / 100);
|
|
4551
|
+
return `calc(${width}% - ${subtractWidth}px)`;
|
|
4565
4552
|
}
|
|
4566
4553
|
function getTabletStyle({
|
|
4567
4554
|
stackedStyle,
|
|
@@ -4663,13 +4650,14 @@ function Columns(props) {
|
|
|
4663
4650
|
}
|
|
4664
4651
|
return <>
|
|
4665
4652
|
<div
|
|
4666
|
-
class={getColumnsClass(props.builderBlock?.id) + " div-
|
|
4653
|
+
class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
|
|
4667
4654
|
style={columnsCssVars()}
|
|
4668
4655
|
{...{}}
|
|
4669
4656
|
>
|
|
4670
4657
|
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default
|
|
4671
4658
|
id="builderio-columns"
|
|
4672
4659
|
styles={columnsStyles()}
|
|
4660
|
+
nonce={props.builderContext.nonce}
|
|
4673
4661
|
/></Show6>
|
|
4674
4662
|
<For4 each={props.columns}>{(column, _index) => {
|
|
4675
4663
|
const index = _index();
|
|
@@ -4691,7 +4679,7 @@ function Columns(props) {
|
|
|
4691
4679
|
/></Dynamic_renderer_default>;
|
|
4692
4680
|
}}</For4>
|
|
4693
4681
|
</div>
|
|
4694
|
-
<style>{`.div-
|
|
4682
|
+
<style>{`.div-5b8fb3ac {
|
|
4695
4683
|
display: flex;
|
|
4696
4684
|
line-height: normal;
|
|
4697
4685
|
}`}</style>
|
|
@@ -5389,9 +5377,6 @@ var componentInfo2 = {
|
|
|
5389
5377
|
static: true,
|
|
5390
5378
|
noWrap: true,
|
|
5391
5379
|
shouldReceiveBuilderProps: {
|
|
5392
|
-
builderBlock: false,
|
|
5393
|
-
builderContext: false,
|
|
5394
|
-
builderComponents: false,
|
|
5395
5380
|
builderLinkComponent: true
|
|
5396
5381
|
}
|
|
5397
5382
|
};
|
|
@@ -5624,12 +5609,6 @@ var componentInfo3 = {
|
|
|
5624
5609
|
|
|
5625
5610
|
// src/blocks/fragment/component-info.ts
|
|
5626
5611
|
var componentInfo4 = {
|
|
5627
|
-
shouldReceiveBuilderProps: {
|
|
5628
|
-
builderBlock: false,
|
|
5629
|
-
builderContext: false,
|
|
5630
|
-
builderComponents: false,
|
|
5631
|
-
builderLinkComponent: false
|
|
5632
|
-
},
|
|
5633
5612
|
name: "Fragment",
|
|
5634
5613
|
static: true,
|
|
5635
5614
|
hidden: true,
|
|
@@ -5764,21 +5743,12 @@ var componentInfo5 = {
|
|
|
5764
5743
|
defaultValue: 0.7041
|
|
5765
5744
|
}],
|
|
5766
5745
|
shouldReceiveBuilderProps: {
|
|
5767
|
-
builderBlock: true
|
|
5768
|
-
builderContext: false,
|
|
5769
|
-
builderComponents: false,
|
|
5770
|
-
builderLinkComponent: false
|
|
5746
|
+
builderBlock: true
|
|
5771
5747
|
}
|
|
5772
5748
|
};
|
|
5773
5749
|
|
|
5774
5750
|
// src/blocks/section/component-info.ts
|
|
5775
5751
|
var componentInfo6 = {
|
|
5776
|
-
shouldReceiveBuilderProps: {
|
|
5777
|
-
builderBlock: false,
|
|
5778
|
-
builderContext: false,
|
|
5779
|
-
builderComponents: false,
|
|
5780
|
-
builderLinkComponent: false
|
|
5781
|
-
},
|
|
5782
5752
|
name: "Core:Section",
|
|
5783
5753
|
static: true,
|
|
5784
5754
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -5834,10 +5804,7 @@ var componentInfo7 = {
|
|
|
5834
5804
|
defaultValue: "children"
|
|
5835
5805
|
}],
|
|
5836
5806
|
shouldReceiveBuilderProps: {
|
|
5837
|
-
|
|
5838
|
-
builderContext: true,
|
|
5839
|
-
builderComponents: false,
|
|
5840
|
-
builderLinkComponent: false
|
|
5807
|
+
builderContext: true
|
|
5841
5808
|
}
|
|
5842
5809
|
};
|
|
5843
5810
|
|
|
@@ -6105,10 +6072,7 @@ var tabs_default = Tabs;
|
|
|
6105
6072
|
// src/blocks/text/component-info.ts
|
|
6106
6073
|
var componentInfo10 = {
|
|
6107
6074
|
shouldReceiveBuilderProps: {
|
|
6108
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
6109
|
-
builderContext: false,
|
|
6110
|
-
builderComponents: false,
|
|
6111
|
-
builderLinkComponent: false
|
|
6075
|
+
builderBlock: TARGET === "reactNative" ? true : false
|
|
6112
6076
|
},
|
|
6113
6077
|
name: "Text",
|
|
6114
6078
|
static: true,
|
|
@@ -6143,12 +6107,6 @@ var text_default = Text;
|
|
|
6143
6107
|
|
|
6144
6108
|
// src/blocks/custom-code/component-info.ts
|
|
6145
6109
|
var componentInfo11 = {
|
|
6146
|
-
shouldReceiveBuilderProps: {
|
|
6147
|
-
builderBlock: false,
|
|
6148
|
-
builderContext: false,
|
|
6149
|
-
builderComponents: false,
|
|
6150
|
-
builderLinkComponent: false
|
|
6151
|
-
},
|
|
6152
6110
|
name: "Custom Code",
|
|
6153
6111
|
static: true,
|
|
6154
6112
|
requiredPermissions: ["editCode"],
|
|
@@ -6221,12 +6179,6 @@ var custom_code_default = CustomCode;
|
|
|
6221
6179
|
|
|
6222
6180
|
// src/blocks/embed/component-info.ts
|
|
6223
6181
|
var componentInfo12 = {
|
|
6224
|
-
shouldReceiveBuilderProps: {
|
|
6225
|
-
builderBlock: false,
|
|
6226
|
-
builderContext: false,
|
|
6227
|
-
builderComponents: false,
|
|
6228
|
-
builderLinkComponent: false
|
|
6229
|
-
},
|
|
6230
6182
|
name: "Embed",
|
|
6231
6183
|
static: true,
|
|
6232
6184
|
inputs: [{
|
|
@@ -6787,12 +6739,6 @@ var form_default = FormComponent;
|
|
|
6787
6739
|
|
|
6788
6740
|
// src/blocks/form/input/component-info.ts
|
|
6789
6741
|
var componentInfo14 = {
|
|
6790
|
-
shouldReceiveBuilderProps: {
|
|
6791
|
-
builderBlock: false,
|
|
6792
|
-
builderContext: false,
|
|
6793
|
-
builderComponents: false,
|
|
6794
|
-
builderLinkComponent: false
|
|
6795
|
-
},
|
|
6796
6742
|
name: "Form:Input",
|
|
6797
6743
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6798
6744
|
inputs: [
|
|
@@ -6863,12 +6809,6 @@ var input_default = FormInputComponent;
|
|
|
6863
6809
|
|
|
6864
6810
|
// src/blocks/form/select/component-info.ts
|
|
6865
6811
|
var componentInfo15 = {
|
|
6866
|
-
shouldReceiveBuilderProps: {
|
|
6867
|
-
builderBlock: false,
|
|
6868
|
-
builderContext: false,
|
|
6869
|
-
builderComponents: false,
|
|
6870
|
-
builderLinkComponent: false
|
|
6871
|
-
},
|
|
6872
6812
|
name: "Form:Select",
|
|
6873
6813
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6874
6814
|
defaultStyles: {
|
|
@@ -6932,12 +6872,6 @@ var select_default = SelectComponent;
|
|
|
6932
6872
|
|
|
6933
6873
|
// src/blocks/form/submit-button/component-info.ts
|
|
6934
6874
|
var componentInfo16 = {
|
|
6935
|
-
shouldReceiveBuilderProps: {
|
|
6936
|
-
builderBlock: false,
|
|
6937
|
-
builderContext: false,
|
|
6938
|
-
builderComponents: false,
|
|
6939
|
-
builderLinkComponent: false
|
|
6940
|
-
},
|
|
6941
6875
|
name: "Form:SubmitButton",
|
|
6942
6876
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
6943
6877
|
defaultStyles: {
|
|
@@ -6972,12 +6906,6 @@ var submit_button_default = SubmitButton;
|
|
|
6972
6906
|
|
|
6973
6907
|
// src/blocks/form/textarea/component-info.ts
|
|
6974
6908
|
var componentInfo17 = {
|
|
6975
|
-
shouldReceiveBuilderProps: {
|
|
6976
|
-
builderBlock: false,
|
|
6977
|
-
builderContext: false,
|
|
6978
|
-
builderComponents: false,
|
|
6979
|
-
builderLinkComponent: false
|
|
6980
|
-
},
|
|
6981
6909
|
name: "Form:TextArea",
|
|
6982
6910
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
6983
6911
|
inputs: [{
|
|
@@ -7031,12 +6959,6 @@ var textarea_default = Textarea;
|
|
|
7031
6959
|
|
|
7032
6960
|
// src/blocks/img/component-info.ts
|
|
7033
6961
|
var componentInfo18 = {
|
|
7034
|
-
shouldReceiveBuilderProps: {
|
|
7035
|
-
builderBlock: false,
|
|
7036
|
-
builderContext: false,
|
|
7037
|
-
builderComponents: false,
|
|
7038
|
-
builderLinkComponent: false
|
|
7039
|
-
},
|
|
7040
6962
|
// friendlyName?
|
|
7041
6963
|
name: "Raw:Img",
|
|
7042
6964
|
hideFromInsertMenu: true,
|
|
@@ -7151,10 +7073,7 @@ var componentInfo19 = {
|
|
|
7151
7073
|
advanced: true
|
|
7152
7074
|
}],
|
|
7153
7075
|
shouldReceiveBuilderProps: {
|
|
7154
|
-
builderBlock: true
|
|
7155
|
-
builderContext: false,
|
|
7156
|
-
builderComponents: false,
|
|
7157
|
-
builderLinkComponent: false
|
|
7076
|
+
builderBlock: true
|
|
7158
7077
|
}
|
|
7159
7078
|
};
|
|
7160
7079
|
|
|
@@ -7378,7 +7297,11 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7378
7297
|
|
|
7379
7298
|
// src/components/inlined-script.tsx
|
|
7380
7299
|
function InlinedScript(props) {
|
|
7381
|
-
return <><script
|
|
7300
|
+
return <><script
|
|
7301
|
+
innerHTML={props.scriptStr}
|
|
7302
|
+
data-id={props.id}
|
|
7303
|
+
nonce={props.nonce || ""}
|
|
7304
|
+
/></>;
|
|
7382
7305
|
}
|
|
7383
7306
|
var Inlined_script_default = InlinedScript;
|
|
7384
7307
|
|
|
@@ -7892,7 +7815,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7892
7815
|
}
|
|
7893
7816
|
|
|
7894
7817
|
// src/constants/sdk-version.ts
|
|
7895
|
-
var SDK_VERSION = "
|
|
7818
|
+
var SDK_VERSION = "2.0.1";
|
|
7896
7819
|
|
|
7897
7820
|
// src/functions/register.ts
|
|
7898
7821
|
var registry = {};
|
|
@@ -8492,6 +8415,7 @@ ${getDefaultStyles(props.isNestedRender)}
|
|
|
8492
8415
|
return <><Inlined_styles_default
|
|
8493
8416
|
id="builderio-content"
|
|
8494
8417
|
styles={injectedStyles()}
|
|
8418
|
+
nonce={props.nonce}
|
|
8495
8419
|
/></>;
|
|
8496
8420
|
}
|
|
8497
8421
|
var Styles_default = ContentStyles;
|
|
@@ -8585,7 +8509,8 @@ function ContentComponent(props) {
|
|
|
8585
8509
|
),
|
|
8586
8510
|
inheritedStyles: {},
|
|
8587
8511
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
8588
|
-
BlocksWrapperProps: props.blocksWrapperProps || {}
|
|
8512
|
+
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
8513
|
+
nonce: props.nonce || ""
|
|
8589
8514
|
});
|
|
8590
8515
|
function contentSetState(newRootState) {
|
|
8591
8516
|
setBuilderContextSignal((PREVIOUS_VALUE) => ({
|
|
@@ -8598,6 +8523,7 @@ function ContentComponent(props) {
|
|
|
8598
8523
|
registeredComponents: registeredComponents()
|
|
8599
8524
|
}}
|
|
8600
8525
|
><Enable_editor_default
|
|
8526
|
+
nonce={props.nonce}
|
|
8601
8527
|
content={props.content}
|
|
8602
8528
|
data={props.data}
|
|
8603
8529
|
model={props.model}
|
|
@@ -8618,8 +8544,10 @@ function ContentComponent(props) {
|
|
|
8618
8544
|
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
8619
8545
|
id="builderio-variant-visibility"
|
|
8620
8546
|
scriptStr={scriptStr()}
|
|
8547
|
+
nonce={props.nonce || ""}
|
|
8621
8548
|
/></Show13>
|
|
8622
8549
|
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
8550
|
+
nonce={props.nonce || ""}
|
|
8623
8551
|
isNestedRender={props.isNestedRender}
|
|
8624
8552
|
contentId={builderContextSignal().content?.id}
|
|
8625
8553
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
@@ -8671,21 +8599,25 @@ function ContentVariants(props) {
|
|
|
8671
8599
|
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
8672
8600
|
id="builderio-init-variants-fns"
|
|
8673
8601
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
8602
|
+
nonce={props.nonce || ""}
|
|
8674
8603
|
/></Show14>
|
|
8675
8604
|
<Show14 when={shouldRenderVariants()}>
|
|
8676
8605
|
<Inlined_styles_default
|
|
8677
8606
|
id="builderio-variants"
|
|
8678
8607
|
styles={hideVariantsStyleString()}
|
|
8608
|
+
nonce={props.nonce || ""}
|
|
8679
8609
|
/>
|
|
8680
8610
|
<Inlined_script_default
|
|
8681
8611
|
id="builderio-variants-visibility"
|
|
8682
8612
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
8613
|
+
nonce={props.nonce || ""}
|
|
8683
8614
|
/>
|
|
8684
8615
|
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
8685
8616
|
const index = _index();
|
|
8686
8617
|
return <Content_default
|
|
8687
8618
|
isNestedRender={props.isNestedRender}
|
|
8688
8619
|
key={variant.testVariationId}
|
|
8620
|
+
nonce={props.nonce}
|
|
8689
8621
|
content={variant}
|
|
8690
8622
|
showContent={false}
|
|
8691
8623
|
model={props.model}
|
|
@@ -8708,6 +8640,7 @@ function ContentVariants(props) {
|
|
|
8708
8640
|
}}</For9>
|
|
8709
8641
|
</Show14>
|
|
8710
8642
|
<Content_default
|
|
8643
|
+
nonce={props.nonce}
|
|
8711
8644
|
isNestedRender={props.isNestedRender}
|
|
8712
8645
|
{...{}}
|
|
8713
8646
|
content={defaultContent()}
|
|
@@ -8794,6 +8727,7 @@ function Symbol2(props) {
|
|
|
8794
8727
|
}
|
|
8795
8728
|
createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8796
8729
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
8730
|
+
nonce={props.builderContext.nonce}
|
|
8797
8731
|
isNestedRender={true}
|
|
8798
8732
|
apiVersion={props.builderContext.apiVersion}
|
|
8799
8733
|
apiKey={props.builderContext.apiKey}
|