@inertiajs/core 2.3.18 → 2.3.22

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
@@ -1793,6 +1793,7 @@ var modal_default = {
1793
1793
  iframe.style.borderRadius = "5px";
1794
1794
  iframe.style.width = "100%";
1795
1795
  iframe.style.height = "100%";
1796
+ iframe.setAttribute("sandbox", "allow-scripts");
1796
1797
  return { iframe, page: page2 };
1797
1798
  },
1798
1799
  show(html) {
@@ -1809,12 +1810,7 @@ var modal_default = {
1809
1810
  this.modal.appendChild(iframe);
1810
1811
  document.body.prepend(this.modal);
1811
1812
  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();
1813
+ iframe.srcdoc = page2.outerHTML;
1818
1814
  this.listener = this.hideOnEscape.bind(this);
1819
1815
  document.addEventListener("keydown", this.listener);
1820
1816
  },
@@ -1871,12 +1867,7 @@ var dialog_default = {
1871
1867
  document.body.prepend(dialog);
1872
1868
  dialog.showModal();
1873
1869
  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();
1870
+ iframe.srcdoc = page2.outerHTML;
1880
1871
  }
1881
1872
  };
1882
1873
 
@@ -2122,10 +2113,9 @@ var Response = class _Response {
2122
2113
  ...pageResponse.onceProps || {}
2123
2114
  };
2124
2115
  }
2125
- pageResponse.flash = {
2126
- ...page.get().flash,
2127
- ...this.requestParams.isDeferredPropsRequest() ? {} : pageResponse.flash
2128
- };
2116
+ if (this.requestParams.isDeferredPropsRequest()) {
2117
+ pageResponse.flash = { ...page.get().flash };
2118
+ }
2129
2119
  const currentOriginalDeferred = page.get().initialDeferredProps;
2130
2120
  if (currentOriginalDeferred && Object.keys(currentOriginalDeferred).length > 0) {
2131
2121
  pageResponse.initialDeferredProps = currentOriginalDeferred;
@@ -3037,7 +3027,7 @@ function createHeadManager(isServer3, titleCallback, onUpdate) {
3037
3027
  return carry;
3038
3028
  }
3039
3029
  if (element.indexOf("<title ") === 0) {
3040
- const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/);
3030
+ const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/s);
3041
3031
  carry.title = title2 ? `${title2[1]}${titleCallback(title2[2])}${title2[3]}` : element;
3042
3032
  return carry;
3043
3033
  }