swup 4.4.0 → 4.4.1

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.
Files changed (83) hide show
  1. package/dist/Swup.cjs +1 -1
  2. package/dist/Swup.cjs.map +1 -1
  3. package/dist/Swup.modern.js +1 -1
  4. package/dist/Swup.modern.js.map +1 -1
  5. package/dist/Swup.module.js +1 -1
  6. package/dist/Swup.module.js.map +1 -1
  7. package/dist/Swup.umd.js +1 -1
  8. package/dist/Swup.umd.js.map +1 -1
  9. package/dist/types/Swup.d.ts +8 -5
  10. package/dist/types/Swup.d.ts.map +1 -0
  11. package/dist/types/config/version.d.ts +1 -0
  12. package/dist/types/config/version.d.ts.map +1 -0
  13. package/dist/types/helpers/Location.d.ts +1 -0
  14. package/dist/types/helpers/Location.d.ts.map +1 -0
  15. package/dist/types/helpers/classify.d.ts +1 -0
  16. package/dist/types/helpers/classify.d.ts.map +1 -0
  17. package/dist/types/helpers/createHistoryRecord.d.ts +1 -0
  18. package/dist/types/helpers/createHistoryRecord.d.ts.map +1 -0
  19. package/dist/types/helpers/delegateEvent.d.ts +3 -2
  20. package/dist/types/helpers/delegateEvent.d.ts.map +1 -0
  21. package/dist/types/helpers/getCurrentUrl.d.ts +1 -0
  22. package/dist/types/helpers/getCurrentUrl.d.ts.map +1 -0
  23. package/dist/types/helpers/matchPath.d.ts +2 -1
  24. package/dist/types/helpers/matchPath.d.ts.map +1 -0
  25. package/dist/types/helpers/updateHistoryRecord.d.ts +1 -0
  26. package/dist/types/helpers/updateHistoryRecord.d.ts.map +1 -0
  27. package/dist/types/helpers.d.ts +1 -0
  28. package/dist/types/helpers.d.ts.map +1 -0
  29. package/dist/types/index.d.ts +1 -0
  30. package/dist/types/index.d.ts.map +1 -0
  31. package/dist/types/modules/Cache.d.ts +3 -2
  32. package/dist/types/modules/Cache.d.ts.map +1 -0
  33. package/dist/types/modules/Classes.d.ts +2 -1
  34. package/dist/types/modules/Classes.d.ts.map +1 -0
  35. package/dist/types/modules/Hooks.d.ts +5 -4
  36. package/dist/types/modules/Hooks.d.ts.map +1 -0
  37. package/dist/types/modules/Visit.d.ts +4 -2
  38. package/dist/types/modules/Visit.d.ts.map +1 -0
  39. package/dist/types/modules/animatePageIn.d.ts +2 -1
  40. package/dist/types/modules/animatePageIn.d.ts.map +1 -0
  41. package/dist/types/modules/animatePageOut.d.ts +2 -1
  42. package/dist/types/modules/animatePageOut.d.ts.map +1 -0
  43. package/dist/types/modules/awaitAnimations.d.ts +3 -1
  44. package/dist/types/modules/awaitAnimations.d.ts.map +1 -0
  45. package/dist/types/modules/fetchPage.d.ts +2 -1
  46. package/dist/types/modules/fetchPage.d.ts.map +1 -0
  47. package/dist/types/modules/getAnchorElement.d.ts +1 -0
  48. package/dist/types/modules/getAnchorElement.d.ts.map +1 -0
  49. package/dist/types/modules/navigate.d.ts +4 -3
  50. package/dist/types/modules/navigate.d.ts.map +1 -0
  51. package/dist/types/modules/plugins.d.ts +2 -1
  52. package/dist/types/modules/plugins.d.ts.map +1 -0
  53. package/dist/types/modules/renderPage.d.ts +3 -2
  54. package/dist/types/modules/renderPage.d.ts.map +1 -0
  55. package/dist/types/modules/replaceContent.d.ts +4 -2
  56. package/dist/types/modules/replaceContent.d.ts.map +1 -0
  57. package/dist/types/modules/resolveUrl.d.ts +2 -1
  58. package/dist/types/modules/resolveUrl.d.ts.map +1 -0
  59. package/dist/types/modules/scrollToContent.d.ts +2 -1
  60. package/dist/types/modules/scrollToContent.d.ts.map +1 -0
  61. package/dist/types/utils/index.d.ts +1 -0
  62. package/dist/types/utils/index.d.ts.map +1 -0
  63. package/dist/types/utils.d.ts +1 -0
  64. package/dist/types/utils.d.ts.map +1 -0
  65. package/package.json +2 -1
  66. package/src/Swup.ts +14 -6
  67. package/src/helpers/delegateEvent.ts +6 -2
  68. package/src/helpers/matchPath.ts +1 -1
  69. package/src/helpers/updateHistoryRecord.ts +1 -1
  70. package/src/modules/Cache.ts +2 -2
  71. package/src/modules/Classes.ts +1 -1
  72. package/src/modules/Hooks.ts +4 -4
  73. package/src/modules/Visit.ts +3 -2
  74. package/src/modules/animatePageIn.ts +1 -1
  75. package/src/modules/animatePageOut.ts +1 -1
  76. package/src/modules/awaitAnimations.ts +2 -1
  77. package/src/modules/fetchPage.ts +1 -1
  78. package/src/modules/navigate.ts +5 -3
  79. package/src/modules/plugins.ts +1 -1
  80. package/src/modules/renderPage.ts +2 -2
  81. package/src/modules/replaceContent.ts +3 -2
  82. package/src/modules/resolveUrl.ts +1 -1
  83. package/src/modules/scrollToContent.ts +1 -1
@@ -22,3 +22,4 @@ export declare class Location extends URL {
22
22
  */
23
23
  static fromUrl(url: URL | string): Location;
24
24
  }
25
+ //# sourceMappingURL=Location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Location.d.ts","sourceRoot":"","sources":["../../../src/helpers/Location.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,GAAG;gBACpB,GAAG,EAAE,GAAG,GAAG,MAAM,EAAE,IAAI,GAAE,MAAyB;IAI9D;;OAEG;IACH,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,QAAQ;IAKzC;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,QAAQ;CAG3C"}
@@ -1,2 +1,3 @@
1
1
  /** Turn a string into a slug by lowercasing and replacing whitespace. */
2
2
  export declare const classify: (text: string, fallback?: string) => string;
3
+ //# sourceMappingURL=classify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../../src/helpers/classify.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,eAAO,MAAM,QAAQ,SAAU,MAAM,aAAa,MAAM,KAAG,MAU1D,CAAC"}
@@ -7,3 +7,4 @@ export interface HistoryState {
7
7
  }
8
8
  /** Create a new history record with a custom swup identifier. */
9
9
  export declare const createHistoryRecord: (url: string, customData?: Record<string, unknown>) => void;
10
+ //# sourceMappingURL=createHistoryRecord.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createHistoryRecord.d.ts","sourceRoot":"","sources":["../../../src/helpers/createHistoryRecord.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,QAC1B,MAAM,eACC,OAAO,MAAM,EAAE,OAAO,CAAC,KACjC,IASF,CAAC"}
@@ -1,7 +1,8 @@
1
- import { DelegateEventHandler, DelegateOptions } from 'delegate-it';
2
- import { ParseSelector } from 'typed-query-selector/parser.js';
1
+ import { type DelegateEventHandler, type DelegateOptions } from 'delegate-it';
2
+ import type { ParseSelector } from 'typed-query-selector/parser.js';
3
3
  export type DelegateEventUnsubscribe = {
4
4
  destroy: () => void;
5
5
  };
6
6
  /** Register a delegated event listener. */
7
7
  export declare const delegateEvent: <Selector extends string, TElement extends Element = ParseSelector<Selector, HTMLElement>, TEvent extends keyof GlobalEventHandlersEventMap = keyof GlobalEventHandlersEventMap>(selector: Selector, type: TEvent, callback: DelegateEventHandler<GlobalEventHandlersEventMap[TEvent], TElement>, options?: DelegateOptions) => DelegateEventUnsubscribe;
8
+ //# sourceMappingURL=delegateEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegateEvent.d.ts","sourceRoot":"","sources":["../../../src/helpers/delegateEvent.ts"],"names":[],"mappings":"AAAA,OAAiB,EAChB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EAEpB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,MAAM,wBAAwB,GAAG;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,2CAA2C;AAC3C,eAAO,MAAM,aAAa,8SAQf,eAAe,KACvB,wBAKF,CAAC"}
@@ -2,3 +2,4 @@
2
2
  export declare const getCurrentUrl: ({ hash }?: {
3
3
  hash?: boolean | undefined;
4
4
  }) => string;
5
+ //# sourceMappingURL=getCurrentUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCurrentUrl.d.ts","sourceRoot":"","sources":["../../../src/helpers/getCurrentUrl.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,aAAa;;MAAwC,MAEjE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { Path, ParseOptions, TokensToRegexpOptions, RegexpToFunctionOptions, MatchFunction } from 'path-to-regexp';
2
- export { Path };
2
+ export { type Path };
3
3
  /** Create a match function from a path pattern that checks if a URLs matches it. */
4
4
  export declare const matchPath: <P extends object = object>(path: Path, options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions) => MatchFunction<P>;
5
+ //# sourceMappingURL=matchPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchPath.d.ts","sourceRoot":"","sources":["../../../src/helpers/matchPath.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,IAAI,EACJ,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;AAErB,oFAAoF;AACpF,eAAO,MAAM,SAAS,oCACf,IAAI,YACA,YAAY,GAAG,qBAAqB,GAAG,uBAAuB,qBAOxE,CAAC"}
@@ -1,2 +1,3 @@
1
1
  /** Update the current history record with a custom swup identifier. */
2
2
  export declare const updateHistoryRecord: (url?: string | null, customData?: Record<string, unknown>) => void;
3
+ //# sourceMappingURL=updateHistoryRecord.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateHistoryRecord.d.ts","sourceRoot":"","sources":["../../../src/helpers/updateHistoryRecord.ts"],"names":[],"mappings":"AAGA,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,SAC1B,MAAM,GAAG,IAAI,eACN,OAAO,MAAM,EAAE,OAAO,CAAC,KACjC,IAWF,CAAC"}
@@ -5,3 +5,4 @@ export { delegateEvent } from './helpers/delegateEvent.js';
5
5
  export { getCurrentUrl } from './helpers/getCurrentUrl.js';
6
6
  export { Location } from './helpers/Location.js';
7
7
  export { matchPath } from './helpers/matchPath.js';
8
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC"}
@@ -12,3 +12,4 @@ export default Swup;
12
12
  export * from './helpers.js';
13
13
  export * from './utils.js';
14
14
  export type { Swup, Options, Plugin, CacheData, PageData, Visit, VisitFrom, VisitTo, VisitAnimation, VisitScroll, VisitHistory, HookArguments, HookDefinitions, HookName, HookOptions, HookUnregister, Handler, Path, DelegateEvent, DelegateEventHandler, DelegateEventUnsubscribe };
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EACX,KAAK,EACL,SAAS,EACT,OAAO,EACP,cAAc,EACd,WAAW,EACX,YAAY,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACX,aAAa,EACb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,cAAc,EACd,OAAO,EACP,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,eAAe,IAAI,CAAC;AACpB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,YAAY,EACX,IAAI,EACJ,OAAO,EACP,MAAM,EACN,SAAS,EACT,QAAQ,EACR,KAAK,EACL,SAAS,EACT,OAAO,EACP,cAAc,EACd,WAAW,EACX,YAAY,EACZ,aAAa,EACb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,cAAc,EACd,OAAO,EACP,IAAI,EACJ,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACxB,CAAC"}
@@ -1,5 +1,5 @@
1
- import Swup from '../Swup.js';
2
- import { PageData } from './fetchPage.js';
1
+ import type Swup from '../Swup.js';
2
+ import { type PageData } from './fetchPage.js';
3
3
  export interface CacheData extends PageData {
4
4
  }
5
5
  /**
@@ -32,3 +32,4 @@ export declare class Cache {
32
32
  /** Resolve URLs by making them local and letting swup resolve them. */
33
33
  protected resolve(urlToResolve: string): string;
34
34
  }
35
+ //# sourceMappingURL=Cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../../src/modules/Cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,SAAU,SAAQ,QAAQ;CAAG;AAE9C;;GAEG;AACH,qBAAa,KAAK;IACjB,0CAA0C;IAC1C,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;IAErB,mCAAmC;IACnC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAa;gBAExC,IAAI,EAAE,IAAI;IAItB,wCAAwC;IACxC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,wBAAwB;IACxB,IAAI,GAAG,kBAMN;IAED,8CAA8C;IAC9C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB,oEAAoE;IACpE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAMvC,mDAAmD;IACnD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS;IAOhC,gEAAgE;IAChE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAMnC,6BAA6B;IAC7B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIzB,uBAAuB;IACvB,KAAK,IAAI,IAAI;IAKb,iFAAiF;IACjF,KAAK,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,OAAO,GAAG,IAAI;IAQjE,uEAAuE;IACvE,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;CAI/C"}
@@ -1,4 +1,4 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  export declare class Classes {
3
3
  protected swup: Swup;
4
4
  protected swupClasses: string[];
@@ -11,3 +11,4 @@ export declare class Classes {
11
11
  clear(): void;
12
12
  protected isSwupClass(className: string): boolean;
13
13
  }
14
+ //# sourceMappingURL=Classes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Classes.d.ts","sourceRoot":"","sources":["../../../src/modules/Classes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAGnC,qBAAa,OAAO;IACnB,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;IACrB,SAAS,CAAC,WAAW,WAAyE;gBAElF,IAAI,EAAE,IAAI;IAItB,SAAS,KAAK,SAAS,IAAI,MAAM,EAAE,CAMlC;IAED,SAAS,KAAK,QAAQ,IAAI,MAAM,CAE/B;IAED,SAAS,KAAK,OAAO,IAAI,WAAW,EAAE,CAGrC;IAED,GAAG,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAI/B,MAAM,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAIlC,KAAK,IAAI,IAAI;IAOb,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;CAGjD"}
@@ -1,7 +1,7 @@
1
- import { DelegateEvent } from 'delegate-it';
2
- import Swup from '../Swup.js';
3
- import { Visit } from './Visit.js';
4
- import { FetchOptions, PageData } from './fetchPage.js';
1
+ import type { DelegateEvent } from 'delegate-it';
2
+ import type Swup from '../Swup.js';
3
+ import type { Visit } from './Visit.js';
4
+ import type { FetchOptions, PageData } from './fetchPage.js';
5
5
  export interface HookDefinitions {
6
6
  'animation:out:start': undefined;
7
7
  'animation:out:await': {
@@ -271,3 +271,4 @@ export declare class Hooks {
271
271
  protected dispatchDomEvent<T extends HookName>(hook: T, args?: HookArguments<T>): void;
272
272
  }
273
273
  export {};
274
+ //# sourceMappingURL=Hooks.d.ts.map
@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,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;IAExJ,SAAS,CAAC,OAAO,CAAC,CAAC,SAAS,QAAQ,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE;IAuB9G;;;;;;OAMG;IACH,SAAS,CAAC,WAAW,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;;;;;;;IA6CrF;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CAAC,CAAC,SAAS,QAAQ,EAC7C,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,EACtB,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,GACpB,MAAM;IAMT;;;OAGG;IACH,SAAS,CAAC,gBAAgB,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI;CAItF"}
@@ -1,5 +1,6 @@
1
- import Swup, { Options } from '../Swup.js';
2
- import { HistoryAction, HistoryDirection } from './navigate.js';
1
+ import type Swup from '../Swup.js';
2
+ import type { Options } from '../Swup.js';
3
+ import type { HistoryAction, HistoryDirection } from './navigate.js';
3
4
  /** An object holding details about the current visit. */
4
5
  export interface Visit {
5
6
  /** A unique ID to identify this visit */
@@ -80,3 +81,4 @@ export interface VisitInitOptions {
80
81
  }
81
82
  /** Create a new visit object. */
82
83
  export declare function createVisit(this: Swup, { to, from, hash, el, event }: VisitInitOptions): Visit;
84
+ //# sourceMappingURL=Visit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Visit.d.ts","sourceRoot":"","sources":["../../../src/modules/Visit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE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K,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC5B,6CAA6C;IAC7C,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,2CAA2C;IAC3C,KAAK,CAAC,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IAC1B,yEAAyE;IACzE,IAAI,EAAE,OAAO,CAAC;IACd,6DAA6D;IAC7D,KAAK,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC5B,qIAAqI;IACrI,MAAM,EAAE,aAAa,CAAC;IACtB,wEAAwE;IACxE,QAAQ,EAAE,OAAO,CAAC;IAClB,4FAA4F;IAC5F,SAAS,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;CACd;AAED,iCAAiC;AACjC,wBAAgB,WAAW,CAC1B,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,EAAE,IAA0B,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,gBAAgB,GACnE,KAAK,CA+BP"}
@@ -1,6 +1,7 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  /**
3
3
  * Perform the in/enter animation of the next page.
4
4
  * @returns Promise<void>
5
5
  */
6
6
  export declare const animatePageIn: (this: Swup) => Promise<void>;
7
+ //# sourceMappingURL=animatePageIn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animatePageIn.d.ts","sourceRoot":"","sources":["../../../src/modules/animatePageIn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAGnC;;;GAGG;AACH,eAAO,MAAM,aAAa,SAAyB,IAAI,kBAuBtD,CAAC"}
@@ -1,6 +1,7 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  /**
3
3
  * Perform the out/leave animation of the current page.
4
4
  * @returns Promise<void>
5
5
  */
6
6
  export declare const animatePageOut: (this: Swup) => Promise<void>;
7
+ //# sourceMappingURL=animatePageOut.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animatePageOut.d.ts","sourceRoot":"","sources":["../../../src/modules/animatePageOut.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAGnC;;;GAGG;AACH,eAAO,MAAM,cAAc,SAAyB,IAAI,kBAsBvD,CAAC"}
@@ -1,4 +1,5 @@
1
- import Swup, { Options } from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
+ import type { Options } from '../Swup.js';
2
3
  declare const TRANSITION = "transition";
3
4
  declare const ANIMATION = "animation";
4
5
  type AnimationTypes = typeof TRANSITION | typeof ANIMATION;
@@ -17,3 +18,4 @@ export declare function getTransitionInfo(element: Element, expectedType?: Anima
17
18
  propCount: number;
18
19
  };
19
20
  export {};
21
+ //# sourceMappingURL=awaitAnimations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"awaitAnimations.d.ts","sourceRoot":"","sources":["../../../src/modules/awaitAnimations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,QAAA,MAAM,UAAU,eAAe,CAAC;AAChC,QAAA,MAAM,SAAS,cAAc,CAAC;AAE9B,KAAK,cAAc,GAAG,OAAO,UAAU,GAAG,OAAO,SAAS,CAAC;AAK3D,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,KAAK,CAAC;AAE9C;;;GAGG;AACH,wBAAsB,eAAe,CACpC,IAAI,EAAE,IAAI,EACV,EACC,QAAQ,EACR,QAAQ,EACR,EAAE;IACF,QAAQ,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,WAAW,EAAE,CAAC;CACnD,GACC,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAoDD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,cAAc;;;;EAyChF"}
@@ -1,4 +1,4 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  /** A page object as used by swup and its cache. */
3
3
  export interface PageData {
4
4
  /** The URL of the page */
@@ -31,3 +31,4 @@ export declare class FetchError extends Error {
31
31
  * Fetch a page from the server, return it and cache it.
32
32
  */
33
33
  export declare function fetchPage(this: Swup, url: URL | string, options?: FetchOptions): Promise<PageData>;
34
+ //# sourceMappingURL=fetchPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchPage.d.ts","sourceRoot":"","sources":["../../../src/modules/fetchPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAGnC,mDAAmD;AACnD,MAAM,WAAW,QAAQ;IACxB,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;CACb;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;IAC/D,0BAA0B;IAC1B,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC;IAC3C,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,UAAW,SAAQ,KAAK;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;gBAEjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE;CASjF;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC9B,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,GAAG,MAAM,EACjB,OAAO,GAAE,YAAiB,GACxB,OAAO,CAAC,QAAQ,CAAC,CAqEnB"}
@@ -7,3 +7,4 @@
7
7
  * @see https://html.spec.whatwg.org/#find-a-potential-indicated-element
8
8
  */
9
9
  export declare const getAnchorElement: (hash?: string) => Element | null;
10
+ //# sourceMappingURL=getAnchorElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAnchorElement.d.ts","sourceRoot":"","sources":["../../../src/modules/getAnchorElement.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,OAAO,GAAG,IAqB1D,CAAC"}
@@ -1,6 +1,6 @@
1
- import Swup from '../Swup.js';
2
- import { FetchOptions } from './fetchPage.js';
3
- import { VisitInitOptions } from './Visit.js';
1
+ import type Swup from '../Swup.js';
2
+ import { type FetchOptions } from './fetchPage.js';
3
+ import type { VisitInitOptions } from './Visit.js';
4
4
  export type HistoryAction = 'push' | 'replace';
5
5
  export type HistoryDirection = 'forwards' | 'backwards';
6
6
  export type NavigationToSelfAction = 'scroll' | 'navigate';
@@ -39,3 +39,4 @@ export declare function navigate(this: Swup, url: string, options?: NavigationOp
39
39
  */
40
40
  export declare function performNavigation(this: Swup, options?: NavigationOptions & FetchOptions): Promise<void>;
41
41
  export {};
42
+ //# sourceMappingURL=navigate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigate.d.ts","sourceRoot":"","sources":["../../../src/modules/navigate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAc,KAAK,YAAY,EAAiB,MAAM,gBAAgB,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAC/C,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,WAAW,CAAC;AACxD,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEtE,wCAAwC;AACxC,KAAK,iBAAiB,GAAG;IACxB,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qIAAqI;IACrI,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iEAAiE;IACjE,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,QAAQ,CACvB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,iBAAiB,GAAG,YAAiB,EAC9C,IAAI,GAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAM,QAevC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACtC,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,iBAAiB,GAAG,YAAiB,GAC5C,OAAO,CAAC,IAAI,CAAC,CA6Hf"}
@@ -1,4 +1,4 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  export type Plugin = {
3
3
  /** Identify as a swup plugin */
4
4
  isSwupPlugin: true;
@@ -24,3 +24,4 @@ export declare const use: (this: Swup, plugin: unknown) => Plugin[] | undefined;
24
24
  export declare function unuse(this: Swup, pluginOrName: Plugin | string): Plugin[] | undefined;
25
25
  /** Find a plugin by name or reference. */
26
26
  export declare function findPlugin(this: Swup, pluginOrName: Plugin | string): Plugin | undefined;
27
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/modules/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,MAAM,MAAM,MAAM,GAAG;IACpB,gCAAgC;IAChC,YAAY,EAAE,IAAI,CAAC;IACnB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC7C,mBAAmB;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,qBAAqB;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC;CACnC,CAAC;AAOF,wBAAwB;AACxB,eAAO,MAAM,GAAG,SAAmB,IAAI,UAAU,OAAO,yBAoBvD,CAAC;AAEF,0BAA0B;AAC1B,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,wBAe9D;AAED,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,sBAOnE"}
@@ -1,6 +1,7 @@
1
- import Swup from '../Swup.js';
2
- import { PageData } from './fetchPage.js';
1
+ import type Swup from '../Swup.js';
2
+ import type { PageData } from './fetchPage.js';
3
3
  /**
4
4
  * Render the next page: replace the content and update scroll position.
5
5
  */
6
6
  export declare const renderPage: (this: Swup, page: PageData) => Promise<void>;
7
+ //# sourceMappingURL=renderPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderPage.d.ts","sourceRoot":"","sources":["../../../src/modules/renderPage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,UAAU,SAAyB,IAAI,QAAQ,QAAQ,KAAG,QAAQ,IAAI,CA0ClF,CAAC"}
@@ -1,5 +1,6 @@
1
- import Swup, { Options } from '../Swup.js';
2
- import { PageData } from './fetchPage.js';
1
+ import type Swup from '../Swup.js';
2
+ import type { Options } from '../Swup.js';
3
+ import type { PageData } from './fetchPage.js';
3
4
  /**
4
5
  * Perform the replacement of content after loading a page.
5
6
  *
@@ -11,3 +12,4 @@ import { PageData } from './fetchPage.js';
11
12
  export declare const replaceContent: (this: Swup, { html }: PageData, { containers }?: {
12
13
  containers: Options['containers'];
13
14
  }) => boolean;
15
+ //# sourceMappingURL=replaceContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replaceContent.d.ts","sourceRoot":"","sources":["../../../src/modules/replaceContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,SACpB,IAAI,YACA,QAAQ;gBACY,OAAO,CAAC,YAAY,CAAC;MACjD,OAuCF,CAAC"}
@@ -1,4 +1,4 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  /**
3
3
  * Utility function to validate and run the global option 'resolveUrl'
4
4
  * @param {string} url
@@ -12,3 +12,4 @@ export declare function resolveUrl(this: Swup, url: string): string;
12
12
  * @returns {boolean}
13
13
  */
14
14
  export declare function isSameResolvedUrl(this: Swup, url1: string, url2: string): boolean;
15
+ //# sourceMappingURL=resolveUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveUrl.d.ts","sourceRoot":"","sources":["../../../src/modules/resolveUrl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAe1D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjF"}
@@ -1,6 +1,7 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  /**
3
3
  * Update the scroll position after page render.
4
4
  * @returns Promise<boolean>
5
5
  */
6
6
  export declare const scrollToContent: (this: Swup) => boolean;
7
+ //# sourceMappingURL=scrollToContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollToContent.d.ts","sourceRoot":"","sources":["../../../src/modules/scrollToContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,eAAe,SAAmB,IAAI,KAAG,OA6BrD,CAAC"}
@@ -18,3 +18,4 @@ export declare function forceReflow(element?: HTMLElement): number;
18
18
  export declare const escapeCssIdentifier: (ident: string) => string;
19
19
  /** Fix for Chrome below v61 formatting CSS floats with comma in some locales. */
20
20
  export declare const toMs: (s: string) => number;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,eAAO,MAAM,KAAK,aAAc,MAAM,YAAW,QAAQ,GAAG,OAAO,uBAElE,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,aACV,MAAM,YACP,QAAQ,GAAG,OAAO,KACzB,WAAW,EAEb,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,QAAQ,QAAO,QAAQ,IAAI,CAQvC,CAAC;AAEF,oDAAoD;AACpD,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAMhE;AAED,wFAAwF;AAExF,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CASnF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,WAAW,UAGhD;AAED,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,UAAW,MAAM,WAMhD,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,IAAI,MAAO,MAAM,WAE7B,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from './utils/index.js';
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "swup",
3
3
  "amdName": "Swup",
4
- "version": "4.4.0",
4
+ "version": "4.4.1",
5
5
  "description": "Versatile and extensible page transition library for server-rendered websites",
6
6
  "type": "module",
7
7
  "source": "./src/Swup.ts",
@@ -80,6 +80,7 @@
80
80
  "nyc": "^15.1.0",
81
81
  "prettier": "^2.8.2",
82
82
  "serve": "^14.2.1",
83
+ "typed-query-selector": "^2.11.0",
83
84
  "vitest": "^0.34.3"
84
85
  },
85
86
  "collective": {
package/src/Swup.ts CHANGED
@@ -1,27 +1,27 @@
1
- import { DelegateEvent } from 'delegate-it';
1
+ import { type DelegateEvent } from 'delegate-it';
2
2
 
3
3
  import version from './config/version.js';
4
4
 
5
5
  import { delegateEvent, getCurrentUrl, Location, updateHistoryRecord } from './helpers.js';
6
- import { DelegateEventUnsubscribe } from './helpers/delegateEvent.js';
6
+ import { type DelegateEventUnsubscribe } from './helpers/delegateEvent.js';
7
7
 
8
8
  import { Cache } from './modules/Cache.js';
9
9
  import { Classes } from './modules/Classes.js';
10
- import { Visit, createVisit } from './modules/Visit.js';
10
+ import { type Visit, createVisit } from './modules/Visit.js';
11
11
  import { Hooks } from './modules/Hooks.js';
12
12
  import { getAnchorElement } from './modules/getAnchorElement.js';
13
13
  import { awaitAnimations } from './modules/awaitAnimations.js';
14
- import { navigate, performNavigation, NavigationToSelfAction } from './modules/navigate.js';
14
+ import { navigate, performNavigation, type NavigationToSelfAction } from './modules/navigate.js';
15
15
  import { fetchPage } from './modules/fetchPage.js';
16
16
  import { animatePageOut } from './modules/animatePageOut.js';
17
17
  import { replaceContent } from './modules/replaceContent.js';
18
18
  import { scrollToContent } from './modules/scrollToContent.js';
19
19
  import { animatePageIn } from './modules/animatePageIn.js';
20
20
  import { renderPage } from './modules/renderPage.js';
21
- import { use, unuse, findPlugin, Plugin } from './modules/plugins.js';
21
+ import { use, unuse, findPlugin, type Plugin } from './modules/plugins.js';
22
22
  import { isSameResolvedUrl, resolveUrl } from './modules/resolveUrl.js';
23
23
  import { nextTick } from './utils.js';
24
- import { HistoryState } from './helpers/createHistoryRecord.js';
24
+ import { type HistoryState } from './helpers/createHistoryRecord.js';
25
25
 
26
26
  /** Options for customizing swup's behavior. */
27
27
  export type Options = {
@@ -96,6 +96,8 @@ export default class Swup {
96
96
  protected currentHistoryIndex: number;
97
97
  /** Delegated event subscription handle */
98
98
  protected clickDelegate?: DelegateEventUnsubscribe;
99
+ /** Navigation status */
100
+ protected navigating: boolean = false;
99
101
 
100
102
  /** Install a plugin */
101
103
  use = use;
@@ -257,6 +259,12 @@ export default class Swup {
257
259
  return;
258
260
  }
259
261
 
262
+ // Ignore if swup is currently navigating towards the link's URL
263
+ if (this.navigating && url === this.visit.to.url) {
264
+ event.preventDefault();
265
+ return;
266
+ }
267
+
260
268
  this.visit = this.createVisit({ to: url, hash, el, event });
261
269
 
262
270
  // Exit early if control key pressed
@@ -1,5 +1,9 @@
1
- import delegate, { DelegateEventHandler, DelegateOptions, EventType } from 'delegate-it';
2
- import { ParseSelector } from 'typed-query-selector/parser.js';
1
+ import delegate, {
2
+ type DelegateEventHandler,
3
+ type DelegateOptions,
4
+ type EventType
5
+ } from 'delegate-it';
6
+ import type { ParseSelector } from 'typed-query-selector/parser.js';
3
7
 
4
8
  export type DelegateEventUnsubscribe = {
5
9
  destroy: () => void;
@@ -8,7 +8,7 @@ import type {
8
8
  MatchFunction
9
9
  } from 'path-to-regexp';
10
10
 
11
- export { Path };
11
+ export { type Path };
12
12
 
13
13
  /** Create a match function from a path pattern that checks if a URLs matches it. */
14
14
  export const matchPath = <P extends object = object>(
@@ -1,4 +1,4 @@
1
- import { HistoryState } from './createHistoryRecord.js';
1
+ import type { HistoryState } from './createHistoryRecord.js';
2
2
  import { getCurrentUrl } from './getCurrentUrl.js';
3
3
 
4
4
  /** Update the current history record with a custom swup identifier. */
@@ -1,6 +1,6 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  import { Location } from '../helpers.js';
3
- import { PageData } from './fetchPage.js';
3
+ import { type PageData } from './fetchPage.js';
4
4
 
5
5
  export interface CacheData extends PageData {}
6
6
 
@@ -1,4 +1,4 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  import { queryAll } from '../utils.js';
3
3
 
4
4
  export class Classes {
@@ -1,9 +1,9 @@
1
- import { DelegateEvent } from 'delegate-it';
1
+ import type { DelegateEvent } from 'delegate-it';
2
2
 
3
- import Swup from '../Swup.js';
3
+ import type Swup from '../Swup.js';
4
4
  import { isPromise, runAsPromise } from '../utils.js';
5
- import { Visit } from './Visit.js';
6
- import { FetchOptions, PageData } from './fetchPage.js';
5
+ import type { Visit } from './Visit.js';
6
+ import type { FetchOptions, PageData } from './fetchPage.js';
7
7
 
8
8
  export interface HookDefinitions {
9
9
  'animation:out:start': undefined;
@@ -1,5 +1,6 @@
1
- import Swup, { Options } from '../Swup.js';
2
- import { HistoryAction, HistoryDirection } from './navigate.js';
1
+ import type Swup from '../Swup.js';
2
+ import type { Options } from '../Swup.js';
3
+ import type { HistoryAction, HistoryDirection } from './navigate.js';
3
4
 
4
5
  /** An object holding details about the current visit. */
5
6
  export interface Visit {
@@ -1,4 +1,4 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  import { nextTick } from '../utils.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  import { classify } from '../helpers.js';
3
3
 
4
4
  /**
@@ -1,5 +1,6 @@
1
1
  import { queryAll, toMs } from '../utils.js';
2
- import Swup, { Options } from '../Swup.js';
2
+ import type Swup from '../Swup.js';
3
+ import type { Options } from '../Swup.js';
3
4
 
4
5
  const TRANSITION = 'transition';
5
6
  const ANIMATION = 'animation';
@@ -1,4 +1,4 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  import { Location } from '../helpers.js';
3
3
 
4
4
  /** A page object as used by swup and its cache. */
@@ -1,7 +1,7 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
  import { createHistoryRecord, updateHistoryRecord, getCurrentUrl, Location } from '../helpers.js';
3
- import { FetchError, FetchOptions, PageData } from './fetchPage.js';
4
- import { VisitInitOptions } from './Visit.js';
3
+ import { FetchError, type FetchOptions, type PageData } from './fetchPage.js';
4
+ import type { VisitInitOptions } from './Visit.js';
5
5
 
6
6
  export type HistoryAction = 'push' | 'replace';
7
7
  export type HistoryDirection = 'forwards' | 'backwards';
@@ -62,6 +62,7 @@ export async function performNavigation(
62
62
  this: Swup,
63
63
  options: NavigationOptions & FetchOptions = {}
64
64
  ): Promise<void> {
65
+ this.navigating = true;
65
66
  // Save this localy to a) allow ignoring the visit if a new one was started in the meantime
66
67
  // and b) avoid unintended modifications to any newer visits
67
68
  const visit = this.visit;
@@ -166,6 +167,7 @@ export async function performNavigation(
166
167
  // if (visit.to && this.isSameResolvedUrl(visit.to.url, requestedUrl)) {
167
168
  // this.visit = this.createVisit({ to: undefined });
168
169
  // }
170
+ this.navigating = false;
169
171
  } catch (error) {
170
172
  // Return early if error is undefined or signals an aborted request
171
173
  if (!error || (error as FetchError)?.aborted) {
@@ -1,4 +1,4 @@
1
- import Swup from '../Swup.js';
1
+ import type Swup from '../Swup.js';
2
2
 
3
3
  export type Plugin = {
4
4
  /** Identify as a swup plugin */
@@ -1,6 +1,6 @@
1
1
  import { updateHistoryRecord, getCurrentUrl, classify } from '../helpers.js';
2
- import Swup from '../Swup.js';
3
- import { PageData } from './fetchPage.js';
2
+ import type Swup from '../Swup.js';
3
+ import type { PageData } from './fetchPage.js';
4
4
 
5
5
  /**
6
6
  * Render the next page: replace the content and update scroll position.