@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/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
|
|
@@ -771,56 +772,33 @@ var getRepeatItemData = ({
|
|
|
771
772
|
}));
|
|
772
773
|
return repeatArray;
|
|
773
774
|
};
|
|
774
|
-
var applyDefaults = (shouldReceiveBuilderProps) => {
|
|
775
|
-
return {
|
|
776
|
-
// once we bump to a major version, toggle this to `false`.
|
|
777
|
-
builderBlock: true,
|
|
778
|
-
// once we bump to a major version, toggle this to `false`.
|
|
779
|
-
builderContext: true,
|
|
780
|
-
builderComponents: false,
|
|
781
|
-
builderLinkComponent: false,
|
|
782
|
-
...shouldReceiveBuilderProps
|
|
783
|
-
};
|
|
784
|
-
};
|
|
785
775
|
var provideLinkComponent = (block, linkComponent) => {
|
|
786
|
-
if (
|
|
787
|
-
return {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
return {
|
|
792
|
-
builderLinkComponent: linkComponent
|
|
793
|
-
};
|
|
776
|
+
if (block?.shouldReceiveBuilderProps?.builderLinkComponent)
|
|
777
|
+
return {
|
|
778
|
+
builderLinkComponent: linkComponent
|
|
779
|
+
};
|
|
780
|
+
return {};
|
|
794
781
|
};
|
|
795
782
|
var provideRegisteredComponents = (block, registeredComponents) => {
|
|
796
|
-
if (
|
|
797
|
-
return {
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
return {
|
|
802
|
-
builderComponents: registeredComponents
|
|
803
|
-
};
|
|
783
|
+
if (block?.shouldReceiveBuilderProps?.builderComponents)
|
|
784
|
+
return {
|
|
785
|
+
builderComponents: registeredComponents
|
|
786
|
+
};
|
|
787
|
+
return {};
|
|
804
788
|
};
|
|
805
789
|
var provideBuilderBlock = (block, builderBlock) => {
|
|
806
|
-
if (
|
|
807
|
-
return {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
return {
|
|
812
|
-
builderBlock
|
|
813
|
-
};
|
|
790
|
+
if (block?.shouldReceiveBuilderProps?.builderBlock)
|
|
791
|
+
return {
|
|
792
|
+
builderBlock
|
|
793
|
+
};
|
|
794
|
+
return {};
|
|
814
795
|
};
|
|
815
796
|
var provideBuilderContext = (block, context) => {
|
|
816
|
-
if (
|
|
817
|
-
return {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
return {
|
|
822
|
-
builderContext: context
|
|
823
|
-
};
|
|
797
|
+
if (block?.shouldReceiveBuilderProps?.builderContext)
|
|
798
|
+
return {
|
|
799
|
+
builderContext: context
|
|
800
|
+
};
|
|
801
|
+
return {};
|
|
824
802
|
};
|
|
825
803
|
|
|
826
804
|
// src/components/block/components/block-styles.tsx
|
|
@@ -877,7 +855,11 @@ var getSizesForBreakpoints = ({
|
|
|
877
855
|
|
|
878
856
|
// src/components/inlined-styles.tsx
|
|
879
857
|
function InlinedStyles(props) {
|
|
880
|
-
return <><style
|
|
858
|
+
return <><style
|
|
859
|
+
innerHTML={props.styles}
|
|
860
|
+
data-id={props.id}
|
|
861
|
+
nonce={props.nonce}
|
|
862
|
+
/></>;
|
|
881
863
|
}
|
|
882
864
|
var Inlined_styles_default = InlinedStyles;
|
|
883
865
|
|
|
@@ -963,7 +945,11 @@ function BlockStyles(props) {
|
|
|
963
945
|
hoverStylesClass
|
|
964
946
|
].join(" ");
|
|
965
947
|
});
|
|
966
|
-
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
948
|
+
return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
|
|
949
|
+
id="builderio-block"
|
|
950
|
+
styles={css()}
|
|
951
|
+
nonce={props.context.nonce}
|
|
952
|
+
/></Show2></>;
|
|
967
953
|
}
|
|
968
954
|
var Block_styles_default = BlockStyles;
|
|
969
955
|
|
|
@@ -1412,8 +1398,9 @@ function Columns(props) {
|
|
|
1412
1398
|
return cols()[index]?.width || 100 / cols().length;
|
|
1413
1399
|
}
|
|
1414
1400
|
function getColumnCssWidth(index) {
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1401
|
+
const width = getWidth(index);
|
|
1402
|
+
const subtractWidth = gutterSize() * (cols().length - 1) * (width / 100);
|
|
1403
|
+
return `calc(${width}% - ${subtractWidth}px)`;
|
|
1417
1404
|
}
|
|
1418
1405
|
function getTabletStyle({
|
|
1419
1406
|
stackedStyle,
|
|
@@ -1515,13 +1502,14 @@ function Columns(props) {
|
|
|
1515
1502
|
}
|
|
1516
1503
|
return <>
|
|
1517
1504
|
<div
|
|
1518
|
-
class={getColumnsClass(props.builderBlock?.id) + " div-
|
|
1505
|
+
class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
|
|
1519
1506
|
style={columnsCssVars()}
|
|
1520
1507
|
{...{}}
|
|
1521
1508
|
>
|
|
1522
1509
|
<Show6 when={TARGET !== "reactNative"}><Inlined_styles_default
|
|
1523
1510
|
id="builderio-columns"
|
|
1524
1511
|
styles={columnsStyles()}
|
|
1512
|
+
nonce={props.builderContext.nonce}
|
|
1525
1513
|
/></Show6>
|
|
1526
1514
|
<For4 each={props.columns}>{(column, _index) => {
|
|
1527
1515
|
const index = _index();
|
|
@@ -1543,7 +1531,7 @@ function Columns(props) {
|
|
|
1543
1531
|
/></Dynamic_renderer_default>;
|
|
1544
1532
|
}}</For4>
|
|
1545
1533
|
</div>
|
|
1546
|
-
<style>{`.div-
|
|
1534
|
+
<style>{`.div-5b8fb3ac {
|
|
1547
1535
|
display: flex;
|
|
1548
1536
|
line-height: normal;
|
|
1549
1537
|
}`}</style>
|
|
@@ -2241,9 +2229,6 @@ var componentInfo2 = {
|
|
|
2241
2229
|
static: true,
|
|
2242
2230
|
noWrap: true,
|
|
2243
2231
|
shouldReceiveBuilderProps: {
|
|
2244
|
-
builderBlock: false,
|
|
2245
|
-
builderContext: false,
|
|
2246
|
-
builderComponents: false,
|
|
2247
2232
|
builderLinkComponent: true
|
|
2248
2233
|
}
|
|
2249
2234
|
};
|
|
@@ -2476,12 +2461,6 @@ var componentInfo3 = {
|
|
|
2476
2461
|
|
|
2477
2462
|
// src/blocks/fragment/component-info.ts
|
|
2478
2463
|
var componentInfo4 = {
|
|
2479
|
-
shouldReceiveBuilderProps: {
|
|
2480
|
-
builderBlock: false,
|
|
2481
|
-
builderContext: false,
|
|
2482
|
-
builderComponents: false,
|
|
2483
|
-
builderLinkComponent: false
|
|
2484
|
-
},
|
|
2485
2464
|
name: "Fragment",
|
|
2486
2465
|
static: true,
|
|
2487
2466
|
hidden: true,
|
|
@@ -2616,21 +2595,12 @@ var componentInfo5 = {
|
|
|
2616
2595
|
defaultValue: 0.7041
|
|
2617
2596
|
}],
|
|
2618
2597
|
shouldReceiveBuilderProps: {
|
|
2619
|
-
builderBlock: true
|
|
2620
|
-
builderContext: false,
|
|
2621
|
-
builderComponents: false,
|
|
2622
|
-
builderLinkComponent: false
|
|
2598
|
+
builderBlock: true
|
|
2623
2599
|
}
|
|
2624
2600
|
};
|
|
2625
2601
|
|
|
2626
2602
|
// src/blocks/section/component-info.ts
|
|
2627
2603
|
var componentInfo6 = {
|
|
2628
|
-
shouldReceiveBuilderProps: {
|
|
2629
|
-
builderBlock: false,
|
|
2630
|
-
builderContext: false,
|
|
2631
|
-
builderComponents: false,
|
|
2632
|
-
builderLinkComponent: false
|
|
2633
|
-
},
|
|
2634
2604
|
name: "Core:Section",
|
|
2635
2605
|
static: true,
|
|
2636
2606
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2686,10 +2656,7 @@ var componentInfo7 = {
|
|
|
2686
2656
|
defaultValue: "children"
|
|
2687
2657
|
}],
|
|
2688
2658
|
shouldReceiveBuilderProps: {
|
|
2689
|
-
|
|
2690
|
-
builderContext: true,
|
|
2691
|
-
builderComponents: false,
|
|
2692
|
-
builderLinkComponent: false
|
|
2659
|
+
builderContext: true
|
|
2693
2660
|
}
|
|
2694
2661
|
};
|
|
2695
2662
|
|
|
@@ -2957,10 +2924,7 @@ var tabs_default = Tabs;
|
|
|
2957
2924
|
// src/blocks/text/component-info.ts
|
|
2958
2925
|
var componentInfo10 = {
|
|
2959
2926
|
shouldReceiveBuilderProps: {
|
|
2960
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
2961
|
-
builderContext: false,
|
|
2962
|
-
builderComponents: false,
|
|
2963
|
-
builderLinkComponent: false
|
|
2927
|
+
builderBlock: TARGET === "reactNative" ? true : false
|
|
2964
2928
|
},
|
|
2965
2929
|
name: "Text",
|
|
2966
2930
|
static: true,
|
|
@@ -2995,12 +2959,6 @@ var text_default = Text;
|
|
|
2995
2959
|
|
|
2996
2960
|
// src/blocks/custom-code/component-info.ts
|
|
2997
2961
|
var componentInfo11 = {
|
|
2998
|
-
shouldReceiveBuilderProps: {
|
|
2999
|
-
builderBlock: false,
|
|
3000
|
-
builderContext: false,
|
|
3001
|
-
builderComponents: false,
|
|
3002
|
-
builderLinkComponent: false
|
|
3003
|
-
},
|
|
3004
2962
|
name: "Custom Code",
|
|
3005
2963
|
static: true,
|
|
3006
2964
|
requiredPermissions: ["editCode"],
|
|
@@ -3073,12 +3031,6 @@ var custom_code_default = CustomCode;
|
|
|
3073
3031
|
|
|
3074
3032
|
// src/blocks/embed/component-info.ts
|
|
3075
3033
|
var componentInfo12 = {
|
|
3076
|
-
shouldReceiveBuilderProps: {
|
|
3077
|
-
builderBlock: false,
|
|
3078
|
-
builderContext: false,
|
|
3079
|
-
builderComponents: false,
|
|
3080
|
-
builderLinkComponent: false
|
|
3081
|
-
},
|
|
3082
3034
|
name: "Embed",
|
|
3083
3035
|
static: true,
|
|
3084
3036
|
inputs: [{
|
|
@@ -3639,12 +3591,6 @@ var form_default = FormComponent;
|
|
|
3639
3591
|
|
|
3640
3592
|
// src/blocks/form/input/component-info.ts
|
|
3641
3593
|
var componentInfo14 = {
|
|
3642
|
-
shouldReceiveBuilderProps: {
|
|
3643
|
-
builderBlock: false,
|
|
3644
|
-
builderContext: false,
|
|
3645
|
-
builderComponents: false,
|
|
3646
|
-
builderLinkComponent: false
|
|
3647
|
-
},
|
|
3648
3594
|
name: "Form:Input",
|
|
3649
3595
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3650
3596
|
inputs: [
|
|
@@ -3715,12 +3661,6 @@ var input_default = FormInputComponent;
|
|
|
3715
3661
|
|
|
3716
3662
|
// src/blocks/form/select/component-info.ts
|
|
3717
3663
|
var componentInfo15 = {
|
|
3718
|
-
shouldReceiveBuilderProps: {
|
|
3719
|
-
builderBlock: false,
|
|
3720
|
-
builderContext: false,
|
|
3721
|
-
builderComponents: false,
|
|
3722
|
-
builderLinkComponent: false
|
|
3723
|
-
},
|
|
3724
3664
|
name: "Form:Select",
|
|
3725
3665
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3726
3666
|
defaultStyles: {
|
|
@@ -3784,12 +3724,6 @@ var select_default = SelectComponent;
|
|
|
3784
3724
|
|
|
3785
3725
|
// src/blocks/form/submit-button/component-info.ts
|
|
3786
3726
|
var componentInfo16 = {
|
|
3787
|
-
shouldReceiveBuilderProps: {
|
|
3788
|
-
builderBlock: false,
|
|
3789
|
-
builderContext: false,
|
|
3790
|
-
builderComponents: false,
|
|
3791
|
-
builderLinkComponent: false
|
|
3792
|
-
},
|
|
3793
3727
|
name: "Form:SubmitButton",
|
|
3794
3728
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3795
3729
|
defaultStyles: {
|
|
@@ -3824,12 +3758,6 @@ var submit_button_default = SubmitButton;
|
|
|
3824
3758
|
|
|
3825
3759
|
// src/blocks/form/textarea/component-info.ts
|
|
3826
3760
|
var componentInfo17 = {
|
|
3827
|
-
shouldReceiveBuilderProps: {
|
|
3828
|
-
builderBlock: false,
|
|
3829
|
-
builderContext: false,
|
|
3830
|
-
builderComponents: false,
|
|
3831
|
-
builderLinkComponent: false
|
|
3832
|
-
},
|
|
3833
3761
|
name: "Form:TextArea",
|
|
3834
3762
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
3835
3763
|
inputs: [{
|
|
@@ -3883,12 +3811,6 @@ var textarea_default = Textarea;
|
|
|
3883
3811
|
|
|
3884
3812
|
// src/blocks/img/component-info.ts
|
|
3885
3813
|
var componentInfo18 = {
|
|
3886
|
-
shouldReceiveBuilderProps: {
|
|
3887
|
-
builderBlock: false,
|
|
3888
|
-
builderContext: false,
|
|
3889
|
-
builderComponents: false,
|
|
3890
|
-
builderLinkComponent: false
|
|
3891
|
-
},
|
|
3892
3814
|
// friendlyName?
|
|
3893
3815
|
name: "Raw:Img",
|
|
3894
3816
|
hideFromInsertMenu: true,
|
|
@@ -4003,10 +3925,7 @@ var componentInfo19 = {
|
|
|
4003
3925
|
advanced: true
|
|
4004
3926
|
}],
|
|
4005
3927
|
shouldReceiveBuilderProps: {
|
|
4006
|
-
builderBlock: true
|
|
4007
|
-
builderContext: false,
|
|
4008
|
-
builderComponents: false,
|
|
4009
|
-
builderLinkComponent: false
|
|
3928
|
+
builderBlock: true
|
|
4010
3929
|
}
|
|
4011
3930
|
};
|
|
4012
3931
|
|
|
@@ -4230,7 +4149,11 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4230
4149
|
|
|
4231
4150
|
// src/components/inlined-script.tsx
|
|
4232
4151
|
function InlinedScript(props) {
|
|
4233
|
-
return <><script
|
|
4152
|
+
return <><script
|
|
4153
|
+
innerHTML={props.scriptStr}
|
|
4154
|
+
data-id={props.id}
|
|
4155
|
+
nonce={props.nonce || ""}
|
|
4156
|
+
/></>;
|
|
4234
4157
|
}
|
|
4235
4158
|
var Inlined_script_default = InlinedScript;
|
|
4236
4159
|
|
|
@@ -4744,7 +4667,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4744
4667
|
}
|
|
4745
4668
|
|
|
4746
4669
|
// src/constants/sdk-version.ts
|
|
4747
|
-
var SDK_VERSION = "
|
|
4670
|
+
var SDK_VERSION = "2.0.1";
|
|
4748
4671
|
|
|
4749
4672
|
// src/functions/register.ts
|
|
4750
4673
|
var registry = {};
|
|
@@ -5344,6 +5267,7 @@ ${getDefaultStyles(props.isNestedRender)}
|
|
|
5344
5267
|
return <><Inlined_styles_default
|
|
5345
5268
|
id="builderio-content"
|
|
5346
5269
|
styles={injectedStyles()}
|
|
5270
|
+
nonce={props.nonce}
|
|
5347
5271
|
/></>;
|
|
5348
5272
|
}
|
|
5349
5273
|
var Styles_default = ContentStyles;
|
|
@@ -5437,7 +5361,8 @@ function ContentComponent(props) {
|
|
|
5437
5361
|
),
|
|
5438
5362
|
inheritedStyles: {},
|
|
5439
5363
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
5440
|
-
BlocksWrapperProps: props.blocksWrapperProps || {}
|
|
5364
|
+
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
5365
|
+
nonce: props.nonce || ""
|
|
5441
5366
|
});
|
|
5442
5367
|
function contentSetState(newRootState) {
|
|
5443
5368
|
setBuilderContextSignal((PREVIOUS_VALUE) => ({
|
|
@@ -5450,6 +5375,7 @@ function ContentComponent(props) {
|
|
|
5450
5375
|
registeredComponents: registeredComponents()
|
|
5451
5376
|
}}
|
|
5452
5377
|
><Enable_editor_default
|
|
5378
|
+
nonce={props.nonce}
|
|
5453
5379
|
content={props.content}
|
|
5454
5380
|
data={props.data}
|
|
5455
5381
|
model={props.model}
|
|
@@ -5470,8 +5396,10 @@ function ContentComponent(props) {
|
|
|
5470
5396
|
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
5471
5397
|
id="builderio-variant-visibility"
|
|
5472
5398
|
scriptStr={scriptStr()}
|
|
5399
|
+
nonce={props.nonce || ""}
|
|
5473
5400
|
/></Show13>
|
|
5474
5401
|
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
5402
|
+
nonce={props.nonce || ""}
|
|
5475
5403
|
isNestedRender={props.isNestedRender}
|
|
5476
5404
|
contentId={builderContextSignal().content?.id}
|
|
5477
5405
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
@@ -5523,21 +5451,25 @@ function ContentVariants(props) {
|
|
|
5523
5451
|
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
5524
5452
|
id="builderio-init-variants-fns"
|
|
5525
5453
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
5454
|
+
nonce={props.nonce || ""}
|
|
5526
5455
|
/></Show14>
|
|
5527
5456
|
<Show14 when={shouldRenderVariants()}>
|
|
5528
5457
|
<Inlined_styles_default
|
|
5529
5458
|
id="builderio-variants"
|
|
5530
5459
|
styles={hideVariantsStyleString()}
|
|
5460
|
+
nonce={props.nonce || ""}
|
|
5531
5461
|
/>
|
|
5532
5462
|
<Inlined_script_default
|
|
5533
5463
|
id="builderio-variants-visibility"
|
|
5534
5464
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
5465
|
+
nonce={props.nonce || ""}
|
|
5535
5466
|
/>
|
|
5536
5467
|
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
5537
5468
|
const index = _index();
|
|
5538
5469
|
return <Content_default
|
|
5539
5470
|
isNestedRender={props.isNestedRender}
|
|
5540
5471
|
key={variant.testVariationId}
|
|
5472
|
+
nonce={props.nonce}
|
|
5541
5473
|
content={variant}
|
|
5542
5474
|
showContent={false}
|
|
5543
5475
|
model={props.model}
|
|
@@ -5560,6 +5492,7 @@ function ContentVariants(props) {
|
|
|
5560
5492
|
}}</For9>
|
|
5561
5493
|
</Show14>
|
|
5562
5494
|
<Content_default
|
|
5495
|
+
nonce={props.nonce}
|
|
5563
5496
|
isNestedRender={props.isNestedRender}
|
|
5564
5497
|
{...{}}
|
|
5565
5498
|
content={defaultContent()}
|
|
@@ -5646,6 +5579,7 @@ function Symbol(props) {
|
|
|
5646
5579
|
}
|
|
5647
5580
|
createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5648
5581
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
5582
|
+
nonce={props.builderContext.nonce}
|
|
5649
5583
|
isNestedRender={true}
|
|
5650
5584
|
apiVersion={props.builderContext.apiVersion}
|
|
5651
5585
|
apiKey={props.builderContext.apiKey}
|