react-markup 0.0.0-experimental-b07717d8-20250528 → 0.0.0-experimental-526dd340-20250602

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.
@@ -766,10 +766,17 @@
766
766
  onHeaders,
767
767
  maxHeadersLength
768
768
  ) {
769
- var inlineScriptWithNonce =
770
- void 0 === nonce
769
+ var nonceScript =
770
+ "string" === typeof nonce ? nonce : nonce && nonce.script,
771
+ inlineScriptWithNonce =
772
+ void 0 === nonceScript
771
773
  ? "<script"
772
- : '<script nonce="' + escapeTextForBrowser(nonce) + '"',
774
+ : '<script nonce="' + escapeTextForBrowser(nonceScript) + '"',
775
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
776
+ inlineStyleWithNonce =
777
+ void 0 === nonceStyle
778
+ ? "<style"
779
+ : '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"',
773
780
  idPrefix = resumableState.idPrefix,
774
781
  bootstrapChunks = [],
775
782
  externalRuntimeScript = null,
@@ -794,7 +801,7 @@
794
801
  src: externalRuntimeConfig,
795
802
  async: !0,
796
803
  integrity: void 0,
797
- nonce: nonce
804
+ nonce: nonceScript
798
805
  }))
799
806
  : ((externalRuntimeScript = {
800
807
  src: externalRuntimeConfig.src,
@@ -804,7 +811,7 @@
804
811
  src: externalRuntimeConfig.src,
805
812
  async: !0,
806
813
  integrity: externalRuntimeConfig.integrity,
807
- nonce: nonce
814
+ nonce: nonceScript
808
815
  })));
809
816
  externalRuntimeConfig = [];
810
817
  void 0 !== importMap &&
@@ -835,6 +842,7 @@
835
842
  segmentPrefix: idPrefix + "S:",
836
843
  boundaryPrefix: idPrefix + "B:",
837
844
  startInlineScript: inlineScriptWithNonce,
845
+ startInlineStyle: inlineStyleWithNonce,
838
846
  preamble: createPreambleState(),
839
847
  externalRuntimeScript: externalRuntimeScript,
840
848
  bootstrapChunks: bootstrapChunks,
@@ -864,7 +872,7 @@
864
872
  scripts: new Map(),
865
873
  moduleScripts: new Map()
866
874
  },
867
- nonce: nonce,
875
+ nonce: { script: nonceScript, style: nonceStyle },
868
876
  hoistableState: null,
869
877
  stylesToHoist: !1
870
878
  };
@@ -874,113 +882,109 @@
874
882
  inlineScriptWithNonce < bootstrapScripts.length;
875
883
  inlineScriptWithNonce++
876
884
  )
877
- (idPrefix = bootstrapScripts[inlineScriptWithNonce]),
878
- (maxHeadersLength = importMap = void 0),
879
- (externalRuntimeConfig = {
885
+ (nonceStyle = bootstrapScripts[inlineScriptWithNonce]),
886
+ (externalRuntimeScript = idPrefix = void 0),
887
+ (importMap = {
880
888
  rel: "preload",
881
889
  as: "script",
882
890
  fetchPriority: "low",
883
891
  nonce: nonce
884
892
  }),
885
- "string" === typeof idPrefix
886
- ? (externalRuntimeConfig.href = externalRuntimeScript = idPrefix)
887
- : ((externalRuntimeConfig.href = externalRuntimeScript =
888
- idPrefix.src),
889
- (externalRuntimeConfig.integrity = maxHeadersLength =
890
- "string" === typeof idPrefix.integrity
891
- ? idPrefix.integrity
893
+ "string" === typeof nonceStyle
894
+ ? (importMap.href = inlineStyleWithNonce = nonceStyle)
895
+ : ((importMap.href = inlineStyleWithNonce = nonceStyle.src),
896
+ (importMap.integrity = externalRuntimeScript =
897
+ "string" === typeof nonceStyle.integrity
898
+ ? nonceStyle.integrity
892
899
  : void 0),
893
- (externalRuntimeConfig.crossOrigin = importMap =
894
- "string" === typeof idPrefix || null == idPrefix.crossOrigin
900
+ (importMap.crossOrigin = idPrefix =
901
+ "string" === typeof nonceStyle ||
902
+ null == nonceStyle.crossOrigin
895
903
  ? void 0
896
- : "use-credentials" === idPrefix.crossOrigin
904
+ : "use-credentials" === nonceStyle.crossOrigin
897
905
  ? "use-credentials"
898
906
  : "")),
899
907
  preloadBootstrapScriptOrModule(
900
908
  resumableState,
901
909
  onHeaders,
902
- externalRuntimeScript,
903
- externalRuntimeConfig
910
+ inlineStyleWithNonce,
911
+ importMap
904
912
  ),
905
913
  bootstrapChunks.push(
906
914
  '<script src="',
907
- escapeTextForBrowser(externalRuntimeScript),
915
+ escapeTextForBrowser(inlineStyleWithNonce),
908
916
  attributeEnd
909
917
  ),
910
- nonce &&
918
+ nonceScript &&
911
919
  bootstrapChunks.push(
912
920
  ' nonce="',
913
- escapeTextForBrowser(nonce),
921
+ escapeTextForBrowser(nonceScript),
914
922
  attributeEnd
915
923
  ),
916
- "string" === typeof maxHeadersLength &&
924
+ "string" === typeof externalRuntimeScript &&
917
925
  bootstrapChunks.push(
918
926
  ' integrity="',
919
- escapeTextForBrowser(maxHeadersLength),
927
+ escapeTextForBrowser(externalRuntimeScript),
920
928
  attributeEnd
921
929
  ),
922
- "string" === typeof importMap &&
930
+ "string" === typeof idPrefix &&
923
931
  bootstrapChunks.push(
924
932
  ' crossorigin="',
925
- escapeTextForBrowser(importMap),
933
+ escapeTextForBrowser(idPrefix),
926
934
  attributeEnd
927
935
  ),
928
936
  pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
929
937
  bootstrapChunks.push(' async="">\x3c/script>');
930
938
  if (void 0 !== bootstrapModules)
931
- for (
932
- bootstrapScripts = 0;
933
- bootstrapScripts < bootstrapModules.length;
934
- bootstrapScripts++
935
- )
936
- (inlineScriptWithNonce = bootstrapModules[bootstrapScripts]),
937
- (importMap = externalRuntimeScript = void 0),
938
- (maxHeadersLength = {
939
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
940
+ (bootstrapScripts = bootstrapModules[nonce]),
941
+ (inlineStyleWithNonce = nonceStyle = void 0),
942
+ (idPrefix = {
939
943
  rel: "modulepreload",
940
944
  fetchPriority: "low",
941
- nonce: nonce
945
+ nonce: nonceScript
942
946
  }),
943
- "string" === typeof inlineScriptWithNonce
944
- ? (maxHeadersLength.href = idPrefix = inlineScriptWithNonce)
945
- : ((maxHeadersLength.href = idPrefix = inlineScriptWithNonce.src),
946
- (maxHeadersLength.integrity = importMap =
947
- "string" === typeof inlineScriptWithNonce.integrity
948
- ? inlineScriptWithNonce.integrity
947
+ "string" === typeof bootstrapScripts
948
+ ? (idPrefix.href = inlineScriptWithNonce = bootstrapScripts)
949
+ : ((idPrefix.href = inlineScriptWithNonce = bootstrapScripts.src),
950
+ (idPrefix.integrity = inlineStyleWithNonce =
951
+ "string" === typeof bootstrapScripts.integrity
952
+ ? bootstrapScripts.integrity
949
953
  : void 0),
950
- (maxHeadersLength.crossOrigin = externalRuntimeScript =
951
- "string" === typeof inlineScriptWithNonce ||
952
- null == inlineScriptWithNonce.crossOrigin
954
+ (idPrefix.crossOrigin = nonceStyle =
955
+ "string" === typeof bootstrapScripts ||
956
+ null == bootstrapScripts.crossOrigin
953
957
  ? void 0
954
- : "use-credentials" === inlineScriptWithNonce.crossOrigin
958
+ : "use-credentials" === bootstrapScripts.crossOrigin
955
959
  ? "use-credentials"
956
960
  : "")),
957
961
  preloadBootstrapScriptOrModule(
958
962
  resumableState,
959
963
  onHeaders,
960
- idPrefix,
961
- maxHeadersLength
964
+ inlineScriptWithNonce,
965
+ idPrefix
962
966
  ),
963
967
  bootstrapChunks.push(
964
968
  '<script type="module" src="',
965
- escapeTextForBrowser(idPrefix),
969
+ escapeTextForBrowser(inlineScriptWithNonce),
966
970
  attributeEnd
967
971
  ),
968
- nonce &&
972
+ nonceScript &&
969
973
  bootstrapChunks.push(
970
974
  ' nonce="',
971
- escapeTextForBrowser(nonce),
975
+ escapeTextForBrowser(nonceScript),
972
976
  attributeEnd
973
977
  ),
974
- "string" === typeof importMap &&
978
+ "string" === typeof inlineStyleWithNonce &&
975
979
  bootstrapChunks.push(
976
980
  ' integrity="',
977
- escapeTextForBrowser(importMap),
981
+ escapeTextForBrowser(inlineStyleWithNonce),
978
982
  attributeEnd
979
983
  ),
980
- "string" === typeof externalRuntimeScript &&
984
+ "string" === typeof nonceStyle &&
981
985
  bootstrapChunks.push(
982
986
  ' crossorigin="',
983
- escapeTextForBrowser(externalRuntimeScript),
987
+ escapeTextForBrowser(nonceStyle),
984
988
  attributeEnd
985
989
  ),
986
990
  pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
@@ -2741,7 +2745,8 @@
2741
2745
  );
2742
2746
  }
2743
2747
  var precedence$jscomp$0 = props.precedence,
2744
- href$jscomp$0 = props.href;
2748
+ href$jscomp$0 = props.href,
2749
+ nonce = props.nonce;
2745
2750
  if (
2746
2751
  4 === formatContext.insertionMode ||
2747
2752
  noscriptTagInScope$jscomp$2 ||
@@ -2810,47 +2815,64 @@
2810
2815
  'React encountered a hoistable style tag for the same href as a preload: "%s". When using a style tag to inline styles you should not also preload it as a stylsheet.',
2811
2816
  href$jscomp$0
2812
2817
  );
2813
- styleQueue$jscomp$0
2814
- ? styleQueue$jscomp$0.hrefs.push(
2815
- escapeTextForBrowser(href$jscomp$0)
2816
- )
2817
- : ((styleQueue$jscomp$0 = {
2818
- precedence: escapeTextForBrowser(precedence$jscomp$0),
2819
- rules: [],
2820
- hrefs: [escapeTextForBrowser(href$jscomp$0)],
2821
- sheets: new Map()
2822
- }),
2823
- renderState.styles.set(
2818
+ styleQueue$jscomp$0 ||
2819
+ ((styleQueue$jscomp$0 = {
2820
+ precedence: escapeTextForBrowser(precedence$jscomp$0),
2821
+ rules: [],
2822
+ hrefs: [],
2823
+ sheets: new Map()
2824
+ }),
2825
+ renderState.styles.set(
2826
+ precedence$jscomp$0,
2827
+ styleQueue$jscomp$0
2828
+ ));
2829
+ var nonceStyle = renderState.nonce.style;
2830
+ if (nonceStyle && nonceStyle !== nonce)
2831
+ console.error(
2832
+ 'React encountered a style tag with `precedence` "%s" and `nonce` "%s". When React manages style rules using `precedence` it will only include rules if the nonce matches the style nonce "%s" that was included with this render.',
2833
+ precedence$jscomp$0,
2834
+ nonce,
2835
+ nonceStyle
2836
+ );
2837
+ else {
2838
+ !nonceStyle &&
2839
+ nonce &&
2840
+ console.error(
2841
+ 'React encountered a style tag with `precedence` "%s" and `nonce` "%s". When React manages style rules using `precedence` it will only include a nonce attributes if you also provide the same style nonce value as a render option.',
2824
2842
  precedence$jscomp$0,
2825
- styleQueue$jscomp$0
2826
- ));
2827
- var target = styleQueue$jscomp$0.rules,
2828
- children$jscomp$9 = null,
2829
- innerHTML$jscomp$6 = null,
2830
- propKey$jscomp$9;
2831
- for (propKey$jscomp$9 in props)
2832
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
2833
- var propValue$jscomp$9 = props[propKey$jscomp$9];
2834
- if (null != propValue$jscomp$9)
2835
- switch (propKey$jscomp$9) {
2836
- case "children":
2837
- children$jscomp$9 = propValue$jscomp$9;
2838
- break;
2839
- case "dangerouslySetInnerHTML":
2840
- innerHTML$jscomp$6 = propValue$jscomp$9;
2841
- }
2842
- }
2843
- var child$jscomp$2 = Array.isArray(children$jscomp$9)
2844
- ? 2 > children$jscomp$9.length
2845
- ? children$jscomp$9[0]
2846
- : null
2847
- : children$jscomp$9;
2848
- "function" !== typeof child$jscomp$2 &&
2849
- "symbol" !== typeof child$jscomp$2 &&
2850
- null !== child$jscomp$2 &&
2851
- void 0 !== child$jscomp$2 &&
2852
- target.push(escapeStyleTextContent(child$jscomp$2));
2853
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
2843
+ nonce
2844
+ );
2845
+ styleQueue$jscomp$0.hrefs.push(
2846
+ escapeTextForBrowser(href$jscomp$0)
2847
+ );
2848
+ var target = styleQueue$jscomp$0.rules,
2849
+ children$jscomp$9 = null,
2850
+ innerHTML$jscomp$6 = null,
2851
+ propKey$jscomp$9;
2852
+ for (propKey$jscomp$9 in props)
2853
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
2854
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
2855
+ if (null != propValue$jscomp$9)
2856
+ switch (propKey$jscomp$9) {
2857
+ case "children":
2858
+ children$jscomp$9 = propValue$jscomp$9;
2859
+ break;
2860
+ case "dangerouslySetInnerHTML":
2861
+ innerHTML$jscomp$6 = propValue$jscomp$9;
2862
+ }
2863
+ }
2864
+ var child$jscomp$2 = Array.isArray(children$jscomp$9)
2865
+ ? 2 > children$jscomp$9.length
2866
+ ? children$jscomp$9[0]
2867
+ : null
2868
+ : children$jscomp$9;
2869
+ "function" !== typeof child$jscomp$2 &&
2870
+ "symbol" !== typeof child$jscomp$2 &&
2871
+ null !== child$jscomp$2 &&
2872
+ void 0 !== child$jscomp$2 &&
2873
+ target.push(escapeStyleTextContent(child$jscomp$2));
2874
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
2875
+ }
2854
2876
  }
2855
2877
  styleQueue$jscomp$0 &&
2856
2878
  hoistableState &&
@@ -3363,7 +3385,8 @@
3363
3385
  );
3364
3386
  var i = 0;
3365
3387
  if (hrefs.length) {
3366
- this.push('<style media="not all" data-precedence="');
3388
+ this.push(currentlyFlushingRenderState.startInlineStyle);
3389
+ this.push(' media="not all" data-precedence="');
3367
3390
  this.push(styleQueue.precedence);
3368
3391
  for (this.push('" data-href="'); i < hrefs.length - 1; i++)
3369
3392
  this.push(hrefs[i]), this.push(spaceSeparator);
@@ -3388,7 +3411,9 @@
3388
3411
  ) {
3389
3412
  currentlyRenderingBoundaryHasStylesToHoist = !1;
3390
3413
  destinationHasCapacity = !0;
3414
+ currentlyFlushingRenderState = renderState;
3391
3415
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
3416
+ currentlyFlushingRenderState = null;
3392
3417
  hoistableState.stylesheets.forEach(hasStylesToHoist);
3393
3418
  currentlyRenderingBoundaryHasStylesToHoist &&
3394
3419
  (renderState.stylesToHoist = !0);
@@ -3412,7 +3437,8 @@
3412
3437
  var rules = styleQueue.rules,
3413
3438
  hrefs = styleQueue.hrefs;
3414
3439
  if (!hasStylesheets || hrefs.length) {
3415
- this.push('<style data-precedence="');
3440
+ this.push(currentlyFlushingRenderState.startInlineStyle);
3441
+ this.push(' data-precedence="');
3416
3442
  this.push(styleQueue.precedence);
3417
3443
  styleQueue = 0;
3418
3444
  if (hrefs.length) {
@@ -8278,7 +8304,9 @@
8278
8304
  renderState.fontPreloads.clear();
8279
8305
  renderState.highImagePreloads.forEach(flushResource, destination);
8280
8306
  renderState.highImagePreloads.clear();
8307
+ currentlyFlushingRenderState = renderState;
8281
8308
  renderState.styles.forEach(flushStylesInPreamble, destination);
8309
+ currentlyFlushingRenderState = null;
8282
8310
  var importMapChunks = renderState.importMapChunks;
8283
8311
  for (
8284
8312
  i$jscomp$0 = 0;
@@ -9323,7 +9351,8 @@
9323
9351
  }),
9324
9352
  PRELOAD_NO_CREDS = [];
9325
9353
  Object.freeze(PRELOAD_NO_CREDS);
9326
- var scriptRegex = /(<\/|<)(s)(cript)/gi;
9354
+ var currentlyFlushingRenderState = null,
9355
+ scriptRegex = /(<\/|<)(s)(cript)/gi;
9327
9356
  var didWarnForNewBooleanPropsWithEmptyValue = {};
9328
9357
  var styleNameCache = new Map(),
9329
9358
  styleAttributeStart = ' style="',
@@ -9637,5 +9666,5 @@
9637
9666
  });
9638
9667
  });
9639
9668
  };
9640
- exports.version = "19.2.0-experimental-b07717d8-20250528";
9669
+ exports.version = "19.2.0-experimental-526dd340-20250602";
9641
9670
  })();