@builder.io/sdk-solid 4.0.9 → 4.1.0

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/node/index.js CHANGED
@@ -2476,8 +2476,8 @@ var DEFAULT_INDEX = "default";
2476
2476
  var FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME = "filterWithCustomTargeting";
2477
2477
  var BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME = "builderIoPersonalization";
2478
2478
  var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "updateVisibilityStylesScript";
2479
- var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte"];
2480
- var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte"];
2479
+ var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte", "qwik"];
2480
+ var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte", "qwik"];
2481
2481
  function checkShouldRenderVariants(variants, canTrack) {
2482
2482
  const hasVariants = variants && variants.length > 0;
2483
2483
  if (TARGET === "reactNative")
@@ -2735,6 +2735,11 @@ var handleABTesting = async ({
2735
2735
  };
2736
2736
  };
2737
2737
 
2738
+ // src/helpers/no-serialize-wrapper.ts
2739
+ function noSerializeWrapper(fn) {
2740
+ return fn;
2741
+ }
2742
+
2738
2743
  // src/helpers/user-attributes.ts
2739
2744
  var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
2740
2745
  function createUserAttributesService() {
@@ -2765,18 +2770,32 @@ function createUserAttributesService() {
2765
2770
  canTrack
2766
2771
  }) || "{}");
2767
2772
  },
2768
- subscribeOnUserAttributesChange(callback) {
2773
+ subscribeOnUserAttributesChange(callback, {
2774
+ fireImmediately
2775
+ } = {}) {
2769
2776
  subscribers.add(callback);
2770
- return () => {
2777
+ if (fireImmediately) {
2778
+ callback(this.getUserAttributes());
2779
+ }
2780
+ return noSerializeWrapper(function() {
2771
2781
  subscribers.delete(callback);
2772
- };
2782
+ });
2773
2783
  },
2774
2784
  setCanTrack(value) {
2775
2785
  canTrack = value;
2776
2786
  }
2777
2787
  };
2778
2788
  }
2779
- var userAttributesService = createUserAttributesService();
2789
+ var _userAttributesService;
2790
+ if (isBrowser() && TARGET === "qwik") {
2791
+ if (!window.__BUILDER_USER_ATTRIBUTES_SERVICE__) {
2792
+ window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = createUserAttributesService();
2793
+ }
2794
+ _userAttributesService = window.__BUILDER_USER_ATTRIBUTES_SERVICE__;
2795
+ } else {
2796
+ _userAttributesService = createUserAttributesService();
2797
+ }
2798
+ var userAttributesService = _userAttributesService;
2780
2799
  var setClientUserAttributes = (attributes) => {
2781
2800
  userAttributesService.setUserAttributes(attributes);
2782
2801
  };
@@ -3631,6 +3650,8 @@ function PersonalizationContainer(props) {
3631
3650
  setShouldResetVariants(true);
3632
3651
  const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs2) => {
3633
3652
  setUserAttributes(attrs2);
3653
+ }, {
3654
+ fireImmediately: TARGET === "qwik"
3634
3655
  });
3635
3656
  if (!(isEditing() || isPreviewing())) {
3636
3657
  const variant = filteredVariants()[0];
@@ -4648,9 +4669,9 @@ function logFetch(url) {
4648
4669
  }
4649
4670
 
4650
4671
  // src/blocks/form/form/form.tsx
4651
- var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
4672
+ var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-7430044e">`);
4652
4673
  var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
4653
- var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
4674
+ var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-7430044e {
4654
4675
  padding: 10px;
4655
4676
  color: red;
4656
4677
  text-align: center;
@@ -4762,6 +4783,14 @@ function FormComponent(props) {
4762
4783
  }
4763
4784
  }
4764
4785
  setFormState("sending");
4786
+ if (props.sendSubmissionsTo === "email" && (props.sendSubmissionsToEmail === "your@email.com" || !props.sendSubmissionsToEmail)) {
4787
+ const message = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
4788
+ setFormState("error");
4789
+ mergeNewRootState({
4790
+ formErrorMessage: message
4791
+ });
4792
+ return;
4793
+ }
4765
4794
  const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
4766
4795
  const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
4767
4796
  logFetch(url);
@@ -4777,17 +4806,30 @@ function FormComponent(props) {
4777
4806
  } else {
4778
4807
  body2 = await res.text();
4779
4808
  }
4780
- if (!res.ok && props.errorMessagePath) {
4781
- let message = get(body2, props.errorMessagePath);
4782
- if (message) {
4783
- if (typeof message !== "string") {
4784
- message = JSON.stringify(message);
4809
+ if (!res.ok) {
4810
+ const submitErrorEvent = new CustomEvent("submit:error", {
4811
+ detail: {
4812
+ error: body2,
4813
+ status: res.status
4814
+ }
4815
+ });
4816
+ if (formRef?.nativeElement) {
4817
+ formRef?.nativeElement.dispatchEvent(submitErrorEvent);
4818
+ if (submitErrorEvent.defaultPrevented) {
4819
+ return;
4785
4820
  }
4786
- setFormErrorMessage(message);
4787
- mergeNewRootState({
4788
- formErrorMessage: message
4789
- });
4790
4821
  }
4822
+ setResponseData(body2);
4823
+ setFormState("error");
4824
+ let message = props.errorMessagePath ? get(body2, props.errorMessagePath) : body2.message || body2.error || body2;
4825
+ if (typeof message !== "string") {
4826
+ message = JSON.stringify(message);
4827
+ }
4828
+ setFormErrorMessage(message);
4829
+ mergeNewRootState({
4830
+ formErrorMessage: message
4831
+ });
4832
+ return;
4791
4833
  }
4792
4834
  setResponseData(body2);
4793
4835
  setFormState(res.ok ? "success" : "error");
@@ -5215,6 +5257,16 @@ var componentInfo19 = {
5215
5257
  };
5216
5258
  var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
5217
5259
  function ImgComponent(props) {
5260
+ const srcSetToUse = createMemo(() => {
5261
+ const url = props.imgSrc || props.image;
5262
+ if (!url || typeof url !== "string") {
5263
+ return void 0;
5264
+ }
5265
+ if (!url.match(/builder\.io/)) {
5266
+ return void 0;
5267
+ }
5268
+ return getSrcSet(url);
5269
+ });
5218
5270
  return (() => {
5219
5271
  const _el$ = _tmpl$20();
5220
5272
  spread(_el$, mergeProps({
@@ -5232,6 +5284,9 @@ function ImgComponent(props) {
5232
5284
  },
5233
5285
  get src() {
5234
5286
  return props.imgSrc || props.image;
5287
+ },
5288
+ get srcSet() {
5289
+ return srcSetToUse();
5235
5290
  }
5236
5291
  }, {}, () => props.attributes), false, false);
5237
5292
  return _el$;
@@ -5602,7 +5657,7 @@ function getPreviewContent(_searchParams) {
5602
5657
  }
5603
5658
 
5604
5659
  // src/constants/sdk-version.ts
5605
- var SDK_VERSION = "4.0.9";
5660
+ var SDK_VERSION = "4.1.0";
5606
5661
 
5607
5662
  // src/helpers/sdk-headers.ts
5608
5663
  var getSdkHeaders = () => ({
@@ -2145,10 +2145,10 @@ function SectionComponent(props) {
2145
2145
  var section_default = SectionComponent;
2146
2146
 
2147
2147
  // src/blocks/symbol/symbol.tsx
2148
- import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
2148
+ import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
2149
2149
 
2150
2150
  // src/components/content-variants/content-variants.tsx
2151
- import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
2151
+ import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
2152
2152
 
2153
2153
  // src/blocks/personalization-container/helpers/inlined-fns.ts
2154
2154
  function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
@@ -2239,8 +2239,8 @@ var DEFAULT_INDEX = "default";
2239
2239
  var FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME = "filterWithCustomTargeting";
2240
2240
  var BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME = "builderIoPersonalization";
2241
2241
  var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "updateVisibilityStylesScript";
2242
- var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte"];
2243
- var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte"];
2242
+ var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte", "qwik"];
2243
+ var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte", "qwik"];
2244
2244
  function checkShouldRenderVariants(variants, canTrack) {
2245
2245
  const hasVariants = variants && variants.length > 0;
2246
2246
  if (TARGET === "reactNative")
@@ -2498,6 +2498,11 @@ var handleABTesting = async ({
2498
2498
  };
2499
2499
  };
2500
2500
 
2501
+ // src/helpers/no-serialize-wrapper.ts
2502
+ function noSerializeWrapper(fn) {
2503
+ return fn;
2504
+ }
2505
+
2501
2506
  // src/helpers/user-attributes.ts
2502
2507
  var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
2503
2508
  function createUserAttributesService() {
@@ -2528,18 +2533,32 @@ function createUserAttributesService() {
2528
2533
  canTrack
2529
2534
  }) || "{}");
2530
2535
  },
2531
- subscribeOnUserAttributesChange(callback) {
2536
+ subscribeOnUserAttributesChange(callback, {
2537
+ fireImmediately
2538
+ } = {}) {
2532
2539
  subscribers.add(callback);
2533
- return () => {
2540
+ if (fireImmediately) {
2541
+ callback(this.getUserAttributes());
2542
+ }
2543
+ return noSerializeWrapper(function() {
2534
2544
  subscribers.delete(callback);
2535
- };
2545
+ });
2536
2546
  },
2537
2547
  setCanTrack(value) {
2538
2548
  canTrack = value;
2539
2549
  }
2540
2550
  };
2541
2551
  }
2542
- var userAttributesService = createUserAttributesService();
2552
+ var _userAttributesService;
2553
+ if (isBrowser() && TARGET === "qwik") {
2554
+ if (!window.__BUILDER_USER_ATTRIBUTES_SERVICE__) {
2555
+ window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = createUserAttributesService();
2556
+ }
2557
+ _userAttributesService = window.__BUILDER_USER_ATTRIBUTES_SERVICE__;
2558
+ } else {
2559
+ _userAttributesService = createUserAttributesService();
2560
+ }
2561
+ var userAttributesService = _userAttributesService;
2543
2562
  var setClientUserAttributes = (attributes) => {
2544
2563
  userAttributesService.setUserAttributes(attributes);
2545
2564
  };
@@ -2552,7 +2571,7 @@ var getDefaultCanTrack = (canTrack) => {
2552
2571
  };
2553
2572
 
2554
2573
  // src/components/content/content.tsx
2555
- import { Show as Show15, createSignal as createSignal18 } from "solid-js";
2574
+ import { Show as Show15, createSignal as createSignal19 } from "solid-js";
2556
2575
 
2557
2576
  // src/blocks/accordion/component-info.ts
2558
2577
  var defaultTitle = {
@@ -3381,6 +3400,9 @@ function PersonalizationContainer(props) {
3381
3400
  const unsub = userAttributesService.subscribeOnUserAttributesChange(
3382
3401
  (attrs2) => {
3383
3402
  setUserAttributes(attrs2);
3403
+ },
3404
+ {
3405
+ fireImmediately: TARGET === "qwik"
3384
3406
  }
3385
3407
  );
3386
3408
  if (!(isEditing() || isPreviewing())) {
@@ -4361,6 +4383,14 @@ function FormComponent(props) {
4361
4383
  }
4362
4384
  }
4363
4385
  setFormState("sending");
4386
+ if (props.sendSubmissionsTo === "email" && (props.sendSubmissionsToEmail === "your@email.com" || !props.sendSubmissionsToEmail)) {
4387
+ const message = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
4388
+ setFormState("error");
4389
+ mergeNewRootState({
4390
+ formErrorMessage: message
4391
+ });
4392
+ return;
4393
+ }
4364
4394
  const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(
4365
4395
  props.sendSubmissionsToEmail || ""
4366
4396
  )}&name=${encodeURIComponent(props.name || "")}`;
@@ -4379,17 +4409,30 @@ function FormComponent(props) {
4379
4409
  } else {
4380
4410
  body2 = await res.text();
4381
4411
  }
4382
- if (!res.ok && props.errorMessagePath) {
4383
- let message = get(body2, props.errorMessagePath);
4384
- if (message) {
4385
- if (typeof message !== "string") {
4386
- message = JSON.stringify(message);
4412
+ if (!res.ok) {
4413
+ const submitErrorEvent = new CustomEvent("submit:error", {
4414
+ detail: {
4415
+ error: body2,
4416
+ status: res.status
4417
+ }
4418
+ });
4419
+ if (formRef?.nativeElement) {
4420
+ formRef?.nativeElement.dispatchEvent(submitErrorEvent);
4421
+ if (submitErrorEvent.defaultPrevented) {
4422
+ return;
4387
4423
  }
4388
- setFormErrorMessage(message);
4389
- mergeNewRootState({
4390
- formErrorMessage: message
4391
- });
4392
4424
  }
4425
+ setResponseData(body2);
4426
+ setFormState("error");
4427
+ let message = props.errorMessagePath ? get(body2, props.errorMessagePath) : body2.message || body2.error || body2;
4428
+ if (typeof message !== "string") {
4429
+ message = JSON.stringify(message);
4430
+ }
4431
+ setFormErrorMessage(message);
4432
+ mergeNewRootState({
4433
+ formErrorMessage: message
4434
+ });
4435
+ return;
4393
4436
  }
4394
4437
  setResponseData(body2);
4395
4438
  setFormState(res.ok ? "success" : "error");
@@ -4468,14 +4511,14 @@ function FormComponent(props) {
4468
4511
  blocks={props.sendingMessage}
4469
4512
  context={props.builderContext}
4470
4513
  /></Show12>
4471
- <Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
4514
+ <Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-7430044e">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
4472
4515
  <Show12 when={submissionState() === "success"}><Blocks_default
4473
4516
  path="successMessage"
4474
4517
  blocks={props.successMessage}
4475
4518
  context={props.builderContext}
4476
4519
  /></Show12>
4477
4520
  </form>
4478
- <style>{`.pre-04a43b72 {
4521
+ <style>{`.pre-7430044e {
4479
4522
  padding: 10px;
4480
4523
  color: red;
4481
4524
  text-align: center;
@@ -4722,7 +4765,18 @@ var componentInfo19 = {
4722
4765
  };
4723
4766
 
4724
4767
  // src/blocks/img/img.tsx
4768
+ import { createMemo as createMemo15 } from "solid-js";
4725
4769
  function ImgComponent(props) {
4770
+ const srcSetToUse = createMemo15(() => {
4771
+ const url = props.imgSrc || props.image;
4772
+ if (!url || typeof url !== "string") {
4773
+ return void 0;
4774
+ }
4775
+ if (!url.match(/builder\.io/)) {
4776
+ return void 0;
4777
+ }
4778
+ return getSrcSet(url);
4779
+ });
4726
4780
  return <><img
4727
4781
  style={{
4728
4782
  "object-fit": props.backgroundSize || "cover",
@@ -4731,6 +4785,7 @@ function ImgComponent(props) {
4731
4785
  key={isEditing() && props.imgSrc || "default-key"}
4732
4786
  alt={props.altText}
4733
4787
  src={props.imgSrc || props.image}
4788
+ srcSet={srcSetToUse()}
4734
4789
  {...{}}
4735
4790
  {...props.attributes}
4736
4791
  /></>;
@@ -4825,10 +4880,10 @@ var componentInfo20 = {
4825
4880
  };
4826
4881
 
4827
4882
  // src/blocks/video/video.tsx
4828
- import { Show as Show13, onMount as onMount7, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
4883
+ import { Show as Show13, onMount as onMount7, createSignal as createSignal16, createMemo as createMemo16 } from "solid-js";
4829
4884
  function Video(props) {
4830
- const [lazyVideoObserver, setLazyVideoObserver] = createSignal15(void 0);
4831
- const videoProps = createMemo15(() => {
4885
+ const [lazyVideoObserver, setLazyVideoObserver] = createSignal16(void 0);
4886
+ const videoProps = createMemo16(() => {
4832
4887
  return {
4833
4888
  ...props.autoPlay === true ? {
4834
4889
  autoPlay: true
@@ -4847,7 +4902,7 @@ function Video(props) {
4847
4902
  } : {}
4848
4903
  };
4849
4904
  });
4850
- const spreadProps = createMemo15(() => {
4905
+ const spreadProps = createMemo16(() => {
4851
4906
  return {
4852
4907
  ...videoProps()
4853
4908
  };
@@ -5086,8 +5141,8 @@ import {
5086
5141
  onMount as onMount8,
5087
5142
  on as on8,
5088
5143
  createEffect as createEffect8,
5089
- createMemo as createMemo16,
5090
- createSignal as createSignal16
5144
+ createMemo as createMemo17,
5145
+ createSignal as createSignal17
5091
5146
  } from "solid-js";
5092
5147
  import { Dynamic as Dynamic5 } from "solid-js/web";
5093
5148
 
@@ -5097,7 +5152,7 @@ function getPreviewContent(_searchParams) {
5097
5152
  }
5098
5153
 
5099
5154
  // src/constants/sdk-version.ts
5100
- var SDK_VERSION = "4.0.9";
5155
+ var SDK_VERSION = "4.1.0";
5101
5156
 
5102
5157
  // src/helpers/sdk-headers.ts
5103
5158
  var getSdkHeaders = () => ({
@@ -5952,13 +6007,13 @@ var getWrapperClassName = (variationId) => {
5952
6007
 
5953
6008
  // src/components/content/components/enable-editor.tsx
5954
6009
  function EnableEditor(props) {
5955
- const [hasExecuted, setHasExecuted] = createSignal16(false);
5956
- const [ContentWrapper, setContentWrapper] = createSignal16(
6010
+ const [hasExecuted, setHasExecuted] = createSignal17(false);
6011
+ const [ContentWrapper, setContentWrapper] = createSignal17(
5957
6012
  props.contentWrapper || "div"
5958
6013
  );
5959
- const [httpReqsData, setHttpReqsData] = createSignal16({});
5960
- const [httpReqsPending, setHttpReqsPending] = createSignal16({});
5961
- const [clicked, setClicked] = createSignal16(false);
6014
+ const [httpReqsData, setHttpReqsData] = createSignal17({});
6015
+ const [httpReqsPending, setHttpReqsPending] = createSignal17({});
6016
+ const [clicked, setClicked] = createSignal17(false);
5962
6017
  function mergeNewRootState(newData) {
5963
6018
  const combinedState = {
5964
6019
  ...props.builderContextSignal.rootState,
@@ -5992,7 +6047,7 @@ function EnableEditor(props) {
5992
6047
  content: newContentValue
5993
6048
  }));
5994
6049
  }
5995
- const showContentProps = createMemo16(() => {
6050
+ const showContentProps = createMemo17(() => {
5996
6051
  return props.showContent ? {} : {
5997
6052
  hidden: true,
5998
6053
  "aria-hidden": true
@@ -6176,14 +6231,14 @@ function EnableEditor(props) {
6176
6231
  }
6177
6232
  }
6178
6233
  });
6179
- const onUpdateFn_0_props_content = createMemo16(() => props.content);
6234
+ const onUpdateFn_0_props_content = createMemo17(() => props.content);
6180
6235
  function onUpdateFn_0() {
6181
6236
  if (props.content) {
6182
6237
  mergeNewContent(props.content);
6183
6238
  }
6184
6239
  }
6185
6240
  createEffect8(on8(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
6186
- const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
6241
+ const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
6187
6242
  () => props.builderContextSignal.rootState
6188
6243
  );
6189
6244
  function onUpdateFn_1() {
@@ -6195,14 +6250,14 @@ function EnableEditor(props) {
6195
6250
  onUpdateFn_1
6196
6251
  )
6197
6252
  );
6198
- const onUpdateFn_2_props_data = createMemo16(() => props.data);
6253
+ const onUpdateFn_2_props_data = createMemo17(() => props.data);
6199
6254
  function onUpdateFn_2() {
6200
6255
  if (props.data) {
6201
6256
  mergeNewRootState(props.data);
6202
6257
  }
6203
6258
  }
6204
6259
  createEffect8(on8(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
6205
- const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
6260
+ const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
6206
6261
  function onUpdateFn_3() {
6207
6262
  if (props.locale) {
6208
6263
  mergeNewRootState({
@@ -6234,9 +6289,9 @@ function EnableEditor(props) {
6234
6289
  var Enable_editor_default = EnableEditor;
6235
6290
 
6236
6291
  // src/components/content/components/styles.tsx
6237
- import { createSignal as createSignal17 } from "solid-js";
6292
+ import { createSignal as createSignal18 } from "solid-js";
6238
6293
  function ContentStyles(props) {
6239
- const [injectedStyles, setInjectedStyles] = createSignal17(
6294
+ const [injectedStyles, setInjectedStyles] = createSignal18(
6240
6295
  `
6241
6296
  ${getCss({
6242
6297
  cssCode: props.cssCode,
@@ -6294,7 +6349,7 @@ var getContentInitialValue = ({
6294
6349
 
6295
6350
  // src/components/content/content.tsx
6296
6351
  function ContentComponent(props) {
6297
- const [scriptStr, setScriptStr] = createSignal18(
6352
+ const [scriptStr, setScriptStr] = createSignal19(
6298
6353
  getUpdateVariantVisibilityScript({
6299
6354
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
6300
6355
  variationId: props.content?.testVariationId,
@@ -6302,7 +6357,7 @@ function ContentComponent(props) {
6302
6357
  contentId: props.content?.id
6303
6358
  })
6304
6359
  );
6305
- const [registeredComponents, setRegisteredComponents] = createSignal18(
6360
+ const [registeredComponents, setRegisteredComponents] = createSignal19(
6306
6361
  [
6307
6362
  ...getDefaultRegisteredComponents(),
6308
6363
  ...props.customComponents || []
@@ -6317,7 +6372,7 @@ function ContentComponent(props) {
6317
6372
  {}
6318
6373
  )
6319
6374
  );
6320
- const [builderContextSignal, setBuilderContextSignal] = createSignal18({
6375
+ const [builderContextSignal, setBuilderContextSignal] = createSignal19({
6321
6376
  content: getContentInitialValue({
6322
6377
  content: props.content,
6323
6378
  data: props.data
@@ -6425,13 +6480,13 @@ var Content_default = ContentComponent;
6425
6480
 
6426
6481
  // src/components/content-variants/content-variants.tsx
6427
6482
  function ContentVariants(props) {
6428
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
6483
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal20(
6429
6484
  checkShouldRenderVariants2({
6430
6485
  canTrack: getDefaultCanTrack(props.canTrack),
6431
6486
  content: props.content
6432
6487
  })
6433
6488
  );
6434
- const updateCookieAndStylesScriptStr = createMemo19(() => {
6489
+ const updateCookieAndStylesScriptStr = createMemo20(() => {
6435
6490
  return getUpdateCookieAndStylesScript(
6436
6491
  getVariants(props.content).map((value) => ({
6437
6492
  id: value.testVariationId,
@@ -6440,10 +6495,10 @@ function ContentVariants(props) {
6440
6495
  props.content?.id || ""
6441
6496
  );
6442
6497
  });
6443
- const hideVariantsStyleString = createMemo19(() => {
6498
+ const hideVariantsStyleString = createMemo20(() => {
6444
6499
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
6445
6500
  });
6446
- const defaultContent = createMemo19(() => {
6501
+ const defaultContent = createMemo20(() => {
6447
6502
  return shouldRenderVariants() ? {
6448
6503
  ...props.content,
6449
6504
  testVariationId: props.content?.id
@@ -6562,15 +6617,15 @@ var fetchSymbolContent = async ({
6562
6617
 
6563
6618
  // src/blocks/symbol/symbol.tsx
6564
6619
  function Symbol(props) {
6565
- const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
6566
- const [symbolEntry, setSymbolEntry] = createSignal20(props.symbol?.entry);
6567
- const blocksWrapper = createMemo20(() => {
6620
+ const [contentToUse, setContentToUse] = createSignal21(props.symbol?.content);
6621
+ const [symbolEntry, setSymbolEntry] = createSignal21(props.symbol?.entry);
6622
+ const blocksWrapper = createMemo21(() => {
6568
6623
  return "div";
6569
6624
  });
6570
- const contentWrapper = createMemo20(() => {
6625
+ const contentWrapper = createMemo21(() => {
6571
6626
  return "div";
6572
6627
  });
6573
- const className = createMemo20(() => {
6628
+ const className = createMemo21(() => {
6574
6629
  return [
6575
6630
  ...[props.attributes[getClassPropName()]],
6576
6631
  "builder-symbol",
@@ -6593,7 +6648,7 @@ function Symbol(props) {
6593
6648
  }
6594
6649
  onMount10(() => {
6595
6650
  });
6596
- const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
6651
+ const onUpdateFn_0_props_symbol = createMemo21(() => props.symbol);
6597
6652
  function onUpdateFn_0() {
6598
6653
  setContent();
6599
6654
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-solid",
3
- "version": "4.0.9",
3
+ "version": "4.1.0",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",