@inertiajs/core 2.3.21 → 2.3.23

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.
package/dist/index.js CHANGED
@@ -335,6 +335,15 @@ var getKeyFromSessionStorage = async () => {
335
335
  var import_lodash_es2 = require("lodash-es");
336
336
 
337
337
  // src/objectUtils.ts
338
+ var stripTopLevelUndefined = (obj) => {
339
+ const result = {};
340
+ for (const key of Object.keys(obj)) {
341
+ if (obj[key] !== void 0) {
342
+ result[key] = obj[key];
343
+ }
344
+ }
345
+ return result;
346
+ };
338
347
  var objectsAreEqual = (obj1, obj2, excludeKeys) => {
339
348
  if (obj1 === obj2) {
340
349
  return true;
@@ -1851,6 +1860,7 @@ var modal_default = {
1851
1860
  iframe.style.borderRadius = "5px";
1852
1861
  iframe.style.width = "100%";
1853
1862
  iframe.style.height = "100%";
1863
+ iframe.setAttribute("sandbox", "allow-scripts");
1854
1864
  return { iframe, page: page2 };
1855
1865
  },
1856
1866
  show(html) {
@@ -1867,12 +1877,7 @@ var modal_default = {
1867
1877
  this.modal.appendChild(iframe);
1868
1878
  document.body.prepend(this.modal);
1869
1879
  document.body.style.overflow = "hidden";
1870
- if (!iframe.contentWindow) {
1871
- throw new Error("iframe not yet ready.");
1872
- }
1873
- iframe.contentWindow.document.open();
1874
- iframe.contentWindow.document.write(page2.outerHTML);
1875
- iframe.contentWindow.document.close();
1880
+ iframe.srcdoc = page2.outerHTML;
1876
1881
  this.listener = this.hideOnEscape.bind(this);
1877
1882
  document.addEventListener("keydown", this.listener);
1878
1883
  },
@@ -1929,12 +1934,7 @@ var dialog_default = {
1929
1934
  document.body.prepend(dialog);
1930
1935
  dialog.showModal();
1931
1936
  dialog.focus();
1932
- if (!iframe.contentWindow) {
1933
- throw new Error("iframe not yet ready.");
1934
- }
1935
- iframe.contentWindow.document.open();
1936
- iframe.contentWindow.document.write(page2.outerHTML);
1937
- iframe.contentWindow.document.close();
1937
+ iframe.srcdoc = page2.outerHTML;
1938
1938
  }
1939
1939
  };
1940
1940
 
@@ -2750,8 +2750,8 @@ var Router = class {
2750
2750
  prefetch: false,
2751
2751
  invalidateCacheTags: [],
2752
2752
  viewTransition: false,
2753
- ...options,
2754
- ...configuredOptions
2753
+ ...stripTopLevelUndefined(options),
2754
+ ...stripTopLevelUndefined(configuredOptions)
2755
2755
  };
2756
2756
  const [url, _data] = transformUrlAndData(
2757
2757
  href,
@@ -3094,7 +3094,7 @@ function createHeadManager(isServer3, titleCallback, onUpdate) {
3094
3094
  return carry;
3095
3095
  }
3096
3096
  if (element.indexOf("<title ") === 0) {
3097
- const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/);
3097
+ const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/s);
3098
3098
  carry.title = title2 ? `${title2[1]}${titleCallback(title2[2])}${title2[3]}` : element;
3099
3099
  return carry;
3100
3100
  }