@alignable/bifrost 0.0.11 → 0.0.12
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.d.ts +1 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/PageShell.d.ts.map +1 -1
- package/dist/lib/getElementAttributes.d.ts +2 -0
- package/dist/lib/getElementAttributes.d.ts.map +1 -0
- package/dist/lib/getElementAttributes.js +7 -0
- package/dist/lib/turbolinks/adapter.d.ts +17 -0
- package/dist/lib/turbolinks/adapter.d.ts.map +1 -0
- package/dist/lib/turbolinks/adapter.js +1 -0
- package/dist/lib/turbolinks/browser_adapter.d.ts +28 -0
- package/dist/lib/turbolinks/browser_adapter.d.ts.map +1 -0
- package/dist/lib/turbolinks/browser_adapter.js +68 -0
- package/dist/lib/turbolinks/controller.d.ts +75 -0
- package/dist/lib/turbolinks/controller.d.ts.map +1 -0
- package/dist/lib/turbolinks/controller.js +219 -0
- package/dist/lib/turbolinks/head_details.d.ts +24 -0
- package/dist/lib/turbolinks/head_details.d.ts.map +1 -0
- package/dist/lib/turbolinks/head_details.js +97 -0
- package/dist/lib/turbolinks/index.d.ts +14 -0
- package/dist/lib/turbolinks/index.d.ts.map +1 -0
- package/dist/lib/turbolinks/index.js +55 -0
- package/dist/lib/turbolinks/location.d.ts +23 -0
- package/dist/lib/turbolinks/location.d.ts.map +1 -0
- package/dist/lib/turbolinks/location.js +75 -0
- package/dist/lib/turbolinks/lruCache.d.ts.map +1 -0
- package/dist/lib/turbolinks/mergeHead.d.ts +2 -0
- package/dist/lib/turbolinks/mergeHead.d.ts.map +1 -0
- package/dist/lib/{mergeHead.js → turbolinks/mergeHead.js} +27 -33
- package/dist/lib/turbolinks/progress_bar.d.ts +24 -0
- package/dist/lib/turbolinks/progress_bar.d.ts.map +1 -0
- package/dist/lib/turbolinks/progress_bar.js +99 -0
- package/dist/lib/turbolinks/types.d.ts +7 -0
- package/dist/lib/turbolinks/types.d.ts.map +1 -0
- package/dist/lib/turbolinks/types.js +3 -0
- package/dist/lib/turbolinks/util.d.ts +18 -0
- package/dist/lib/turbolinks/util.d.ts.map +1 -0
- package/dist/lib/turbolinks/util.js +125 -0
- package/dist/lib/turbolinks/visit.d.ts +55 -0
- package/dist/lib/turbolinks/visit.d.ts.map +1 -0
- package/dist/lib/turbolinks/visit.js +163 -0
- package/dist/proxy/pages/onRenderClient.d.ts.map +1 -1
- package/dist/proxy/pages/onRenderClient.js +40 -29
- package/dist/proxy/pages/onRenderHtml.d.ts.map +1 -1
- package/dist/proxy/pages/onRenderHtml.js +19 -5
- package/dist/proxy/pages/restorationVisit/+config.d.ts +2 -0
- package/dist/proxy/pages/restorationVisit/+config.d.ts.map +1 -1
- package/dist/proxy/pages/restorationVisit/+config.js +3 -0
- package/dist/proxy/pages/restorationVisit/onRenderClient.d.ts +3 -0
- package/dist/proxy/pages/restorationVisit/onRenderClient.d.ts.map +1 -0
- package/dist/proxy/pages/restorationVisit/onRenderClient.js +41 -0
- package/dist/renderer/onBeforeRoute.d.ts +1 -6
- package/dist/renderer/onBeforeRoute.d.ts.map +1 -1
- package/dist/renderer/onBeforeRoute.js +19 -11
- package/dist/renderer/onRenderClient.d.ts.map +1 -1
- package/dist/renderer/onRenderClient.js +29 -23
- package/dist/renderer/onRenderHtml.d.ts.map +1 -1
- package/dist/renderer/onRenderHtml.js +12 -16
- package/dist/renderer/utils/buildHead.d.ts +4 -0
- package/dist/renderer/utils/buildHead.d.ts.map +1 -0
- package/dist/renderer/utils/buildHead.js +10 -0
- package/dist/types/internal.d.ts +25 -23
- package/dist/types/internal.d.ts.map +1 -1
- package/package.json +13 -5
- package/dist/lib/dispatchTurbolinks.d.ts +0 -28
- package/dist/lib/dispatchTurbolinks.d.ts.map +0 -1
- package/dist/lib/dispatchTurbolinks.js +0 -5
- package/dist/lib/domUtils.d.ts +0 -3
- package/dist/lib/domUtils.d.ts.map +0 -1
- package/dist/lib/domUtils.js +0 -34
- package/dist/lib/linkInterceptor.d.ts +0 -2
- package/dist/lib/linkInterceptor.d.ts.map +0 -1
- package/dist/lib/linkInterceptor.js +0 -74
- package/dist/lib/lruCache.d.ts.map +0 -1
- package/dist/lib/mergeHead.d.ts +0 -2
- package/dist/lib/mergeHead.d.ts.map +0 -1
- package/dist/lib/navigateAnywhere.d.ts +0 -3
- package/dist/lib/navigateAnywhere.d.ts.map +0 -1
- package/dist/lib/navigateAnywhere.js +0 -15
- package/dist/lib/snapshots.d.ts +0 -9
- package/dist/lib/snapshots.d.ts.map +0 -1
- package/dist/lib/snapshots.js +0 -50
- package/dist/lib/turbolinks.d.ts +0 -5
- package/dist/lib/turbolinks.d.ts.map +0 -1
- package/dist/lib/turbolinks.js +0 -14
- package/dist/renderer/utils/formatMetaObject.d.ts +0 -4
- package/dist/renderer/utils/formatMetaObject.d.ts.map +0 -1
- package/dist/renderer/utils/formatMetaObject.js +0 -3
- /package/dist/lib/{lruCache.d.ts → turbolinks/lruCache.d.ts} +0 -0
- /package/dist/lib/{lruCache.js → turbolinks/lruCache.js} +0 -0
package/dist/types/internal.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
|
-
import { PageContextBuiltIn, PageContextBuiltInClientWithClientRouting as PageContextBuiltInClient } from "vite-plugin-ssr/types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
2
|
+
import { Config, ConfigNonHeaderFile, PageContextBuiltIn, PageContextBuiltInClientWithClientRouting as PageContextBuiltInClient } from "vite-plugin-ssr/types";
|
|
3
|
+
import InternalProxyConfig from "../proxy/pages/+config.js";
|
|
4
|
+
import InternalNoProxyConfig from "../renderer/+config.js";
|
|
5
|
+
type ConfigConstructor<LibConfig extends ConfigNonHeaderFile, T extends {
|
|
6
|
+
[K in keyof LibConfig["meta"]]: any;
|
|
7
|
+
}> = Config & Partial<T>;
|
|
8
8
|
export type Layout<LayoutProps> = React.ComponentType<PropsWithChildren<LayoutProps>>;
|
|
9
9
|
export type LayoutMap<LayoutProps> = Record<string, Layout<LayoutProps>>;
|
|
10
|
+
export type ProxyConfig<LayoutProps> = ConfigConstructor<typeof InternalProxyConfig, {
|
|
11
|
+
layoutMap: LayoutMap<LayoutProps>;
|
|
12
|
+
}>;
|
|
10
13
|
type PageContextProxyCommon<LayoutProps = Record<string, unknown>> = {
|
|
11
14
|
layout: string;
|
|
12
15
|
layoutProps: LayoutProps;
|
|
13
|
-
config:
|
|
14
|
-
layoutMap: LayoutMap<LayoutProps>;
|
|
15
|
-
};
|
|
16
|
+
config: ProxyConfig<LayoutProps>;
|
|
16
17
|
};
|
|
17
18
|
type PageContextProxyClientHydration = {
|
|
18
19
|
isHydration: true;
|
|
@@ -21,13 +22,17 @@ type PageContextProxyClientHydration = {
|
|
|
21
22
|
type PageContextProxyClientNav = {
|
|
22
23
|
isHydration: false;
|
|
23
24
|
redirectTo?: string;
|
|
24
|
-
proxySendClient?:
|
|
25
|
+
proxySendClient?: string;
|
|
25
26
|
};
|
|
26
27
|
export type PageContextProxyServer = PageContextBuiltIn<Page> & PageContextProxyCommon & {
|
|
27
|
-
proxy:
|
|
28
|
+
proxy: string;
|
|
28
29
|
};
|
|
29
30
|
export type PageContextProxyClient = PageContextBuiltInClient<Page> & PageContextProxyCommon & (PageContextProxyClientHydration | PageContextProxyClientNav);
|
|
30
31
|
export type PageContextProxy = PageContextProxyServer | PageContextProxyClient;
|
|
32
|
+
export type PageContextProxyRestorationVisit = PageContextBuiltInClient<Page> & {
|
|
33
|
+
bodyEl: Element;
|
|
34
|
+
headEl: HTMLHeadElement;
|
|
35
|
+
} & PageContextProxyCommon;
|
|
31
36
|
export interface DocumentProps {
|
|
32
37
|
title?: string;
|
|
33
38
|
description?: string;
|
|
@@ -35,27 +40,24 @@ export interface DocumentProps {
|
|
|
35
40
|
[key: string]: string;
|
|
36
41
|
};
|
|
37
42
|
}
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
export type NoProxyConfig<LayoutProps> = ConfigConstructor<typeof InternalNoProxyConfig, {
|
|
44
|
+
Layout: Layout<LayoutProps>;
|
|
45
|
+
layoutProps: LayoutProps;
|
|
46
|
+
documentProps: DocumentProps;
|
|
47
|
+
scripts: string[];
|
|
48
|
+
isLoggedIn: boolean;
|
|
49
|
+
}>;
|
|
42
50
|
type PageProps = Record<string, unknown>;
|
|
43
51
|
type Page = React.ComponentType<PageProps>;
|
|
44
52
|
interface PageContextNoProxyCommon<LayoutProps = Record<string, unknown>> {
|
|
45
53
|
pageProps: PageProps;
|
|
46
54
|
redirectTo?: string;
|
|
47
55
|
documentProps?: DocumentProps;
|
|
48
|
-
config:
|
|
49
|
-
Layout: Layout<LayoutProps>;
|
|
50
|
-
layoutProps?: LayoutProps;
|
|
51
|
-
documentProps?: DocumentProps;
|
|
52
|
-
isLoggedIn?: boolean;
|
|
53
|
-
scripts: ScriptProps;
|
|
54
|
-
};
|
|
56
|
+
config: NoProxyConfig<LayoutProps>;
|
|
55
57
|
}
|
|
56
58
|
export type PageContextNoProxyServer = PageContextBuiltIn<Page> & PageContextNoProxyCommon;
|
|
57
59
|
export type PageContextNoProxyClient = PageContextBuiltInClient<Page> & PageContextNoProxyCommon;
|
|
58
60
|
export type PageContextNoProxy = PageContextNoProxyServer | PageContextNoProxyClient;
|
|
59
|
-
export type PageContext = PageContextNoProxy | PageContextProxy;
|
|
61
|
+
export type PageContext = PageContextNoProxy | PageContextProxy | PageContextProxyRestorationVisit;
|
|
60
62
|
export {};
|
|
61
63
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../types/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAClB,yCAAyC,IAAI,wBAAwB,EACtE,MAAM,uBAAuB,C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;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAC7D,wBAAwB,CAAC;AAC3B,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAC,IAAI,CAAC,GACnE,wBAAwB,CAAC;AAE3B,MAAM,MAAM,kBAAkB,GAC1B,wBAAwB,GACxB,wBAAwB,CAAC;AAE7B,MAAM,MAAM,WAAW,GACnB,kBAAkB,GAClB,gBAAgB,GAChB,gCAAgC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alignable/bifrost",
|
|
3
3
|
"repository": "https://github.com/Alignable/bifrost.git",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
"types": "./dist/proxy/pages/restorationVisit/route.d.ts",
|
|
50
50
|
"default": "./dist/proxy/pages/restorationVisit/route.js"
|
|
51
51
|
},
|
|
52
|
+
"./proxy/pages/restorationVisit/onRenderClient": {
|
|
53
|
+
"types": "./dist/proxy/pages/restorationVisit/onRenderClient.d.ts",
|
|
54
|
+
"default": "./dist/proxy/pages/restorationVisit/onRenderClient.js"
|
|
55
|
+
},
|
|
52
56
|
".": {
|
|
53
57
|
"types": "./dist/index.d.ts",
|
|
54
58
|
"default": "./dist/index.js"
|
|
@@ -66,23 +70,27 @@
|
|
|
66
70
|
"scripts": {
|
|
67
71
|
"dev": "vite",
|
|
68
72
|
"release": "release-me patch",
|
|
69
|
-
"build": "rm -rf dist/ && yarn tsc"
|
|
73
|
+
"build": "rm -rf dist/ && yarn tsc",
|
|
74
|
+
"tsc": "tsc"
|
|
70
75
|
},
|
|
71
76
|
"files": [
|
|
72
77
|
"dist/"
|
|
73
78
|
],
|
|
74
79
|
"dependencies": {
|
|
75
80
|
"cross-env": "^7.0.3",
|
|
81
|
+
"jsdom": "^22.1.0",
|
|
76
82
|
"react": "^18.x.x",
|
|
77
83
|
"react-dom": "^18.x.x",
|
|
84
|
+
"tough-cookie": "^4.1.2",
|
|
78
85
|
"uuid": "^9.0.0",
|
|
79
|
-
"vite-plugin-ssr": "0.4.
|
|
86
|
+
"vite-plugin-ssr": "0.4.131-commit-35ca471f7"
|
|
80
87
|
},
|
|
81
88
|
"peerDependencies": {
|
|
82
89
|
"react": "^18.x.x",
|
|
83
90
|
"react-dom": "^18.x.x",
|
|
84
|
-
"
|
|
85
|
-
"
|
|
91
|
+
"typescript": ">=4.7",
|
|
92
|
+
"jsdom": "^22.1.0",
|
|
93
|
+
"vite-plugin-ssr": "0.4.131-commit-35ca471f7"
|
|
86
94
|
},
|
|
87
95
|
"devDependencies": {
|
|
88
96
|
"@types/node": "^18.11.9",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export interface TurbolinksTiming {
|
|
2
|
-
requestEnd: number;
|
|
3
|
-
requestStart: number;
|
|
4
|
-
visitEnd: number;
|
|
5
|
-
visitStart: number;
|
|
6
|
-
}
|
|
7
|
-
export type TurbolinksEvents = {
|
|
8
|
-
"turbolinks:click": {
|
|
9
|
-
url: string;
|
|
10
|
-
};
|
|
11
|
-
"turbolinks:before-visit": {
|
|
12
|
-
url: string;
|
|
13
|
-
};
|
|
14
|
-
"turbolinks:visit": {
|
|
15
|
-
url: string;
|
|
16
|
-
};
|
|
17
|
-
"turbolinks:before-cache": {};
|
|
18
|
-
"turbolinks:before-render": {
|
|
19
|
-
newBody: string;
|
|
20
|
-
};
|
|
21
|
-
"turbolinks:render": {};
|
|
22
|
-
"turbolinks:load": {
|
|
23
|
-
url: string;
|
|
24
|
-
timing?: TurbolinksTiming;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export declare function dispatchTurbolinks<E extends keyof TurbolinksEvents>(name: E, data: TurbolinksEvents[E], target?: EventTarget): void;
|
|
28
|
-
//# sourceMappingURL=dispatchTurbolinks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dispatchTurbolinks.d.ts","sourceRoot":"","sources":["../../lib/dispatchTurbolinks.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,kBAAkB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,yBAAyB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,kBAAkB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,yBAAyB,EAAE,EAAE,CAAC;IAC9B,0BAA0B,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC;IAC/C,mBAAmB,EAAE,EAAE,CAAC;IACxB,iBAAiB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;CAC/D,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,gBAAgB,EACjE,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,EACzB,MAAM,GAAE,WAAsB,QAK/B"}
|
package/dist/lib/domUtils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"domUtils.d.ts","sourceRoot":"","sources":["../../lib/domUtils.ts"],"names":[],"mappings":"AASA,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,IAAI,WAepE;AAQD,wBAAgB,6BAA6B,CAC3C,iBAAiB,EAAE,iBAAiB,EAAE,QAMvC"}
|
package/dist/lib/domUtils.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
function copyElementAttributes(destinationElement, sourceElement) {
|
|
2
|
-
for (const { name, value } of Array.from(sourceElement.attributes)) {
|
|
3
|
-
destinationElement.setAttribute(name, value);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
export function createScriptElement(element, cb) {
|
|
7
|
-
if (element.getAttribute("data-turbolinks-eval") == "false") {
|
|
8
|
-
return element;
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
const createdScriptElement = document.createElement("script");
|
|
12
|
-
createdScriptElement.textContent = element.textContent;
|
|
13
|
-
// async false makes scripts run in-order. it wont block js execution (thankfully)
|
|
14
|
-
// https://github.com/turbolinks/turbolinks/issues/282#issuecomment-355731712
|
|
15
|
-
createdScriptElement.async = false;
|
|
16
|
-
copyElementAttributes(createdScriptElement, element);
|
|
17
|
-
if (cb) {
|
|
18
|
-
createdScriptElement.addEventListener("load", cb);
|
|
19
|
-
}
|
|
20
|
-
return createdScriptElement;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function replaceElementWithElement(fromElement, toElement) {
|
|
24
|
-
const parentElement = fromElement.parentElement;
|
|
25
|
-
if (parentElement) {
|
|
26
|
-
return parentElement.replaceChild(toElement, fromElement);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export function activateNewBodyScriptElements(newScriptElements) {
|
|
30
|
-
for (const inertScriptElement of newScriptElements) {
|
|
31
|
-
const activatedScriptElement = createScriptElement(inertScriptElement);
|
|
32
|
-
replaceElementWithElement(inertScriptElement, activatedScriptElement);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linkInterceptor.d.ts","sourceRoot":"","sources":["../../lib/linkInterceptor.ts"],"names":[],"mappings":"AA2EA,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,QAgBxD"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { dispatchTurbolinks } from "./dispatchTurbolinks.js";
|
|
2
|
-
import { Turbolinks } from "./turbolinks.js";
|
|
3
|
-
function isAction(action) {
|
|
4
|
-
return action == "advance" || action == "replace" || action == "restore";
|
|
5
|
-
}
|
|
6
|
-
// TODO: polyfilled closest may not be required. check caniuse?
|
|
7
|
-
const closest = (() => {
|
|
8
|
-
const html = typeof window !== 'undefined' && document.documentElement;
|
|
9
|
-
const match = html.matches ||
|
|
10
|
-
html.webkitMatchesSelector ||
|
|
11
|
-
html.msMatchesSelector ||
|
|
12
|
-
html.mozMatchesSelector;
|
|
13
|
-
const closest = (html && html.closest) ||
|
|
14
|
-
function (selector) {
|
|
15
|
-
let element = this;
|
|
16
|
-
while (element) {
|
|
17
|
-
if (match.call(element, selector)) {
|
|
18
|
-
return element;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
element = element.parentElement;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
return function (element, selector) {
|
|
26
|
-
return closest.call(element, selector);
|
|
27
|
-
};
|
|
28
|
-
})();
|
|
29
|
-
function elementIsVisitable(element) {
|
|
30
|
-
const container = closest(element, "[data-turbolinks]");
|
|
31
|
-
if (container) {
|
|
32
|
-
return container.getAttribute("data-turbolinks") != "false";
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function getVisitableLinkForTarget(target) {
|
|
39
|
-
if (target instanceof Element && elementIsVisitable(target)) {
|
|
40
|
-
return closest(target, "a[href]:not([target]):not([download])");
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
// stolen from turbolinks controller.ts
|
|
45
|
-
function clickEventIsSignificant(event) {
|
|
46
|
-
return !((event.target && event.target.isContentEditable) ||
|
|
47
|
-
event.defaultPrevented ||
|
|
48
|
-
event.which > 1 ||
|
|
49
|
-
event.altKey ||
|
|
50
|
-
event.ctrlKey ||
|
|
51
|
-
event.metaKey ||
|
|
52
|
-
event.shiftKey);
|
|
53
|
-
}
|
|
54
|
-
function getActionForLink(link) {
|
|
55
|
-
const action = link.getAttribute("data-turbolinks-action");
|
|
56
|
-
return isAction(action) ? action : "advance";
|
|
57
|
-
}
|
|
58
|
-
export function turbolinksClickListener(event) {
|
|
59
|
-
if (clickEventIsSignificant(event)) {
|
|
60
|
-
const link = getVisitableLinkForTarget(event.target);
|
|
61
|
-
if (link) {
|
|
62
|
-
const location = link.getAttribute("href") || "";
|
|
63
|
-
if (location) {
|
|
64
|
-
const action = getActionForLink(link);
|
|
65
|
-
event.preventDefault();
|
|
66
|
-
// TODO: technically canceling these events should do various things, but afaict we never do that in alignableweb
|
|
67
|
-
dispatchTurbolinks("turbolinks:click", { url: location }, link);
|
|
68
|
-
dispatchTurbolinks("turbolinks:before-visit", { url: location });
|
|
69
|
-
dispatchTurbolinks("turbolinks:visit", { url: location });
|
|
70
|
-
Turbolinks.visit(location, { action });
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lruCache.d.ts","sourceRoot":"","sources":["../../lib/lruCache.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ,CAAC,CAAC;IACrB,OAAO,CAAC,MAAM,CAAwC;IACtD,OAAO,CAAC,UAAU,CAAC;gBAEP,UAAU,EAAE,MAAM;IAIvB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAa/B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;CAUjC"}
|
package/dist/lib/mergeHead.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mergeHead.d.ts","sourceRoot":"","sources":["../../lib/mergeHead.ts"],"names":[],"mappings":"AAUA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,QAuBrC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigateAnywhere.d.ts","sourceRoot":"","sources":["../../lib/navigateAnywhere.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAIzD,wBAAgB,gBAAgB,CAC9B,EAAE,CAAC,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,WAWtC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { navigate } from "vite-plugin-ssr/client/router";
|
|
2
|
-
// handle internal and external navigation
|
|
3
|
-
// returns whether or not we redirected
|
|
4
|
-
export function navigateAnywhere(to, opts) {
|
|
5
|
-
if (to) {
|
|
6
|
-
const url = new URL(to, window.location.href);
|
|
7
|
-
if (url.host !== window.location.host) {
|
|
8
|
-
window.location.href = to;
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
navigate(url.pathname + url.hash + url.search, opts);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return !!to;
|
|
15
|
-
}
|
package/dist/lib/snapshots.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PageContextProxyClient } from "../types/internal.js";
|
|
2
|
-
type Snapshot = Pick<Extract<PageContextProxyClient, {
|
|
3
|
-
isHydration: false;
|
|
4
|
-
}>, "proxySendClient" | "layout" | "layoutProps">;
|
|
5
|
-
export declare function writeRestorationIdentifier(pageContext: PageContextProxyClient): void;
|
|
6
|
-
export declare function cacheProxiedBody(): void;
|
|
7
|
-
export declare function getSnapshot(): Snapshot | undefined;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=snapshots.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshots.d.ts","sourceRoot":"","sources":["../../lib/snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAS,MAAM,sBAAsB,CAAC;AAKrE,KAAK,QAAQ,GAAG,IAAI,CAClB,OAAO,CAAC,sBAAsB,EAAE;IAAE,WAAW,EAAE,KAAK,CAAA;CAAE,CAAC,EACvD,iBAAiB,GAAG,QAAQ,GAAG,aAAa,CAC7C,CAAC;AAMF,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,sBAAsB,QAkBpC;AASD,wBAAgB,gBAAgB,SAiB/B;AAGD,wBAAgB,WAAW,IAAI,QAAQ,GAAG,SAAS,CAGlD"}
|
package/dist/lib/snapshots.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { dispatchTurbolinks } from "./dispatchTurbolinks.js";
|
|
2
|
-
import { v4 as uuidv4 } from "uuid";
|
|
3
|
-
import { LruCache } from "./lruCache.js";
|
|
4
|
-
const snapshots = new LruCache(10);
|
|
5
|
-
let lastRestorationIdentifier;
|
|
6
|
-
export function writeRestorationIdentifier(pageContext) {
|
|
7
|
-
if (history.state.restorationIdentifier) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
lastRestorationIdentifier = uuidv4();
|
|
11
|
-
history.replaceState({
|
|
12
|
-
restorationIdentifier: lastRestorationIdentifier,
|
|
13
|
-
// these two could go in snapshot instead...
|
|
14
|
-
...history.state,
|
|
15
|
-
}, "");
|
|
16
|
-
snapshots.put(lastRestorationIdentifier, {
|
|
17
|
-
layout: pageContext.layout,
|
|
18
|
-
layoutProps: pageContext.layoutProps,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/*
|
|
22
|
-
this is not working rn because we need to put the restoration identifier onto the history stack BEFORE navigate calls pushState
|
|
23
|
-
otherwise it is too late and we can only modify the new page's state...
|
|
24
|
-
|
|
25
|
-
what if we add the restoration identifier on page load?
|
|
26
|
-
how does react history state libs do it?
|
|
27
|
-
*/
|
|
28
|
-
export function cacheProxiedBody() {
|
|
29
|
-
if (document.getElementById("proxied-body")) {
|
|
30
|
-
dispatchTurbolinks("turbolinks:before-cache", {});
|
|
31
|
-
const bodyAttrs = {};
|
|
32
|
-
document.body.getAttributeNames().forEach((name) => {
|
|
33
|
-
bodyAttrs[name] = document.body.getAttribute(name);
|
|
34
|
-
}, {});
|
|
35
|
-
snapshots.put(lastRestorationIdentifier, {
|
|
36
|
-
...snapshots.get(lastRestorationIdentifier),
|
|
37
|
-
proxySendClient: {
|
|
38
|
-
head: document.head.innerHTML,
|
|
39
|
-
body: document.getElementById("proxied-body").innerHTML,
|
|
40
|
-
bodyAttrs,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const onBrowser = typeof window !== "undefined";
|
|
46
|
-
export function getSnapshot() {
|
|
47
|
-
if (!onBrowser)
|
|
48
|
-
return;
|
|
49
|
-
return snapshots.get(history.state.restorationIdentifier);
|
|
50
|
-
}
|
package/dist/lib/turbolinks.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const Turbolinks: {
|
|
2
|
-
visit: (location: import("turbolinks/dist/location.js").Locatable, options?: Partial<import("turbolinks/dist/controller.js").VisitOptions> | undefined) => void;
|
|
3
|
-
};
|
|
4
|
-
export declare function setupTurbolinks(): void;
|
|
5
|
-
//# sourceMappingURL=turbolinks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"turbolinks.d.ts","sourceRoot":"","sources":["../../lib/turbolinks.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;;CAOtB,CAAC;AAEF,wBAAgB,eAAe,SAI9B"}
|
package/dist/lib/turbolinks.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { navigateAnywhere } from "./navigateAnywhere.js";
|
|
2
|
-
export const Turbolinks = {
|
|
3
|
-
visit: function (location, options) {
|
|
4
|
-
const href = location.toString();
|
|
5
|
-
navigateAnywhere(href, {
|
|
6
|
-
overwriteLastHistoryEntry: options?.action === "replace",
|
|
7
|
-
});
|
|
8
|
-
},
|
|
9
|
-
};
|
|
10
|
-
export function setupTurbolinks() {
|
|
11
|
-
if (typeof window !== "undefined" && !window.Turbolinks) {
|
|
12
|
-
window.Turbolinks = Turbolinks;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatMetaObject.d.ts","sourceRoot":"","sources":["../../../renderer/utils/formatMetaObject.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,GAAG,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,UAE9D"}
|
|
File without changes
|
|
File without changes
|