react-markup 0.0.0-experimental-b07717d8-20250528 → 0.0.0-experimental-14094f80-20250529

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.
@@ -292,6 +292,7 @@ var sharedNotPendingObject = {
292
292
  action: null
293
293
  },
294
294
  PRELOAD_NO_CREDS = [],
295
+ currentlyFlushingRenderState = null,
295
296
  scriptRegex = /(<\/|<)(s)(cript)/gi;
296
297
  function scriptReplacer(match, prefix, s, suffix) {
297
298
  return "" + prefix + ("s" === s ? "\\u0073" : "\\u0053") + suffix;
@@ -304,10 +305,16 @@ function createRenderState(
304
305
  onHeaders,
305
306
  maxHeadersLength
306
307
  ) {
307
- var inlineScriptWithNonce =
308
- void 0 === nonce
308
+ var nonceScript = "string" === typeof nonce ? nonce : nonce && nonce.script,
309
+ inlineScriptWithNonce =
310
+ void 0 === nonceScript
309
311
  ? "<script"
310
- : '<script nonce="' + escapeTextForBrowser(nonce) + '"',
312
+ : '<script nonce="' + escapeTextForBrowser(nonceScript) + '"',
313
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
314
+ inlineStyleWithNonce =
315
+ void 0 === nonceStyle
316
+ ? "<style"
317
+ : '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"',
311
318
  idPrefix = resumableState.idPrefix,
312
319
  bootstrapChunks = [],
313
320
  externalRuntimeScript = null,
@@ -329,7 +336,7 @@ function createRenderState(
329
336
  src: externalRuntimeConfig,
330
337
  async: !0,
331
338
  integrity: void 0,
332
- nonce: nonce
339
+ nonce: nonceScript
333
340
  }))
334
341
  : ((externalRuntimeScript = {
335
342
  src: externalRuntimeConfig.src,
@@ -339,7 +346,7 @@ function createRenderState(
339
346
  src: externalRuntimeConfig.src,
340
347
  async: !0,
341
348
  integrity: externalRuntimeConfig.integrity,
342
- nonce: nonce
349
+ nonce: nonceScript
343
350
  })));
344
351
  externalRuntimeConfig = [];
345
352
  void 0 !== importMap &&
@@ -362,6 +369,7 @@ function createRenderState(
362
369
  segmentPrefix: idPrefix + "S:",
363
370
  boundaryPrefix: idPrefix + "B:",
364
371
  startInlineScript: inlineScriptWithNonce,
372
+ startInlineStyle: inlineStyleWithNonce,
365
373
  preamble: createPreambleState(),
366
374
  externalRuntimeScript: externalRuntimeScript,
367
375
  bootstrapChunks: bootstrapChunks,
@@ -391,7 +399,7 @@ function createRenderState(
391
399
  scripts: new Map(),
392
400
  moduleScripts: new Map()
393
401
  },
394
- nonce: nonce,
402
+ nonce: { script: nonceScript, style: nonceStyle },
395
403
  hoistableState: null,
396
404
  stylesToHoist: !1
397
405
  };
@@ -401,108 +409,109 @@ function createRenderState(
401
409
  inlineScriptWithNonce < bootstrapScripts.length;
402
410
  inlineScriptWithNonce++
403
411
  )
404
- (externalRuntimeConfig = bootstrapScripts[inlineScriptWithNonce]),
405
- (importMap = externalRuntimeScript = void 0),
406
- (maxHeadersLength = {
412
+ (importMap = bootstrapScripts[inlineScriptWithNonce]),
413
+ (idPrefix = inlineStyleWithNonce = void 0),
414
+ (externalRuntimeScript = {
407
415
  rel: "preload",
408
416
  as: "script",
409
417
  fetchPriority: "low",
410
418
  nonce: nonce
411
419
  }),
412
- "string" === typeof externalRuntimeConfig
413
- ? (maxHeadersLength.href = idPrefix = externalRuntimeConfig)
414
- : ((maxHeadersLength.href = idPrefix = externalRuntimeConfig.src),
415
- (maxHeadersLength.integrity = importMap =
416
- "string" === typeof externalRuntimeConfig.integrity
417
- ? externalRuntimeConfig.integrity
420
+ "string" === typeof importMap
421
+ ? (externalRuntimeScript.href = nonceStyle = importMap)
422
+ : ((externalRuntimeScript.href = nonceStyle = importMap.src),
423
+ (externalRuntimeScript.integrity = idPrefix =
424
+ "string" === typeof importMap.integrity
425
+ ? importMap.integrity
418
426
  : void 0),
419
- (maxHeadersLength.crossOrigin = externalRuntimeScript =
420
- "string" === typeof externalRuntimeConfig ||
421
- null == externalRuntimeConfig.crossOrigin
427
+ (externalRuntimeScript.crossOrigin = inlineStyleWithNonce =
428
+ "string" === typeof importMap || null == importMap.crossOrigin
422
429
  ? void 0
423
- : "use-credentials" === externalRuntimeConfig.crossOrigin
430
+ : "use-credentials" === importMap.crossOrigin
424
431
  ? "use-credentials"
425
432
  : "")),
426
- (externalRuntimeConfig = resumableState),
427
- (bootstrapScriptContent = idPrefix),
428
- (externalRuntimeConfig.scriptResources[bootstrapScriptContent] = null),
429
- (externalRuntimeConfig.moduleScriptResources[bootstrapScriptContent] =
430
- null),
431
- (externalRuntimeConfig = []),
432
- pushLinkImpl(externalRuntimeConfig, maxHeadersLength),
433
- onHeaders.bootstrapScripts.add(externalRuntimeConfig),
433
+ (importMap = resumableState),
434
+ (maxHeadersLength = nonceStyle),
435
+ (importMap.scriptResources[maxHeadersLength] = null),
436
+ (importMap.moduleScriptResources[maxHeadersLength] = null),
437
+ (importMap = []),
438
+ pushLinkImpl(importMap, externalRuntimeScript),
439
+ onHeaders.bootstrapScripts.add(importMap),
434
440
  bootstrapChunks.push(
435
441
  '<script src="',
436
- escapeTextForBrowser(idPrefix),
442
+ escapeTextForBrowser(nonceStyle),
437
443
  '"'
438
444
  ),
439
- nonce &&
440
- bootstrapChunks.push(' nonce="', escapeTextForBrowser(nonce), '"'),
441
- "string" === typeof importMap &&
445
+ nonceScript &&
446
+ bootstrapChunks.push(
447
+ ' nonce="',
448
+ escapeTextForBrowser(nonceScript),
449
+ '"'
450
+ ),
451
+ "string" === typeof idPrefix &&
442
452
  bootstrapChunks.push(
443
453
  ' integrity="',
444
- escapeTextForBrowser(importMap),
454
+ escapeTextForBrowser(idPrefix),
445
455
  '"'
446
456
  ),
447
- "string" === typeof externalRuntimeScript &&
457
+ "string" === typeof inlineStyleWithNonce &&
448
458
  bootstrapChunks.push(
449
459
  ' crossorigin="',
450
- escapeTextForBrowser(externalRuntimeScript),
460
+ escapeTextForBrowser(inlineStyleWithNonce),
451
461
  '"'
452
462
  ),
453
463
  pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
454
464
  bootstrapChunks.push(' async="">\x3c/script>');
455
465
  if (void 0 !== bootstrapModules)
456
- for (
457
- bootstrapScripts = 0;
458
- bootstrapScripts < bootstrapModules.length;
459
- bootstrapScripts++
460
- )
461
- (maxHeadersLength = bootstrapModules[bootstrapScripts]),
462
- (externalRuntimeScript = idPrefix = void 0),
463
- (importMap = {
466
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
467
+ (idPrefix = bootstrapModules[nonce]),
468
+ (nonceStyle = inlineScriptWithNonce = void 0),
469
+ (inlineStyleWithNonce = {
464
470
  rel: "modulepreload",
465
471
  fetchPriority: "low",
466
- nonce: nonce
472
+ nonce: nonceScript
467
473
  }),
468
- "string" === typeof maxHeadersLength
469
- ? (importMap.href = inlineScriptWithNonce = maxHeadersLength)
470
- : ((importMap.href = inlineScriptWithNonce = maxHeadersLength.src),
471
- (importMap.integrity = externalRuntimeScript =
472
- "string" === typeof maxHeadersLength.integrity
473
- ? maxHeadersLength.integrity
474
+ "string" === typeof idPrefix
475
+ ? (inlineStyleWithNonce.href = bootstrapScripts = idPrefix)
476
+ : ((inlineStyleWithNonce.href = bootstrapScripts = idPrefix.src),
477
+ (inlineStyleWithNonce.integrity = nonceStyle =
478
+ "string" === typeof idPrefix.integrity
479
+ ? idPrefix.integrity
474
480
  : void 0),
475
- (importMap.crossOrigin = idPrefix =
476
- "string" === typeof maxHeadersLength ||
477
- null == maxHeadersLength.crossOrigin
481
+ (inlineStyleWithNonce.crossOrigin = inlineScriptWithNonce =
482
+ "string" === typeof idPrefix || null == idPrefix.crossOrigin
478
483
  ? void 0
479
- : "use-credentials" === maxHeadersLength.crossOrigin
484
+ : "use-credentials" === idPrefix.crossOrigin
480
485
  ? "use-credentials"
481
486
  : "")),
482
- (maxHeadersLength = resumableState),
483
- (externalRuntimeConfig = inlineScriptWithNonce),
484
- (maxHeadersLength.scriptResources[externalRuntimeConfig] = null),
485
- (maxHeadersLength.moduleScriptResources[externalRuntimeConfig] = null),
486
- (maxHeadersLength = []),
487
- pushLinkImpl(maxHeadersLength, importMap),
488
- onHeaders.bootstrapScripts.add(maxHeadersLength),
487
+ (idPrefix = resumableState),
488
+ (externalRuntimeScript = bootstrapScripts),
489
+ (idPrefix.scriptResources[externalRuntimeScript] = null),
490
+ (idPrefix.moduleScriptResources[externalRuntimeScript] = null),
491
+ (idPrefix = []),
492
+ pushLinkImpl(idPrefix, inlineStyleWithNonce),
493
+ onHeaders.bootstrapScripts.add(idPrefix),
489
494
  bootstrapChunks.push(
490
495
  '<script type="module" src="',
491
- escapeTextForBrowser(inlineScriptWithNonce),
496
+ escapeTextForBrowser(bootstrapScripts),
492
497
  '"'
493
498
  ),
494
- nonce &&
495
- bootstrapChunks.push(' nonce="', escapeTextForBrowser(nonce), '"'),
496
- "string" === typeof externalRuntimeScript &&
499
+ nonceScript &&
500
+ bootstrapChunks.push(
501
+ ' nonce="',
502
+ escapeTextForBrowser(nonceScript),
503
+ '"'
504
+ ),
505
+ "string" === typeof nonceStyle &&
497
506
  bootstrapChunks.push(
498
507
  ' integrity="',
499
- escapeTextForBrowser(externalRuntimeScript),
508
+ escapeTextForBrowser(nonceStyle),
500
509
  '"'
501
510
  ),
502
- "string" === typeof idPrefix &&
511
+ "string" === typeof inlineScriptWithNonce &&
503
512
  bootstrapChunks.push(
504
513
  ' crossorigin="',
505
- escapeTextForBrowser(idPrefix),
514
+ escapeTextForBrowser(inlineScriptWithNonce),
506
515
  '"'
507
516
  ),
508
517
  pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
@@ -1828,7 +1837,8 @@ function pushStartInstance$1(
1828
1837
  case "style":
1829
1838
  var noscriptTagInScope$jscomp$2 = formatContext.tagScope & 1,
1830
1839
  precedence$jscomp$0 = props.precedence,
1831
- href$jscomp$0 = props.href;
1840
+ href$jscomp$0 = props.href,
1841
+ nonce = props.nonce;
1832
1842
  if (
1833
1843
  4 === formatContext.insertionMode ||
1834
1844
  noscriptTagInScope$jscomp$2 ||
@@ -1883,46 +1893,47 @@ function pushStartInstance$1(
1883
1893
  : void 0)
1884
1894
  ) {
1885
1895
  resumableState.styleResources[href$jscomp$0] = null;
1886
- styleQueue$jscomp$0
1887
- ? styleQueue$jscomp$0.hrefs.push(
1888
- escapeTextForBrowser(href$jscomp$0)
1889
- )
1890
- : ((styleQueue$jscomp$0 = {
1891
- precedence: escapeTextForBrowser(precedence$jscomp$0),
1892
- rules: [],
1893
- hrefs: [escapeTextForBrowser(href$jscomp$0)],
1894
- sheets: new Map()
1895
- }),
1896
- renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
1897
- var target = styleQueue$jscomp$0.rules,
1898
- children$jscomp$7 = null,
1899
- innerHTML$jscomp$6 = null,
1900
- propKey$jscomp$9;
1901
- for (propKey$jscomp$9 in props)
1902
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
1903
- var propValue$jscomp$9 = props[propKey$jscomp$9];
1904
- if (null != propValue$jscomp$9)
1905
- switch (propKey$jscomp$9) {
1906
- case "children":
1907
- children$jscomp$7 = propValue$jscomp$9;
1908
- break;
1909
- case "dangerouslySetInnerHTML":
1910
- innerHTML$jscomp$6 = propValue$jscomp$9;
1911
- }
1912
- }
1913
- var child$jscomp$0 = Array.isArray(children$jscomp$7)
1914
- ? 2 > children$jscomp$7.length
1915
- ? children$jscomp$7[0]
1916
- : null
1917
- : children$jscomp$7;
1918
- "function" !== typeof child$jscomp$0 &&
1919
- "symbol" !== typeof child$jscomp$0 &&
1920
- null !== child$jscomp$0 &&
1921
- void 0 !== child$jscomp$0 &&
1922
- target.push(
1923
- ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
1924
- );
1925
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
1896
+ styleQueue$jscomp$0 ||
1897
+ ((styleQueue$jscomp$0 = {
1898
+ precedence: escapeTextForBrowser(precedence$jscomp$0),
1899
+ rules: [],
1900
+ hrefs: [],
1901
+ sheets: new Map()
1902
+ }),
1903
+ renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
1904
+ var nonceStyle = renderState.nonce.style;
1905
+ if (!nonceStyle || nonceStyle === nonce) {
1906
+ styleQueue$jscomp$0.hrefs.push(escapeTextForBrowser(href$jscomp$0));
1907
+ var target = styleQueue$jscomp$0.rules,
1908
+ children$jscomp$7 = null,
1909
+ innerHTML$jscomp$6 = null,
1910
+ propKey$jscomp$9;
1911
+ for (propKey$jscomp$9 in props)
1912
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
1913
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
1914
+ if (null != propValue$jscomp$9)
1915
+ switch (propKey$jscomp$9) {
1916
+ case "children":
1917
+ children$jscomp$7 = propValue$jscomp$9;
1918
+ break;
1919
+ case "dangerouslySetInnerHTML":
1920
+ innerHTML$jscomp$6 = propValue$jscomp$9;
1921
+ }
1922
+ }
1923
+ var child$jscomp$0 = Array.isArray(children$jscomp$7)
1924
+ ? 2 > children$jscomp$7.length
1925
+ ? children$jscomp$7[0]
1926
+ : null
1927
+ : children$jscomp$7;
1928
+ "function" !== typeof child$jscomp$0 &&
1929
+ "symbol" !== typeof child$jscomp$0 &&
1930
+ null !== child$jscomp$0 &&
1931
+ void 0 !== child$jscomp$0 &&
1932
+ target.push(
1933
+ ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
1934
+ );
1935
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
1936
+ }
1926
1937
  }
1927
1938
  styleQueue$jscomp$0 &&
1928
1939
  hoistableState &&
@@ -2417,7 +2428,8 @@ function flushStyleTagsLateForBoundary(styleQueue) {
2417
2428
  hrefs = styleQueue.hrefs,
2418
2429
  i = 0;
2419
2430
  if (hrefs.length) {
2420
- this.push('<style media="not all" data-precedence="');
2431
+ this.push(currentlyFlushingRenderState.startInlineStyle);
2432
+ this.push(' media="not all" data-precedence="');
2421
2433
  this.push(styleQueue.precedence);
2422
2434
  for (this.push('" data-href="'); i < hrefs.length - 1; i++)
2423
2435
  this.push(hrefs[i]), this.push(" ");
@@ -2438,7 +2450,9 @@ function hasStylesToHoist(stylesheet) {
2438
2450
  function writeHoistablesForBoundary(destination, hoistableState, renderState) {
2439
2451
  currentlyRenderingBoundaryHasStylesToHoist = !1;
2440
2452
  destinationHasCapacity = !0;
2453
+ currentlyFlushingRenderState = renderState;
2441
2454
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
2455
+ currentlyFlushingRenderState = null;
2442
2456
  hoistableState.stylesheets.forEach(hasStylesToHoist);
2443
2457
  currentlyRenderingBoundaryHasStylesToHoist &&
2444
2458
  (renderState.stylesToHoist = !0);
@@ -2463,7 +2477,8 @@ function flushStylesInPreamble(styleQueue) {
2463
2477
  var rules = styleQueue.rules,
2464
2478
  hrefs = styleQueue.hrefs;
2465
2479
  if (!hasStylesheets || hrefs.length) {
2466
- this.push('<style data-precedence="');
2480
+ this.push(currentlyFlushingRenderState.startInlineStyle);
2481
+ this.push(' data-precedence="');
2467
2482
  this.push(styleQueue.precedence);
2468
2483
  styleQueue = 0;
2469
2484
  if (hrefs.length) {
@@ -6358,7 +6373,9 @@ function flushCompletedQueues(request, destination) {
6358
6373
  renderState.fontPreloads.clear();
6359
6374
  renderState.highImagePreloads.forEach(flushResource, destination);
6360
6375
  renderState.highImagePreloads.clear();
6376
+ currentlyFlushingRenderState = renderState;
6361
6377
  renderState.styles.forEach(flushStylesInPreamble, destination);
6378
+ currentlyFlushingRenderState = null;
6362
6379
  var importMapChunks = renderState.importMapChunks;
6363
6380
  for (i$jscomp$0 = 0; i$jscomp$0 < importMapChunks.length; i$jscomp$0++)
6364
6381
  destination.push(importMapChunks[i$jscomp$0]);
@@ -6672,4 +6689,4 @@ exports.experimental_renderToHTML = function (children, options) {
6672
6689
  });
6673
6690
  });
6674
6691
  };
6675
- exports.version = "19.2.0-experimental-b07717d8-20250528";
6692
+ exports.version = "19.2.0-experimental-14094f80-20250529";