@builder.io/sdk-solid 1.0.35 → 1.0.36
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/lib/browser/dev.js +83 -13
- package/lib/browser/dev.jsx +62 -5
- package/lib/browser/index.js +83 -13
- package/lib/browser/index.jsx +62 -5
- package/lib/edge/dev.js +83 -13
- package/lib/edge/dev.jsx +62 -5
- package/lib/edge/index.js +83 -13
- package/lib/edge/index.jsx +62 -5
- package/lib/node/dev.js +104 -19
- package/lib/node/dev.jsx +83 -11
- package/lib/node/index.js +104 -19
- package/lib/node/index.jsx +83 -11
- package/package.json +1 -1
package/lib/node/index.jsx
CHANGED
|
@@ -290,6 +290,19 @@ function flattenState({
|
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
+
// src/constants/sdk-name.ts
|
|
294
|
+
var SDK_NAME_FOR_TARGET = (() => {
|
|
295
|
+
switch (TARGET) {
|
|
296
|
+
case "rsc":
|
|
297
|
+
return "react-nextjs";
|
|
298
|
+
case "reactNative":
|
|
299
|
+
return "react-native";
|
|
300
|
+
default:
|
|
301
|
+
return TARGET;
|
|
302
|
+
}
|
|
303
|
+
})();
|
|
304
|
+
var SDK_NAME = `@builder.io/sdk-${SDK_NAME_FOR_TARGET}`;
|
|
305
|
+
|
|
293
306
|
// src/functions/fast-clone.ts
|
|
294
307
|
var fastClone = (obj) => JSON.parse(JSON.stringify(obj));
|
|
295
308
|
|
|
@@ -371,6 +384,7 @@ if (typeof output === 'object' && output !== null) {
|
|
|
371
384
|
};
|
|
372
385
|
var IVM_INSTANCE = null;
|
|
373
386
|
var IVM_CONTEXT = null;
|
|
387
|
+
var SHOULD_MENTION_INITIALIZE_SCRIPT = SDK_NAME === "@builder.io/sdk-react-nextjs" || SDK_NAME === "@builder.io/sdk-react";
|
|
374
388
|
var getIvm = () => {
|
|
375
389
|
try {
|
|
376
390
|
if (IVM_INSTANCE)
|
|
@@ -381,14 +395,15 @@ var getIvm = () => {
|
|
|
381
395
|
} catch (error2) {
|
|
382
396
|
logger.error("isolated-vm import error.", error2);
|
|
383
397
|
}
|
|
384
|
-
|
|
398
|
+
const ERROR_MESSAGE = `${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
385
399
|
|
|
386
|
-
In
|
|
387
|
-
|
|
388
|
-
|
|
400
|
+
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
401
|
+
|
|
402
|
+
${SHOULD_MENTION_INITIALIZE_SCRIPT ? '- import and call `initializeNodeRuntime()` from "${SDK_NAME}/node/init".' : ""}
|
|
403
|
+
- add the following import: \`await import('isolated-vm')\`.
|
|
389
404
|
|
|
390
|
-
|
|
391
|
-
|
|
405
|
+
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;
|
|
406
|
+
throw new Error(ERROR_MESSAGE);
|
|
392
407
|
};
|
|
393
408
|
function setIsolateContext(options = {
|
|
394
409
|
memoryLimit: 128
|
|
@@ -3814,6 +3829,7 @@ function SelectComponent(props) {
|
|
|
3814
3829
|
key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
|
|
3815
3830
|
defaultValue={props.defaultValue}
|
|
3816
3831
|
name={props.name}
|
|
3832
|
+
required={props.required}
|
|
3817
3833
|
><For8 each={props.options}>{(option, _index) => {
|
|
3818
3834
|
const index = _index();
|
|
3819
3835
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
@@ -3855,8 +3871,61 @@ function SubmitButton(props) {
|
|
|
3855
3871
|
}
|
|
3856
3872
|
var submit_button_default = SubmitButton;
|
|
3857
3873
|
|
|
3858
|
-
// src/blocks/
|
|
3874
|
+
// src/blocks/form/textarea/component-info.ts
|
|
3859
3875
|
var componentInfo17 = {
|
|
3876
|
+
name: "Form:TextArea",
|
|
3877
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
3878
|
+
inputs: [{
|
|
3879
|
+
advanced: true,
|
|
3880
|
+
name: "value",
|
|
3881
|
+
type: "string"
|
|
3882
|
+
}, {
|
|
3883
|
+
name: "name",
|
|
3884
|
+
type: "string",
|
|
3885
|
+
required: true,
|
|
3886
|
+
helperText: 'Every input in a form needs a unique name describing what it gets, e.g. "email"'
|
|
3887
|
+
}, {
|
|
3888
|
+
name: "defaultValue",
|
|
3889
|
+
type: "string"
|
|
3890
|
+
}, {
|
|
3891
|
+
name: "placeholder",
|
|
3892
|
+
type: "string",
|
|
3893
|
+
defaultValue: "Hello there"
|
|
3894
|
+
}, {
|
|
3895
|
+
name: "required",
|
|
3896
|
+
type: "boolean",
|
|
3897
|
+
defaultValue: false
|
|
3898
|
+
}],
|
|
3899
|
+
defaultStyles: {
|
|
3900
|
+
paddingTop: "10px",
|
|
3901
|
+
paddingBottom: "10px",
|
|
3902
|
+
paddingLeft: "10px",
|
|
3903
|
+
paddingRight: "10px",
|
|
3904
|
+
borderRadius: "3px",
|
|
3905
|
+
borderWidth: "1px",
|
|
3906
|
+
borderStyle: "solid",
|
|
3907
|
+
borderColor: "#ccc"
|
|
3908
|
+
},
|
|
3909
|
+
static: true,
|
|
3910
|
+
noWrap: true
|
|
3911
|
+
};
|
|
3912
|
+
|
|
3913
|
+
// src/blocks/form/textarea/textarea.tsx
|
|
3914
|
+
function Textarea(props) {
|
|
3915
|
+
return <><textarea
|
|
3916
|
+
{...{}}
|
|
3917
|
+
{...props.attributes}
|
|
3918
|
+
placeholder={props.placeholder}
|
|
3919
|
+
name={props.name}
|
|
3920
|
+
value={props.value}
|
|
3921
|
+
defaultValue={props.defaultValue}
|
|
3922
|
+
required={props.required}
|
|
3923
|
+
/></>;
|
|
3924
|
+
}
|
|
3925
|
+
var textarea_default = Textarea;
|
|
3926
|
+
|
|
3927
|
+
// src/blocks/img/component-info.ts
|
|
3928
|
+
var componentInfo18 = {
|
|
3860
3929
|
// friendlyName?
|
|
3861
3930
|
name: "Raw:Img",
|
|
3862
3931
|
hideFromInsertMenu: true,
|
|
@@ -3889,7 +3958,7 @@ function ImgComponent(props) {
|
|
|
3889
3958
|
var img_default = ImgComponent;
|
|
3890
3959
|
|
|
3891
3960
|
// src/blocks/video/component-info.ts
|
|
3892
|
-
var
|
|
3961
|
+
var componentInfo19 = {
|
|
3893
3962
|
name: "Video",
|
|
3894
3963
|
canHaveChildren: true,
|
|
3895
3964
|
defaultStyles: {
|
|
@@ -4078,12 +4147,15 @@ var getExtraComponents = () => [{
|
|
|
4078
4147
|
}, {
|
|
4079
4148
|
component: select_default,
|
|
4080
4149
|
...componentInfo15
|
|
4150
|
+
}, {
|
|
4151
|
+
component: textarea_default,
|
|
4152
|
+
...componentInfo17
|
|
4081
4153
|
}], {
|
|
4082
4154
|
component: img_default,
|
|
4083
|
-
...
|
|
4155
|
+
...componentInfo18
|
|
4084
4156
|
}, {
|
|
4085
4157
|
component: video_default,
|
|
4086
|
-
...
|
|
4158
|
+
...componentInfo19
|
|
4087
4159
|
}];
|
|
4088
4160
|
|
|
4089
4161
|
// src/constants/builder-registered-components.ts
|
|
@@ -4698,7 +4770,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4698
4770
|
}
|
|
4699
4771
|
|
|
4700
4772
|
// src/constants/sdk-version.ts
|
|
4701
|
-
var SDK_VERSION = "1.0.
|
|
4773
|
+
var SDK_VERSION = "1.0.36";
|
|
4702
4774
|
|
|
4703
4775
|
// src/functions/register.ts
|
|
4704
4776
|
var registry = {};
|