@builder.io/sdk-qwik 0.14.29 → 0.14.31

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.
@@ -234,6 +234,17 @@ function flattenState({ rootState, localState, rootSetState }) {
234
234
  }
235
235
  });
236
236
  }
237
+ const SDK_NAME_FOR_TARGET = (() => {
238
+ switch (TARGET) {
239
+ case "rsc":
240
+ return "react-nextjs";
241
+ case "reactNative":
242
+ return "react-native";
243
+ default:
244
+ return TARGET;
245
+ }
246
+ })();
247
+ const SDK_NAME = `@builder.io/sdk-${SDK_NAME_FOR_TARGET}`;
237
248
  const fastClone = (obj) => JSON.parse(JSON.stringify(obj));
238
249
  const set = (obj, _path, value) => {
239
250
  if (Object(obj) !== obj)
@@ -292,6 +303,7 @@ if (typeof output === 'object' && output !== null) {
292
303
  };
293
304
  let IVM_INSTANCE = null;
294
305
  let IVM_CONTEXT = null;
306
+ const SHOULD_MENTION_INITIALIZE_SCRIPT = SDK_NAME === "@builder.io/sdk-react-nextjs" || SDK_NAME === "@builder.io/sdk-react";
295
307
  const getIvm = () => {
296
308
  try {
297
309
  if (IVM_INSTANCE)
@@ -302,14 +314,15 @@ const getIvm = () => {
302
314
  } catch (error) {
303
315
  logger.error("isolated-vm import error.", error);
304
316
  }
305
- throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
317
+ const ERROR_MESSAGE = `${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
306
318
 
307
- In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
308
- importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
309
- a server-only execution path within your application.
319
+ SOLUTION: In a server-only execution path within your application, do one of the following:
320
+
321
+ ${SHOULD_MENTION_INITIALIZE_SCRIPT ? '- import and call `initializeNodeRuntime()` from "${SDK_NAME}/node/init".' : ""}
322
+ - add the following import: \`await import('isolated-vm')\`.
310
323
 
311
- Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
312
- `);
324
+ For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;
325
+ throw new Error(ERROR_MESSAGE);
313
326
  };
314
327
  function setIsolateContext(options = {
315
328
  memoryLimit: 128
@@ -2304,7 +2317,7 @@ const defaultDetail = {
2304
2317
  }
2305
2318
  ]
2306
2319
  };
2307
- const componentInfo$h = {
2320
+ const componentInfo$i = {
2308
2321
  name: "Builder:Accordion",
2309
2322
  canHaveChildren: true,
2310
2323
  image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
@@ -2596,7 +2609,7 @@ const Accordion = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlined
2596
2609
  }, 1, "hf_3");
2597
2610
  }), 1, "hf_4");
2598
2611
  }, "Accordion_component_jkuUCHm0nt0"));
2599
- const componentInfo$g = {
2612
+ const componentInfo$h = {
2600
2613
  name: "Core:Button",
2601
2614
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
2602
2615
  defaultStyles: {
@@ -2634,7 +2647,7 @@ const componentInfo$g = {
2634
2647
  static: true,
2635
2648
  noWrap: true
2636
2649
  };
2637
- const componentInfo$f = {
2650
+ const componentInfo$g = {
2638
2651
  // TODO: ways to statically preprocess JSON for references, functions, etc
2639
2652
  name: "Columns",
2640
2653
  isRSC: true,
@@ -2876,14 +2889,14 @@ const componentInfo$f = {
2876
2889
  }
2877
2890
  ]
2878
2891
  };
2879
- const componentInfo$e = {
2892
+ const componentInfo$f = {
2880
2893
  name: "Fragment",
2881
2894
  static: true,
2882
2895
  hidden: true,
2883
2896
  canHaveChildren: true,
2884
2897
  noWrap: true
2885
2898
  };
2886
- const componentInfo$d = {
2899
+ const componentInfo$e = {
2887
2900
  name: "Image",
2888
2901
  static: true,
2889
2902
  image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
@@ -3038,7 +3051,7 @@ const componentInfo$d = {
3038
3051
  }
3039
3052
  ]
3040
3053
  };
3041
- const componentInfo$c = {
3054
+ const componentInfo$d = {
3042
3055
  name: "Core:Section",
3043
3056
  static: true,
3044
3057
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -3083,7 +3096,7 @@ const componentInfo$c = {
3083
3096
  }
3084
3097
  ]
3085
3098
  };
3086
- const componentInfo$b = {
3099
+ const componentInfo$c = {
3087
3100
  name: "Slot",
3088
3101
  isRSC: true,
3089
3102
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -3138,7 +3151,7 @@ const Slot = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
3138
3151
  }
3139
3152
  }, 0, "B1_1");
3140
3153
  }, "Slot_component_WWgWgfV0bb0"));
3141
- const componentInfo$a = {
3154
+ const componentInfo$b = {
3142
3155
  name: "Symbol",
3143
3156
  noWrap: true,
3144
3157
  static: true,
@@ -3218,7 +3231,7 @@ const defaultElement = {
3218
3231
  }
3219
3232
  }
3220
3233
  };
3221
- const componentInfo$9 = {
3234
+ const componentInfo$a = {
3222
3235
  name: "Builder: Tabs",
3223
3236
  inputs: [
3224
3237
  {
@@ -3456,7 +3469,7 @@ const Tabs = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
3456
3469
  }, 3, "6k_1"), 1, "6k_2") : null
3457
3470
  ], 1, "6k_3");
3458
3471
  }, "Tabs_component_MhWcxXy0lMY"));
3459
- const componentInfo$8 = {
3472
+ const componentInfo$9 = {
3460
3473
  name: "Text",
3461
3474
  static: true,
3462
3475
  isRSC: true,
@@ -3491,7 +3504,7 @@ const Text = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
3491
3504
  }
3492
3505
  }, null, 3, "yO_0");
3493
3506
  }, "Text_component_15p0cKUxgIE"));
3494
- const componentInfo$7 = {
3507
+ const componentInfo$8 = {
3495
3508
  name: "Custom Code",
3496
3509
  static: true,
3497
3510
  requiredPermissions: [
@@ -3570,7 +3583,7 @@ const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inline
3570
3583
  ], "p0.code")
3571
3584
  }, null, 3, "bY_0");
3572
3585
  }, "CustomCode_component_uYOSy7w7Zqw"));
3573
- const componentInfo$6 = {
3586
+ const componentInfo$7 = {
3574
3587
  name: "Embed",
3575
3588
  static: true,
3576
3589
  inputs: [
@@ -3663,7 +3676,7 @@ const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
3663
3676
  ], "p0.content")
3664
3677
  }, null, 3, "9r_0");
3665
3678
  }, "Embed_component_Uji08ORjXbE"));
3666
- const componentInfo$5 = {
3679
+ const componentInfo$6 = {
3667
3680
  name: "Form:Form",
3668
3681
  // editableTags: ['builder-form-error']
3669
3682
  defaults: {
@@ -4244,7 +4257,7 @@ const STYLES = `
4244
4257
  text-align: center;
4245
4258
  }
4246
4259
  `;
4247
- const componentInfo$4 = {
4260
+ const componentInfo$5 = {
4248
4261
  name: "Form:Input",
4249
4262
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
4250
4263
  inputs: [
@@ -4327,7 +4340,7 @@ const FormInputComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwi
4327
4340
  required: props.required
4328
4341
  });
4329
4342
  }, "FormInputComponent_component_AUUjdN0ueMs"));
4330
- const componentInfo$3 = {
4343
+ const componentInfo$4 = {
4331
4344
  name: "Form:Select",
4332
4345
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
4333
4346
  defaultStyles: {
@@ -4388,14 +4401,15 @@ const SelectComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
4388
4401
  value: props.value,
4389
4402
  key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
4390
4403
  defaultValue: props.defaultValue,
4391
- name: props.name
4404
+ name: props.name,
4405
+ required: props.required
4392
4406
  }, (props.options || []).map((option, index) => {
4393
4407
  return /* @__PURE__ */ qwik._jsxQ("option", {
4394
4408
  value: qwik._wrapSignal(option, "value")
4395
4409
  }, null, option.name || option.value, 1, `${option.name}-${index}`);
4396
4410
  }));
4397
4411
  }, "SelectComponent_component_SPKbsFLikZU"));
4398
- const componentInfo$2 = {
4412
+ const componentInfo$3 = {
4399
4413
  name: "Form:SubmitButton",
4400
4414
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
4401
4415
  defaultStyles: {
@@ -4429,6 +4443,70 @@ const SubmitButton = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4429
4443
  type: "submit"
4430
4444
  }, 0, "6z_0");
4431
4445
  }, "SubmitButton_component_NXvMBMCDhwc"));
4446
+ const componentInfo$2 = {
4447
+ name: "Form:TextArea",
4448
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
4449
+ inputs: [
4450
+ {
4451
+ advanced: true,
4452
+ name: "value",
4453
+ type: "string"
4454
+ },
4455
+ {
4456
+ name: "name",
4457
+ type: "string",
4458
+ required: true,
4459
+ helperText: 'Every input in a form needs a unique name describing what it gets, e.g. "email"'
4460
+ },
4461
+ {
4462
+ name: "defaultValue",
4463
+ type: "string"
4464
+ },
4465
+ {
4466
+ name: "placeholder",
4467
+ type: "string",
4468
+ defaultValue: "Hello there"
4469
+ },
4470
+ {
4471
+ name: "required",
4472
+ type: "boolean",
4473
+ defaultValue: false
4474
+ }
4475
+ ],
4476
+ defaultStyles: {
4477
+ paddingTop: "10px",
4478
+ paddingBottom: "10px",
4479
+ paddingLeft: "10px",
4480
+ paddingRight: "10px",
4481
+ borderRadius: "3px",
4482
+ borderWidth: "1px",
4483
+ borderStyle: "solid",
4484
+ borderColor: "#ccc"
4485
+ },
4486
+ static: true,
4487
+ noWrap: true
4488
+ };
4489
+ const Textarea = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
4490
+ return /* @__PURE__ */ qwik._jsxS("textarea", {
4491
+ ...props.attributes
4492
+ }, {
4493
+ defaultValue: qwik._fnSignal((p0) => p0.defaultValue, [
4494
+ props
4495
+ ], "p0.defaultValue"),
4496
+ name: qwik._fnSignal((p0) => p0.name, [
4497
+ props
4498
+ ], "p0.name"),
4499
+ placeholder: qwik._fnSignal((p0) => p0.placeholder, [
4500
+ props
4501
+ ], "p0.placeholder"),
4502
+ required: qwik._fnSignal((p0) => p0.required, [
4503
+ props
4504
+ ], "p0.required"),
4505
+ value: qwik._fnSignal((p0) => p0.value, [
4506
+ props
4507
+ ], "p0.value")
4508
+ }, 0, "kE_0");
4509
+ }, "Textarea_component_o1TcxV139Oc"));
4432
4510
  const componentInfo$1 = {
4433
4511
  // friendlyName?
4434
4512
  name: "Raw:Img",
@@ -4700,28 +4778,32 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
4700
4778
  const getExtraComponents = () => [
4701
4779
  {
4702
4780
  component: CustomCode,
4703
- ...componentInfo$7
4781
+ ...componentInfo$8
4704
4782
  },
4705
4783
  {
4706
4784
  component: Embed,
4707
- ...componentInfo$6
4785
+ ...componentInfo$7
4708
4786
  },
4709
4787
  ...[
4710
4788
  {
4711
4789
  component: FormComponent,
4712
- ...componentInfo$5
4790
+ ...componentInfo$6
4713
4791
  },
4714
4792
  {
4715
4793
  component: FormInputComponent,
4716
- ...componentInfo$4
4794
+ ...componentInfo$5
4717
4795
  },
4718
4796
  {
4719
4797
  component: SubmitButton,
4720
- ...componentInfo$2
4798
+ ...componentInfo$3
4721
4799
  },
4722
4800
  {
4723
4801
  component: SelectComponent,
4724
- ...componentInfo$3
4802
+ ...componentInfo$4
4803
+ },
4804
+ {
4805
+ component: Textarea,
4806
+ ...componentInfo$2
4725
4807
  }
4726
4808
  ],
4727
4809
  {
@@ -4736,44 +4818,44 @@ const getExtraComponents = () => [
4736
4818
  const getDefaultRegisteredComponents = () => [
4737
4819
  {
4738
4820
  component: Button,
4739
- ...componentInfo$g
4821
+ ...componentInfo$h
4740
4822
  },
4741
4823
  {
4742
4824
  component: Columns,
4743
- ...componentInfo$f
4825
+ ...componentInfo$g
4744
4826
  },
4745
4827
  {
4746
4828
  component: FragmentComponent,
4747
- ...componentInfo$e
4829
+ ...componentInfo$f
4748
4830
  },
4749
4831
  {
4750
4832
  component: Image,
4751
- ...componentInfo$d
4833
+ ...componentInfo$e
4752
4834
  },
4753
4835
  {
4754
4836
  component: SectionComponent,
4755
- ...componentInfo$c
4837
+ ...componentInfo$d
4756
4838
  },
4757
4839
  {
4758
4840
  component: Slot,
4759
- ...componentInfo$b
4841
+ ...componentInfo$c
4760
4842
  },
4761
4843
  {
4762
4844
  component: Symbol$1,
4763
- ...componentInfo$a
4845
+ ...componentInfo$b
4764
4846
  },
4765
4847
  {
4766
4848
  component: Text,
4767
- ...componentInfo$8
4849
+ ...componentInfo$9
4768
4850
  },
4769
4851
  ...[
4770
4852
  {
4771
4853
  component: Tabs,
4772
- ...componentInfo$9
4854
+ ...componentInfo$a
4773
4855
  },
4774
4856
  {
4775
4857
  component: Accordion,
4776
- ...componentInfo$h
4858
+ ...componentInfo$i
4777
4859
  }
4778
4860
  ],
4779
4861
  ...getExtraComponents()
@@ -5234,7 +5316,7 @@ function isFromTrustedHost(trustedHosts, e) {
5234
5316
  const url = new URL(e.origin), hostname = url.hostname;
5235
5317
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
5236
5318
  }
5237
- const SDK_VERSION = "0.14.29";
5319
+ const SDK_VERSION = "0.14.31";
5238
5320
  const registry = {};
5239
5321
  function register(type, info) {
5240
5322
  let typeList = registry[type];