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.
@@ -5598,10 +5598,17 @@
5598
5598
  onHeaders,
5599
5599
  maxHeadersLength
5600
5600
  ) {
5601
- var inlineScriptWithNonce =
5602
- void 0 === nonce
5601
+ var nonceScript =
5602
+ "string" === typeof nonce ? nonce : nonce && nonce.script,
5603
+ inlineScriptWithNonce =
5604
+ void 0 === nonceScript
5603
5605
  ? "<script"
5604
- : '<script nonce="' + escapeTextForBrowser(nonce) + '"',
5606
+ : '<script nonce="' + escapeTextForBrowser(nonceScript) + '"',
5607
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
5608
+ inlineStyleWithNonce =
5609
+ void 0 === nonceStyle
5610
+ ? "<style"
5611
+ : '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"',
5605
5612
  idPrefix = resumableState.idPrefix,
5606
5613
  bootstrapChunks = [],
5607
5614
  externalRuntimeScript = null,
@@ -5626,7 +5633,7 @@
5626
5633
  src: externalRuntimeConfig,
5627
5634
  async: !0,
5628
5635
  integrity: void 0,
5629
- nonce: nonce
5636
+ nonce: nonceScript
5630
5637
  }))
5631
5638
  : ((externalRuntimeScript = {
5632
5639
  src: externalRuntimeConfig.src,
@@ -5636,7 +5643,7 @@
5636
5643
  src: externalRuntimeConfig.src,
5637
5644
  async: !0,
5638
5645
  integrity: externalRuntimeConfig.integrity,
5639
- nonce: nonce
5646
+ nonce: nonceScript
5640
5647
  })));
5641
5648
  externalRuntimeConfig = [];
5642
5649
  void 0 !== importMap &&
@@ -5667,6 +5674,7 @@
5667
5674
  segmentPrefix: idPrefix + "S:",
5668
5675
  boundaryPrefix: idPrefix + "B:",
5669
5676
  startInlineScript: inlineScriptWithNonce,
5677
+ startInlineStyle: inlineStyleWithNonce,
5670
5678
  preamble: createPreambleState(),
5671
5679
  externalRuntimeScript: externalRuntimeScript,
5672
5680
  bootstrapChunks: bootstrapChunks,
@@ -5696,7 +5704,7 @@
5696
5704
  scripts: new Map(),
5697
5705
  moduleScripts: new Map()
5698
5706
  },
5699
- nonce: nonce,
5707
+ nonce: { script: nonceScript, style: nonceStyle },
5700
5708
  hoistableState: null,
5701
5709
  stylesToHoist: !1
5702
5710
  };
@@ -5706,113 +5714,109 @@
5706
5714
  inlineScriptWithNonce < bootstrapScripts.length;
5707
5715
  inlineScriptWithNonce++
5708
5716
  )
5709
- (idPrefix = bootstrapScripts[inlineScriptWithNonce]),
5710
- (maxHeadersLength = importMap = void 0),
5711
- (externalRuntimeConfig = {
5717
+ (nonceStyle = bootstrapScripts[inlineScriptWithNonce]),
5718
+ (externalRuntimeScript = idPrefix = void 0),
5719
+ (importMap = {
5712
5720
  rel: "preload",
5713
5721
  as: "script",
5714
5722
  fetchPriority: "low",
5715
5723
  nonce: nonce
5716
5724
  }),
5717
- "string" === typeof idPrefix
5718
- ? (externalRuntimeConfig.href = externalRuntimeScript = idPrefix)
5719
- : ((externalRuntimeConfig.href = externalRuntimeScript =
5720
- idPrefix.src),
5721
- (externalRuntimeConfig.integrity = maxHeadersLength =
5722
- "string" === typeof idPrefix.integrity
5723
- ? idPrefix.integrity
5725
+ "string" === typeof nonceStyle
5726
+ ? (importMap.href = inlineStyleWithNonce = nonceStyle)
5727
+ : ((importMap.href = inlineStyleWithNonce = nonceStyle.src),
5728
+ (importMap.integrity = externalRuntimeScript =
5729
+ "string" === typeof nonceStyle.integrity
5730
+ ? nonceStyle.integrity
5724
5731
  : void 0),
5725
- (externalRuntimeConfig.crossOrigin = importMap =
5726
- "string" === typeof idPrefix || null == idPrefix.crossOrigin
5732
+ (importMap.crossOrigin = idPrefix =
5733
+ "string" === typeof nonceStyle ||
5734
+ null == nonceStyle.crossOrigin
5727
5735
  ? void 0
5728
- : "use-credentials" === idPrefix.crossOrigin
5736
+ : "use-credentials" === nonceStyle.crossOrigin
5729
5737
  ? "use-credentials"
5730
5738
  : "")),
5731
5739
  preloadBootstrapScriptOrModule(
5732
5740
  resumableState,
5733
5741
  onHeaders,
5734
- externalRuntimeScript,
5735
- externalRuntimeConfig
5742
+ inlineStyleWithNonce,
5743
+ importMap
5736
5744
  ),
5737
5745
  bootstrapChunks.push(
5738
5746
  '<script src="',
5739
- escapeTextForBrowser(externalRuntimeScript),
5747
+ escapeTextForBrowser(inlineStyleWithNonce),
5740
5748
  attributeEnd
5741
5749
  ),
5742
- nonce &&
5750
+ nonceScript &&
5743
5751
  bootstrapChunks.push(
5744
5752
  ' nonce="',
5745
- escapeTextForBrowser(nonce),
5753
+ escapeTextForBrowser(nonceScript),
5746
5754
  attributeEnd
5747
5755
  ),
5748
- "string" === typeof maxHeadersLength &&
5756
+ "string" === typeof externalRuntimeScript &&
5749
5757
  bootstrapChunks.push(
5750
5758
  ' integrity="',
5751
- escapeTextForBrowser(maxHeadersLength),
5759
+ escapeTextForBrowser(externalRuntimeScript),
5752
5760
  attributeEnd
5753
5761
  ),
5754
- "string" === typeof importMap &&
5762
+ "string" === typeof idPrefix &&
5755
5763
  bootstrapChunks.push(
5756
5764
  ' crossorigin="',
5757
- escapeTextForBrowser(importMap),
5765
+ escapeTextForBrowser(idPrefix),
5758
5766
  attributeEnd
5759
5767
  ),
5760
5768
  pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
5761
5769
  bootstrapChunks.push(' async="">\x3c/script>');
5762
5770
  if (void 0 !== bootstrapModules)
5763
- for (
5764
- bootstrapScripts = 0;
5765
- bootstrapScripts < bootstrapModules.length;
5766
- bootstrapScripts++
5767
- )
5768
- (inlineScriptWithNonce = bootstrapModules[bootstrapScripts]),
5769
- (importMap = externalRuntimeScript = void 0),
5770
- (maxHeadersLength = {
5771
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
5772
+ (bootstrapScripts = bootstrapModules[nonce]),
5773
+ (inlineStyleWithNonce = nonceStyle = void 0),
5774
+ (idPrefix = {
5771
5775
  rel: "modulepreload",
5772
5776
  fetchPriority: "low",
5773
- nonce: nonce
5777
+ nonce: nonceScript
5774
5778
  }),
5775
- "string" === typeof inlineScriptWithNonce
5776
- ? (maxHeadersLength.href = idPrefix = inlineScriptWithNonce)
5777
- : ((maxHeadersLength.href = idPrefix = inlineScriptWithNonce.src),
5778
- (maxHeadersLength.integrity = importMap =
5779
- "string" === typeof inlineScriptWithNonce.integrity
5780
- ? inlineScriptWithNonce.integrity
5779
+ "string" === typeof bootstrapScripts
5780
+ ? (idPrefix.href = inlineScriptWithNonce = bootstrapScripts)
5781
+ : ((idPrefix.href = inlineScriptWithNonce = bootstrapScripts.src),
5782
+ (idPrefix.integrity = inlineStyleWithNonce =
5783
+ "string" === typeof bootstrapScripts.integrity
5784
+ ? bootstrapScripts.integrity
5781
5785
  : void 0),
5782
- (maxHeadersLength.crossOrigin = externalRuntimeScript =
5783
- "string" === typeof inlineScriptWithNonce ||
5784
- null == inlineScriptWithNonce.crossOrigin
5786
+ (idPrefix.crossOrigin = nonceStyle =
5787
+ "string" === typeof bootstrapScripts ||
5788
+ null == bootstrapScripts.crossOrigin
5785
5789
  ? void 0
5786
- : "use-credentials" === inlineScriptWithNonce.crossOrigin
5790
+ : "use-credentials" === bootstrapScripts.crossOrigin
5787
5791
  ? "use-credentials"
5788
5792
  : "")),
5789
5793
  preloadBootstrapScriptOrModule(
5790
5794
  resumableState,
5791
5795
  onHeaders,
5792
- idPrefix,
5793
- maxHeadersLength
5796
+ inlineScriptWithNonce,
5797
+ idPrefix
5794
5798
  ),
5795
5799
  bootstrapChunks.push(
5796
5800
  '<script type="module" src="',
5797
- escapeTextForBrowser(idPrefix),
5801
+ escapeTextForBrowser(inlineScriptWithNonce),
5798
5802
  attributeEnd
5799
5803
  ),
5800
- nonce &&
5804
+ nonceScript &&
5801
5805
  bootstrapChunks.push(
5802
5806
  ' nonce="',
5803
- escapeTextForBrowser(nonce),
5807
+ escapeTextForBrowser(nonceScript),
5804
5808
  attributeEnd
5805
5809
  ),
5806
- "string" === typeof importMap &&
5810
+ "string" === typeof inlineStyleWithNonce &&
5807
5811
  bootstrapChunks.push(
5808
5812
  ' integrity="',
5809
- escapeTextForBrowser(importMap),
5813
+ escapeTextForBrowser(inlineStyleWithNonce),
5810
5814
  attributeEnd
5811
5815
  ),
5812
- "string" === typeof externalRuntimeScript &&
5816
+ "string" === typeof nonceStyle &&
5813
5817
  bootstrapChunks.push(
5814
5818
  ' crossorigin="',
5815
- escapeTextForBrowser(externalRuntimeScript),
5819
+ escapeTextForBrowser(nonceStyle),
5816
5820
  attributeEnd
5817
5821
  ),
5818
5822
  pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
@@ -7573,7 +7577,8 @@
7573
7577
  );
7574
7578
  }
7575
7579
  var precedence$jscomp$0 = props.precedence,
7576
- href$jscomp$0 = props.href;
7580
+ href$jscomp$0 = props.href,
7581
+ nonce = props.nonce;
7577
7582
  if (
7578
7583
  4 === formatContext.insertionMode ||
7579
7584
  noscriptTagInScope$jscomp$2 ||
@@ -7642,47 +7647,64 @@
7642
7647
  '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.',
7643
7648
  href$jscomp$0
7644
7649
  );
7645
- styleQueue$jscomp$0
7646
- ? styleQueue$jscomp$0.hrefs.push(
7647
- escapeTextForBrowser(href$jscomp$0)
7648
- )
7649
- : ((styleQueue$jscomp$0 = {
7650
- precedence: escapeTextForBrowser(precedence$jscomp$0),
7651
- rules: [],
7652
- hrefs: [escapeTextForBrowser(href$jscomp$0)],
7653
- sheets: new Map()
7654
- }),
7655
- renderState.styles.set(
7650
+ styleQueue$jscomp$0 ||
7651
+ ((styleQueue$jscomp$0 = {
7652
+ precedence: escapeTextForBrowser(precedence$jscomp$0),
7653
+ rules: [],
7654
+ hrefs: [],
7655
+ sheets: new Map()
7656
+ }),
7657
+ renderState.styles.set(
7658
+ precedence$jscomp$0,
7659
+ styleQueue$jscomp$0
7660
+ ));
7661
+ var nonceStyle = renderState.nonce.style;
7662
+ if (nonceStyle && nonceStyle !== nonce)
7663
+ console.error(
7664
+ '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.',
7665
+ precedence$jscomp$0,
7666
+ nonce,
7667
+ nonceStyle
7668
+ );
7669
+ else {
7670
+ !nonceStyle &&
7671
+ nonce &&
7672
+ console.error(
7673
+ '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.',
7656
7674
  precedence$jscomp$0,
7657
- styleQueue$jscomp$0
7658
- ));
7659
- var target = styleQueue$jscomp$0.rules,
7660
- children$jscomp$9 = null,
7661
- innerHTML$jscomp$6 = null,
7662
- propKey$jscomp$9;
7663
- for (propKey$jscomp$9 in props)
7664
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
7665
- var propValue$jscomp$9 = props[propKey$jscomp$9];
7666
- if (null != propValue$jscomp$9)
7667
- switch (propKey$jscomp$9) {
7668
- case "children":
7669
- children$jscomp$9 = propValue$jscomp$9;
7670
- break;
7671
- case "dangerouslySetInnerHTML":
7672
- innerHTML$jscomp$6 = propValue$jscomp$9;
7673
- }
7674
- }
7675
- var child$jscomp$2 = Array.isArray(children$jscomp$9)
7676
- ? 2 > children$jscomp$9.length
7677
- ? children$jscomp$9[0]
7678
- : null
7679
- : children$jscomp$9;
7680
- "function" !== typeof child$jscomp$2 &&
7681
- "symbol" !== typeof child$jscomp$2 &&
7682
- null !== child$jscomp$2 &&
7683
- void 0 !== child$jscomp$2 &&
7684
- target.push(escapeStyleTextContent(child$jscomp$2));
7685
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
7675
+ nonce
7676
+ );
7677
+ styleQueue$jscomp$0.hrefs.push(
7678
+ escapeTextForBrowser(href$jscomp$0)
7679
+ );
7680
+ var target = styleQueue$jscomp$0.rules,
7681
+ children$jscomp$9 = null,
7682
+ innerHTML$jscomp$6 = null,
7683
+ propKey$jscomp$9;
7684
+ for (propKey$jscomp$9 in props)
7685
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
7686
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
7687
+ if (null != propValue$jscomp$9)
7688
+ switch (propKey$jscomp$9) {
7689
+ case "children":
7690
+ children$jscomp$9 = propValue$jscomp$9;
7691
+ break;
7692
+ case "dangerouslySetInnerHTML":
7693
+ innerHTML$jscomp$6 = propValue$jscomp$9;
7694
+ }
7695
+ }
7696
+ var child$jscomp$2 = Array.isArray(children$jscomp$9)
7697
+ ? 2 > children$jscomp$9.length
7698
+ ? children$jscomp$9[0]
7699
+ : null
7700
+ : children$jscomp$9;
7701
+ "function" !== typeof child$jscomp$2 &&
7702
+ "symbol" !== typeof child$jscomp$2 &&
7703
+ null !== child$jscomp$2 &&
7704
+ void 0 !== child$jscomp$2 &&
7705
+ target.push(escapeStyleTextContent(child$jscomp$2));
7706
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
7707
+ }
7686
7708
  }
7687
7709
  styleQueue$jscomp$0 &&
7688
7710
  hoistableState &&
@@ -8195,7 +8217,8 @@
8195
8217
  );
8196
8218
  var i = 0;
8197
8219
  if (hrefs.length) {
8198
- this.push('<style media="not all" data-precedence="');
8220
+ this.push(currentlyFlushingRenderState.startInlineStyle);
8221
+ this.push(' media="not all" data-precedence="');
8199
8222
  this.push(styleQueue.precedence);
8200
8223
  for (this.push('" data-href="'); i < hrefs.length - 1; i++)
8201
8224
  this.push(hrefs[i]), this.push(spaceSeparator);
@@ -8220,7 +8243,9 @@
8220
8243
  ) {
8221
8244
  currentlyRenderingBoundaryHasStylesToHoist = !1;
8222
8245
  destinationHasCapacity = !0;
8246
+ currentlyFlushingRenderState = renderState;
8223
8247
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
8248
+ currentlyFlushingRenderState = null;
8224
8249
  hoistableState.stylesheets.forEach(hasStylesToHoist);
8225
8250
  currentlyRenderingBoundaryHasStylesToHoist &&
8226
8251
  (renderState.stylesToHoist = !0);
@@ -8244,7 +8269,8 @@
8244
8269
  var rules = styleQueue.rules,
8245
8270
  hrefs = styleQueue.hrefs;
8246
8271
  if (!hasStylesheets || hrefs.length) {
8247
- this.push('<style data-precedence="');
8272
+ this.push(currentlyFlushingRenderState.startInlineStyle);
8273
+ this.push(' data-precedence="');
8248
8274
  this.push(styleQueue.precedence);
8249
8275
  styleQueue = 0;
8250
8276
  if (hrefs.length) {
@@ -12787,7 +12813,9 @@
12787
12813
  renderState.fontPreloads.clear();
12788
12814
  renderState.highImagePreloads.forEach(flushResource, destination);
12789
12815
  renderState.highImagePreloads.clear();
12816
+ currentlyFlushingRenderState = renderState;
12790
12817
  renderState.styles.forEach(flushStylesInPreamble, destination);
12818
+ currentlyFlushingRenderState = null;
12791
12819
  var importMapChunks = renderState.importMapChunks;
12792
12820
  for (
12793
12821
  i$jscomp$0 = 0;
@@ -14170,7 +14198,8 @@
14170
14198
  }),
14171
14199
  PRELOAD_NO_CREDS = [];
14172
14200
  Object.freeze(PRELOAD_NO_CREDS);
14173
- var scriptRegex = /(<\/|<)(s)(cript)/gi;
14201
+ var currentlyFlushingRenderState = null,
14202
+ scriptRegex = /(<\/|<)(s)(cript)/gi;
14174
14203
  var didWarnForNewBooleanPropsWithEmptyValue = {};
14175
14204
  var styleNameCache = new Map(),
14176
14205
  styleAttributeStart = ' style="',
@@ -14605,5 +14634,5 @@
14605
14634
  });
14606
14635
  });
14607
14636
  };
14608
- exports.version = "19.2.0-experimental-b07717d8-20250528";
14637
+ exports.version = "19.2.0-experimental-526dd340-20250602";
14609
14638
  })();