@hotwired/turbo 7.0.0-rc.2 → 7.0.0

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.
@@ -6,7 +6,8 @@ import { Session } from "../session";
6
6
  export declare class BrowserAdapter implements Adapter {
7
7
  readonly session: Session;
8
8
  readonly progressBar: ProgressBar;
9
- progressBarTimeout?: number;
9
+ visitProgressBarTimeout?: number;
10
+ formProgressBarTimeout?: number;
10
11
  constructor(session: Session);
11
12
  visitProposedToLocation(location: URL, options?: Partial<VisitOptions>): void;
12
13
  visitStarted(visit: Visit): void;
@@ -20,9 +21,11 @@ export declare class BrowserAdapter implements Adapter {
20
21
  visitRendered(visit: Visit): void;
21
22
  formSubmissionStarted(formSubmission: FormSubmission): void;
22
23
  formSubmissionFinished(formSubmission: FormSubmission): void;
23
- showProgressBarAfterDelay(): void;
24
+ showVisitProgressBarAfterDelay(): void;
25
+ hideVisitProgressBar(): void;
26
+ showFormProgressBarAfterDelay(): void;
27
+ hideFormProgressBar(): void;
24
28
  showProgressBar: () => void;
25
- hideProgressBar(): void;
26
29
  reload(): void;
27
30
  get navigator(): import("../drive/navigator").Navigator;
28
31
  }
@@ -1,4 +1,5 @@
1
1
  import { FetchResponse } from "./fetch_response";
2
+ import { FrameElement } from "../elements/frame_element";
2
3
  export interface FetchRequestDelegate {
3
4
  referrer?: URL;
4
5
  prepareHeadersForRequest?(headers: FetchRequestHeaders, request: FetchRequest): void;
@@ -32,9 +33,10 @@ export declare class FetchRequest {
32
33
  readonly headers: FetchRequestHeaders;
33
34
  readonly url: URL;
34
35
  readonly body?: FetchRequestBody;
36
+ readonly target?: FrameElement | HTMLFormElement | null;
35
37
  readonly abortController: AbortController;
36
38
  private resolveRequestPromise;
37
- constructor(delegate: FetchRequestDelegate, method: FetchMethod, location: URL, body?: FetchRequestBody);
39
+ constructor(delegate: FetchRequestDelegate, method: FetchMethod, location: URL, body?: FetchRequestBody, target?: FrameElement | HTMLFormElement | null);
38
40
  get location(): URL;
39
41
  get params(): URLSearchParams;
40
42
  get entries(): [string, FormDataEntryValue][];
@@ -21,6 +21,12 @@ export declare class FormSubmissionTests extends TurboDriveTestCase {
21
21
  "test invalid form submission with server error status"(): Promise<void>;
22
22
  "test submitter form submission reads button attributes"(): Promise<void>;
23
23
  "test submitter POST form submission with multipart/form-data formenctype"(): Promise<void>;
24
+ "test submitter GET submission from submitter with data-turbo-frame"(): Promise<void>;
25
+ "test submitter POST submission from submitter with data-turbo-frame"(): Promise<void>;
26
+ "test frame form GET submission from submitter with data-turbo-frame=_top"(): Promise<void>;
27
+ "test frame form POST submission from submitter with data-turbo-frame=_top"(): Promise<void>;
28
+ "test frame form GET submission from submitter referencing another frame"(): Promise<void>;
29
+ "test frame form POST submission from submitter referencing another frame"(): Promise<void>;
24
30
  "test frame form submission with redirect response"(): Promise<void>;
25
31
  "test frame form submission toggles the ancestor frame's [busy] attribute"(): Promise<void>;
26
32
  "test frame form submission toggles the target frame's [busy] attribute"(): Promise<void>;
@@ -41,6 +47,7 @@ export declare class FormSubmissionTests extends TurboDriveTestCase {
41
47
  "test form submission targeting a frame submits the Turbo-Frame header"(): Promise<void>;
42
48
  "test link method form submission inside frame"(): Promise<void>;
43
49
  "test link method form submission outside frame"(): Promise<void>;
44
- "test link method form submission inside form"(): Promise<void>;
50
+ "test turbo:before-fetch-request fires on the form element"(): Promise<void>;
51
+ "test turbo:before-fetch-response fires on the form element"(): Promise<void>;
45
52
  get formSubmitted(): Promise<boolean>;
46
53
  }
@@ -2,5 +2,6 @@ import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
2
2
  export declare class FrameNavigationTests extends TurboDriveTestCase {
3
3
  setup(): Promise<void>;
4
4
  "test frame navigation with descendant link"(): Promise<void>;
5
+ "test frame navigation with self link"(): Promise<void>;
5
6
  "test frame navigation with exterior link"(): Promise<void>;
6
7
  }
@@ -9,6 +9,7 @@ export declare class FrameTests extends TurboDriveTestCase {
9
9
  "test following a link within a descendant frame whose ancestor declares a target set navigates the descendant frame"(): Promise<void>;
10
10
  "test following a link that declares data-turbo-frame within a frame whose ancestor respects the override"(): Promise<void>;
11
11
  "test following a link within a frame with target=_top navigates the page"(): Promise<void>;
12
+ "test following a link that declares data-turbo-frame='_self' within a frame with target=_top navigates the frame itself"(): Promise<void>;
12
13
  "test following a link to a page with a <turbo-frame recurse> which lazily loads a matching frame"(): Promise<void>;
13
14
  "test submitting a form that redirects to a page with a <turbo-frame recurse> which lazily loads a matching frame"(): Promise<void>;
14
15
  "test removing [disabled] attribute from eager-loaded frame navigates it"(): Promise<void>;
@@ -16,8 +17,14 @@ export declare class FrameTests extends TurboDriveTestCase {
16
17
  "test does not evaluate data-turbo-eval=false scripts"(): Promise<void>;
17
18
  "test redirecting in a form is still navigatable after redirect"(): Promise<void>;
18
19
  "test 'turbo:frame-render' is triggered after frame has finished rendering"(): Promise<void>;
19
- "test following a link reloads frame on every click"(): Promise<void>;
20
+ "test following inner link reloads frame on every click"(): Promise<void>;
21
+ "test following outer link reloads frame on every click"(): Promise<void>;
22
+ "test following outer form reloads frame on every submit"(): Promise<void>;
23
+ "test an inner/outer link reloads frame on every click"(): Promise<void>;
24
+ "test an inner/outer form reloads frame on every submit"(): Promise<void>;
20
25
  "test reconnecting after following a link does not reload the frame"(): Promise<void>;
26
+ "test turbo:before-fetch-request fires on the frame element"(): Promise<void>;
27
+ "test turbo:before-fetch-response fires on the frame element"(): Promise<void>;
21
28
  get frameScriptEvaluationCount(): Promise<number | undefined>;
22
29
  }
23
30
  declare global {
@@ -5,6 +5,7 @@ export declare class RenderingTests extends TurboDriveTestCase {
5
5
  "test triggers before-render and render events"(): Promise<void>;
6
6
  "test triggers before-render and render events for error pages"(): Promise<void>;
7
7
  "test reloads when tracked elements change"(): Promise<void>;
8
+ "test wont reload when tracked elements has a nonce"(): Promise<void>;
8
9
  "test reloads when turbo-visit-control setting is reload"(): Promise<void>;
9
10
  "test accumulates asset elements in head"(): Promise<void>;
10
11
  "test replaces provisional elements in head"(): Promise<void>;
@@ -7,6 +7,7 @@ export declare class VisitTests extends TurboDriveTestCase {
7
7
  "test canceling a before-visit event prevents navigation"(): Promise<void>;
8
8
  "test navigation by history is not cancelable"(): Promise<void>;
9
9
  "test turbo:before-fetch-request event.detail"(): Promise<void>;
10
+ "test turbo:before-fetch-response open new site"(): Promise<void>;
10
11
  visitLocation(location: string): Promise<void>;
11
12
  cancelNextVisit(): Promise<void>;
12
13
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@hotwired/turbo",
3
- "version": "7.0.0-rc.2",
3
+ "version": "7.0.0",
4
4
  "description": "The speed of a single-page web application without having to write any JavaScript",
5
5
  "module": "dist/turbo.es2017-esm.js",
6
- "main": "dist/turbo.es5-umd.js",
6
+ "main": "dist/turbo.es2017-umd.js",
7
7
  "types": "dist/types/index.d.ts",
8
8
  "files": [
9
9
  "dist/*.js",