@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/index.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
|
|
@@ -3913,56 +3914,33 @@ var getRepeatItemData = ({
|
|
|
3913
3914
|
}));
|
|
3914
3915
|
return repeatArray;
|
|
3915
3916
|
};
|
|
3916
|
-
var applyDefaults = (shouldReceiveBuilderProps) => {
|
|
3917
|
-
return {
|
|
3918
|
-
// once we bump to a major version, toggle this to `false`.
|
|
3919
|
-
builderBlock: true,
|
|
3920
|
-
// once we bump to a major version, toggle this to `false`.
|
|
3921
|
-
builderContext: true,
|
|
3922
|
-
builderComponents: false,
|
|
3923
|
-
builderLinkComponent: false,
|
|
3924
|
-
...shouldReceiveBuilderProps
|
|
3925
|
-
};
|
|
3926
|
-
};
|
|
3927
3917
|
var provideLinkComponent = (block, linkComponent) => {
|
|
3928
|
-
if (
|
|
3929
|
-
return {
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
return {
|
|
3934
|
-
builderLinkComponent: linkComponent
|
|
3935
|
-
};
|
|
3918
|
+
if (block?.shouldReceiveBuilderProps?.builderLinkComponent)
|
|
3919
|
+
return {
|
|
3920
|
+
builderLinkComponent: linkComponent
|
|
3921
|
+
};
|
|
3922
|
+
return {};
|
|
3936
3923
|
};
|
|
3937
3924
|
var provideRegisteredComponents = (block, registeredComponents) => {
|
|
3938
|
-
if (
|
|
3939
|
-
return {
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
return {
|
|
3944
|
-
builderComponents: registeredComponents
|
|
3945
|
-
};
|
|
3925
|
+
if (block?.shouldReceiveBuilderProps?.builderComponents)
|
|
3926
|
+
return {
|
|
3927
|
+
builderComponents: registeredComponents
|
|
3928
|
+
};
|
|
3929
|
+
return {};
|
|
3946
3930
|
};
|
|
3947
3931
|
var provideBuilderBlock = (block, builderBlock) => {
|
|
3948
|
-
if (
|
|
3949
|
-
return {
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
return {
|
|
3954
|
-
builderBlock
|
|
3955
|
-
};
|
|
3932
|
+
if (block?.shouldReceiveBuilderProps?.builderBlock)
|
|
3933
|
+
return {
|
|
3934
|
+
builderBlock
|
|
3935
|
+
};
|
|
3936
|
+
return {};
|
|
3956
3937
|
};
|
|
3957
3938
|
var provideBuilderContext = (block, context) => {
|
|
3958
|
-
if (
|
|
3959
|
-
return {
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
return {
|
|
3964
|
-
builderContext: context
|
|
3965
|
-
};
|
|
3939
|
+
if (block?.shouldReceiveBuilderProps?.builderContext)
|
|
3940
|
+
return {
|
|
3941
|
+
builderContext: context
|
|
3942
|
+
};
|
|
3943
|
+
return {};
|
|
3966
3944
|
};
|
|
3967
3945
|
|
|
3968
3946
|
// src/components/block/components/block-styles.tsx
|
|
@@ -4019,7 +3997,11 @@ var getSizesForBreakpoints = ({
|
|
|
4019
3997
|
|
|
4020
3998
|
// src/components/inlined-styles.tsx
|
|
4021
3999
|
function InlinedStyles(props) {
|
|
4022
|
-
return <><style
|
|
4000
|
+
return <><style
|
|
4001
|
+
innerHTML={props.styles}
|
|
4002
|
+
data-id={props.id}
|
|
4003
|
+
nonce={props.nonce}
|
|
4004
|
+
/></>;
|
|
4023
4005
|
}
|
|
4024
4006
|
var Inlined_styles_default = InlinedStyles;
|
|
4025
4007
|
|
|
@@ -4105,7 +4087,11 @@ function BlockStyles(props) {
|
|
|
4105
4087
|
hoverStylesClass
|
|
4106
4088
|
].join(" ");
|
|
4107
4089
|
});
|
|
4108
|
-
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
4090
|
+
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
4091
|
+
id="builderio-block"
|
|
4092
|
+
styles={css()}
|
|
4093
|
+
nonce={props.context.nonce}
|
|
4094
|
+
/></Show2></>;
|
|
4109
4095
|
}
|
|
4110
4096
|
var Block_styles_default = BlockStyles;
|
|
4111
4097
|
|
|
@@ -4554,8 +4540,9 @@ function Columns(props) {
|
|
|
4554
4540
|
return cols()[index]?.width || 100 / cols().length;
|
|
4555
4541
|
}
|
|
4556
4542
|
function getColumnCssWidth(index) {
|
|
4557
|
-
const
|
|
4558
|
-
|
|
4543
|
+
const width = getWidth(index);
|
|
4544
|
+
const subtractWidth = gutterSize() * (cols().length - 1) * (width / 100);
|
|
4545
|
+
return `calc(${width}% - ${subtractWidth}px)`;
|
|
4559
4546
|
}
|
|
4560
4547
|
function getTabletStyle({
|
|
4561
4548
|
stackedStyle,
|
|
@@ -4657,13 +4644,14 @@ function Columns(props) {
|
|
|
4657
4644
|
}
|
|
4658
4645
|
return <>
|
|
4659
4646
|
<div
|
|
4660
|
-
class={getColumnsClass(props.builderBlock?.id) + " div-
|
|
4647
|
+
class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
|
|
4661
4648
|
style={columnsCssVars()}
|
|
4662
4649
|
{...{}}
|
|
4663
4650
|
>
|
|
4664
4651
|
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default
|
|
4665
4652
|
id="builderio-columns"
|
|
4666
4653
|
styles={columnsStyles()}
|
|
4654
|
+
nonce={props.builderContext.nonce}
|
|
4667
4655
|
/></Show6>
|
|
4668
4656
|
<For4 each={props.columns}>{(column, _index) => {
|
|
4669
4657
|
const index = _index();
|
|
@@ -4685,7 +4673,7 @@ function Columns(props) {
|
|
|
4685
4673
|
/></Dynamic_renderer_default>;
|
|
4686
4674
|
}}</For4>
|
|
4687
4675
|
</div>
|
|
4688
|
-
<style>{`.div-
|
|
4676
|
+
<style>{`.div-5b8fb3ac {
|
|
4689
4677
|
display: flex;
|
|
4690
4678
|
line-height: normal;
|
|
4691
4679
|
}`}</style>
|
|
@@ -5382,9 +5370,6 @@ var componentInfo2 = {
|
|
|
5382
5370
|
static: true,
|
|
5383
5371
|
noWrap: true,
|
|
5384
5372
|
shouldReceiveBuilderProps: {
|
|
5385
|
-
builderBlock: false,
|
|
5386
|
-
builderContext: false,
|
|
5387
|
-
builderComponents: false,
|
|
5388
5373
|
builderLinkComponent: true
|
|
5389
5374
|
}
|
|
5390
5375
|
};
|
|
@@ -5617,12 +5602,6 @@ var componentInfo3 = {
|
|
|
5617
5602
|
|
|
5618
5603
|
// src/blocks/fragment/component-info.ts
|
|
5619
5604
|
var componentInfo4 = {
|
|
5620
|
-
shouldReceiveBuilderProps: {
|
|
5621
|
-
builderBlock: false,
|
|
5622
|
-
builderContext: false,
|
|
5623
|
-
builderComponents: false,
|
|
5624
|
-
builderLinkComponent: false
|
|
5625
|
-
},
|
|
5626
5605
|
name: "Fragment",
|
|
5627
5606
|
static: true,
|
|
5628
5607
|
hidden: true,
|
|
@@ -5756,21 +5735,12 @@ var componentInfo5 = {
|
|
|
5756
5735
|
defaultValue: 0.7041
|
|
5757
5736
|
}],
|
|
5758
5737
|
shouldReceiveBuilderProps: {
|
|
5759
|
-
builderBlock: true
|
|
5760
|
-
builderContext: false,
|
|
5761
|
-
builderComponents: false,
|
|
5762
|
-
builderLinkComponent: false
|
|
5738
|
+
builderBlock: true
|
|
5763
5739
|
}
|
|
5764
5740
|
};
|
|
5765
5741
|
|
|
5766
5742
|
// src/blocks/section/component-info.ts
|
|
5767
5743
|
var componentInfo6 = {
|
|
5768
|
-
shouldReceiveBuilderProps: {
|
|
5769
|
-
builderBlock: false,
|
|
5770
|
-
builderContext: false,
|
|
5771
|
-
builderComponents: false,
|
|
5772
|
-
builderLinkComponent: false
|
|
5773
|
-
},
|
|
5774
5744
|
name: "Core:Section",
|
|
5775
5745
|
static: true,
|
|
5776
5746
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -5826,10 +5796,7 @@ var componentInfo7 = {
|
|
|
5826
5796
|
defaultValue: "children"
|
|
5827
5797
|
}],
|
|
5828
5798
|
shouldReceiveBuilderProps: {
|
|
5829
|
-
|
|
5830
|
-
builderContext: true,
|
|
5831
|
-
builderComponents: false,
|
|
5832
|
-
builderLinkComponent: false
|
|
5799
|
+
builderContext: true
|
|
5833
5800
|
}
|
|
5834
5801
|
};
|
|
5835
5802
|
|
|
@@ -6097,10 +6064,7 @@ var tabs_default = Tabs;
|
|
|
6097
6064
|
// src/blocks/text/component-info.ts
|
|
6098
6065
|
var componentInfo10 = {
|
|
6099
6066
|
shouldReceiveBuilderProps: {
|
|
6100
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
6101
|
-
builderContext: false,
|
|
6102
|
-
builderComponents: false,
|
|
6103
|
-
builderLinkComponent: false
|
|
6067
|
+
builderBlock: TARGET === "reactNative" ? true : false
|
|
6104
6068
|
},
|
|
6105
6069
|
name: "Text",
|
|
6106
6070
|
static: true,
|
|
@@ -6135,12 +6099,6 @@ var text_default = Text;
|
|
|
6135
6099
|
|
|
6136
6100
|
// src/blocks/custom-code/component-info.ts
|
|
6137
6101
|
var componentInfo11 = {
|
|
6138
|
-
shouldReceiveBuilderProps: {
|
|
6139
|
-
builderBlock: false,
|
|
6140
|
-
builderContext: false,
|
|
6141
|
-
builderComponents: false,
|
|
6142
|
-
builderLinkComponent: false
|
|
6143
|
-
},
|
|
6144
6102
|
name: "Custom Code",
|
|
6145
6103
|
static: true,
|
|
6146
6104
|
requiredPermissions: ["editCode"],
|
|
@@ -6212,12 +6170,6 @@ var custom_code_default = CustomCode;
|
|
|
6212
6170
|
|
|
6213
6171
|
// src/blocks/embed/component-info.ts
|
|
6214
6172
|
var componentInfo12 = {
|
|
6215
|
-
shouldReceiveBuilderProps: {
|
|
6216
|
-
builderBlock: false,
|
|
6217
|
-
builderContext: false,
|
|
6218
|
-
builderComponents: false,
|
|
6219
|
-
builderLinkComponent: false
|
|
6220
|
-
},
|
|
6221
6173
|
name: "Embed",
|
|
6222
6174
|
static: true,
|
|
6223
6175
|
inputs: [{
|
|
@@ -6777,12 +6729,6 @@ var form_default = FormComponent;
|
|
|
6777
6729
|
|
|
6778
6730
|
// src/blocks/form/input/component-info.ts
|
|
6779
6731
|
var componentInfo14 = {
|
|
6780
|
-
shouldReceiveBuilderProps: {
|
|
6781
|
-
builderBlock: false,
|
|
6782
|
-
builderContext: false,
|
|
6783
|
-
builderComponents: false,
|
|
6784
|
-
builderLinkComponent: false
|
|
6785
|
-
},
|
|
6786
6732
|
name: "Form:Input",
|
|
6787
6733
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6788
6734
|
inputs: [
|
|
@@ -6853,12 +6799,6 @@ var input_default = FormInputComponent;
|
|
|
6853
6799
|
|
|
6854
6800
|
// src/blocks/form/select/component-info.ts
|
|
6855
6801
|
var componentInfo15 = {
|
|
6856
|
-
shouldReceiveBuilderProps: {
|
|
6857
|
-
builderBlock: false,
|
|
6858
|
-
builderContext: false,
|
|
6859
|
-
builderComponents: false,
|
|
6860
|
-
builderLinkComponent: false
|
|
6861
|
-
},
|
|
6862
6802
|
name: "Form:Select",
|
|
6863
6803
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6864
6804
|
defaultStyles: {
|
|
@@ -6922,12 +6862,6 @@ var select_default = SelectComponent;
|
|
|
6922
6862
|
|
|
6923
6863
|
// src/blocks/form/submit-button/component-info.ts
|
|
6924
6864
|
var componentInfo16 = {
|
|
6925
|
-
shouldReceiveBuilderProps: {
|
|
6926
|
-
builderBlock: false,
|
|
6927
|
-
builderContext: false,
|
|
6928
|
-
builderComponents: false,
|
|
6929
|
-
builderLinkComponent: false
|
|
6930
|
-
},
|
|
6931
6865
|
name: "Form:SubmitButton",
|
|
6932
6866
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
6933
6867
|
defaultStyles: {
|
|
@@ -6962,12 +6896,6 @@ var submit_button_default = SubmitButton;
|
|
|
6962
6896
|
|
|
6963
6897
|
// src/blocks/form/textarea/component-info.ts
|
|
6964
6898
|
var componentInfo17 = {
|
|
6965
|
-
shouldReceiveBuilderProps: {
|
|
6966
|
-
builderBlock: false,
|
|
6967
|
-
builderContext: false,
|
|
6968
|
-
builderComponents: false,
|
|
6969
|
-
builderLinkComponent: false
|
|
6970
|
-
},
|
|
6971
6899
|
name: "Form:TextArea",
|
|
6972
6900
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
6973
6901
|
inputs: [{
|
|
@@ -7021,12 +6949,6 @@ var textarea_default = Textarea;
|
|
|
7021
6949
|
|
|
7022
6950
|
// src/blocks/img/component-info.ts
|
|
7023
6951
|
var componentInfo18 = {
|
|
7024
|
-
shouldReceiveBuilderProps: {
|
|
7025
|
-
builderBlock: false,
|
|
7026
|
-
builderContext: false,
|
|
7027
|
-
builderComponents: false,
|
|
7028
|
-
builderLinkComponent: false
|
|
7029
|
-
},
|
|
7030
6952
|
// friendlyName?
|
|
7031
6953
|
name: "Raw:Img",
|
|
7032
6954
|
hideFromInsertMenu: true,
|
|
@@ -7141,10 +7063,7 @@ var componentInfo19 = {
|
|
|
7141
7063
|
advanced: true
|
|
7142
7064
|
}],
|
|
7143
7065
|
shouldReceiveBuilderProps: {
|
|
7144
|
-
builderBlock: true
|
|
7145
|
-
builderContext: false,
|
|
7146
|
-
builderComponents: false,
|
|
7147
|
-
builderLinkComponent: false
|
|
7066
|
+
builderBlock: true
|
|
7148
7067
|
}
|
|
7149
7068
|
};
|
|
7150
7069
|
|
|
@@ -7368,7 +7287,11 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7368
7287
|
|
|
7369
7288
|
// src/components/inlined-script.tsx
|
|
7370
7289
|
function InlinedScript(props) {
|
|
7371
|
-
return <><script
|
|
7290
|
+
return <><script
|
|
7291
|
+
innerHTML={props.scriptStr}
|
|
7292
|
+
data-id={props.id}
|
|
7293
|
+
nonce={props.nonce || ""}
|
|
7294
|
+
/></>;
|
|
7372
7295
|
}
|
|
7373
7296
|
var Inlined_script_default = InlinedScript;
|
|
7374
7297
|
|
|
@@ -7877,7 +7800,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7877
7800
|
}
|
|
7878
7801
|
|
|
7879
7802
|
// src/constants/sdk-version.ts
|
|
7880
|
-
var SDK_VERSION = "
|
|
7803
|
+
var SDK_VERSION = "2.0.1";
|
|
7881
7804
|
|
|
7882
7805
|
// src/functions/register.ts
|
|
7883
7806
|
var registry = {};
|
|
@@ -8475,6 +8398,7 @@ ${getDefaultStyles(props.isNestedRender)}
|
|
|
8475
8398
|
return <><Inlined_styles_default
|
|
8476
8399
|
id="builderio-content"
|
|
8477
8400
|
styles={injectedStyles()}
|
|
8401
|
+
nonce={props.nonce}
|
|
8478
8402
|
/></>;
|
|
8479
8403
|
}
|
|
8480
8404
|
var Styles_default = ContentStyles;
|
|
@@ -8568,7 +8492,8 @@ function ContentComponent(props) {
|
|
|
8568
8492
|
),
|
|
8569
8493
|
inheritedStyles: {},
|
|
8570
8494
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
8571
|
-
BlocksWrapperProps: props.blocksWrapperProps || {}
|
|
8495
|
+
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
8496
|
+
nonce: props.nonce || ""
|
|
8572
8497
|
});
|
|
8573
8498
|
function contentSetState(newRootState) {
|
|
8574
8499
|
setBuilderContextSignal((PREVIOUS_VALUE) => ({
|
|
@@ -8581,6 +8506,7 @@ function ContentComponent(props) {
|
|
|
8581
8506
|
registeredComponents: registeredComponents()
|
|
8582
8507
|
}}
|
|
8583
8508
|
><Enable_editor_default
|
|
8509
|
+
nonce={props.nonce}
|
|
8584
8510
|
content={props.content}
|
|
8585
8511
|
data={props.data}
|
|
8586
8512
|
model={props.model}
|
|
@@ -8601,8 +8527,10 @@ function ContentComponent(props) {
|
|
|
8601
8527
|
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
8602
8528
|
id="builderio-variant-visibility"
|
|
8603
8529
|
scriptStr={scriptStr()}
|
|
8530
|
+
nonce={props.nonce || ""}
|
|
8604
8531
|
/></Show13>
|
|
8605
8532
|
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
8533
|
+
nonce={props.nonce || ""}
|
|
8606
8534
|
isNestedRender={props.isNestedRender}
|
|
8607
8535
|
contentId={builderContextSignal().content?.id}
|
|
8608
8536
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
@@ -8654,21 +8582,25 @@ function ContentVariants(props) {
|
|
|
8654
8582
|
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
8655
8583
|
id="builderio-init-variants-fns"
|
|
8656
8584
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
8585
|
+
nonce={props.nonce || ""}
|
|
8657
8586
|
/></Show14>
|
|
8658
8587
|
<Show14 when={shouldRenderVariants()}>
|
|
8659
8588
|
<Inlined_styles_default
|
|
8660
8589
|
id="builderio-variants"
|
|
8661
8590
|
styles={hideVariantsStyleString()}
|
|
8591
|
+
nonce={props.nonce || ""}
|
|
8662
8592
|
/>
|
|
8663
8593
|
<Inlined_script_default
|
|
8664
8594
|
id="builderio-variants-visibility"
|
|
8665
8595
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
8596
|
+
nonce={props.nonce || ""}
|
|
8666
8597
|
/>
|
|
8667
8598
|
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
8668
8599
|
const index = _index();
|
|
8669
8600
|
return <Content_default
|
|
8670
8601
|
isNestedRender={props.isNestedRender}
|
|
8671
8602
|
key={variant.testVariationId}
|
|
8603
|
+
nonce={props.nonce}
|
|
8672
8604
|
content={variant}
|
|
8673
8605
|
showContent={false}
|
|
8674
8606
|
model={props.model}
|
|
@@ -8691,6 +8623,7 @@ function ContentVariants(props) {
|
|
|
8691
8623
|
}}</For9>
|
|
8692
8624
|
</Show14>
|
|
8693
8625
|
<Content_default
|
|
8626
|
+
nonce={props.nonce}
|
|
8694
8627
|
isNestedRender={props.isNestedRender}
|
|
8695
8628
|
{...{}}
|
|
8696
8629
|
content={defaultContent()}
|
|
@@ -8777,6 +8710,7 @@ function Symbol2(props) {
|
|
|
8777
8710
|
}
|
|
8778
8711
|
createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8779
8712
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
8713
|
+
nonce={props.builderContext.nonce}
|
|
8780
8714
|
isNestedRender={true}
|
|
8781
8715
|
apiVersion={props.builderContext.apiVersion}
|
|
8782
8716
|
apiKey={props.builderContext.apiKey}
|