@builder.io/sdk-solid 2.0.0 → 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.
@@ -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
@@ -848,7 +849,11 @@ var getSizesForBreakpoints = ({
848
849
 
849
850
  // src/components/inlined-styles.tsx
850
851
  function InlinedStyles(props) {
851
- return <><style innerHTML={props.styles} data-id={props.id} /></>;
852
+ return <><style
853
+ innerHTML={props.styles}
854
+ data-id={props.id}
855
+ nonce={props.nonce}
856
+ /></>;
852
857
  }
853
858
  var Inlined_styles_default = InlinedStyles;
854
859
 
@@ -934,7 +939,11 @@ function BlockStyles(props) {
934
939
  hoverStylesClass
935
940
  ].join(" ");
936
941
  });
937
- return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default id="builderio-block" styles={css()} /></Show2></>;
942
+ return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
943
+ id="builderio-block"
944
+ styles={css()}
945
+ nonce={props.context.nonce}
946
+ /></Show2></>;
938
947
  }
939
948
  var Block_styles_default = BlockStyles;
940
949
 
@@ -1487,13 +1496,14 @@ function Columns(props) {
1487
1496
  }
1488
1497
  return <>
1489
1498
  <div
1490
- class={getColumnsClass(props.builderBlock?.id) + " div-710294c2"}
1499
+ class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
1491
1500
  style={columnsCssVars()}
1492
1501
  {...{}}
1493
1502
  >
1494
1503
  <Show6 when={TARGET !== "reactNative"}><Inlined_styles_default
1495
1504
  id="builderio-columns"
1496
1505
  styles={columnsStyles()}
1506
+ nonce={props.builderContext.nonce}
1497
1507
  /></Show6>
1498
1508
  <For4 each={props.columns}>{(column, _index) => {
1499
1509
  const index = _index();
@@ -1515,7 +1525,7 @@ function Columns(props) {
1515
1525
  /></Dynamic_renderer_default>;
1516
1526
  }}</For4>
1517
1527
  </div>
1518
- <style>{`.div-710294c2 {
1528
+ <style>{`.div-5b8fb3ac {
1519
1529
  display: flex;
1520
1530
  line-height: normal;
1521
1531
  }`}</style>
@@ -4129,7 +4139,11 @@ var getUpdateVariantVisibilityScript = ({
4129
4139
 
4130
4140
  // src/components/inlined-script.tsx
4131
4141
  function InlinedScript(props) {
4132
- return <><script innerHTML={props.scriptStr} data-id={props.id} /></>;
4142
+ return <><script
4143
+ innerHTML={props.scriptStr}
4144
+ data-id={props.id}
4145
+ nonce={props.nonce || ""}
4146
+ /></>;
4133
4147
  }
4134
4148
  var Inlined_script_default = InlinedScript;
4135
4149
 
@@ -4638,7 +4652,7 @@ function isFromTrustedHost(trustedHosts, e) {
4638
4652
  }
4639
4653
 
4640
4654
  // src/constants/sdk-version.ts
4641
- var SDK_VERSION = "2.0.0";
4655
+ var SDK_VERSION = "2.0.1";
4642
4656
 
4643
4657
  // src/functions/register.ts
4644
4658
  var registry = {};
@@ -5236,6 +5250,7 @@ ${getDefaultStyles(props.isNestedRender)}
5236
5250
  return <><Inlined_styles_default
5237
5251
  id="builderio-content"
5238
5252
  styles={injectedStyles()}
5253
+ nonce={props.nonce}
5239
5254
  /></>;
5240
5255
  }
5241
5256
  var Styles_default = ContentStyles;
@@ -5329,7 +5344,8 @@ function ContentComponent(props) {
5329
5344
  ),
5330
5345
  inheritedStyles: {},
5331
5346
  BlocksWrapper: props.blocksWrapper || "div",
5332
- BlocksWrapperProps: props.blocksWrapperProps || {}
5347
+ BlocksWrapperProps: props.blocksWrapperProps || {},
5348
+ nonce: props.nonce || ""
5333
5349
  });
5334
5350
  function contentSetState(newRootState) {
5335
5351
  setBuilderContextSignal((PREVIOUS_VALUE) => ({
@@ -5342,6 +5358,7 @@ function ContentComponent(props) {
5342
5358
  registeredComponents: registeredComponents()
5343
5359
  }}
5344
5360
  ><Enable_editor_default
5361
+ nonce={props.nonce}
5345
5362
  content={props.content}
5346
5363
  data={props.data}
5347
5364
  model={props.model}
@@ -5362,8 +5379,10 @@ function ContentComponent(props) {
5362
5379
  <Show13 when={props.isSsrAbTest}><Inlined_script_default
5363
5380
  id="builderio-variant-visibility"
5364
5381
  scriptStr={scriptStr()}
5382
+ nonce={props.nonce || ""}
5365
5383
  /></Show13>
5366
5384
  <Show13 when={TARGET !== "reactNative"}><Styles_default
5385
+ nonce={props.nonce || ""}
5367
5386
  isNestedRender={props.isNestedRender}
5368
5387
  contentId={builderContextSignal().content?.id}
5369
5388
  cssCode={builderContextSignal().content?.data?.cssCode}
@@ -5415,21 +5434,25 @@ function ContentVariants(props) {
5415
5434
  <Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5416
5435
  id="builderio-init-variants-fns"
5417
5436
  scriptStr={getInitVariantsFnsScriptString()}
5437
+ nonce={props.nonce || ""}
5418
5438
  /></Show14>
5419
5439
  <Show14 when={shouldRenderVariants()}>
5420
5440
  <Inlined_styles_default
5421
5441
  id="builderio-variants"
5422
5442
  styles={hideVariantsStyleString()}
5443
+ nonce={props.nonce || ""}
5423
5444
  />
5424
5445
  <Inlined_script_default
5425
5446
  id="builderio-variants-visibility"
5426
5447
  scriptStr={updateCookieAndStylesScriptStr()}
5448
+ nonce={props.nonce || ""}
5427
5449
  />
5428
5450
  <For9 each={getVariants(props.content)}>{(variant, _index) => {
5429
5451
  const index = _index();
5430
5452
  return <Content_default
5431
5453
  isNestedRender={props.isNestedRender}
5432
5454
  key={variant.testVariationId}
5455
+ nonce={props.nonce}
5433
5456
  content={variant}
5434
5457
  showContent={false}
5435
5458
  model={props.model}
@@ -5452,6 +5475,7 @@ function ContentVariants(props) {
5452
5475
  }}</For9>
5453
5476
  </Show14>
5454
5477
  <Content_default
5478
+ nonce={props.nonce}
5455
5479
  isNestedRender={props.isNestedRender}
5456
5480
  {...{}}
5457
5481
  content={defaultContent()}
@@ -5538,6 +5562,7 @@ function Symbol(props) {
5538
5562
  }
5539
5563
  createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
5540
5564
  return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
5565
+ nonce={props.builderContext.nonce}
5541
5566
  isNestedRender={true}
5542
5567
  apiVersion={props.builderContext.apiVersion}
5543
5568
  apiKey={props.builderContext.apiKey}
package/lib/edge/dev.js CHANGED
@@ -119,7 +119,8 @@ var builder_context_default = createContext({
119
119
  componentInfos: {},
120
120
  inheritedStyles: {},
121
121
  BlocksWrapper: "div",
122
- BlocksWrapperProps: {}
122
+ BlocksWrapperProps: {},
123
+ nonce: ""
123
124
  });
124
125
  var components_context_default = createContext({ registeredComponents: {} });
125
126
 
@@ -4012,13 +4013,15 @@ function InlinedStyles(props) {
4012
4013
  return (() => {
4013
4014
  const _el$ = _tmpl$();
4014
4015
  effect((_p$) => {
4015
- const _v$ = props.styles, _v$2 = props.id;
4016
+ const _v$ = props.styles, _v$2 = props.id, _v$3 = props.nonce;
4016
4017
  _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
4017
4018
  _v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
4019
+ _v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
4018
4020
  return _p$;
4019
4021
  }, {
4020
4022
  _v$: void 0,
4021
- _v$2: void 0
4023
+ _v$2: void 0,
4024
+ _v$3: void 0
4022
4025
  });
4023
4026
  return _el$;
4024
4027
  })();
@@ -4101,6 +4104,9 @@ function BlockStyles(props) {
4101
4104
  id: "builderio-block",
4102
4105
  get styles() {
4103
4106
  return css();
4107
+ },
4108
+ get nonce() {
4109
+ return props.context.nonce;
4104
4110
  }
4105
4111
  });
4106
4112
  }
@@ -4703,7 +4709,7 @@ var getColumnsClass = (id2) => {
4703
4709
 
4704
4710
  // src/blocks/columns/columns.tsx
4705
4711
  var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
4706
- var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-710294c2 {
4712
+ var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-5b8fb3ac {
4707
4713
  display: flex;
4708
4714
  line-height: normal;
4709
4715
  }`);
@@ -4823,7 +4829,7 @@ function Columns(props) {
4823
4829
  const _el$ = _tmpl$3();
4824
4830
  spread(_el$, mergeProps({
4825
4831
  get ["class"]() {
4826
- return getColumnsClass(props.builderBlock?.id) + " div-710294c2";
4832
+ return getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac";
4827
4833
  },
4828
4834
  get style() {
4829
4835
  return columnsCssVars();
@@ -4836,6 +4842,9 @@ function Columns(props) {
4836
4842
  id: "builderio-columns",
4837
4843
  get styles() {
4838
4844
  return columnsStyles();
4845
+ },
4846
+ get nonce() {
4847
+ return props.builderContext.nonce;
4839
4848
  }
4840
4849
  });
4841
4850
  }
@@ -7771,13 +7780,15 @@ function InlinedScript(props) {
7771
7780
  return (() => {
7772
7781
  const _el$ = _tmpl$20();
7773
7782
  effect((_p$) => {
7774
- const _v$ = props.scriptStr, _v$2 = props.id;
7783
+ const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
7775
7784
  _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
7776
7785
  _v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
7786
+ _v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
7777
7787
  return _p$;
7778
7788
  }, {
7779
7789
  _v$: void 0,
7780
- _v$2: void 0
7790
+ _v$2: void 0,
7791
+ _v$3: void 0
7781
7792
  });
7782
7793
  return _el$;
7783
7794
  })();
@@ -8283,7 +8294,7 @@ function isFromTrustedHost(trustedHosts, e) {
8283
8294
  }
8284
8295
 
8285
8296
  // src/constants/sdk-version.ts
8286
- var SDK_VERSION = "2.0.0";
8297
+ var SDK_VERSION = "2.0.1";
8287
8298
 
8288
8299
  // src/functions/register.ts
8289
8300
  var registry = {};
@@ -8866,6 +8877,9 @@ ${getDefaultStyles(props.isNestedRender)}
8866
8877
  id: "builderio-content",
8867
8878
  get styles() {
8868
8879
  return injectedStyles();
8880
+ },
8881
+ get nonce() {
8882
+ return props.nonce;
8869
8883
  }
8870
8884
  });
8871
8885
  }
@@ -8950,7 +8964,8 @@ function ContentComponent(props) {
8950
8964
  }), {}),
8951
8965
  inheritedStyles: {},
8952
8966
  BlocksWrapper: props.blocksWrapper || "div",
8953
- BlocksWrapperProps: props.blocksWrapperProps || {}
8967
+ BlocksWrapperProps: props.blocksWrapperProps || {},
8968
+ nonce: props.nonce || ""
8954
8969
  });
8955
8970
  function contentSetState(newRootState) {
8956
8971
  setBuilderContextSignal((PREVIOUS_VALUE) => ({
@@ -8966,6 +8981,9 @@ function ContentComponent(props) {
8966
8981
  },
8967
8982
  get children() {
8968
8983
  return createComponent(enable_editor_default, mergeProps({
8984
+ get nonce() {
8985
+ return props.nonce;
8986
+ },
8969
8987
  get content() {
8970
8988
  return props.content;
8971
8989
  },
@@ -9018,6 +9036,9 @@ function ContentComponent(props) {
9018
9036
  id: "builderio-variant-visibility",
9019
9037
  get scriptStr() {
9020
9038
  return scriptStr();
9039
+ },
9040
+ get nonce() {
9041
+ return props.nonce || "";
9021
9042
  }
9022
9043
  });
9023
9044
  }
@@ -9025,6 +9046,9 @@ function ContentComponent(props) {
9025
9046
  when: TARGET !== "reactNative",
9026
9047
  get children() {
9027
9048
  return createComponent(styles_default, {
9049
+ get nonce() {
9050
+ return props.nonce || "";
9051
+ },
9028
9052
  get isNestedRender() {
9029
9053
  return props.isNestedRender;
9030
9054
  },
@@ -9096,6 +9120,9 @@ function ContentVariants(props) {
9096
9120
  id: "builderio-init-variants-fns",
9097
9121
  get scriptStr() {
9098
9122
  return getInitVariantsFnsScriptString();
9123
+ },
9124
+ get nonce() {
9125
+ return props.nonce || "";
9099
9126
  }
9100
9127
  });
9101
9128
  }
@@ -9108,11 +9135,17 @@ function ContentVariants(props) {
9108
9135
  id: "builderio-variants",
9109
9136
  get styles() {
9110
9137
  return hideVariantsStyleString();
9138
+ },
9139
+ get nonce() {
9140
+ return props.nonce || "";
9111
9141
  }
9112
9142
  }), createComponent(inlined_script_default, {
9113
9143
  id: "builderio-variants-visibility",
9114
9144
  get scriptStr() {
9115
9145
  return updateCookieAndStylesScriptStr();
9146
+ },
9147
+ get nonce() {
9148
+ return props.nonce || "";
9116
9149
  }
9117
9150
  }), createComponent(For, {
9118
9151
  get each() {
@@ -9127,6 +9160,9 @@ function ContentVariants(props) {
9127
9160
  get key() {
9128
9161
  return variant.testVariationId;
9129
9162
  },
9163
+ get nonce() {
9164
+ return props.nonce;
9165
+ },
9130
9166
  content: variant,
9131
9167
  showContent: false,
9132
9168
  get model() {
@@ -9182,6 +9218,9 @@ function ContentVariants(props) {
9182
9218
  })];
9183
9219
  }
9184
9220
  }), createComponent(content_default, mergeProps({
9221
+ get nonce() {
9222
+ return props.nonce;
9223
+ },
9185
9224
  get isNestedRender() {
9186
9225
  return props.isNestedRender;
9187
9226
  }
@@ -9306,6 +9345,9 @@ function Symbol2(props) {
9306
9345
  }
9307
9346
  }, {}, () => props.attributes, {}), false, true);
9308
9347
  insert(_el$, createComponent(content_variants_default, {
9348
+ get nonce() {
9349
+ return props.builderContext.nonce;
9350
+ },
9309
9351
  isNestedRender: true,
9310
9352
  get apiVersion() {
9311
9353
  return props.builderContext.apiVersion;
package/lib/edge/dev.jsx CHANGED
@@ -102,7 +102,8 @@ var builder_context_default = createContext({
102
102
  componentInfos: {},
103
103
  inheritedStyles: {},
104
104
  BlocksWrapper: "div",
105
- BlocksWrapperProps: {}
105
+ BlocksWrapperProps: {},
106
+ nonce: ""
106
107
  });
107
108
 
108
109
  // src/context/components.context.ts
@@ -4002,7 +4003,11 @@ var getSizesForBreakpoints = ({
4002
4003
 
4003
4004
  // src/components/inlined-styles.tsx
4004
4005
  function InlinedStyles(props) {
4005
- return <><style innerHTML={props.styles} data-id={props.id} /></>;
4006
+ return <><style
4007
+ innerHTML={props.styles}
4008
+ data-id={props.id}
4009
+ nonce={props.nonce}
4010
+ /></>;
4006
4011
  }
4007
4012
  var Inlined_styles_default = InlinedStyles;
4008
4013
 
@@ -4088,7 +4093,11 @@ function BlockStyles(props) {
4088
4093
  hoverStylesClass
4089
4094
  ].join(" ");
4090
4095
  });
4091
- return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default id="builderio-block" styles={css()} /></Show2></>;
4096
+ return <><Show2 when={TARGET !== "reactNative" && css() && canShowBlock()}><Inlined_styles_default
4097
+ id="builderio-block"
4098
+ styles={css()}
4099
+ nonce={props.context.nonce}
4100
+ /></Show2></>;
4092
4101
  }
4093
4102
  var Block_styles_default = BlockStyles;
4094
4103
 
@@ -4641,13 +4650,14 @@ function Columns(props) {
4641
4650
  }
4642
4651
  return <>
4643
4652
  <div
4644
- class={getColumnsClass(props.builderBlock?.id) + " div-710294c2"}
4653
+ class={getColumnsClass(props.builderBlock?.id) + " div-5b8fb3ac"}
4645
4654
  style={columnsCssVars()}
4646
4655
  {...{}}
4647
4656
  >
4648
4657
  <Show6 when={TARGET !== "reactNative"}><Inlined_styles_default
4649
4658
  id="builderio-columns"
4650
4659
  styles={columnsStyles()}
4660
+ nonce={props.builderContext.nonce}
4651
4661
  /></Show6>
4652
4662
  <For4 each={props.columns}>{(column, _index) => {
4653
4663
  const index = _index();
@@ -4669,7 +4679,7 @@ function Columns(props) {
4669
4679
  /></Dynamic_renderer_default>;
4670
4680
  }}</For4>
4671
4681
  </div>
4672
- <style>{`.div-710294c2 {
4682
+ <style>{`.div-5b8fb3ac {
4673
4683
  display: flex;
4674
4684
  line-height: normal;
4675
4685
  }`}</style>
@@ -7287,7 +7297,11 @@ var getUpdateVariantVisibilityScript = ({
7287
7297
 
7288
7298
  // src/components/inlined-script.tsx
7289
7299
  function InlinedScript(props) {
7290
- return <><script innerHTML={props.scriptStr} data-id={props.id} /></>;
7300
+ return <><script
7301
+ innerHTML={props.scriptStr}
7302
+ data-id={props.id}
7303
+ nonce={props.nonce || ""}
7304
+ /></>;
7291
7305
  }
7292
7306
  var Inlined_script_default = InlinedScript;
7293
7307
 
@@ -7801,7 +7815,7 @@ function isFromTrustedHost(trustedHosts, e) {
7801
7815
  }
7802
7816
 
7803
7817
  // src/constants/sdk-version.ts
7804
- var SDK_VERSION = "2.0.0";
7818
+ var SDK_VERSION = "2.0.1";
7805
7819
 
7806
7820
  // src/functions/register.ts
7807
7821
  var registry = {};
@@ -8401,6 +8415,7 @@ ${getDefaultStyles(props.isNestedRender)}
8401
8415
  return <><Inlined_styles_default
8402
8416
  id="builderio-content"
8403
8417
  styles={injectedStyles()}
8418
+ nonce={props.nonce}
8404
8419
  /></>;
8405
8420
  }
8406
8421
  var Styles_default = ContentStyles;
@@ -8494,7 +8509,8 @@ function ContentComponent(props) {
8494
8509
  ),
8495
8510
  inheritedStyles: {},
8496
8511
  BlocksWrapper: props.blocksWrapper || "div",
8497
- BlocksWrapperProps: props.blocksWrapperProps || {}
8512
+ BlocksWrapperProps: props.blocksWrapperProps || {},
8513
+ nonce: props.nonce || ""
8498
8514
  });
8499
8515
  function contentSetState(newRootState) {
8500
8516
  setBuilderContextSignal((PREVIOUS_VALUE) => ({
@@ -8507,6 +8523,7 @@ function ContentComponent(props) {
8507
8523
  registeredComponents: registeredComponents()
8508
8524
  }}
8509
8525
  ><Enable_editor_default
8526
+ nonce={props.nonce}
8510
8527
  content={props.content}
8511
8528
  data={props.data}
8512
8529
  model={props.model}
@@ -8527,8 +8544,10 @@ function ContentComponent(props) {
8527
8544
  <Show13 when={props.isSsrAbTest}><Inlined_script_default
8528
8545
  id="builderio-variant-visibility"
8529
8546
  scriptStr={scriptStr()}
8547
+ nonce={props.nonce || ""}
8530
8548
  /></Show13>
8531
8549
  <Show13 when={TARGET !== "reactNative"}><Styles_default
8550
+ nonce={props.nonce || ""}
8532
8551
  isNestedRender={props.isNestedRender}
8533
8552
  contentId={builderContextSignal().content?.id}
8534
8553
  cssCode={builderContextSignal().content?.data?.cssCode}
@@ -8580,21 +8599,25 @@ function ContentVariants(props) {
8580
8599
  <Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
8581
8600
  id="builderio-init-variants-fns"
8582
8601
  scriptStr={getInitVariantsFnsScriptString()}
8602
+ nonce={props.nonce || ""}
8583
8603
  /></Show14>
8584
8604
  <Show14 when={shouldRenderVariants()}>
8585
8605
  <Inlined_styles_default
8586
8606
  id="builderio-variants"
8587
8607
  styles={hideVariantsStyleString()}
8608
+ nonce={props.nonce || ""}
8588
8609
  />
8589
8610
  <Inlined_script_default
8590
8611
  id="builderio-variants-visibility"
8591
8612
  scriptStr={updateCookieAndStylesScriptStr()}
8613
+ nonce={props.nonce || ""}
8592
8614
  />
8593
8615
  <For9 each={getVariants(props.content)}>{(variant, _index) => {
8594
8616
  const index = _index();
8595
8617
  return <Content_default
8596
8618
  isNestedRender={props.isNestedRender}
8597
8619
  key={variant.testVariationId}
8620
+ nonce={props.nonce}
8598
8621
  content={variant}
8599
8622
  showContent={false}
8600
8623
  model={props.model}
@@ -8617,6 +8640,7 @@ function ContentVariants(props) {
8617
8640
  }}</For9>
8618
8641
  </Show14>
8619
8642
  <Content_default
8643
+ nonce={props.nonce}
8620
8644
  isNestedRender={props.isNestedRender}
8621
8645
  {...{}}
8622
8646
  content={defaultContent()}
@@ -8703,6 +8727,7 @@ function Symbol2(props) {
8703
8727
  }
8704
8728
  createEffect4(on4(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
8705
8729
  return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
8730
+ nonce={props.builderContext.nonce}
8706
8731
  isNestedRender={true}
8707
8732
  apiVersion={props.builderContext.apiVersion}
8708
8733
  apiKey={props.builderContext.apiKey}