@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.js CHANGED
@@ -1851,6 +1851,7 @@ var modal_default = {
1851
1851
  iframe.style.borderRadius = "5px";
1852
1852
  iframe.style.width = "100%";
1853
1853
  iframe.style.height = "100%";
1854
+ iframe.setAttribute("sandbox", "allow-scripts");
1854
1855
  return { iframe, page: page2 };
1855
1856
  },
1856
1857
  show(html) {
@@ -1867,12 +1868,7 @@ var modal_default = {
1867
1868
  this.modal.appendChild(iframe);
1868
1869
  document.body.prepend(this.modal);
1869
1870
  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();
1871
+ iframe.srcdoc = page2.outerHTML;
1876
1872
  this.listener = this.hideOnEscape.bind(this);
1877
1873
  document.addEventListener("keydown", this.listener);
1878
1874
  },
@@ -1929,12 +1925,7 @@ var dialog_default = {
1929
1925
  document.body.prepend(dialog);
1930
1926
  dialog.showModal();
1931
1927
  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();
1928
+ iframe.srcdoc = page2.outerHTML;
1938
1929
  }
1939
1930
  };
1940
1931
 
@@ -2180,10 +2171,9 @@ var Response = class _Response {
2180
2171
  ...pageResponse.onceProps || {}
2181
2172
  };
2182
2173
  }
2183
- pageResponse.flash = {
2184
- ...page.get().flash,
2185
- ...this.requestParams.isDeferredPropsRequest() ? {} : pageResponse.flash
2186
- };
2174
+ if (this.requestParams.isDeferredPropsRequest()) {
2175
+ pageResponse.flash = { ...page.get().flash };
2176
+ }
2187
2177
  const currentOriginalDeferred = page.get().initialDeferredProps;
2188
2178
  if (currentOriginalDeferred && Object.keys(currentOriginalDeferred).length > 0) {
2189
2179
  pageResponse.initialDeferredProps = currentOriginalDeferred;
@@ -3095,7 +3085,7 @@ function createHeadManager(isServer3, titleCallback, onUpdate) {
3095
3085
  return carry;
3096
3086
  }
3097
3087
  if (element.indexOf("<title ") === 0) {
3098
- const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/);
3088
+ const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/s);
3099
3089
  carry.title = title2 ? `${title2[1]}${titleCallback(title2[2])}${title2[3]}` : element;
3100
3090
  return carry;
3101
3091
  }