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.
@@ -3234,6 +3234,7 @@ var sharedNotPendingObject = {
3234
3234
  action: null
3235
3235
  },
3236
3236
  PRELOAD_NO_CREDS = [],
3237
+ currentlyFlushingRenderState = null,
3237
3238
  scriptRegex = /(<\/|<)(s)(cript)/gi;
3238
3239
  function scriptReplacer(match, prefix, s, suffix) {
3239
3240
  return "" + prefix + ("s" === s ? "\\u0073" : "\\u0053") + suffix;
@@ -3246,10 +3247,16 @@ function createRenderState(
3246
3247
  onHeaders,
3247
3248
  maxHeadersLength
3248
3249
  ) {
3249
- var inlineScriptWithNonce =
3250
- void 0 === nonce
3250
+ var nonceScript = "string" === typeof nonce ? nonce : nonce && nonce.script,
3251
+ inlineScriptWithNonce =
3252
+ void 0 === nonceScript
3251
3253
  ? "<script"
3252
- : '<script nonce="' + escapeTextForBrowser(nonce) + '"',
3254
+ : '<script nonce="' + escapeTextForBrowser(nonceScript) + '"',
3255
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
3256
+ inlineStyleWithNonce =
3257
+ void 0 === nonceStyle
3258
+ ? "<style"
3259
+ : '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"',
3253
3260
  idPrefix = resumableState.idPrefix,
3254
3261
  bootstrapChunks = [],
3255
3262
  externalRuntimeScript = null,
@@ -3271,7 +3278,7 @@ function createRenderState(
3271
3278
  src: externalRuntimeConfig,
3272
3279
  async: !0,
3273
3280
  integrity: void 0,
3274
- nonce: nonce
3281
+ nonce: nonceScript
3275
3282
  }))
3276
3283
  : ((externalRuntimeScript = {
3277
3284
  src: externalRuntimeConfig.src,
@@ -3281,7 +3288,7 @@ function createRenderState(
3281
3288
  src: externalRuntimeConfig.src,
3282
3289
  async: !0,
3283
3290
  integrity: externalRuntimeConfig.integrity,
3284
- nonce: nonce
3291
+ nonce: nonceScript
3285
3292
  })));
3286
3293
  externalRuntimeConfig = [];
3287
3294
  void 0 !== importMap &&
@@ -3304,6 +3311,7 @@ function createRenderState(
3304
3311
  segmentPrefix: idPrefix + "S:",
3305
3312
  boundaryPrefix: idPrefix + "B:",
3306
3313
  startInlineScript: inlineScriptWithNonce,
3314
+ startInlineStyle: inlineStyleWithNonce,
3307
3315
  preamble: createPreambleState(),
3308
3316
  externalRuntimeScript: externalRuntimeScript,
3309
3317
  bootstrapChunks: bootstrapChunks,
@@ -3333,7 +3341,7 @@ function createRenderState(
3333
3341
  scripts: new Map(),
3334
3342
  moduleScripts: new Map()
3335
3343
  },
3336
- nonce: nonce,
3344
+ nonce: { script: nonceScript, style: nonceStyle },
3337
3345
  hoistableState: null,
3338
3346
  stylesToHoist: !1
3339
3347
  };
@@ -3343,108 +3351,109 @@ function createRenderState(
3343
3351
  inlineScriptWithNonce < bootstrapScripts.length;
3344
3352
  inlineScriptWithNonce++
3345
3353
  )
3346
- (externalRuntimeConfig = bootstrapScripts[inlineScriptWithNonce]),
3347
- (importMap = externalRuntimeScript = void 0),
3348
- (maxHeadersLength = {
3354
+ (importMap = bootstrapScripts[inlineScriptWithNonce]),
3355
+ (idPrefix = inlineStyleWithNonce = void 0),
3356
+ (externalRuntimeScript = {
3349
3357
  rel: "preload",
3350
3358
  as: "script",
3351
3359
  fetchPriority: "low",
3352
3360
  nonce: nonce
3353
3361
  }),
3354
- "string" === typeof externalRuntimeConfig
3355
- ? (maxHeadersLength.href = idPrefix = externalRuntimeConfig)
3356
- : ((maxHeadersLength.href = idPrefix = externalRuntimeConfig.src),
3357
- (maxHeadersLength.integrity = importMap =
3358
- "string" === typeof externalRuntimeConfig.integrity
3359
- ? externalRuntimeConfig.integrity
3362
+ "string" === typeof importMap
3363
+ ? (externalRuntimeScript.href = nonceStyle = importMap)
3364
+ : ((externalRuntimeScript.href = nonceStyle = importMap.src),
3365
+ (externalRuntimeScript.integrity = idPrefix =
3366
+ "string" === typeof importMap.integrity
3367
+ ? importMap.integrity
3360
3368
  : void 0),
3361
- (maxHeadersLength.crossOrigin = externalRuntimeScript =
3362
- "string" === typeof externalRuntimeConfig ||
3363
- null == externalRuntimeConfig.crossOrigin
3369
+ (externalRuntimeScript.crossOrigin = inlineStyleWithNonce =
3370
+ "string" === typeof importMap || null == importMap.crossOrigin
3364
3371
  ? void 0
3365
- : "use-credentials" === externalRuntimeConfig.crossOrigin
3372
+ : "use-credentials" === importMap.crossOrigin
3366
3373
  ? "use-credentials"
3367
3374
  : "")),
3368
- (externalRuntimeConfig = resumableState),
3369
- (bootstrapScriptContent = idPrefix),
3370
- (externalRuntimeConfig.scriptResources[bootstrapScriptContent] = null),
3371
- (externalRuntimeConfig.moduleScriptResources[bootstrapScriptContent] =
3372
- null),
3373
- (externalRuntimeConfig = []),
3374
- pushLinkImpl(externalRuntimeConfig, maxHeadersLength),
3375
- onHeaders.bootstrapScripts.add(externalRuntimeConfig),
3375
+ (importMap = resumableState),
3376
+ (maxHeadersLength = nonceStyle),
3377
+ (importMap.scriptResources[maxHeadersLength] = null),
3378
+ (importMap.moduleScriptResources[maxHeadersLength] = null),
3379
+ (importMap = []),
3380
+ pushLinkImpl(importMap, externalRuntimeScript),
3381
+ onHeaders.bootstrapScripts.add(importMap),
3376
3382
  bootstrapChunks.push(
3377
3383
  '<script src="',
3378
- escapeTextForBrowser(idPrefix),
3384
+ escapeTextForBrowser(nonceStyle),
3379
3385
  '"'
3380
3386
  ),
3381
- nonce &&
3382
- bootstrapChunks.push(' nonce="', escapeTextForBrowser(nonce), '"'),
3383
- "string" === typeof importMap &&
3387
+ nonceScript &&
3388
+ bootstrapChunks.push(
3389
+ ' nonce="',
3390
+ escapeTextForBrowser(nonceScript),
3391
+ '"'
3392
+ ),
3393
+ "string" === typeof idPrefix &&
3384
3394
  bootstrapChunks.push(
3385
3395
  ' integrity="',
3386
- escapeTextForBrowser(importMap),
3396
+ escapeTextForBrowser(idPrefix),
3387
3397
  '"'
3388
3398
  ),
3389
- "string" === typeof externalRuntimeScript &&
3399
+ "string" === typeof inlineStyleWithNonce &&
3390
3400
  bootstrapChunks.push(
3391
3401
  ' crossorigin="',
3392
- escapeTextForBrowser(externalRuntimeScript),
3402
+ escapeTextForBrowser(inlineStyleWithNonce),
3393
3403
  '"'
3394
3404
  ),
3395
3405
  pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
3396
3406
  bootstrapChunks.push(' async="">\x3c/script>');
3397
3407
  if (void 0 !== bootstrapModules)
3398
- for (
3399
- bootstrapScripts = 0;
3400
- bootstrapScripts < bootstrapModules.length;
3401
- bootstrapScripts++
3402
- )
3403
- (maxHeadersLength = bootstrapModules[bootstrapScripts]),
3404
- (externalRuntimeScript = idPrefix = void 0),
3405
- (importMap = {
3408
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
3409
+ (idPrefix = bootstrapModules[nonce]),
3410
+ (nonceStyle = inlineScriptWithNonce = void 0),
3411
+ (inlineStyleWithNonce = {
3406
3412
  rel: "modulepreload",
3407
3413
  fetchPriority: "low",
3408
- nonce: nonce
3414
+ nonce: nonceScript
3409
3415
  }),
3410
- "string" === typeof maxHeadersLength
3411
- ? (importMap.href = inlineScriptWithNonce = maxHeadersLength)
3412
- : ((importMap.href = inlineScriptWithNonce = maxHeadersLength.src),
3413
- (importMap.integrity = externalRuntimeScript =
3414
- "string" === typeof maxHeadersLength.integrity
3415
- ? maxHeadersLength.integrity
3416
+ "string" === typeof idPrefix
3417
+ ? (inlineStyleWithNonce.href = bootstrapScripts = idPrefix)
3418
+ : ((inlineStyleWithNonce.href = bootstrapScripts = idPrefix.src),
3419
+ (inlineStyleWithNonce.integrity = nonceStyle =
3420
+ "string" === typeof idPrefix.integrity
3421
+ ? idPrefix.integrity
3416
3422
  : void 0),
3417
- (importMap.crossOrigin = idPrefix =
3418
- "string" === typeof maxHeadersLength ||
3419
- null == maxHeadersLength.crossOrigin
3423
+ (inlineStyleWithNonce.crossOrigin = inlineScriptWithNonce =
3424
+ "string" === typeof idPrefix || null == idPrefix.crossOrigin
3420
3425
  ? void 0
3421
- : "use-credentials" === maxHeadersLength.crossOrigin
3426
+ : "use-credentials" === idPrefix.crossOrigin
3422
3427
  ? "use-credentials"
3423
3428
  : "")),
3424
- (maxHeadersLength = resumableState),
3425
- (externalRuntimeConfig = inlineScriptWithNonce),
3426
- (maxHeadersLength.scriptResources[externalRuntimeConfig] = null),
3427
- (maxHeadersLength.moduleScriptResources[externalRuntimeConfig] = null),
3428
- (maxHeadersLength = []),
3429
- pushLinkImpl(maxHeadersLength, importMap),
3430
- onHeaders.bootstrapScripts.add(maxHeadersLength),
3429
+ (idPrefix = resumableState),
3430
+ (externalRuntimeScript = bootstrapScripts),
3431
+ (idPrefix.scriptResources[externalRuntimeScript] = null),
3432
+ (idPrefix.moduleScriptResources[externalRuntimeScript] = null),
3433
+ (idPrefix = []),
3434
+ pushLinkImpl(idPrefix, inlineStyleWithNonce),
3435
+ onHeaders.bootstrapScripts.add(idPrefix),
3431
3436
  bootstrapChunks.push(
3432
3437
  '<script type="module" src="',
3433
- escapeTextForBrowser(inlineScriptWithNonce),
3438
+ escapeTextForBrowser(bootstrapScripts),
3434
3439
  '"'
3435
3440
  ),
3436
- nonce &&
3437
- bootstrapChunks.push(' nonce="', escapeTextForBrowser(nonce), '"'),
3438
- "string" === typeof externalRuntimeScript &&
3441
+ nonceScript &&
3442
+ bootstrapChunks.push(
3443
+ ' nonce="',
3444
+ escapeTextForBrowser(nonceScript),
3445
+ '"'
3446
+ ),
3447
+ "string" === typeof nonceStyle &&
3439
3448
  bootstrapChunks.push(
3440
3449
  ' integrity="',
3441
- escapeTextForBrowser(externalRuntimeScript),
3450
+ escapeTextForBrowser(nonceStyle),
3442
3451
  '"'
3443
3452
  ),
3444
- "string" === typeof idPrefix &&
3453
+ "string" === typeof inlineScriptWithNonce &&
3445
3454
  bootstrapChunks.push(
3446
3455
  ' crossorigin="',
3447
- escapeTextForBrowser(idPrefix),
3456
+ escapeTextForBrowser(inlineScriptWithNonce),
3448
3457
  '"'
3449
3458
  ),
3450
3459
  pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
@@ -4770,7 +4779,8 @@ function pushStartInstance$1(
4770
4779
  case "style":
4771
4780
  var noscriptTagInScope$jscomp$2 = formatContext.tagScope & 1,
4772
4781
  precedence$jscomp$0 = props.precedence,
4773
- href$jscomp$0 = props.href;
4782
+ href$jscomp$0 = props.href,
4783
+ nonce = props.nonce;
4774
4784
  if (
4775
4785
  4 === formatContext.insertionMode ||
4776
4786
  noscriptTagInScope$jscomp$2 ||
@@ -4825,46 +4835,47 @@ function pushStartInstance$1(
4825
4835
  : void 0)
4826
4836
  ) {
4827
4837
  resumableState.styleResources[href$jscomp$0] = null;
4828
- styleQueue$jscomp$0
4829
- ? styleQueue$jscomp$0.hrefs.push(
4830
- escapeTextForBrowser(href$jscomp$0)
4831
- )
4832
- : ((styleQueue$jscomp$0 = {
4833
- precedence: escapeTextForBrowser(precedence$jscomp$0),
4834
- rules: [],
4835
- hrefs: [escapeTextForBrowser(href$jscomp$0)],
4836
- sheets: new Map()
4837
- }),
4838
- renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
4839
- var target = styleQueue$jscomp$0.rules,
4840
- children$jscomp$7 = null,
4841
- innerHTML$jscomp$6 = null,
4842
- propKey$jscomp$9;
4843
- for (propKey$jscomp$9 in props)
4844
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
4845
- var propValue$jscomp$9 = props[propKey$jscomp$9];
4846
- if (null != propValue$jscomp$9)
4847
- switch (propKey$jscomp$9) {
4848
- case "children":
4849
- children$jscomp$7 = propValue$jscomp$9;
4850
- break;
4851
- case "dangerouslySetInnerHTML":
4852
- innerHTML$jscomp$6 = propValue$jscomp$9;
4853
- }
4854
- }
4855
- var child$jscomp$0 = Array.isArray(children$jscomp$7)
4856
- ? 2 > children$jscomp$7.length
4857
- ? children$jscomp$7[0]
4858
- : null
4859
- : children$jscomp$7;
4860
- "function" !== typeof child$jscomp$0 &&
4861
- "symbol" !== typeof child$jscomp$0 &&
4862
- null !== child$jscomp$0 &&
4863
- void 0 !== child$jscomp$0 &&
4864
- target.push(
4865
- ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
4866
- );
4867
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
4838
+ styleQueue$jscomp$0 ||
4839
+ ((styleQueue$jscomp$0 = {
4840
+ precedence: escapeTextForBrowser(precedence$jscomp$0),
4841
+ rules: [],
4842
+ hrefs: [],
4843
+ sheets: new Map()
4844
+ }),
4845
+ renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
4846
+ var nonceStyle = renderState.nonce.style;
4847
+ if (!nonceStyle || nonceStyle === nonce) {
4848
+ styleQueue$jscomp$0.hrefs.push(escapeTextForBrowser(href$jscomp$0));
4849
+ var target = styleQueue$jscomp$0.rules,
4850
+ children$jscomp$7 = null,
4851
+ innerHTML$jscomp$6 = null,
4852
+ propKey$jscomp$9;
4853
+ for (propKey$jscomp$9 in props)
4854
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
4855
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
4856
+ if (null != propValue$jscomp$9)
4857
+ switch (propKey$jscomp$9) {
4858
+ case "children":
4859
+ children$jscomp$7 = propValue$jscomp$9;
4860
+ break;
4861
+ case "dangerouslySetInnerHTML":
4862
+ innerHTML$jscomp$6 = propValue$jscomp$9;
4863
+ }
4864
+ }
4865
+ var child$jscomp$0 = Array.isArray(children$jscomp$7)
4866
+ ? 2 > children$jscomp$7.length
4867
+ ? children$jscomp$7[0]
4868
+ : null
4869
+ : children$jscomp$7;
4870
+ "function" !== typeof child$jscomp$0 &&
4871
+ "symbol" !== typeof child$jscomp$0 &&
4872
+ null !== child$jscomp$0 &&
4873
+ void 0 !== child$jscomp$0 &&
4874
+ target.push(
4875
+ ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
4876
+ );
4877
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
4878
+ }
4868
4879
  }
4869
4880
  styleQueue$jscomp$0 &&
4870
4881
  hoistableState &&
@@ -5359,7 +5370,8 @@ function flushStyleTagsLateForBoundary(styleQueue) {
5359
5370
  hrefs = styleQueue.hrefs,
5360
5371
  i = 0;
5361
5372
  if (hrefs.length) {
5362
- this.push('<style media="not all" data-precedence="');
5373
+ this.push(currentlyFlushingRenderState.startInlineStyle);
5374
+ this.push(' media="not all" data-precedence="');
5363
5375
  this.push(styleQueue.precedence);
5364
5376
  for (this.push('" data-href="'); i < hrefs.length - 1; i++)
5365
5377
  this.push(hrefs[i]), this.push(" ");
@@ -5380,7 +5392,9 @@ function hasStylesToHoist(stylesheet) {
5380
5392
  function writeHoistablesForBoundary(destination, hoistableState, renderState) {
5381
5393
  currentlyRenderingBoundaryHasStylesToHoist = !1;
5382
5394
  destinationHasCapacity = !0;
5395
+ currentlyFlushingRenderState = renderState;
5383
5396
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
5397
+ currentlyFlushingRenderState = null;
5384
5398
  hoistableState.stylesheets.forEach(hasStylesToHoist);
5385
5399
  currentlyRenderingBoundaryHasStylesToHoist &&
5386
5400
  (renderState.stylesToHoist = !0);
@@ -5405,7 +5419,8 @@ function flushStylesInPreamble(styleQueue) {
5405
5419
  var rules = styleQueue.rules,
5406
5420
  hrefs = styleQueue.hrefs;
5407
5421
  if (!hasStylesheets || hrefs.length) {
5408
- this.push('<style data-precedence="');
5422
+ this.push(currentlyFlushingRenderState.startInlineStyle);
5423
+ this.push(' data-precedence="');
5409
5424
  this.push(styleQueue.precedence);
5410
5425
  styleQueue = 0;
5411
5426
  if (hrefs.length) {
@@ -9087,7 +9102,9 @@ function flushCompletedQueues(request, destination) {
9087
9102
  renderState.fontPreloads.clear();
9088
9103
  renderState.highImagePreloads.forEach(flushResource, destination);
9089
9104
  renderState.highImagePreloads.clear();
9105
+ currentlyFlushingRenderState = renderState;
9090
9106
  renderState.styles.forEach(flushStylesInPreamble, destination);
9107
+ currentlyFlushingRenderState = null;
9091
9108
  var importMapChunks = renderState.importMapChunks;
9092
9109
  for (i$jscomp$0 = 0; i$jscomp$0 < importMapChunks.length; i$jscomp$0++)
9093
9110
  destination.push(importMapChunks[i$jscomp$0]);
@@ -9638,4 +9655,4 @@ exports.experimental_renderToHTML = function (children, options) {
9638
9655
  });
9639
9656
  });
9640
9657
  };
9641
- exports.version = "19.2.0-experimental-b07717d8-20250528";
9658
+ exports.version = "19.2.0-experimental-526dd340-20250602";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-markup",
3
- "version": "0.0.0-experimental-b07717d8-20250528",
3
+ "version": "0.0.0-experimental-526dd340-20250602",
4
4
  "description": "React package generating embedded markup such as e-mails with support for Server Components.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "homepage": "https://react.dev/",
19
19
  "peerDependencies": {
20
- "react": "0.0.0-experimental-b07717d8-20250528"
20
+ "react": "0.0.0-experimental-526dd340-20250602"
21
21
  },
22
22
  "files": [
23
23
  "LICENSE",