react-markup 0.0.0-experimental-33661467-20250407 → 0.0.0-experimental-ea05b750-20250408

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.
@@ -262,6 +262,22 @@
262
262
  4294967295;
263
263
  return (h1 ^ (h1 >>> 16)) >>> 0;
264
264
  }
265
+ function readAsDataURL(blob) {
266
+ return blob.arrayBuffer().then(function (arrayBuffer) {
267
+ arrayBuffer =
268
+ "function" === typeof Buffer && "function" === typeof Buffer.from
269
+ ? Buffer.from(arrayBuffer).toString("base64")
270
+ : btoa(
271
+ String.fromCharCode.apply(String, new Uint8Array(arrayBuffer))
272
+ );
273
+ return (
274
+ "data:" +
275
+ (blob.type || "application/octet-stream") +
276
+ ";base64," +
277
+ arrayBuffer
278
+ );
279
+ });
280
+ }
265
281
  function typeName(value) {
266
282
  return (
267
283
  ("function" === typeof Symbol &&
@@ -1247,6 +1263,33 @@
1247
1263
  null != formTarget && pushAttribute(target, "formTarget", formTarget);
1248
1264
  return formData;
1249
1265
  }
1266
+ function pushSrcObjectAttribute(target, blob) {
1267
+ null === blobCache && (blobCache = new WeakMap());
1268
+ var suspenseCache = blobCache,
1269
+ thenable = suspenseCache.get(blob);
1270
+ void 0 === thenable &&
1271
+ ((thenable = readAsDataURL(blob)),
1272
+ thenable.then(
1273
+ function (result) {
1274
+ thenable.status = "fulfilled";
1275
+ thenable.value = result;
1276
+ },
1277
+ function (error) {
1278
+ thenable.status = "rejected";
1279
+ thenable.reason = error;
1280
+ }
1281
+ ),
1282
+ suspenseCache.set(blob, thenable));
1283
+ if ("rejected" === thenable.status) throw thenable.reason;
1284
+ if ("fulfilled" !== thenable.status) throw thenable;
1285
+ target.push(
1286
+ attributeSeparator,
1287
+ "src",
1288
+ attributeAssign,
1289
+ escapeTextForBrowser(thenable.value),
1290
+ attributeEnd
1291
+ );
1292
+ }
1250
1293
  function pushAttribute(target, name, value) {
1251
1294
  switch (name) {
1252
1295
  case "className":
@@ -1266,6 +1309,15 @@
1266
1309
  pushStyleAttribute(target, value);
1267
1310
  break;
1268
1311
  case "src":
1312
+ if (
1313
+ "object" === typeof value &&
1314
+ null !== value &&
1315
+ "function" === typeof Blob &&
1316
+ value instanceof Blob
1317
+ ) {
1318
+ pushSrcObjectAttribute(target, value);
1319
+ break;
1320
+ }
1269
1321
  case "href":
1270
1322
  if ("" === value) {
1271
1323
  "src" === name
@@ -8644,6 +8696,7 @@
8644
8696
  actionJavaScriptURL = escapeTextForBrowser(
8645
8697
  "javascript:throw new Error('React form unexpectedly submitted.')"
8646
8698
  ),
8699
+ blobCache = null,
8647
8700
  endOfStartTag = ">",
8648
8701
  endOfStartTagSelfClosing = "/>",
8649
8702
  didWarnDefaultInputValue = !1,
@@ -8946,5 +8999,5 @@
8946
8999
  });
8947
9000
  });
8948
9001
  };
8949
- exports.version = "19.2.0-experimental-33661467-20250407";
9002
+ exports.version = "19.2.0-experimental-ea05b750-20250408";
8950
9003
  })();
@@ -109,6 +109,20 @@ function murmurhash3_32_gc(key, seed) {
109
109
  4294967295;
110
110
  return (h1 ^ (h1 >>> 16)) >>> 0;
111
111
  }
112
+ function readAsDataURL(blob) {
113
+ return blob.arrayBuffer().then(function (arrayBuffer) {
114
+ arrayBuffer =
115
+ "function" === typeof Buffer && "function" === typeof Buffer.from
116
+ ? Buffer.from(arrayBuffer).toString("base64")
117
+ : btoa(String.fromCharCode.apply(String, new Uint8Array(arrayBuffer)));
118
+ return (
119
+ "data:" +
120
+ (blob.type || "application/octet-stream") +
121
+ ";base64," +
122
+ arrayBuffer
123
+ );
124
+ });
125
+ }
112
126
  var assign = Object.assign,
113
127
  hasOwnProperty = Object.prototype.hasOwnProperty,
114
128
  VALID_ATTRIBUTE_NAME_REGEX = RegExp(
@@ -676,6 +690,28 @@ function pushFormActionAttribute(
676
690
  null != formTarget && pushAttribute(target, "formTarget", formTarget);
677
691
  return formData;
678
692
  }
693
+ var blobCache = null;
694
+ function pushSrcObjectAttribute(target, blob) {
695
+ null === blobCache && (blobCache = new WeakMap());
696
+ var suspenseCache = blobCache,
697
+ thenable = suspenseCache.get(blob);
698
+ void 0 === thenable &&
699
+ ((thenable = readAsDataURL(blob)),
700
+ thenable.then(
701
+ function (result) {
702
+ thenable.status = "fulfilled";
703
+ thenable.value = result;
704
+ },
705
+ function (error) {
706
+ thenable.status = "rejected";
707
+ thenable.reason = error;
708
+ }
709
+ ),
710
+ suspenseCache.set(blob, thenable));
711
+ if ("rejected" === thenable.status) throw thenable.reason;
712
+ if ("fulfilled" !== thenable.status) throw thenable;
713
+ target.push(" ", "src", '="', escapeTextForBrowser(thenable.value), '"');
714
+ }
679
715
  function pushAttribute(target, name, value) {
680
716
  switch (name) {
681
717
  case "className":
@@ -695,6 +731,15 @@ function pushAttribute(target, name, value) {
695
731
  pushStyleAttribute(target, value);
696
732
  break;
697
733
  case "src":
734
+ if (
735
+ "object" === typeof value &&
736
+ null !== value &&
737
+ "function" === typeof Blob &&
738
+ value instanceof Blob
739
+ ) {
740
+ pushSrcObjectAttribute(target, value);
741
+ break;
742
+ }
698
743
  case "href":
699
744
  if ("" === value) break;
700
745
  case "action":
@@ -5995,4 +6040,4 @@ exports.experimental_renderToHTML = function (children, options) {
5995
6040
  });
5996
6041
  });
5997
6042
  };
5998
- exports.version = "19.2.0-experimental-33661467-20250407";
6043
+ exports.version = "19.2.0-experimental-ea05b750-20250408";
@@ -120,6 +120,22 @@
120
120
  4294967295;
121
121
  return (h1 ^ (h1 >>> 16)) >>> 0;
122
122
  }
123
+ function readAsDataURL(blob) {
124
+ return blob.arrayBuffer().then(function (arrayBuffer) {
125
+ arrayBuffer =
126
+ "function" === typeof Buffer && "function" === typeof Buffer.from
127
+ ? Buffer.from(arrayBuffer).toString("base64")
128
+ : btoa(
129
+ String.fromCharCode.apply(String, new Uint8Array(arrayBuffer))
130
+ );
131
+ return (
132
+ "data:" +
133
+ (blob.type || "application/octet-stream") +
134
+ ";base64," +
135
+ arrayBuffer
136
+ );
137
+ });
138
+ }
123
139
  function prepareStackTrace(error, structuredStackTrace) {
124
140
  error = (error.name || "Error") + ": " + (error.message || "");
125
141
  for (var i = 0; i < structuredStackTrace.length; i++)
@@ -5876,6 +5892,33 @@
5876
5892
  null != formTarget && pushAttribute(target, "formTarget", formTarget);
5877
5893
  return formData;
5878
5894
  }
5895
+ function pushSrcObjectAttribute(target, blob) {
5896
+ null === blobCache && (blobCache = new WeakMap());
5897
+ var suspenseCache = blobCache,
5898
+ thenable = suspenseCache.get(blob);
5899
+ void 0 === thenable &&
5900
+ ((thenable = readAsDataURL(blob)),
5901
+ thenable.then(
5902
+ function (result) {
5903
+ thenable.status = "fulfilled";
5904
+ thenable.value = result;
5905
+ },
5906
+ function (error) {
5907
+ thenable.status = "rejected";
5908
+ thenable.reason = error;
5909
+ }
5910
+ ),
5911
+ suspenseCache.set(blob, thenable));
5912
+ if ("rejected" === thenable.status) throw thenable.reason;
5913
+ if ("fulfilled" !== thenable.status) throw thenable;
5914
+ target.push(
5915
+ attributeSeparator,
5916
+ "src",
5917
+ attributeAssign,
5918
+ escapeTextForBrowser(thenable.value),
5919
+ attributeEnd
5920
+ );
5921
+ }
5879
5922
  function pushAttribute(target, name, value) {
5880
5923
  switch (name) {
5881
5924
  case "className":
@@ -5895,6 +5938,15 @@
5895
5938
  pushStyleAttribute(target, value);
5896
5939
  break;
5897
5940
  case "src":
5941
+ if (
5942
+ "object" === typeof value &&
5943
+ null !== value &&
5944
+ "function" === typeof Blob &&
5945
+ value instanceof Blob
5946
+ ) {
5947
+ pushSrcObjectAttribute(target, value);
5948
+ break;
5949
+ }
5898
5950
  case "href":
5899
5951
  if ("" === value) {
5900
5952
  "src" === name
@@ -13296,6 +13348,7 @@
13296
13348
  actionJavaScriptURL = escapeTextForBrowser(
13297
13349
  "javascript:throw new Error('React form unexpectedly submitted.')"
13298
13350
  ),
13351
+ blobCache = null,
13299
13352
  endOfStartTag = ">",
13300
13353
  endOfStartTagSelfClosing = "/>",
13301
13354
  didWarnDefaultInputValue = !1,
@@ -13719,5 +13772,5 @@
13719
13772
  });
13720
13773
  });
13721
13774
  };
13722
- exports.version = "19.2.0-experimental-33661467-20250407";
13775
+ exports.version = "19.2.0-experimental-ea05b750-20250408";
13723
13776
  })();
@@ -94,6 +94,20 @@ function murmurhash3_32_gc(key, seed) {
94
94
  4294967295;
95
95
  return (h1 ^ (h1 >>> 16)) >>> 0;
96
96
  }
97
+ function readAsDataURL(blob) {
98
+ return blob.arrayBuffer().then(function (arrayBuffer) {
99
+ arrayBuffer =
100
+ "function" === typeof Buffer && "function" === typeof Buffer.from
101
+ ? Buffer.from(arrayBuffer).toString("base64")
102
+ : btoa(String.fromCharCode.apply(String, new Uint8Array(arrayBuffer)));
103
+ return (
104
+ "data:" +
105
+ (blob.type || "application/octet-stream") +
106
+ ";base64," +
107
+ arrayBuffer
108
+ );
109
+ });
110
+ }
97
111
  function prepareStackTrace(error, structuredStackTrace) {
98
112
  error = (error.name || "Error") + ": " + (error.message || "");
99
113
  for (var i = 0; i < structuredStackTrace.length; i++)
@@ -3594,6 +3608,28 @@ function pushFormActionAttribute(
3594
3608
  null != formTarget && pushAttribute(target, "formTarget", formTarget);
3595
3609
  return formData;
3596
3610
  }
3611
+ var blobCache = null;
3612
+ function pushSrcObjectAttribute(target, blob) {
3613
+ null === blobCache && (blobCache = new WeakMap());
3614
+ var suspenseCache = blobCache,
3615
+ thenable = suspenseCache.get(blob);
3616
+ void 0 === thenable &&
3617
+ ((thenable = readAsDataURL(blob)),
3618
+ thenable.then(
3619
+ function (result) {
3620
+ thenable.status = "fulfilled";
3621
+ thenable.value = result;
3622
+ },
3623
+ function (error) {
3624
+ thenable.status = "rejected";
3625
+ thenable.reason = error;
3626
+ }
3627
+ ),
3628
+ suspenseCache.set(blob, thenable));
3629
+ if ("rejected" === thenable.status) throw thenable.reason;
3630
+ if ("fulfilled" !== thenable.status) throw thenable;
3631
+ target.push(" ", "src", '="', escapeTextForBrowser(thenable.value), '"');
3632
+ }
3597
3633
  function pushAttribute(target, name, value) {
3598
3634
  switch (name) {
3599
3635
  case "className":
@@ -3613,6 +3649,15 @@ function pushAttribute(target, name, value) {
3613
3649
  pushStyleAttribute(target, value);
3614
3650
  break;
3615
3651
  case "src":
3652
+ if (
3653
+ "object" === typeof value &&
3654
+ null !== value &&
3655
+ "function" === typeof Blob &&
3656
+ value instanceof Blob
3657
+ ) {
3658
+ pushSrcObjectAttribute(target, value);
3659
+ break;
3660
+ }
3616
3661
  case "href":
3617
3662
  if ("" === value) break;
3618
3663
  case "action":
@@ -8932,4 +8977,4 @@ exports.experimental_renderToHTML = function (children, options) {
8932
8977
  });
8933
8978
  });
8934
8979
  };
8935
- exports.version = "19.2.0-experimental-33661467-20250407";
8980
+ exports.version = "19.2.0-experimental-ea05b750-20250408";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-markup",
3
- "version": "0.0.0-experimental-33661467-20250407",
3
+ "version": "0.0.0-experimental-ea05b750-20250408",
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-33661467-20250407"
20
+ "react": "0.0.0-experimental-ea05b750-20250408"
21
21
  },
22
22
  "files": [
23
23
  "LICENSE",