@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.esm.js CHANGED
@@ -277,6 +277,15 @@ var getKeyFromSessionStorage = async () => {
277
277
  import { cloneDeep } from "lodash-es";
278
278
 
279
279
  // src/objectUtils.ts
280
+ var stripTopLevelUndefined = (obj) => {
281
+ const result = {};
282
+ for (const key of Object.keys(obj)) {
283
+ if (obj[key] !== void 0) {
284
+ result[key] = obj[key];
285
+ }
286
+ }
287
+ return result;
288
+ };
280
289
  var objectsAreEqual = (obj1, obj2, excludeKeys) => {
281
290
  if (obj1 === obj2) {
282
291
  return true;
@@ -1793,6 +1802,7 @@ var modal_default = {
1793
1802
  iframe.style.borderRadius = "5px";
1794
1803
  iframe.style.width = "100%";
1795
1804
  iframe.style.height = "100%";
1805
+ iframe.setAttribute("sandbox", "allow-scripts");
1796
1806
  return { iframe, page: page2 };
1797
1807
  },
1798
1808
  show(html) {
@@ -1809,12 +1819,7 @@ var modal_default = {
1809
1819
  this.modal.appendChild(iframe);
1810
1820
  document.body.prepend(this.modal);
1811
1821
  document.body.style.overflow = "hidden";
1812
- if (!iframe.contentWindow) {
1813
- throw new Error("iframe not yet ready.");
1814
- }
1815
- iframe.contentWindow.document.open();
1816
- iframe.contentWindow.document.write(page2.outerHTML);
1817
- iframe.contentWindow.document.close();
1822
+ iframe.srcdoc = page2.outerHTML;
1818
1823
  this.listener = this.hideOnEscape.bind(this);
1819
1824
  document.addEventListener("keydown", this.listener);
1820
1825
  },
@@ -1871,12 +1876,7 @@ var dialog_default = {
1871
1876
  document.body.prepend(dialog);
1872
1877
  dialog.showModal();
1873
1878
  dialog.focus();
1874
- if (!iframe.contentWindow) {
1875
- throw new Error("iframe not yet ready.");
1876
- }
1877
- iframe.contentWindow.document.open();
1878
- iframe.contentWindow.document.write(page2.outerHTML);
1879
- iframe.contentWindow.document.close();
1879
+ iframe.srcdoc = page2.outerHTML;
1880
1880
  }
1881
1881
  };
1882
1882
 
@@ -2692,8 +2692,8 @@ var Router = class {
2692
2692
  prefetch: false,
2693
2693
  invalidateCacheTags: [],
2694
2694
  viewTransition: false,
2695
- ...options,
2696
- ...configuredOptions
2695
+ ...stripTopLevelUndefined(options),
2696
+ ...stripTopLevelUndefined(configuredOptions)
2697
2697
  };
2698
2698
  const [url, _data] = transformUrlAndData(
2699
2699
  href,
@@ -3036,7 +3036,7 @@ function createHeadManager(isServer3, titleCallback, onUpdate) {
3036
3036
  return carry;
3037
3037
  }
3038
3038
  if (element.indexOf("<title ") === 0) {
3039
- const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/);
3039
+ const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/s);
3040
3040
  carry.title = title2 ? `${title2[1]}${titleCallback(title2[2])}${title2[3]}` : element;
3041
3041
  return carry;
3042
3042
  }