@builder.io/sdk-qwik 0.14.18 → 0.14.20

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.
@@ -631,22 +631,22 @@ const getRepeatItemData = ({ block, context }) => {
631
631
  }));
632
632
  return repeatArray;
633
633
  };
634
- const shouldPassLinkComponent = (blockName) => {
635
- return blockName && [
634
+ const shouldPassLinkComponent = (block) => {
635
+ return block && (block.isRSC || [
636
636
  "Core:Button",
637
637
  "Symbol",
638
638
  "Columns",
639
639
  "Form:Form",
640
640
  "Builder: Tabs"
641
- ].includes(blockName);
641
+ ].includes(block.name));
642
642
  };
643
- const shouldPassRegisteredComponents = (blockName) => {
644
- return blockName && [
643
+ const shouldPassRegisteredComponents = (block) => {
644
+ return block && (block.isRSC || [
645
645
  "Symbol",
646
646
  "Columns",
647
647
  "Form:Form",
648
648
  "Builder: Tabs"
649
- ].includes(blockName);
649
+ ].includes(block.name));
650
650
  };
651
651
  const SIZES = {
652
652
  small: {
@@ -1097,7 +1097,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1097
1097
  repeatItem
1098
1098
  ]));
1099
1099
  const componentRefProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
1100
- var _a2, _b, _c, _d, _e;
1100
+ var _a2, _b, _c;
1101
1101
  const [blockComponent2, processedBlock2, props2] = qwik.useLexicalScope();
1102
1102
  return {
1103
1103
  blockChildren: processedBlock2.value.children ?? [],
@@ -1105,10 +1105,10 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1105
1105
  componentOptions: {
1106
1106
  ...getBlockComponentOptions(processedBlock2.value),
1107
1107
  builderContext: props2.context,
1108
- ...shouldPassLinkComponent((_b = blockComponent2.value) == null ? void 0 : _b.name) ? {
1108
+ ...shouldPassLinkComponent(blockComponent2.value) ? {
1109
1109
  builderLinkComponent: props2.linkComponent
1110
1110
  } : {},
1111
- ...shouldPassRegisteredComponents((_c = blockComponent2.value) == null ? void 0 : _c.name) ? {
1111
+ ...shouldPassRegisteredComponents(blockComponent2.value) ? {
1112
1112
  builderComponents: props2.registeredComponents
1113
1113
  } : {}
1114
1114
  },
@@ -1116,8 +1116,8 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1116
1116
  linkComponent: props2.linkComponent,
1117
1117
  registeredComponents: props2.registeredComponents,
1118
1118
  builderBlock: processedBlock2.value,
1119
- includeBlockProps: ((_d = blockComponent2.value) == null ? void 0 : _d.noWrap) === true,
1120
- isInteractive: !((_e = blockComponent2.value) == null ? void 0 : _e.isRSC)
1119
+ includeBlockProps: ((_b = blockComponent2.value) == null ? void 0 : _b.noWrap) === true,
1120
+ isInteractive: !((_c = blockComponent2.value) == null ? void 0 : _c.isRSC)
1121
1121
  };
1122
1122
  }, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
1123
1123
  blockComponent,
@@ -4695,7 +4695,7 @@ function isFromTrustedHost(trustedHosts, e) {
4695
4695
  const url = new URL(e.origin), hostname = url.hostname;
4696
4696
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4697
4697
  }
4698
- const SDK_VERSION = "0.14.18";
4698
+ const SDK_VERSION = "0.14.20";
4699
4699
  const registry = {};
4700
4700
  function register(type, info) {
4701
4701
  let typeList = registry[type];
@@ -629,22 +629,22 @@ const getRepeatItemData = ({ block, context }) => {
629
629
  }));
630
630
  return repeatArray;
631
631
  };
632
- const shouldPassLinkComponent = (blockName) => {
633
- return blockName && [
632
+ const shouldPassLinkComponent = (block) => {
633
+ return block && (block.isRSC || [
634
634
  "Core:Button",
635
635
  "Symbol",
636
636
  "Columns",
637
637
  "Form:Form",
638
638
  "Builder: Tabs"
639
- ].includes(blockName);
639
+ ].includes(block.name));
640
640
  };
641
- const shouldPassRegisteredComponents = (blockName) => {
642
- return blockName && [
641
+ const shouldPassRegisteredComponents = (block) => {
642
+ return block && (block.isRSC || [
643
643
  "Symbol",
644
644
  "Columns",
645
645
  "Form:Form",
646
646
  "Builder: Tabs"
647
- ].includes(blockName);
647
+ ].includes(block.name));
648
648
  };
649
649
  const SIZES = {
650
650
  small: {
@@ -1095,7 +1095,7 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1095
1095
  repeatItem
1096
1096
  ]));
1097
1097
  const componentRefProps = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
1098
- var _a2, _b, _c, _d, _e;
1098
+ var _a2, _b, _c;
1099
1099
  const [blockComponent2, processedBlock2, props2] = useLexicalScope();
1100
1100
  return {
1101
1101
  blockChildren: processedBlock2.value.children ?? [],
@@ -1103,10 +1103,10 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1103
1103
  componentOptions: {
1104
1104
  ...getBlockComponentOptions(processedBlock2.value),
1105
1105
  builderContext: props2.context,
1106
- ...shouldPassLinkComponent((_b = blockComponent2.value) == null ? void 0 : _b.name) ? {
1106
+ ...shouldPassLinkComponent(blockComponent2.value) ? {
1107
1107
  builderLinkComponent: props2.linkComponent
1108
1108
  } : {},
1109
- ...shouldPassRegisteredComponents((_c = blockComponent2.value) == null ? void 0 : _c.name) ? {
1109
+ ...shouldPassRegisteredComponents(blockComponent2.value) ? {
1110
1110
  builderComponents: props2.registeredComponents
1111
1111
  } : {}
1112
1112
  },
@@ -1114,8 +1114,8 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1114
1114
  linkComponent: props2.linkComponent,
1115
1115
  registeredComponents: props2.registeredComponents,
1116
1116
  builderBlock: processedBlock2.value,
1117
- includeBlockProps: ((_d = blockComponent2.value) == null ? void 0 : _d.noWrap) === true,
1118
- isInteractive: !((_e = blockComponent2.value) == null ? void 0 : _e.isRSC)
1117
+ includeBlockProps: ((_b = blockComponent2.value) == null ? void 0 : _b.noWrap) === true,
1118
+ isInteractive: !((_c = blockComponent2.value) == null ? void 0 : _c.isRSC)
1119
1119
  };
1120
1120
  }, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
1121
1121
  blockComponent,
@@ -4693,7 +4693,7 @@ function isFromTrustedHost(trustedHosts, e) {
4693
4693
  const url = new URL(e.origin), hostname = url.hostname;
4694
4694
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4695
4695
  }
4696
- const SDK_VERSION = "0.14.18";
4696
+ const SDK_VERSION = "0.14.20";
4697
4697
  const registry = {};
4698
4698
  function register(type, info) {
4699
4699
  let typeList = registry[type];
@@ -3862,22 +3862,22 @@ const getRepeatItemData = ({ block, context }) => {
3862
3862
  }));
3863
3863
  return repeatArray;
3864
3864
  };
3865
- const shouldPassLinkComponent = (blockName) => {
3866
- return blockName && [
3865
+ const shouldPassLinkComponent = (block) => {
3866
+ return block && (block.isRSC || [
3867
3867
  "Core:Button",
3868
3868
  "Symbol",
3869
3869
  "Columns",
3870
3870
  "Form:Form",
3871
3871
  "Builder: Tabs"
3872
- ].includes(blockName);
3872
+ ].includes(block.name));
3873
3873
  };
3874
- const shouldPassRegisteredComponents = (blockName) => {
3875
- return blockName && [
3874
+ const shouldPassRegisteredComponents = (block) => {
3875
+ return block && (block.isRSC || [
3876
3876
  "Symbol",
3877
3877
  "Columns",
3878
3878
  "Form:Form",
3879
3879
  "Builder: Tabs"
3880
- ].includes(blockName);
3880
+ ].includes(block.name));
3881
3881
  };
3882
3882
  const SIZES = {
3883
3883
  small: {
@@ -4328,7 +4328,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
4328
4328
  repeatItem
4329
4329
  ]));
4330
4330
  const componentRefProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
4331
- var _a2, _b, _c, _d, _e;
4331
+ var _a2, _b, _c;
4332
4332
  const [blockComponent2, processedBlock2, props2] = qwik.useLexicalScope();
4333
4333
  return {
4334
4334
  blockChildren: processedBlock2.value.children ?? [],
@@ -4336,10 +4336,10 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
4336
4336
  componentOptions: {
4337
4337
  ...getBlockComponentOptions(processedBlock2.value),
4338
4338
  builderContext: props2.context,
4339
- ...shouldPassLinkComponent((_b = blockComponent2.value) == null ? void 0 : _b.name) ? {
4339
+ ...shouldPassLinkComponent(blockComponent2.value) ? {
4340
4340
  builderLinkComponent: props2.linkComponent
4341
4341
  } : {},
4342
- ...shouldPassRegisteredComponents((_c = blockComponent2.value) == null ? void 0 : _c.name) ? {
4342
+ ...shouldPassRegisteredComponents(blockComponent2.value) ? {
4343
4343
  builderComponents: props2.registeredComponents
4344
4344
  } : {}
4345
4345
  },
@@ -4347,8 +4347,8 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
4347
4347
  linkComponent: props2.linkComponent,
4348
4348
  registeredComponents: props2.registeredComponents,
4349
4349
  builderBlock: processedBlock2.value,
4350
- includeBlockProps: ((_d = blockComponent2.value) == null ? void 0 : _d.noWrap) === true,
4351
- isInteractive: !((_e = blockComponent2.value) == null ? void 0 : _e.isRSC)
4350
+ includeBlockProps: ((_b = blockComponent2.value) == null ? void 0 : _b.noWrap) === true,
4351
+ isInteractive: !((_c = blockComponent2.value) == null ? void 0 : _c.isRSC)
4352
4352
  };
4353
4353
  }, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
4354
4354
  blockComponent,
@@ -7926,7 +7926,7 @@ function isFromTrustedHost(trustedHosts, e) {
7926
7926
  const url = new URL(e.origin), hostname = url.hostname;
7927
7927
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
7928
7928
  }
7929
- const SDK_VERSION = "0.14.18";
7929
+ const SDK_VERSION = "0.14.20";
7930
7930
  const registry = {};
7931
7931
  function register(type, info) {
7932
7932
  let typeList = registry[type];
@@ -3860,22 +3860,22 @@ const getRepeatItemData = ({ block, context }) => {
3860
3860
  }));
3861
3861
  return repeatArray;
3862
3862
  };
3863
- const shouldPassLinkComponent = (blockName) => {
3864
- return blockName && [
3863
+ const shouldPassLinkComponent = (block) => {
3864
+ return block && (block.isRSC || [
3865
3865
  "Core:Button",
3866
3866
  "Symbol",
3867
3867
  "Columns",
3868
3868
  "Form:Form",
3869
3869
  "Builder: Tabs"
3870
- ].includes(blockName);
3870
+ ].includes(block.name));
3871
3871
  };
3872
- const shouldPassRegisteredComponents = (blockName) => {
3873
- return blockName && [
3872
+ const shouldPassRegisteredComponents = (block) => {
3873
+ return block && (block.isRSC || [
3874
3874
  "Symbol",
3875
3875
  "Columns",
3876
3876
  "Form:Form",
3877
3877
  "Builder: Tabs"
3878
- ].includes(blockName);
3878
+ ].includes(block.name));
3879
3879
  };
3880
3880
  const SIZES = {
3881
3881
  small: {
@@ -4326,7 +4326,7 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
4326
4326
  repeatItem
4327
4327
  ]));
4328
4328
  const componentRefProps = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
4329
- var _a2, _b, _c, _d, _e;
4329
+ var _a2, _b, _c;
4330
4330
  const [blockComponent2, processedBlock2, props2] = useLexicalScope();
4331
4331
  return {
4332
4332
  blockChildren: processedBlock2.value.children ?? [],
@@ -4334,10 +4334,10 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
4334
4334
  componentOptions: {
4335
4335
  ...getBlockComponentOptions(processedBlock2.value),
4336
4336
  builderContext: props2.context,
4337
- ...shouldPassLinkComponent((_b = blockComponent2.value) == null ? void 0 : _b.name) ? {
4337
+ ...shouldPassLinkComponent(blockComponent2.value) ? {
4338
4338
  builderLinkComponent: props2.linkComponent
4339
4339
  } : {},
4340
- ...shouldPassRegisteredComponents((_c = blockComponent2.value) == null ? void 0 : _c.name) ? {
4340
+ ...shouldPassRegisteredComponents(blockComponent2.value) ? {
4341
4341
  builderComponents: props2.registeredComponents
4342
4342
  } : {}
4343
4343
  },
@@ -4345,8 +4345,8 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
4345
4345
  linkComponent: props2.linkComponent,
4346
4346
  registeredComponents: props2.registeredComponents,
4347
4347
  builderBlock: processedBlock2.value,
4348
- includeBlockProps: ((_d = blockComponent2.value) == null ? void 0 : _d.noWrap) === true,
4349
- isInteractive: !((_e = blockComponent2.value) == null ? void 0 : _e.isRSC)
4348
+ includeBlockProps: ((_b = blockComponent2.value) == null ? void 0 : _b.noWrap) === true,
4349
+ isInteractive: !((_c = blockComponent2.value) == null ? void 0 : _c.isRSC)
4350
4350
  };
4351
4351
  }, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
4352
4352
  blockComponent,
@@ -7924,7 +7924,7 @@ function isFromTrustedHost(trustedHosts, e) {
7924
7924
  const url = new URL(e.origin), hostname = url.hostname;
7925
7925
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
7926
7926
  }
7927
- const SDK_VERSION = "0.14.18";
7927
+ const SDK_VERSION = "0.14.20";
7928
7928
  const registry = {};
7929
7929
  function register(type, info) {
7930
7930
  let typeList = registry[type];
@@ -285,16 +285,17 @@ function theFunction() {
285
285
  ${code}
286
286
  }
287
287
 
288
- let output = theFunction()
288
+ const output = theFunction()
289
289
 
290
290
  if (typeof output === 'object' && output !== null) {
291
- output = JSON.stringify(output.copySync ? output.copySync() : output);
291
+ return JSON.stringify(output.copySync ? output.copySync() : output);
292
+ } else {
293
+ return output;
292
294
  }
293
-
294
- output;
295
295
  `;
296
296
  };
297
297
  let IVM_INSTANCE = null;
298
+ let IVM_CONTEXT = null;
298
299
  const getIvm = () => {
299
300
  try {
300
301
  if (IVM_INSTANCE)
@@ -314,12 +315,26 @@ const getIvm = () => {
314
315
  Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
315
316
  `);
316
317
  };
317
- const getIsolateContext = () => {
318
+ function setIsolateContext(options = {
319
+ memoryLimit: 128
320
+ }) {
318
321
  const ivm = getIvm();
319
- const isolate = new ivm.Isolate({
320
- memoryLimit: 128
322
+ const isolate = new ivm.Isolate(options);
323
+ const context = isolate.createContextSync();
324
+ const jail = context.global;
325
+ jail.setSync("global", jail.derefInto());
326
+ jail.setSync("log", function(...logArgs) {
327
+ console.log(...logArgs);
321
328
  });
322
- return isolate.createContextSync();
329
+ jail.setSync(INJECTED_IVM_GLOBAL, ivm);
330
+ IVM_CONTEXT = context;
331
+ return context;
332
+ }
333
+ const getIsolateContext = () => {
334
+ if (IVM_CONTEXT)
335
+ return IVM_CONTEXT;
336
+ const context = setIsolateContext();
337
+ return context;
323
338
  };
324
339
  const runInNode = ({ code, builder, context, event, localState, rootSetState, rootState }) => {
325
340
  const ivm = getIvm();
@@ -335,10 +350,6 @@ const runInNode = ({ code, builder, context, event, localState, rootSetState, ro
335
350
  });
336
351
  const isolateContext = getIsolateContext();
337
352
  const jail = isolateContext.global;
338
- jail.setSync("global", jail.derefInto());
339
- jail.setSync("log", function(...logArgs) {
340
- console.log(...logArgs);
341
- });
342
353
  jail.setSync(BUILDER_SET_STATE_NAME, function(key, value) {
343
354
  set(rootState, key, value);
344
355
  rootSetState == null ? void 0 : rootSetState(rootState);
@@ -353,12 +364,11 @@ const runInNode = ({ code, builder, context, event, localState, rootSetState, ro
353
364
  ) : null;
354
365
  jail.setSync(getSyncValName(key), val);
355
366
  });
356
- jail.setSync(INJECTED_IVM_GLOBAL, ivm);
357
367
  const evalStr = processCode({
358
368
  code,
359
369
  args
360
370
  });
361
- const resultStr = isolateContext.evalSync(evalStr);
371
+ const resultStr = isolateContext.evalClosureSync(evalStr);
362
372
  try {
363
373
  const res = JSON.parse(resultStr);
364
374
  return res;
@@ -753,22 +763,22 @@ const getRepeatItemData = ({ block, context }) => {
753
763
  }));
754
764
  return repeatArray;
755
765
  };
756
- const shouldPassLinkComponent = (blockName) => {
757
- return blockName && [
766
+ const shouldPassLinkComponent = (block) => {
767
+ return block && (block.isRSC || [
758
768
  "Core:Button",
759
769
  "Symbol",
760
770
  "Columns",
761
771
  "Form:Form",
762
772
  "Builder: Tabs"
763
- ].includes(blockName);
773
+ ].includes(block.name));
764
774
  };
765
- const shouldPassRegisteredComponents = (blockName) => {
766
- return blockName && [
775
+ const shouldPassRegisteredComponents = (block) => {
776
+ return block && (block.isRSC || [
767
777
  "Symbol",
768
778
  "Columns",
769
779
  "Form:Form",
770
780
  "Builder: Tabs"
771
- ].includes(blockName);
781
+ ].includes(block.name));
772
782
  };
773
783
  const SIZES = {
774
784
  small: {
@@ -1219,7 +1229,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1219
1229
  repeatItem
1220
1230
  ]));
1221
1231
  const componentRefProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
1222
- var _a2, _b, _c, _d, _e;
1232
+ var _a2, _b, _c;
1223
1233
  const [blockComponent2, processedBlock2, props2] = qwik.useLexicalScope();
1224
1234
  return {
1225
1235
  blockChildren: processedBlock2.value.children ?? [],
@@ -1227,10 +1237,10 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1227
1237
  componentOptions: {
1228
1238
  ...getBlockComponentOptions(processedBlock2.value),
1229
1239
  builderContext: props2.context,
1230
- ...shouldPassLinkComponent((_b = blockComponent2.value) == null ? void 0 : _b.name) ? {
1240
+ ...shouldPassLinkComponent(blockComponent2.value) ? {
1231
1241
  builderLinkComponent: props2.linkComponent
1232
1242
  } : {},
1233
- ...shouldPassRegisteredComponents((_c = blockComponent2.value) == null ? void 0 : _c.name) ? {
1243
+ ...shouldPassRegisteredComponents(blockComponent2.value) ? {
1234
1244
  builderComponents: props2.registeredComponents
1235
1245
  } : {}
1236
1246
  },
@@ -1238,8 +1248,8 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1238
1248
  linkComponent: props2.linkComponent,
1239
1249
  registeredComponents: props2.registeredComponents,
1240
1250
  builderBlock: processedBlock2.value,
1241
- includeBlockProps: ((_d = blockComponent2.value) == null ? void 0 : _d.noWrap) === true,
1242
- isInteractive: !((_e = blockComponent2.value) == null ? void 0 : _e.isRSC)
1251
+ includeBlockProps: ((_b = blockComponent2.value) == null ? void 0 : _b.noWrap) === true,
1252
+ isInteractive: !((_c = blockComponent2.value) == null ? void 0 : _c.isRSC)
1243
1253
  };
1244
1254
  }, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
1245
1255
  blockComponent,
@@ -4817,7 +4827,7 @@ function isFromTrustedHost(trustedHosts, e) {
4817
4827
  const url = new URL(e.origin), hostname = url.hostname;
4818
4828
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4819
4829
  }
4820
- const SDK_VERSION = "0.14.18";
4830
+ const SDK_VERSION = "0.14.20";
4821
4831
  const registry = {};
4822
4832
  function register(type, info) {
4823
4833
  let typeList = registry[type];
@@ -283,16 +283,17 @@ function theFunction() {
283
283
  ${code}
284
284
  }
285
285
 
286
- let output = theFunction()
286
+ const output = theFunction()
287
287
 
288
288
  if (typeof output === 'object' && output !== null) {
289
- output = JSON.stringify(output.copySync ? output.copySync() : output);
289
+ return JSON.stringify(output.copySync ? output.copySync() : output);
290
+ } else {
291
+ return output;
290
292
  }
291
-
292
- output;
293
293
  `;
294
294
  };
295
295
  let IVM_INSTANCE = null;
296
+ let IVM_CONTEXT = null;
296
297
  const getIvm = () => {
297
298
  try {
298
299
  if (IVM_INSTANCE)
@@ -312,12 +313,26 @@ const getIvm = () => {
312
313
  Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
313
314
  `);
314
315
  };
315
- const getIsolateContext = () => {
316
+ function setIsolateContext(options = {
317
+ memoryLimit: 128
318
+ }) {
316
319
  const ivm = getIvm();
317
- const isolate = new ivm.Isolate({
318
- memoryLimit: 128
320
+ const isolate = new ivm.Isolate(options);
321
+ const context = isolate.createContextSync();
322
+ const jail = context.global;
323
+ jail.setSync("global", jail.derefInto());
324
+ jail.setSync("log", function(...logArgs) {
325
+ console.log(...logArgs);
319
326
  });
320
- return isolate.createContextSync();
327
+ jail.setSync(INJECTED_IVM_GLOBAL, ivm);
328
+ IVM_CONTEXT = context;
329
+ return context;
330
+ }
331
+ const getIsolateContext = () => {
332
+ if (IVM_CONTEXT)
333
+ return IVM_CONTEXT;
334
+ const context = setIsolateContext();
335
+ return context;
321
336
  };
322
337
  const runInNode = ({ code, builder, context, event, localState, rootSetState, rootState }) => {
323
338
  const ivm = getIvm();
@@ -333,10 +348,6 @@ const runInNode = ({ code, builder, context, event, localState, rootSetState, ro
333
348
  });
334
349
  const isolateContext = getIsolateContext();
335
350
  const jail = isolateContext.global;
336
- jail.setSync("global", jail.derefInto());
337
- jail.setSync("log", function(...logArgs) {
338
- console.log(...logArgs);
339
- });
340
351
  jail.setSync(BUILDER_SET_STATE_NAME, function(key, value) {
341
352
  set(rootState, key, value);
342
353
  rootSetState == null ? void 0 : rootSetState(rootState);
@@ -351,12 +362,11 @@ const runInNode = ({ code, builder, context, event, localState, rootSetState, ro
351
362
  ) : null;
352
363
  jail.setSync(getSyncValName(key), val);
353
364
  });
354
- jail.setSync(INJECTED_IVM_GLOBAL, ivm);
355
365
  const evalStr = processCode({
356
366
  code,
357
367
  args
358
368
  });
359
- const resultStr = isolateContext.evalSync(evalStr);
369
+ const resultStr = isolateContext.evalClosureSync(evalStr);
360
370
  try {
361
371
  const res = JSON.parse(resultStr);
362
372
  return res;
@@ -751,22 +761,22 @@ const getRepeatItemData = ({ block, context }) => {
751
761
  }));
752
762
  return repeatArray;
753
763
  };
754
- const shouldPassLinkComponent = (blockName) => {
755
- return blockName && [
764
+ const shouldPassLinkComponent = (block) => {
765
+ return block && (block.isRSC || [
756
766
  "Core:Button",
757
767
  "Symbol",
758
768
  "Columns",
759
769
  "Form:Form",
760
770
  "Builder: Tabs"
761
- ].includes(blockName);
771
+ ].includes(block.name));
762
772
  };
763
- const shouldPassRegisteredComponents = (blockName) => {
764
- return blockName && [
773
+ const shouldPassRegisteredComponents = (block) => {
774
+ return block && (block.isRSC || [
765
775
  "Symbol",
766
776
  "Columns",
767
777
  "Form:Form",
768
778
  "Builder: Tabs"
769
- ].includes(blockName);
779
+ ].includes(block.name));
770
780
  };
771
781
  const SIZES = {
772
782
  small: {
@@ -1217,7 +1227,7 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1217
1227
  repeatItem
1218
1228
  ]));
1219
1229
  const componentRefProps = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
1220
- var _a2, _b, _c, _d, _e;
1230
+ var _a2, _b, _c;
1221
1231
  const [blockComponent2, processedBlock2, props2] = useLexicalScope();
1222
1232
  return {
1223
1233
  blockChildren: processedBlock2.value.children ?? [],
@@ -1225,10 +1235,10 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1225
1235
  componentOptions: {
1226
1236
  ...getBlockComponentOptions(processedBlock2.value),
1227
1237
  builderContext: props2.context,
1228
- ...shouldPassLinkComponent((_b = blockComponent2.value) == null ? void 0 : _b.name) ? {
1238
+ ...shouldPassLinkComponent(blockComponent2.value) ? {
1229
1239
  builderLinkComponent: props2.linkComponent
1230
1240
  } : {},
1231
- ...shouldPassRegisteredComponents((_c = blockComponent2.value) == null ? void 0 : _c.name) ? {
1241
+ ...shouldPassRegisteredComponents(blockComponent2.value) ? {
1232
1242
  builderComponents: props2.registeredComponents
1233
1243
  } : {}
1234
1244
  },
@@ -1236,8 +1246,8 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1236
1246
  linkComponent: props2.linkComponent,
1237
1247
  registeredComponents: props2.registeredComponents,
1238
1248
  builderBlock: processedBlock2.value,
1239
- includeBlockProps: ((_d = blockComponent2.value) == null ? void 0 : _d.noWrap) === true,
1240
- isInteractive: !((_e = blockComponent2.value) == null ? void 0 : _e.isRSC)
1249
+ includeBlockProps: ((_b = blockComponent2.value) == null ? void 0 : _b.noWrap) === true,
1250
+ isInteractive: !((_c = blockComponent2.value) == null ? void 0 : _c.isRSC)
1241
1251
  };
1242
1252
  }, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
1243
1253
  blockComponent,
@@ -4815,7 +4825,7 @@ function isFromTrustedHost(trustedHosts, e) {
4815
4825
  const url = new URL(e.origin), hostname = url.hostname;
4816
4826
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4817
4827
  }
4818
- const SDK_VERSION = "0.14.18";
4828
+ const SDK_VERSION = "0.14.20";
4819
4829
  const registry = {};
4820
4830
  function register(type, info) {
4821
4831
  let typeList = registry[type];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.14.18",
3
+ "version": "0.14.20",
4
4
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/qwik",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,11 +1,11 @@
1
- import type { BuilderContextInterface, RegisteredComponents } from '../../context/types';
1
+ import type { BuilderContextInterface, RegisteredComponent, RegisteredComponents } from '../../context/types';
2
2
  import type { BuilderBlock } from '../../types/builder-block';
3
3
  import type { RepeatData } from './types';
4
4
  export declare const getComponent: ({ block, context, registeredComponents }: {
5
5
  block: BuilderBlock;
6
6
  context: BuilderContextInterface;
7
7
  registeredComponents: RegisteredComponents;
8
- }) => import("../../context/types").RegisteredComponent | null | undefined;
8
+ }) => RegisteredComponent | null | undefined;
9
9
  export declare const getRepeatItemData: ({ block, context }: {
10
10
  block: BuilderBlock;
11
11
  context: BuilderContextInterface;
@@ -14,5 +14,5 @@ export declare const getInheritedStyles: ({ block, context }: {
14
14
  block: BuilderBlock;
15
15
  context: BuilderContextInterface;
16
16
  }) => Partial<CSSStyleDeclaration>;
17
- export declare const shouldPassLinkComponent: (blockName: string | undefined) => boolean | "" | undefined;
18
- export declare const shouldPassRegisteredComponents: (blockName: string | undefined) => boolean | "" | undefined;
17
+ export declare const shouldPassLinkComponent: (block: RegisteredComponent | null | undefined) => boolean | null | undefined;
18
+ export declare const shouldPassRegisteredComponents: (block: RegisteredComponent | null | undefined) => boolean | null | undefined;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.14.18";
1
+ export declare const SDK_VERSION = "0.14.20";
@@ -1,3 +1,4 @@
1
+ import type { IsolateOptions } from 'isolated-vm';
1
2
  /**
2
3
  * This function initializes the SDK on a Node server. It handles importing the
3
4
  * `isolated-vm` package which is needed for dynamic bindings.
@@ -7,4 +8,6 @@
7
8
  * - The NextJS Pages router's `_document.tsx`
8
9
  * - Your Remix route's `loader`
9
10
  */
10
- export declare const initializeNodeRuntime: () => void;
11
+ export declare const initializeNodeRuntime: (args?: {
12
+ ivmIsolateOptions?: IsolateOptions;
13
+ }) => void;
@@ -1,8 +1,11 @@
1
+ import type { IsolateOptions } from 'isolated-vm';
1
2
  import type { ExecutorArgs } from '../helpers';
3
+ type IsolatedVMImport = typeof import('isolated-vm');
2
4
  /**
3
5
  * Set the `isolated-vm` instance to be used by the node runtime.
4
6
  * This is useful for environments that are not able to rely on our
5
7
  * `safeDynamicRequire` trick to import the `isolated-vm` package.
6
8
  */
7
- export declare const setIvm: (ivm: typeof import('isolated-vm')) => void;
9
+ export declare const setIvm: (ivm: IsolatedVMImport, options?: IsolateOptions) => void;
8
10
  export declare const runInNode: ({ code, builder, context, event, localState, rootSetState, rootState }: ExecutorArgs) => any;
11
+ export {};