@analogjs/router 2.0.0-alpha.1 → 2.0.0-alpha.11
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/fesm2022/{analogjs-router-debug.page-D4X8Jhux.mjs → analogjs-router-debug.page-e5DJlNv3.mjs} +31 -23
- package/fesm2022/analogjs-router-debug.page-e5DJlNv3.mjs.map +1 -0
- package/fesm2022/analogjs-router-server.mjs +171 -3
- package/fesm2022/analogjs-router-server.mjs.map +1 -1
- package/fesm2022/analogjs-router-tokens.mjs.map +1 -1
- package/fesm2022/analogjs-router.mjs +136 -46
- package/fesm2022/analogjs-router.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/cache-key.d.ts +3 -0
- package/lib/form-action.directive.d.ts +1 -0
- package/lib/server.component.d.ts +32 -0
- package/package.json +3 -2
- package/server/index.d.ts +3 -0
- package/server/render.d.ts +12 -0
- package/server/server-component-render.d.ts +4 -0
- package/server/tokens.d.ts +7 -0
- package/fesm2022/analogjs-router-debug.page-D4X8Jhux.mjs.map +0 -1
package/fesm2022/{analogjs-router-debug.page-D4X8Jhux.mjs → analogjs-router-debug.page-e5DJlNv3.mjs}
RENAMED
|
@@ -21,12 +21,14 @@ class DebugRoutesComponent {
|
|
|
21
21
|
isLayout: route.isLayout,
|
|
22
22
|
});
|
|
23
23
|
if (route.children) {
|
|
24
|
-
|
|
24
|
+
const parentSegments = [parent, route.path];
|
|
25
|
+
const fullParentPath = parentSegments.filter((s) => !!s).join('/');
|
|
26
|
+
this.traverseRoutes(route.children, fullParentPath);
|
|
25
27
|
}
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.
|
|
30
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: DebugRoutesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
31
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.4", type: DebugRoutesComponent, isStandalone: true, selector: "analogjs-debug-routes-page", ngImport: i0, template: `
|
|
30
32
|
<h2>Routes</h2>
|
|
31
33
|
|
|
32
34
|
<div class="table-container">
|
|
@@ -36,22 +38,25 @@ class DebugRoutesComponent {
|
|
|
36
38
|
<div class="header-cell">Type</div>
|
|
37
39
|
</div>
|
|
38
40
|
<div class="table-body">
|
|
39
|
-
@for(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
@for (
|
|
42
|
+
collectedRoute of collectedRoutes;
|
|
43
|
+
track collectedRoute.filename
|
|
44
|
+
) {
|
|
45
|
+
<div class="table-row">
|
|
46
|
+
<div class="table-cell">{{ collectedRoute.path }}</div>
|
|
47
|
+
<div class="table-cell" [title]="collectedRoute.filename">
|
|
48
|
+
{{ collectedRoute.file }}
|
|
49
|
+
</div>
|
|
50
|
+
<div class="table-cell">
|
|
51
|
+
{{ collectedRoute.isLayout ? 'Layout' : 'Page' }}
|
|
52
|
+
</div>
|
|
44
53
|
</div>
|
|
45
|
-
<div class="table-cell">
|
|
46
|
-
{{ collectedRoute.isLayout ? 'Layout' : 'Page' }}
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
54
|
}
|
|
50
55
|
</div>
|
|
51
56
|
</div>
|
|
52
57
|
`, isInline: true, styles: [":host{width:100%}.table-container{width:100%;max-width:900px;margin:0 auto;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;overflow:hidden}.table-header{display:grid;grid-template-columns:repeat(3,1fr);background:gray;border-bottom:2px solid #e5e7eb}.header-cell{padding:16px 24px;font-weight:600;text-transform:uppercase;font-size:14px;letter-spacing:.05em;color:#fff}.table-body{display:flex;flex-direction:column}.table-row{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid #e5e7eb;transition:background-color .2s ease}.table-row:last-child{border-bottom:none}.table-row:hover{background-color:#f9fafb}.table-cell{padding:16px 24px;font-size:16px;color:#4b5563}@media (max-width: 640px){.table-container{border-radius:0;margin:0}.header-cell,.table-cell{padding:12px 16px}}\n"] }); }
|
|
53
58
|
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: DebugRoutesComponent, decorators: [{
|
|
55
60
|
type: Component,
|
|
56
61
|
args: [{ selector: 'analogjs-debug-routes-page', standalone: true, template: `
|
|
57
62
|
<h2>Routes</h2>
|
|
@@ -63,16 +68,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
|
63
68
|
<div class="header-cell">Type</div>
|
|
64
69
|
</div>
|
|
65
70
|
<div class="table-body">
|
|
66
|
-
@for(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
@for (
|
|
72
|
+
collectedRoute of collectedRoutes;
|
|
73
|
+
track collectedRoute.filename
|
|
74
|
+
) {
|
|
75
|
+
<div class="table-row">
|
|
76
|
+
<div class="table-cell">{{ collectedRoute.path }}</div>
|
|
77
|
+
<div class="table-cell" [title]="collectedRoute.filename">
|
|
78
|
+
{{ collectedRoute.file }}
|
|
79
|
+
</div>
|
|
80
|
+
<div class="table-cell">
|
|
81
|
+
{{ collectedRoute.isLayout ? 'Layout' : 'Page' }}
|
|
82
|
+
</div>
|
|
74
83
|
</div>
|
|
75
|
-
</div>
|
|
76
84
|
}
|
|
77
85
|
</div>
|
|
78
86
|
</div>
|
|
@@ -80,4 +88,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
|
80
88
|
}] });
|
|
81
89
|
|
|
82
90
|
export { DebugRoutesComponent as default };
|
|
83
|
-
//# sourceMappingURL=analogjs-router-debug.page-
|
|
91
|
+
//# sourceMappingURL=analogjs-router-debug.page-e5DJlNv3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analogjs-router-debug.page-e5DJlNv3.mjs","sources":["../../../../packages/router/src/lib/debug/debug.page.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\nimport { injectDebugRoutes, DebugRoute } from './routes';\n\ntype CollectedRoute = {\n path: string;\n filename: string;\n file: string;\n isLayout: boolean;\n};\n\n@Component({\n selector: 'analogjs-debug-routes-page',\n standalone: true,\n template: `\n <h2>Routes</h2>\n\n <div class=\"table-container\">\n <div class=\"table-header\">\n <div class=\"header-cell\">Route Path</div>\n <div class=\"header-cell\">File</div>\n <div class=\"header-cell\">Type</div>\n </div>\n <div class=\"table-body\">\n @for (\n collectedRoute of collectedRoutes;\n track collectedRoute.filename\n ) {\n <div class=\"table-row\">\n <div class=\"table-cell\">{{ collectedRoute.path }}</div>\n <div class=\"table-cell\" [title]=\"collectedRoute.filename\">\n {{ collectedRoute.file }}\n </div>\n <div class=\"table-cell\">\n {{ collectedRoute.isLayout ? 'Layout' : 'Page' }}\n </div>\n </div>\n }\n </div>\n </div>\n `,\n styles: `\n :host {\n width: 100%;\n }\n\n .table-container {\n width: 100%;\n max-width: 900px;\n margin: 0 auto;\n background: white;\n border-radius: 8px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n }\n\n .table-header {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n background: gray;\n border-bottom: 2px solid #e5e7eb;\n }\n\n .header-cell {\n padding: 16px 24px;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 14px;\n letter-spacing: 0.05em;\n color: white;\n }\n\n .table-body {\n display: flex;\n flex-direction: column;\n }\n\n .table-row {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n border-bottom: 1px solid #e5e7eb;\n transition: background-color 0.2s ease;\n }\n\n .table-row:last-child {\n border-bottom: none;\n }\n\n .table-row:hover {\n background-color: #f9fafb;\n }\n\n .table-cell {\n padding: 16px 24px;\n font-size: 16px;\n color: #4b5563;\n }\n\n @media (max-width: 640px) {\n .table-container {\n border-radius: 0;\n margin: 0;\n }\n\n .header-cell,\n .table-cell {\n padding: 12px 16px;\n }\n }\n `,\n})\nexport default class DebugRoutesComponent {\n collectedRoutes: CollectedRoute[] = [];\n debugRoutes = injectDebugRoutes();\n\n ngOnInit() {\n this.traverseRoutes(this.debugRoutes);\n }\n\n traverseRoutes(routes: DebugRoute[], parent?: string) {\n routes.forEach((route) => {\n this.collectedRoutes.push({\n path: route.isLayout\n ? `${parent ? `/${parent}` : ''}${route.path ? `/${route.path}` : ''}`\n : `${parent ? `/${parent}` : ''}${\n route.path ? `/${route.path}` : '/'\n }`,\n filename: route.filename,\n file: route.filename?.replace(/(^.*)pages\\//, '') || '',\n isLayout: route.isLayout,\n });\n\n if (route.children) {\n const parentSegments = [parent, route.path];\n\n const fullParentPath = parentSegments.filter((s) => !!s).join('/');\n this.traverseRoutes(route.children, fullParentPath);\n }\n });\n }\n}\n"],"names":[],"mappings":";;;;AA+Gc,MAAO,oBAAoB,CAAA;AApGzC,IAAA,WAAA,GAAA;QAqGE,IAAe,CAAA,eAAA,GAAqB,EAAE;QACtC,IAAW,CAAA,WAAA,GAAG,iBAAiB,EAAE;AA2BlC;IAzBC,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC;;IAGvC,cAAc,CAAC,MAAoB,EAAE,MAAe,EAAA;AAClD,QAAA,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACvB,YAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;gBACxB,IAAI,EAAE,KAAK,CAAC;AACV,sBAAE,CAAA,EAAG,MAAM,GAAG,CAAI,CAAA,EAAA,MAAM,CAAE,CAAA,GAAG,EA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AA,EAAA,MAAA,EAAA,CAAA,ozBAAA,CAAA,EAAA,CAAA,CAAA;;2FAuEkB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBApGxC,SAAS;+BACE,4BAA4B,EAAA,UAAA,EAC1B,IAAI,EACN,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,ozBAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { ɵresetCompiledComponents as _resetCompiledComponents } from '@angular/core';
|
|
2
|
-
import { ɵSERVER_CONTEXT as _SERVER_CONTEXT } from '@angular/platform-server';
|
|
1
|
+
import { ɵresetCompiledComponents as _resetCompiledComponents, InjectionToken, assertInInjectionContext, inject, TransferState, makeStateKey, reflectComponentType, APP_ID, ɵConsole as _Console, enableProdMode } from '@angular/core';
|
|
2
|
+
import { ɵSERVER_CONTEXT as _SERVER_CONTEXT, provideServerRendering, renderApplication } from '@angular/platform-server';
|
|
3
3
|
import { REQUEST, RESPONSE, BASE_URL } from '@analogjs/router/tokens';
|
|
4
|
+
import { bootstrapApplication } from '@angular/platform-browser';
|
|
5
|
+
import { getHeader, createEvent, readBody } from 'h3';
|
|
4
6
|
|
|
5
7
|
function provideServerContext({ req, res, }) {
|
|
6
8
|
const baseUrl = getBaseUrl(req);
|
|
@@ -31,9 +33,175 @@ function getRequestProtocol(req, opts = {}) {
|
|
|
31
33
|
return req.connection?.encrypted ? 'https' : 'http';
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
const STATIC_PROPS = new InjectionToken('Static Props');
|
|
37
|
+
function provideStaticProps(props) {
|
|
38
|
+
return {
|
|
39
|
+
provide: STATIC_PROPS,
|
|
40
|
+
useFactory() {
|
|
41
|
+
return props;
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function injectStaticProps() {
|
|
46
|
+
assertInInjectionContext(injectStaticProps);
|
|
47
|
+
return inject(STATIC_PROPS);
|
|
48
|
+
}
|
|
49
|
+
function injectStaticOutputs() {
|
|
50
|
+
const transferState = inject(TransferState);
|
|
51
|
+
const outputsKey = makeStateKey('_analog_output');
|
|
52
|
+
return {
|
|
53
|
+
set(data) {
|
|
54
|
+
transferState.set(outputsKey, data);
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function serverComponentRequest(serverContext) {
|
|
60
|
+
const serverComponentId = getHeader(createEvent(serverContext.req, serverContext.res), 'X-Analog-Component');
|
|
61
|
+
if (!serverComponentId &&
|
|
62
|
+
serverContext.req.url &&
|
|
63
|
+
serverContext.req.url.startsWith('/_analog/components')) {
|
|
64
|
+
const componentId = serverContext.req.url.split('/')?.[3];
|
|
65
|
+
return componentId;
|
|
66
|
+
}
|
|
67
|
+
return serverComponentId;
|
|
68
|
+
}
|
|
69
|
+
const components = import.meta.glob([
|
|
70
|
+
'/src/server/components/**/*.{ts,analog,ag}',
|
|
71
|
+
]);
|
|
72
|
+
async function renderServerComponent(url, serverContext, config) {
|
|
73
|
+
const componentReqId = serverComponentRequest(serverContext);
|
|
74
|
+
const { componentLoader, componentId } = getComponentLoader(componentReqId);
|
|
75
|
+
if (!componentLoader) {
|
|
76
|
+
return new Response(`Server Component Not Found ${componentId}`, {
|
|
77
|
+
status: 404,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const component = (await componentLoader())['default'];
|
|
81
|
+
if (!component) {
|
|
82
|
+
return new Response(`No default export for ${componentId}`, {
|
|
83
|
+
status: 422,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const mirror = reflectComponentType(component);
|
|
87
|
+
const selector = mirror?.selector.split(',')?.[0] || 'server-component';
|
|
88
|
+
const event = createEvent(serverContext.req, serverContext.res);
|
|
89
|
+
const body = (await readBody(event)) || {};
|
|
90
|
+
const appId = `analog-server-${selector.toLowerCase()}-${new Date().getTime()}`;
|
|
91
|
+
const bootstrap = () => bootstrapApplication(component, {
|
|
92
|
+
providers: [
|
|
93
|
+
provideServerRendering(),
|
|
94
|
+
provideStaticProps(body),
|
|
95
|
+
{ provide: _SERVER_CONTEXT, useValue: 'analog-server-component' },
|
|
96
|
+
{
|
|
97
|
+
provide: APP_ID,
|
|
98
|
+
useFactory() {
|
|
99
|
+
return appId;
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
...(config?.providers || []),
|
|
103
|
+
],
|
|
104
|
+
});
|
|
105
|
+
const html = await renderApplication(bootstrap, {
|
|
106
|
+
url,
|
|
107
|
+
document: `<${selector}></${selector}>`,
|
|
108
|
+
platformProviders: [
|
|
109
|
+
{
|
|
110
|
+
provide: _Console,
|
|
111
|
+
useFactory() {
|
|
112
|
+
return {
|
|
113
|
+
warn: () => { },
|
|
114
|
+
log: () => { },
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
});
|
|
120
|
+
const outputs = retrieveTransferredState(html, appId);
|
|
121
|
+
const responseData = {
|
|
122
|
+
html,
|
|
123
|
+
outputs,
|
|
124
|
+
};
|
|
125
|
+
return new Response(JSON.stringify(responseData), {
|
|
126
|
+
headers: {
|
|
127
|
+
'X-Analog-Component': 'true',
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function getComponentLoader(componentReqId) {
|
|
132
|
+
let _componentId = `/src/server/components/${componentReqId.toLowerCase()}`;
|
|
133
|
+
let componentLoader = undefined;
|
|
134
|
+
let componentId = _componentId;
|
|
135
|
+
if (components[`${_componentId}.ts`]) {
|
|
136
|
+
componentId = `${_componentId}.ts`;
|
|
137
|
+
componentLoader = components[componentId];
|
|
138
|
+
}
|
|
139
|
+
else if (components[`${componentId}.analog`]) {
|
|
140
|
+
componentId = `${_componentId}.analog`;
|
|
141
|
+
componentLoader = components[componentId];
|
|
142
|
+
}
|
|
143
|
+
else if (components[`${componentId}.ag`]) {
|
|
144
|
+
componentId = `${_componentId}.ag`;
|
|
145
|
+
componentLoader = components[componentId];
|
|
146
|
+
}
|
|
147
|
+
return { componentLoader, componentId };
|
|
148
|
+
}
|
|
149
|
+
function retrieveTransferredState(html, appId) {
|
|
150
|
+
const regex = new RegExp(`<script id="${appId}-state" type="application/json">(.*?)<\/script>`);
|
|
151
|
+
const match = html.match(regex);
|
|
152
|
+
if (match) {
|
|
153
|
+
const scriptContent = match[1];
|
|
154
|
+
if (scriptContent) {
|
|
155
|
+
try {
|
|
156
|
+
const parsedContent = JSON.parse(scriptContent);
|
|
157
|
+
return parsedContent._analog_output || {};
|
|
158
|
+
}
|
|
159
|
+
catch (e) {
|
|
160
|
+
console.warn('Exception while parsing static outputs for ' + appId, e);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return {};
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
return {};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (import.meta.env.PROD) {
|
|
171
|
+
enableProdMode();
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Returns a function that accepts the navigation URL,
|
|
175
|
+
* the root HTML, and server context.
|
|
176
|
+
*
|
|
177
|
+
* @param rootComponent
|
|
178
|
+
* @param config
|
|
179
|
+
* @param platformProviders
|
|
180
|
+
* @returns Promise<string | Reponse>
|
|
181
|
+
*/
|
|
182
|
+
function render(rootComponent, config, platformProviders = []) {
|
|
183
|
+
function bootstrap() {
|
|
184
|
+
return bootstrapApplication(rootComponent, config);
|
|
185
|
+
}
|
|
186
|
+
return async function render(url, document, serverContext) {
|
|
187
|
+
if (serverComponentRequest(serverContext)) {
|
|
188
|
+
return await renderServerComponent(url, serverContext);
|
|
189
|
+
}
|
|
190
|
+
const html = await renderApplication(bootstrap, {
|
|
191
|
+
document,
|
|
192
|
+
url,
|
|
193
|
+
platformProviders: [
|
|
194
|
+
provideServerContext(serverContext),
|
|
195
|
+
platformProviders,
|
|
196
|
+
],
|
|
197
|
+
});
|
|
198
|
+
return html;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
34
202
|
/**
|
|
35
203
|
* Generated bundle index. Do not edit.
|
|
36
204
|
*/
|
|
37
205
|
|
|
38
|
-
export { provideServerContext };
|
|
206
|
+
export { injectStaticOutputs, injectStaticProps, provideServerContext, render, renderServerComponent, serverComponentRequest };
|
|
39
207
|
//# sourceMappingURL=analogjs-router-server.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-router-server.mjs","sources":["../../../../packages/router/server/src/provide-server-context.ts","../../../../packages/router/server/src/analogjs-router-server.ts"],"sourcesContent":["import { StaticProvider, ɵresetCompiledComponents } from '@angular/core';\nimport { ɵSERVER_CONTEXT as SERVER_CONTEXT } from '@angular/platform-server';\n\nimport {\n BASE_URL,\n REQUEST,\n RESPONSE,\n ServerRequest,\n ServerResponse,\n} from '@analogjs/router/tokens';\n\nexport function provideServerContext({\n req,\n res,\n}: {\n req: ServerRequest;\n res: ServerResponse;\n}): StaticProvider[] {\n const baseUrl = getBaseUrl(req);\n\n if (import.meta.env.DEV) {\n ɵresetCompiledComponents();\n }\n\n return [\n { provide: SERVER_CONTEXT, useValue: 'ssr-analog' },\n { provide: REQUEST, useValue: req },\n { provide: RESPONSE, useValue: res },\n { provide: BASE_URL, useValue: baseUrl },\n ];\n}\n\nexport function getBaseUrl(req: ServerRequest) {\n const protocol = getRequestProtocol(req);\n const { originalUrl, headers } = req;\n const parsedUrl = new URL(\n '',\n `${protocol}://${headers.host}${\n originalUrl.endsWith('/')\n ? originalUrl.substring(0, originalUrl.length - 1)\n : originalUrl\n }`\n );\n const baseUrl = parsedUrl.origin;\n\n return baseUrl;\n}\n\nexport function getRequestProtocol(\n req: ServerRequest,\n opts: { xForwardedProto?: boolean } = {}\n) {\n if (\n opts.xForwardedProto !== false &&\n req.headers['x-forwarded-proto'] === 'https'\n ) {\n return 'https';\n }\n\n return (req.connection as any)?.encrypted ? 'https' : 'http';\n}\n","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K,OAAO,EAC5C;AACA,QAAA,OAAO,OAAO;;AAGhB,IAAA,OAAQ,GAAG,CAAC,UAAkB,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM;AAC9D;;AC5DA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"analogjs-router-server.mjs","sources":["../../../../packages/router/server/src/provide-server-context.ts","../../../../packages/router/server/src/tokens.ts","../../../../packages/router/server/src/server-component-render.ts","../../../../packages/router/server/src/render.ts","../../../../packages/router/server/src/analogjs-router-server.ts"],"sourcesContent":["import { StaticProvider, ɵresetCompiledComponents } from '@angular/core';\nimport { ɵSERVER_CONTEXT as SERVER_CONTEXT } from '@angular/platform-server';\n\nimport {\n BASE_URL,\n REQUEST,\n RESPONSE,\n ServerRequest,\n ServerResponse,\n} from '@analogjs/router/tokens';\n\nexport function provideServerContext({\n req,\n res,\n}: {\n req: ServerRequest;\n res: ServerResponse;\n}): StaticProvider[] {\n const baseUrl = getBaseUrl(req);\n\n if (import.meta.env.DEV) {\n ɵresetCompiledComponents();\n }\n\n return [\n { provide: SERVER_CONTEXT, useValue: 'ssr-analog' },\n { provide: REQUEST, useValue: req },\n { provide: RESPONSE, useValue: res },\n { provide: BASE_URL, useValue: baseUrl },\n ];\n}\n\nexport function getBaseUrl(req: ServerRequest) {\n const protocol = getRequestProtocol(req);\n const { originalUrl, headers } = req;\n const parsedUrl = new URL(\n '',\n `${protocol}://${headers.host}${\n originalUrl.endsWith('/')\n ? originalUrl.substring(0, originalUrl.length - 1)\n : originalUrl\n }`,\n );\n const baseUrl = parsedUrl.origin;\n\n return baseUrl;\n}\n\nexport function getRequestProtocol(\n req: ServerRequest,\n opts: { xForwardedProto?: boolean } = {},\n) {\n if (\n opts.xForwardedProto !== false &&\n req.headers['x-forwarded-proto'] === 'https'\n ) {\n return 'https';\n }\n\n return (req.connection as any)?.encrypted ? 'https' : 'http';\n}\n","import {\n assertInInjectionContext,\n inject,\n InjectionToken,\n makeStateKey,\n Provider,\n TransferState,\n} from '@angular/core';\n\nexport const STATIC_PROPS = new InjectionToken<Record<string, any>>(\n 'Static Props',\n);\n\nexport function provideStaticProps<T = Record<string, any>>(\n props: T,\n): Provider {\n return {\n provide: STATIC_PROPS,\n useFactory() {\n return props;\n },\n };\n}\n\nexport function injectStaticProps() {\n assertInInjectionContext(injectStaticProps);\n\n return inject(STATIC_PROPS);\n}\n\nexport function injectStaticOutputs<T>() {\n const transferState = inject(TransferState);\n const outputsKey = makeStateKey<T>('_analog_output');\n\n return {\n set(data: T) {\n transferState.set(outputsKey, data);\n },\n };\n}\n","import { ApplicationConfig, Type } from '@angular/core';\nimport { bootstrapApplication } from '@angular/platform-browser';\nimport {\n reflectComponentType,\n ɵConsole as Console,\n APP_ID,\n} from '@angular/core';\nimport {\n provideServerRendering,\n renderApplication,\n ɵSERVER_CONTEXT as SERVER_CONTEXT,\n} from '@angular/platform-server';\nimport { ServerContext } from '@analogjs/router/tokens';\nimport { createEvent, readBody, getHeader } from 'h3';\n\nimport { provideStaticProps } from './tokens';\n\ntype ComponentLoader = () => Promise<Type<unknown>>;\n\nexport function serverComponentRequest(serverContext: ServerContext) {\n const serverComponentId = getHeader(\n createEvent(serverContext.req, serverContext.res),\n 'X-Analog-Component',\n );\n\n if (\n !serverComponentId &&\n serverContext.req.url &&\n serverContext.req.url.startsWith('/_analog/components')\n ) {\n const componentId = serverContext.req.url.split('/')?.[3];\n\n return componentId;\n }\n\n return serverComponentId;\n}\n\nconst components = import.meta.glob([\n '/src/server/components/**/*.{ts,analog,ag}',\n]);\n\nexport async function renderServerComponent(\n url: string,\n serverContext: ServerContext,\n config?: ApplicationConfig,\n) {\n const componentReqId = serverComponentRequest(serverContext) as string;\n const { componentLoader, componentId } = getComponentLoader(componentReqId);\n\n if (!componentLoader) {\n return new Response(`Server Component Not Found ${componentId}`, {\n status: 404,\n });\n }\n\n const component = ((await componentLoader()) as any)[\n 'default'\n ] as Type<unknown>;\n\n if (!component) {\n return new Response(`No default export for ${componentId}`, {\n status: 422,\n });\n }\n\n const mirror = reflectComponentType(component);\n const selector = mirror?.selector.split(',')?.[0] || 'server-component';\n const event = createEvent(serverContext.req, serverContext.res);\n const body = (await readBody(event)) || {};\n const appId = `analog-server-${selector.toLowerCase()}-${new Date().getTime()}`;\n\n const bootstrap = () =>\n bootstrapApplication(component, {\n providers: [\n provideServerRendering(),\n provideStaticProps(body),\n { provide: SERVER_CONTEXT, useValue: 'analog-server-component' },\n {\n provide: APP_ID,\n useFactory() {\n return appId;\n },\n },\n ...(config?.providers || []),\n ],\n });\n\n const html = await renderApplication(bootstrap, {\n url,\n document: `<${selector}></${selector}>`,\n platformProviders: [\n {\n provide: Console,\n useFactory() {\n return {\n warn: () => {},\n log: () => {},\n };\n },\n },\n ],\n });\n\n const outputs = retrieveTransferredState(html, appId);\n const responseData: { html: string; outputs: Record<string, any> } = {\n html,\n outputs,\n };\n\n return new Response(JSON.stringify(responseData), {\n headers: {\n 'X-Analog-Component': 'true',\n },\n });\n}\n\nfunction getComponentLoader(componentReqId: string): {\n componentLoader: ComponentLoader | undefined;\n componentId: string;\n} {\n let _componentId = `/src/server/components/${componentReqId.toLowerCase()}`;\n let componentLoader: ComponentLoader | undefined = undefined;\n let componentId = _componentId;\n\n if (components[`${_componentId}.ts`]) {\n componentId = `${_componentId}.ts`;\n componentLoader = components[componentId] as ComponentLoader;\n } else if (components[`${componentId}.analog`]) {\n componentId = `${_componentId}.analog`;\n componentLoader = components[componentId] as ComponentLoader;\n } else if (components[`${componentId}.ag`]) {\n componentId = `${_componentId}.ag`;\n componentLoader = components[componentId] as ComponentLoader;\n }\n\n return { componentLoader, componentId };\n}\n\nfunction retrieveTransferredState(\n html: string,\n appId: string,\n): Record<string, unknown | undefined> {\n const regex = new RegExp(\n `<script id=\"${appId}-state\" type=\"application/json\">(.*?)<\\/script>`,\n );\n const match = html.match(regex);\n\n if (match) {\n const scriptContent = match[1];\n\n if (scriptContent) {\n try {\n const parsedContent: {\n _analog_output: Record<string, unknown | undefined>;\n } = JSON.parse(scriptContent);\n return parsedContent._analog_output || {};\n } catch (e) {\n console.warn('Exception while parsing static outputs for ' + appId, e);\n }\n }\n\n return {};\n } else {\n return {};\n }\n}\n","import {\n ApplicationConfig,\n Provider,\n Type,\n enableProdMode,\n} from '@angular/core';\nimport { bootstrapApplication } from '@angular/platform-browser';\nimport { renderApplication } from '@angular/platform-server';\nimport type { ServerContext } from '@analogjs/router/tokens';\n\nimport { provideServerContext } from './provide-server-context';\nimport {\n serverComponentRequest,\n renderServerComponent,\n} from './server-component-render';\n\nif (import.meta.env.PROD) {\n enableProdMode();\n}\n\n/**\n * Returns a function that accepts the navigation URL,\n * the root HTML, and server context.\n *\n * @param rootComponent\n * @param config\n * @param platformProviders\n * @returns Promise<string | Reponse>\n */\nexport function render(\n rootComponent: Type<unknown>,\n config: ApplicationConfig,\n platformProviders: Provider[] = [],\n) {\n function bootstrap() {\n return bootstrapApplication(rootComponent, config);\n }\n\n return async function render(\n url: string,\n document: string,\n serverContext: ServerContext,\n ) {\n if (serverComponentRequest(serverContext)) {\n return await renderServerComponent(url, serverContext);\n }\n\n const html = await renderApplication(bootstrap, {\n document,\n url,\n platformProviders: [\n provideServerContext(serverContext),\n platformProviders,\n ],\n });\n\n return html;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ɵresetCompiledComponents","SERVER_CONTEXT","Console"],"mappings":";;;;;;SAWgB,oBAAoB,CAAC,EACnC,GAAG,EACH,GAAG,GAIJ,EAAA;AACC,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC;IAE/B,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;AACvB,QAAAA,wBAAwB,EAAE;;IAG5B,OAAO;AACL,QAAA,EAAE,OAAO,EAAEC,eAAc,EAAE,QAAQ,EAAE,YAAY,EAAE;AACnD,QAAA,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE;AACnC,Q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C;gBACnC,iBAAiB;AAClB,aAAA;AACF,SAAA,CAAC;AAEF,QAAA,OAAO,IAAI;AACb,KAAC;AACH;;AC1DA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-router-tokens.mjs","sources":["../../../../packages/router/tokens/src/index.ts","../../../../packages/router/tokens/src/analogjs-router-tokens.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport type {\n IncomingMessage,\n ServerResponse as NodeServerResponse,\n} from 'node:http';\n\nexport type ServerRequest = IncomingMessage & { originalUrl: string };\nexport type ServerResponse = NodeServerResponse;\nexport type ServerContext = { req: ServerRequest; res: ServerResponse };\n\nexport const REQUEST = new InjectionToken<ServerRequest>(\n '@analogjs/router Server Request'
|
|
1
|
+
{"version":3,"file":"analogjs-router-tokens.mjs","sources":["../../../../packages/router/tokens/src/index.ts","../../../../packages/router/tokens/src/analogjs-router-tokens.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport type {\n IncomingMessage,\n ServerResponse as NodeServerResponse,\n} from 'node:http';\n\nexport type ServerRequest = IncomingMessage & { originalUrl: string };\nexport type ServerResponse = NodeServerResponse;\nexport type ServerContext = { req: ServerRequest; res: ServerResponse };\n\nexport const REQUEST = new InjectionToken<ServerRequest>(\n '@analogjs/router Server Request',\n);\nexport const RESPONSE = new InjectionToken<ServerResponse>(\n '@analogjs/router Server Response',\n);\nexport const BASE_URL = new InjectionToken<string>('@analogjs/router Base URL');\n\nexport const API_PREFIX = new InjectionToken<string>(\n '@analogjs/router API Prefix',\n);\n\nexport function injectRequest() {\n return inject(REQUEST, { optional: true });\n}\n\nexport function injectResponse() {\n return inject(RESPONSE, { optional: true });\n}\n\nexport function injectBaseURL() {\n return inject(BASE_URL, { optional: true });\n}\n\nexport function injectAPIPrefix() {\n return inject(API_PREFIX);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAUa,OAAO,GAAG,IAAI,cAAc,CACvC,iCAAiC;MAEtB,QAAQ,GAAG,IAAI,cAAc,CACxC,kCAAkC;MAEvB,QAAQ,GAAG,IAAI,cAAc,CAAS,2BAA2B;MAEjE,UAAU,GAAG,IAAI,cAAc,CAC1C,6BAA6B;SAGf,aAAa,GAAA;IAC3B,OAAO,MAAM,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5C;SAEgB,cAAc,GAAA;IAC5B,OAAO,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC7C;SAEgB,aAAa,GAAA;IAC3B,OAAO,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC7C;SAEgB,eAAe,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;ACpCA;;AAEG;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, PLATFORM_ID, makeEnvironmentProviders, ENVIRONMENT_INITIALIZER, Injector,
|
|
3
|
-
import { HttpClient, HttpHeaders, ɵHTTP_ROOT_INTERCEPTOR_FNS as _HTTP_ROOT_INTERCEPTOR_FNS, HttpResponse } from '@angular/common/http';
|
|
4
|
-
import { firstValueFrom, map, from, of } from 'rxjs';
|
|
5
|
-
import { Meta } from '@angular/platform-browser';
|
|
2
|
+
import { inject, PLATFORM_ID, makeEnvironmentProviders, ENVIRONMENT_INITIALIZER, Injector, makeStateKey, TransferState, input, output, Directive, InjectionToken, signal, effect, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
+
import { HttpClient, HttpHeaders, ɵHTTP_ROOT_INTERCEPTOR_FNS as _HTTP_ROOT_INTERCEPTOR_FNS, HttpResponse, HttpRequest } from '@angular/common/http';
|
|
4
|
+
import { firstValueFrom, map, from, of, throwError, catchError } from 'rxjs';
|
|
5
|
+
import { Meta, DomSanitizer } from '@angular/platform-browser';
|
|
6
6
|
import { Router, NavigationEnd, ActivatedRoute, provideRouter, ROUTES } from '@angular/router';
|
|
7
7
|
import { filter } from 'rxjs/operators';
|
|
8
8
|
import { injectAPIPrefix, injectBaseURL, injectRequest, API_PREFIX } from '@analogjs/router/tokens';
|
|
@@ -468,6 +468,43 @@ async function getLoadResolver(route) {
|
|
|
468
468
|
return route.routeConfig?.resolve?.['load']?.(route);
|
|
469
469
|
}
|
|
470
470
|
|
|
471
|
+
function sortAndConcatParams(params) {
|
|
472
|
+
return [...params.keys()]
|
|
473
|
+
.sort()
|
|
474
|
+
.map((k) => `${k}=${params.getAll(k)}`)
|
|
475
|
+
.join('&');
|
|
476
|
+
}
|
|
477
|
+
function makeCacheKey(request, mappedRequestUrl) {
|
|
478
|
+
// make the params encoded same as a url so it's easy to identify
|
|
479
|
+
const { params, method, responseType } = request;
|
|
480
|
+
const encodedParams = sortAndConcatParams(params);
|
|
481
|
+
let serializedBody = request.serializeBody();
|
|
482
|
+
if (serializedBody instanceof URLSearchParams) {
|
|
483
|
+
serializedBody = sortAndConcatParams(serializedBody);
|
|
484
|
+
}
|
|
485
|
+
else if (typeof serializedBody !== 'string') {
|
|
486
|
+
serializedBody = '';
|
|
487
|
+
}
|
|
488
|
+
const key = [
|
|
489
|
+
method,
|
|
490
|
+
responseType,
|
|
491
|
+
mappedRequestUrl,
|
|
492
|
+
serializedBody,
|
|
493
|
+
encodedParams,
|
|
494
|
+
].join('|');
|
|
495
|
+
const hash = generateHash(key);
|
|
496
|
+
return makeStateKey(hash);
|
|
497
|
+
}
|
|
498
|
+
function generateHash(str) {
|
|
499
|
+
let hash = 0;
|
|
500
|
+
for (let i = 0, len = str.length; i < len; i++) {
|
|
501
|
+
let chr = str.charCodeAt(i);
|
|
502
|
+
hash = (hash << 5) - hash + chr;
|
|
503
|
+
hash |= 0; // Convert to 32bit integer
|
|
504
|
+
}
|
|
505
|
+
return `${hash}`;
|
|
506
|
+
}
|
|
507
|
+
|
|
471
508
|
/**
|
|
472
509
|
* Interceptor that is server-aware when making HttpClient requests.
|
|
473
510
|
* Server-side requests use the full URL
|
|
@@ -497,6 +534,7 @@ function requestContextInterceptor(req, next) {
|
|
|
497
534
|
return from(global.$fetch
|
|
498
535
|
.raw(fetchUrl, {
|
|
499
536
|
method: req.method,
|
|
537
|
+
body: req.body ? req.body : undefined,
|
|
500
538
|
params: requestUrl.searchParams,
|
|
501
539
|
responseType,
|
|
502
540
|
headers: req.headers.keys().reduce((hdrs, current) => {
|
|
@@ -548,42 +586,6 @@ function requestContextInterceptor(req, next) {
|
|
|
548
586
|
}
|
|
549
587
|
return next(req);
|
|
550
588
|
}
|
|
551
|
-
function sortAndConcatParams(params) {
|
|
552
|
-
return [...params.keys()]
|
|
553
|
-
.sort()
|
|
554
|
-
.map((k) => `${k}=${params.getAll(k)}`)
|
|
555
|
-
.join('&');
|
|
556
|
-
}
|
|
557
|
-
function makeCacheKey(request, mappedRequestUrl) {
|
|
558
|
-
// make the params encoded same as a url so it's easy to identify
|
|
559
|
-
const { params, method, responseType } = request;
|
|
560
|
-
const encodedParams = sortAndConcatParams(params);
|
|
561
|
-
let serializedBody = request.serializeBody();
|
|
562
|
-
if (serializedBody instanceof URLSearchParams) {
|
|
563
|
-
serializedBody = sortAndConcatParams(serializedBody);
|
|
564
|
-
}
|
|
565
|
-
else if (typeof serializedBody !== 'string') {
|
|
566
|
-
serializedBody = '';
|
|
567
|
-
}
|
|
568
|
-
const key = [
|
|
569
|
-
method,
|
|
570
|
-
responseType,
|
|
571
|
-
mappedRequestUrl,
|
|
572
|
-
serializedBody,
|
|
573
|
-
encodedParams,
|
|
574
|
-
].join('|');
|
|
575
|
-
const hash = generateHash(key);
|
|
576
|
-
return makeStateKey(hash);
|
|
577
|
-
}
|
|
578
|
-
function generateHash(str) {
|
|
579
|
-
let hash = 0;
|
|
580
|
-
for (let i = 0, len = str.length; i < len; i++) {
|
|
581
|
-
let chr = str.charCodeAt(i);
|
|
582
|
-
hash = (hash << 5) - hash + chr;
|
|
583
|
-
hash |= 0; // Convert to 32bit integer
|
|
584
|
-
}
|
|
585
|
-
return `${hash}`;
|
|
586
|
-
}
|
|
587
589
|
|
|
588
590
|
class FormAction {
|
|
589
591
|
constructor() {
|
|
@@ -628,7 +630,7 @@ class FormAction {
|
|
|
628
630
|
this.state.emit('redirect');
|
|
629
631
|
this.router.navigate([redirectUrl]);
|
|
630
632
|
}
|
|
631
|
-
else if (res.headers.get('Content-type')
|
|
633
|
+
else if (this._isJSON(res.headers.get('Content-type'))) {
|
|
632
634
|
res.json().then((result) => {
|
|
633
635
|
this.onSuccess.emit(result);
|
|
634
636
|
this.state.emit('success');
|
|
@@ -663,10 +665,15 @@ class FormAction {
|
|
|
663
665
|
}
|
|
664
666
|
return `/api/_analog/pages${window.location.pathname}`;
|
|
665
667
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
+
_isJSON(contentType) {
|
|
669
|
+
const mime = contentType ? contentType.split(';') : [];
|
|
670
|
+
const essence = mime[0];
|
|
671
|
+
return essence === 'application/json';
|
|
672
|
+
}
|
|
673
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: FormAction, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
674
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: FormAction, isStandalone: true, selector: "form[action],form[method]", inputs: { action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSuccess: "onSuccess", onError: "onError", state: "state" }, host: { listeners: { "submit": "submitted($event)" } }, ngImport: i0 }); }
|
|
668
675
|
}
|
|
669
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: FormAction, decorators: [{
|
|
670
677
|
type: Directive,
|
|
671
678
|
args: [{
|
|
672
679
|
selector: 'form[action],form[method]',
|
|
@@ -700,7 +707,7 @@ function withDebugRoutes() {
|
|
|
700
707
|
const routes = [
|
|
701
708
|
{
|
|
702
709
|
path: '__analog/routes',
|
|
703
|
-
loadComponent: () => import('./analogjs-router-debug.page-
|
|
710
|
+
loadComponent: () => import('./analogjs-router-debug.page-e5DJlNv3.mjs'),
|
|
704
711
|
},
|
|
705
712
|
];
|
|
706
713
|
return {
|
|
@@ -709,9 +716,92 @@ function withDebugRoutes() {
|
|
|
709
716
|
};
|
|
710
717
|
}
|
|
711
718
|
|
|
719
|
+
/**
|
|
720
|
+
* @description
|
|
721
|
+
* Component that defines the bridge between the client and server-only
|
|
722
|
+
* components. The component passes the component ID and props to the server
|
|
723
|
+
* and retrieves the rendered HTML and outputs from the server-only component.
|
|
724
|
+
*
|
|
725
|
+
* Status: experimental
|
|
726
|
+
*/
|
|
727
|
+
class ServerOnly {
|
|
728
|
+
constructor() {
|
|
729
|
+
this.component = input.required();
|
|
730
|
+
this.props = input();
|
|
731
|
+
this.outputs = output();
|
|
732
|
+
this.http = inject(HttpClient);
|
|
733
|
+
this.sanitizer = inject(DomSanitizer);
|
|
734
|
+
this.content = signal('');
|
|
735
|
+
this.route = inject(ActivatedRoute, { optional: true });
|
|
736
|
+
this.baseURL = injectBaseURL();
|
|
737
|
+
this.transferState = inject(TransferState);
|
|
738
|
+
effect(() => {
|
|
739
|
+
const routeComponentId = this.route?.snapshot.data['component'];
|
|
740
|
+
const props = this.props() || {};
|
|
741
|
+
const componentId = routeComponentId || this.component();
|
|
742
|
+
const headers = new HttpHeaders(new Headers({
|
|
743
|
+
'Content-type': 'application/json',
|
|
744
|
+
'X-Analog-Component': componentId,
|
|
745
|
+
}));
|
|
746
|
+
const componentUrl = this.getComponentUrl(componentId);
|
|
747
|
+
const httpRequest = new HttpRequest('POST', componentUrl, props, {
|
|
748
|
+
headers,
|
|
749
|
+
});
|
|
750
|
+
const cacheKey = makeCacheKey(httpRequest, new URL(componentUrl).pathname);
|
|
751
|
+
const storeKey = makeStateKey(cacheKey);
|
|
752
|
+
const componentState = this.transferState.get(storeKey, null);
|
|
753
|
+
if (componentState) {
|
|
754
|
+
this.updateContent(componentState);
|
|
755
|
+
this.transferState.remove(storeKey);
|
|
756
|
+
}
|
|
757
|
+
else {
|
|
758
|
+
this.http
|
|
759
|
+
.request(httpRequest)
|
|
760
|
+
.pipe(map((response) => {
|
|
761
|
+
if (response instanceof HttpResponse) {
|
|
762
|
+
if (import.meta.env.SSR) {
|
|
763
|
+
this.transferState.set(storeKey, response.body);
|
|
764
|
+
}
|
|
765
|
+
return response.body;
|
|
766
|
+
}
|
|
767
|
+
return throwError(() => ({}));
|
|
768
|
+
}), catchError((error) => {
|
|
769
|
+
console.log(error);
|
|
770
|
+
return of({
|
|
771
|
+
html: '',
|
|
772
|
+
outputs: {},
|
|
773
|
+
});
|
|
774
|
+
}))
|
|
775
|
+
.subscribe((content) => this.updateContent(content));
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
updateContent(content) {
|
|
780
|
+
this.content.set(this.sanitizer.bypassSecurityTrustHtml(content.html));
|
|
781
|
+
this.outputs.emit(content.outputs);
|
|
782
|
+
}
|
|
783
|
+
getComponentUrl(componentId) {
|
|
784
|
+
let baseURL = this.baseURL;
|
|
785
|
+
if (!baseURL && typeof window !== 'undefined') {
|
|
786
|
+
baseURL = window.location.origin;
|
|
787
|
+
}
|
|
788
|
+
return `${baseURL}/_analog/components/${componentId}`;
|
|
789
|
+
}
|
|
790
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ServerOnly, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
791
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.4", type: ServerOnly, isStandalone: true, selector: "server-only,ServerOnly,Server", inputs: { component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: true, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outputs: "outputs" }, ngImport: i0, template: ` <div [innerHTML]="content()"></div> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
792
|
+
}
|
|
793
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ServerOnly, decorators: [{
|
|
794
|
+
type: Component,
|
|
795
|
+
args: [{
|
|
796
|
+
selector: 'server-only,ServerOnly,Server',
|
|
797
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
798
|
+
template: ` <div [innerHTML]="content()"></div> `,
|
|
799
|
+
}]
|
|
800
|
+
}], ctorParameters: () => [] });
|
|
801
|
+
|
|
712
802
|
/**
|
|
713
803
|
* Generated bundle index. Do not edit.
|
|
714
804
|
*/
|
|
715
805
|
|
|
716
|
-
export { FormAction, createRoutes, defineRouteMeta, getLoadResolver, injectActivatedRoute, injectDebugRoutes, injectLoad, injectRouteEndpointURL, injectRouter, provideFileRouter, requestContextInterceptor, routes, withDebugRoutes, withExtraRoutes };
|
|
806
|
+
export { FormAction, ServerOnly, createRoutes, defineRouteMeta, getLoadResolver, injectActivatedRoute, injectDebugRoutes, injectLoad, injectRouteEndpointURL, injectRouter, provideFileRouter, requestContextInterceptor, routes, withDebugRoutes, withExtraRoutes };
|
|
717
807
|
//# sourceMappingURL=analogjs-router.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-router.mjs","sources":["../../../../packages/router/src/lib/meta-tags.ts","../../../../packages/router/src/lib/endpoints.ts","../../../../packages/router/src/lib/inject-route-endpoint-url.ts","../../../../packages/router/src/lib/route-config.ts","../../../../packages/router/src/lib/markdown-helpers.ts","../../../../packages/router/src/lib/constants.ts","../../../../packages/router/src/lib/routes.ts","../../../../packages/router/src/lib/define-route.ts","../../../../packages/router/src/lib/cookie-interceptor.ts","../../../../packages/router/src/lib/provide-file-router.ts","../../../../packages/router/src/lib/inject-load.ts","../../../../packages/router/src/lib/get-load-resolver.ts","../../../../packages/router/src/lib/request-context.ts","../../../../packages/router/src/lib/form-action.directive.ts","../../../../packages/router/src/lib/debug/routes.ts","../../../../packages/router/src/lib/debug/index.ts","../../../../packages/router/src/analogjs-router.ts"],"sourcesContent":["import { inject } from '@angular/core';\nimport { Meta, MetaDefinition as NgMetaTag } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nexport const ROUTE_META_TAGS_KEY = Symbol(\n '@analogjs/router Route Meta Tags Key'\n);\n\nconst CHARSET_KEY = 'charset';\nconst HTTP_EQUIV_KEY = 'httpEquiv';\n// httpEquiv selector key needs to be in kebab case format\nconst HTTP_EQUIV_SELECTOR_KEY = 'http-equiv';\nconst NAME_KEY = 'name';\nconst PROPERTY_KEY = 'property';\nconst CONTENT_KEY = 'content';\n\nexport type MetaTag =\n | (CharsetMetaTag & ExcludeRestMetaTagKeys<typeof CHARSET_KEY>)\n | (HttpEquivMetaTag & ExcludeRestMetaTagKeys<typeof HTTP_EQUIV_KEY>)\n | (NameMetaTag & ExcludeRestMetaTagKeys<typeof NAME_KEY>)\n | (PropertyMetaTag & ExcludeRestMetaTagKeys<typeof PROPERTY_KEY>);\n\ntype CharsetMetaTag = { [CHARSET_KEY]: string };\ntype HttpEquivMetaTag = { [HTTP_EQUIV_KEY]: string; [CONTENT_KEY]: string };\ntype NameMetaTag = { [NAME_KEY]: string; [CONTENT_KEY]: string };\ntype PropertyMetaTag = { [PROPERTY_KEY]: string; [CONTENT_KEY]: string };\n\ntype MetaTagKey =\n | typeof CHARSET_KEY\n | typeof HTTP_EQUIV_KEY\n | typeof NAME_KEY\n | typeof PROPERTY_KEY;\ntype ExcludeRestMetaTagKeys<Key extends MetaTagKey> = {\n [K in Exclude<MetaTagKey, Key>]?: never;\n};\n\ntype MetaTagSelector =\n | typeof CHARSET_KEY\n | `${\n | typeof HTTP_EQUIV_SELECTOR_KEY\n | typeof NAME_KEY\n | typeof PROPERTY_KEY}=\"${string}\"`;\ntype MetaTagMap = Record<MetaTagSelector, MetaTag>;\n\nexport function updateMetaTagsOnRouteChange(): void {\n const router = inject(Router);\n const metaService = inject(Meta);\n\n router.events\n .pipe(filter((event) => event instanceof NavigationEnd))\n .subscribe(() => {\n const metaTagMap = getMetaTagMap(router.routerState.snapshot.root);\n\n for (const metaTagSelector in metaTagMap) {\n const metaTag = metaTagMap[\n metaTagSelector as MetaTagSelector\n ] as NgMetaTag;\n metaService.updateTag(metaTag, metaTagSelector);\n }\n });\n}\n\nfunction getMetaTagMap(route: ActivatedRouteSnapshot): MetaTagMap {\n const metaTagMap = {} as MetaTagMap;\n let currentRoute: ActivatedRouteSnapshot | null = route;\n\n while (currentRoute) {\n const metaTags: MetaTag[] = currentRoute.data[ROUTE_META_TAGS_KEY] ?? [];\n for (const metaTag of metaTags) {\n metaTagMap[getMetaTagSelector(metaTag)] = metaTag;\n }\n\n currentRoute = currentRoute.firstChild;\n }\n\n return metaTagMap;\n}\n\nfunction getMetaTagSelector(metaTag: MetaTag): MetaTagSelector {\n if (metaTag.name) {\n return `${NAME_KEY}=\"${metaTag.name}\"`;\n }\n\n if (metaTag.property) {\n return `${PROPERTY_KEY}=\"${metaTag.property}\"`;\n }\n\n if (metaTag.httpEquiv) {\n return `${HTTP_EQUIV_SELECTOR_KEY}=\"${metaTag.httpEquiv}\"`;\n }\n\n return CHARSET_KEY;\n}\n","export const ANALOG_META_KEY = Symbol(\n '@analogjs/router Analog Route Metadata Key'\n);\n\n/**\n * This variable reference is replaced with a glob of all route endpoints.\n */\nexport let ANALOG_PAGE_ENDPOINTS: any = {};\n","import type { ActivatedRouteSnapshot, Route } from '@angular/router';\nimport { injectBaseURL, injectAPIPrefix } from '@analogjs/router/tokens';\n\nimport { ANALOG_META_KEY } from './endpoints';\n\nexport function injectRouteEndpointURL(route: ActivatedRouteSnapshot) {\n const routeConfig = route.routeConfig as Route & {\n [ANALOG_META_KEY]: { endpoint: string; endpointKey: string };\n };\n\n const apiPrefix = injectAPIPrefix();\n const baseUrl = injectBaseURL();\n const { queryParams, fragment: hash, params, parent } = route;\n const segment = parent?.url.map((segment) => segment.path).join('/') || '';\n const url = new URL(\n '',\n import.meta.env['VITE_ANALOG_PUBLIC_BASE_URL'] ||\n baseUrl ||\n (typeof window !== 'undefined' && window.location.origin\n ? window.location.origin\n : '')\n );\n url.pathname = `${\n url.pathname.endsWith('/') ? url.pathname : url.pathname + '/'\n }${apiPrefix}/_analog${routeConfig[ANALOG_META_KEY].endpoint}`;\n url.search = `${new URLSearchParams(queryParams).toString()}`;\n url.hash = hash ?? '';\n\n Object.keys(params).forEach((param) => {\n url.pathname = url.pathname.replace(`[${param}]`, params[param]);\n });\n url.pathname = url.pathname.replace('**', segment);\n\n return url;\n}\n","import { inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport type { Route } from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\n\nimport { RedirectRouteMeta, RouteConfig, RouteMeta } from './models';\nimport { ROUTE_META_TAGS_KEY } from './meta-tags';\nimport { ANALOG_PAGE_ENDPOINTS, ANALOG_META_KEY } from './endpoints';\nimport { injectRouteEndpointURL } from './inject-route-endpoint-url';\n\nexport function toRouteConfig(routeMeta: RouteMeta | undefined): RouteConfig {\n if (routeMeta && isRedirectRouteMeta(routeMeta)) {\n return routeMeta;\n }\n\n let { meta, ...routeConfig } = routeMeta ?? {};\n\n if (Array.isArray(meta)) {\n routeConfig.data = { ...routeConfig.data, [ROUTE_META_TAGS_KEY]: meta };\n } else if (typeof meta === 'function') {\n routeConfig.resolve = {\n ...routeConfig.resolve,\n [ROUTE_META_TAGS_KEY]: meta,\n };\n }\n\n if (!routeConfig) {\n routeConfig = {};\n }\n\n routeConfig.runGuardsAndResolvers =\n routeConfig.runGuardsAndResolvers ?? 'paramsOrQueryParamsChange';\n routeConfig.resolve = {\n ...routeConfig.resolve,\n load: async (route) => {\n const routeConfig = route.routeConfig as Route & {\n [ANALOG_META_KEY]: { endpoint: string; endpointKey: string };\n };\n\n if (ANALOG_PAGE_ENDPOINTS[routeConfig[ANALOG_META_KEY].endpointKey]) {\n const http = inject(HttpClient);\n const url = injectRouteEndpointURL(route);\n\n if (\n !!import.meta.env['VITE_ANALOG_PUBLIC_BASE_URL'] &&\n (globalThis as any).$fetch\n ) {\n return (globalThis as any).$fetch(url.pathname);\n }\n\n return firstValueFrom(http.get(`${url.href}`));\n }\n\n return {};\n },\n };\n\n return routeConfig;\n}\n\nfunction isRedirectRouteMeta(\n routeMeta: RouteMeta\n): routeMeta is RedirectRouteMeta {\n return !!routeMeta.redirectTo;\n}\n","import { inject } from '@angular/core';\nimport { RouteExport } from './models';\n\ndeclare const Zone: any;\n\n// The Zone is currently enabled by default, so we wouldn't need this check.\n// However, leaving this open space will be useful if zone.js becomes optional\n// in the future. This means we won't have to modify the current code, and it will\n// continue to work seamlessly.\nconst isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.root;\n\nexport function toMarkdownModule(\n markdownFileFactory: () => Promise<string>\n): () => Promise<RouteExport> {\n return async () => {\n const createLoader = () =>\n Promise.all([import('@analogjs/content'), markdownFileFactory()]);\n\n const [\n { parseRawContentFile, MarkdownRouteComponent, ContentRenderer },\n markdownFile,\n ]: [typeof import('@analogjs/content'), string] = await (isNgZoneEnabled\n ? // We are not able to use `runOutsideAngular` because we are not inside\n // an injection context to retrieve the `NgZone` instance.\n // The `Zone.root.run` is required when the code is running in the\n // browser since asynchronous tasks being scheduled in the current context\n // are a reason for unnecessary change detection cycles.\n Zone.root.run(createLoader)\n : createLoader());\n\n const { content, attributes } = parseRawContentFile(markdownFile);\n const { title, meta } = attributes;\n\n return {\n default: MarkdownRouteComponent,\n routeMeta: {\n data: { _analogContent: content },\n title,\n meta,\n resolve: {\n renderedAnalogContent: async () => {\n const contentRenderer = inject(ContentRenderer);\n return contentRenderer.render(content);\n },\n },\n },\n };\n };\n}\n","export const ENDPOINT_EXTENSION = '.server.ts';\nexport const APP_DIR = 'src/app';\n","import type { Route } from '@angular/router';\n\nimport type { RouteExport, RouteMeta } from './models';\nimport { toRouteConfig } from './route-config';\nimport { toMarkdownModule } from './markdown-helpers';\nimport { ENDPOINT_EXTENSION } from './constants';\nimport { ANALOG_META_KEY } from './endpoints';\n\n/**\n * This variable reference is replaced with a glob of all page routes.\n */\nexport let ANALOG_ROUTE_FILES = {};\n\n/**\n * This variable reference is replaced with a glob of all content routes.\n */\nexport let ANALOG_CONTENT_ROUTE_FILES = {};\n\nexport type Files = Record<string, () => Promise<RouteExport | string>>;\n\ntype RawRoute = {\n filename: string | null;\n rawSegment: string;\n ancestorRawSegments: string[];\n segment: string;\n level: number;\n children: RawRoute[];\n};\n\ntype RawRouteMap = Record<string, RawRoute>;\n\ntype RawRouteByLevelMap = Record<number, RawRouteMap>;\n\n/**\n * A function used to parse list of files and create configuration of routes.\n *\n * @param files\n * @returns Array of routes\n */\nexport function createRoutes(files: Files, debug = false): Route[] {\n const filenames = Object.keys(files);\n\n if (filenames.length === 0) {\n return [];\n }\n\n // map filenames to raw routes and group them by level\n const rawRoutesByLevelMap = filenames.reduce((acc, filename) => {\n const rawPath = toRawPath(filename);\n const rawSegments = rawPath.split('/');\n // nesting level starts at 0\n // rawPath: /products => level: 0\n // rawPath: /products/:id => level: 1\n const level = rawSegments.length - 1;\n const rawSegment = rawSegments[level];\n const ancestorRawSegments = rawSegments.slice(0, level);\n\n return {\n ...acc,\n [level]: {\n ...acc[level],\n [rawPath]: {\n filename,\n rawSegment,\n ancestorRawSegments,\n segment: toSegment(rawSegment),\n level,\n children: [],\n },\n },\n };\n }, {} as RawRouteByLevelMap);\n\n const allLevels = Object.keys(rawRoutesByLevelMap).map(Number);\n const maxLevel = Math.max(...allLevels);\n\n // add each raw route to its parent's children array\n for (let level = maxLevel; level > 0; level--) {\n const rawRoutesMap = rawRoutesByLevelMap[level];\n const rawPaths = Object.keys(rawRoutesMap);\n\n for (const rawPath of rawPaths) {\n const rawRoute = rawRoutesMap[rawPath];\n const parentRawPath = rawRoute.ancestorRawSegments.join('/');\n const parentRawSegmentIndex = rawRoute.ancestorRawSegments.length - 1;\n const parentRawSegment =\n rawRoute.ancestorRawSegments[parentRawSegmentIndex];\n\n // create the parent level and/or raw route if it does not exist\n // parent route won't exist for nested routes that don't have a layout route\n rawRoutesByLevelMap[level - 1] ||= {};\n rawRoutesByLevelMap[level - 1][parentRawPath] ||= {\n filename: null,\n rawSegment: parentRawSegment,\n ancestorRawSegments: rawRoute.ancestorRawSegments.slice(\n 0,\n parentRawSegmentIndex\n ),\n segment: toSegment(parentRawSegment),\n level: level - 1,\n children: [],\n };\n\n rawRoutesByLevelMap[level - 1][parentRawPath].children.push(rawRoute);\n }\n }\n\n // only take raw routes from the root level\n // since they already contain nested routes as their children\n const rootRawRoutesMap = rawRoutesByLevelMap[0];\n const rawRoutes = Object.keys(rootRawRoutesMap).map(\n (segment) => rootRawRoutesMap[segment]\n );\n sortRawRoutes(rawRoutes);\n\n return toRoutes(rawRoutes, files, debug);\n}\n\nfunction toRawPath(filename: string): string {\n return filename\n .replace(\n // convert to relative path and remove file extension\n /^(?:[a-zA-Z]:[\\\\/])?(.*?)[\\\\/](?:routes|pages)[\\\\/]|(?:[\\\\/](?:app[\\\\/](?:routes|pages)[\\\\/]))|(\\.page\\.(js|ts|analog|ag)$)|(\\.(ts|md|analog|ag)$)/g,\n ''\n )\n .replace(/\\[\\.{3}.+\\]/, '**') // [...not-found] => **\n .replace(/\\[([^\\]]+)\\]/g, ':$1'); // [id] => :id\n}\n\nfunction toSegment(rawSegment: string): string {\n return rawSegment\n .replace(/index|\\(.*?\\)/g, '') // replace named empty segments\n .replace(/\\.|\\/+/g, '/') // replace dots with slashes and remove redundant slashes\n .replace(/^\\/+|\\/+$/g, ''); // remove trailing slashes\n}\n\nfunction toRoutes(rawRoutes: RawRoute[], files: Files, debug = false): Route[] {\n const routes: Route[] = [];\n\n for (const rawRoute of rawRoutes) {\n const children: Route[] | undefined =\n rawRoute.children.length > 0\n ? toRoutes(rawRoute.children, files, debug)\n : undefined;\n let module: (() => Promise<RouteExport>) | undefined = undefined;\n let analogMeta: { endpoint: string; endpointKey: string } | undefined =\n undefined;\n\n if (rawRoute.filename) {\n const isMarkdownFile = rawRoute.filename.endsWith('.md');\n\n if (!debug) {\n module = isMarkdownFile\n ? toMarkdownModule(files[rawRoute.filename] as () => Promise<string>)\n : (files[rawRoute.filename] as () => Promise<RouteExport>);\n }\n\n const endpointKey = rawRoute.filename.replace(\n /\\.page\\.(ts|analog|ag)$/,\n ENDPOINT_EXTENSION\n );\n\n // get endpoint path\n const rawEndpoint = rawRoute.filename\n .replace(/\\.page\\.(ts|analog|ag)$/, '')\n .replace(/\\[\\.{3}.+\\]/, '**') // [...not-found] => **\n .replace(/^(.*?)\\/pages/, '/pages');\n\n // replace periods, remove (index) paths\n const endpoint = (rawEndpoint || '')\n .replace(/\\./g, '/')\n .replace(/\\/\\((.*?)\\)$/, '/-$1-');\n\n analogMeta = {\n endpoint,\n endpointKey,\n };\n }\n\n type DebugRoute = Route & {\n filename?: string | null | undefined;\n isLayout?: boolean;\n };\n\n const route: Route & { meta?: typeof analogMeta } & DebugRoute = module\n ? {\n path: rawRoute.segment,\n loadChildren: () =>\n module!().then((m) => {\n if (import.meta.env.DEV) {\n const hasModuleDefault = !!m.default;\n const hasRedirect = !!m.routeMeta?.redirectTo;\n\n if (!hasModuleDefault && !hasRedirect) {\n console.warn(\n `[Analog] Missing default export at ${rawRoute.filename}`\n );\n }\n }\n\n return [\n {\n path: '',\n component: m.default,\n ...toRouteConfig(m.routeMeta as RouteMeta | undefined),\n children,\n [ANALOG_META_KEY]: analogMeta,\n },\n ];\n }),\n }\n : {\n path: rawRoute.segment,\n ...(debug\n ? {\n filename: rawRoute.filename ? rawRoute.filename : undefined,\n isLayout: children && children.length > 0 ? true : false,\n }\n : {}),\n children,\n };\n\n routes.push(route);\n }\n\n return routes;\n}\n\nfunction sortRawRoutes(rawRoutes: RawRoute[]): void {\n rawRoutes.sort((a, b) => {\n let segmentA = deprioritizeSegment(a.segment);\n let segmentB = deprioritizeSegment(b.segment);\n\n // prioritize routes with fewer children\n if (a.children.length > b.children.length) {\n segmentA = `~${segmentA}`;\n } else if (a.children.length < b.children.length) {\n segmentB = `~${segmentB}`;\n }\n\n return segmentA > segmentB ? 1 : -1;\n });\n\n for (const rawRoute of rawRoutes) {\n sortRawRoutes(rawRoute.children);\n }\n}\n\nfunction deprioritizeSegment(segment: string): string {\n // deprioritize param and wildcard segments\n return segment.replace(':', '~~').replace('**', '~~~~');\n}\n\nexport const routes: Route[] = createRoutes({\n ...ANALOG_ROUTE_FILES,\n ...ANALOG_CONTENT_ROUTE_FILES,\n});\n","import { inject } from '@angular/core';\nimport { Route as NgRoute, Router } from '@angular/router';\nimport { ActivatedRoute } from '@angular/router';\n\ntype RouteOmitted =\n | 'component'\n | 'loadComponent'\n | 'loadChildren'\n | 'path'\n | 'pathMatch';\n\ntype RestrictedRoute = Omit<NgRoute, RouteOmitted>;\n\n/**\n * @deprecated Use `RouteMeta` type instead.\n * For more info see: https://github.com/analogjs/analog/issues/223\n *\n * Defines additional route config metadata. This\n * object is merged into the route config with\n * the predefined file-based route.\n *\n * @usageNotes\n *\n * ```\n * import { Component } from '@angular/core';\n * import { defineRouteMeta } from '@analogjs/router';\n *\n * export const routeMeta = defineRouteMeta({\n * title: 'Welcome'\n * });\n *\n * @Component({\n * template: `Home`,\n * standalone: true,\n * })\n * export default class HomeComponent {}\n * ```\n *\n * @param route\n * @returns\n */\nexport const defineRouteMeta = (route: RestrictedRoute) => {\n return route;\n};\n\n/**\n * Returns the instance of Angular Router\n *\n * @returns The router\n */\nexport const injectRouter = () => {\n return inject(Router);\n};\n\n/**\n * Returns the instance of the Activate Route for the component\n *\n * @returns The activated route\n */\nexport const injectActivatedRoute = () => {\n return inject(ActivatedRoute);\n};\n","import { isPlatformServer } from '@angular/common';\nimport { HttpHandlerFn, HttpHeaders, HttpRequest } from '@angular/common/http';\nimport { PLATFORM_ID, inject } from '@angular/core';\nimport { injectRequest } from '@analogjs/router/tokens';\n\nexport function cookieInterceptor(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn,\n location = inject(PLATFORM_ID),\n serverRequest = injectRequest()\n) {\n if (isPlatformServer(location) && req.url.includes('/_analog/')) {\n let headers = new HttpHeaders();\n const cookies = serverRequest?.headers.cookie;\n headers = headers.set('cookie', cookies ?? '');\n\n const cookiedRequest = req.clone({\n headers,\n });\n\n return next(cookiedRequest);\n } else {\n return next(req);\n }\n}\n","import {\n ENVIRONMENT_INITIALIZER,\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { provideRouter, RouterFeatures, ROUTES, Routes } from '@angular/router';\nimport { API_PREFIX } from '@analogjs/router/tokens';\nimport { ɵHTTP_ROOT_INTERCEPTOR_FNS as HTTP_ROOT_INTERCEPTOR_FNS } from '@angular/common/http';\n\nimport { routes } from './routes';\nimport { updateMetaTagsOnRouteChange } from './meta-tags';\nimport { cookieInterceptor } from './cookie-interceptor';\n\ndeclare const ANALOG_API_PREFIX: string;\n\n/**\n * Sets up providers for the Angular router, and registers\n * file-based routes. Additional features can be provided\n * to further configure the behavior of the router.\n *\n * @param features\n * @returns Providers and features to configure the router with routes\n */\nexport function provideFileRouter(\n ...features: RouterFeatures[]\n): EnvironmentProviders {\n const extraRoutesFeature = features.filter((feat) => feat.ɵkind >= 100);\n const routerFeatures = features.filter((feat) => feat.ɵkind < 100);\n\n return makeEnvironmentProviders([\n extraRoutesFeature.map((erf) => erf.ɵproviders),\n provideRouter(routes, ...routerFeatures),\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => updateMetaTagsOnRouteChange(),\n },\n {\n provide: HTTP_ROOT_INTERCEPTOR_FNS,\n multi: true,\n useValue: cookieInterceptor,\n },\n {\n provide: API_PREFIX,\n useFactory() {\n return typeof ANALOG_API_PREFIX !== 'undefined'\n ? ANALOG_API_PREFIX\n : 'api';\n },\n },\n ]);\n}\n\n/**\n * Provides extra custom routes in addition to the routes\n * discovered from the filesystem-based routing. These routes are\n * inserted before the filesystem-based routes, and take priority in\n * route matching.\n */\nexport function withExtraRoutes(routes: Routes): RouterFeatures {\n return {\n ɵkind: 100 as number,\n ɵproviders: [{ provide: ROUTES, useValue: routes, multi: true }],\n };\n}\n","import { Injector, inject } from '@angular/core';\nimport { ActivatedRoute, Data } from '@angular/router';\nimport { Observable, map } from 'rxjs';\n\nimport { PageServerLoad } from './route-types';\n\nexport function injectLoad<\n T extends (pageServerLoad: PageServerLoad) => Promise<any>\n>(options?: { injector?: Injector }): Observable<Awaited<ReturnType<T>>> {\n const injector = options?.injector ?? inject(Injector);\n const route = injector.get(ActivatedRoute);\n\n return route.data.pipe(\n map<Data, Awaited<ReturnType<T>>>((data) => data['load'])\n );\n}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\n/**\n * Get server load resolver data for the route\n *\n * @param route Provides the route to get server load resolver\n * @returns Returns server load resolver data for the route\n */\nexport async function getLoadResolver<T>(\n route: ActivatedRouteSnapshot\n): Promise<T> {\n return route.routeConfig?.resolve?.['load']?.(route);\n}\n","import { StateKey, TransferState, inject, makeStateKey } from '@angular/core';\nimport {\n HttpHandlerFn,\n HttpHeaders,\n HttpParams,\n HttpRequest,\n HttpResponse,\n} from '@angular/common/http';\n\nimport { from, of } from 'rxjs';\n\nimport { injectBaseURL, injectAPIPrefix } from '@analogjs/router/tokens';\n\n/**\n * Interceptor that is server-aware when making HttpClient requests.\n * Server-side requests use the full URL\n * Prerendering uses the internal Nitro $fetch function, along with state transfer\n * Client-side requests use the window.location.origin\n *\n * @param req HttpRequest<unknown>\n * @param next HttpHandlerFn\n * @returns\n */\nexport function requestContextInterceptor(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn\n) {\n const apiPrefix = injectAPIPrefix();\n const baseUrl = injectBaseURL();\n const transferState = inject(TransferState);\n\n // during prerendering with Nitro\n if (\n typeof global !== 'undefined' &&\n global.$fetch &&\n baseUrl &&\n (req.url.startsWith('/') ||\n req.url.startsWith(baseUrl) ||\n req.url.startsWith(`/${apiPrefix}`))\n ) {\n const requestUrl = new URL(req.url, baseUrl);\n const cacheKey = makeCacheKey(req, new URL(requestUrl).pathname);\n const storeKey = makeStateKey<unknown>(`analog_${cacheKey}`);\n const fetchUrl = requestUrl.pathname;\n\n const responseType =\n req.responseType === 'arraybuffer' ? 'arrayBuffer' : req.responseType;\n\n return from(\n global.$fetch\n .raw(fetchUrl, {\n method: req.method as any,\n params: requestUrl.searchParams,\n responseType,\n headers: req.headers.keys().reduce((hdrs, current) => {\n return {\n ...hdrs,\n [current]: req.headers.get(current),\n };\n }, {}),\n })\n .then((res) => {\n const cacheResponse = {\n body: res._data,\n headers: new HttpHeaders(res.headers),\n status: 200,\n statusText: 'OK',\n url: fetchUrl,\n };\n const transferResponse = new HttpResponse(cacheResponse);\n\n transferState.set(storeKey, cacheResponse);\n return transferResponse;\n })\n );\n }\n\n // on the client\n if (\n !import.meta.env.SSR &&\n (req.url.startsWith('/') || req.url.includes('/_analog/'))\n ) {\n // /_analog/ requests are full URLs\n const requestUrl = req.url.includes('/_analog/')\n ? req.url\n : `${window.location.origin}${req.url}`;\n const cacheKey = makeCacheKey(req, new URL(requestUrl).pathname);\n const storeKey = makeStateKey<unknown>(`analog_${cacheKey}`);\n const cacheRestoreResponse = transferState.get(storeKey, null);\n\n if (cacheRestoreResponse) {\n transferState.remove(storeKey);\n return of(new HttpResponse(cacheRestoreResponse));\n }\n\n return next(\n req.clone({\n url: requestUrl,\n })\n );\n }\n\n // on the server\n if (baseUrl && (req.url.startsWith('/') || req.url.startsWith(baseUrl))) {\n const requestUrl =\n req.url.startsWith(baseUrl) && !req.url.startsWith('/')\n ? req.url\n : `${baseUrl}${req.url}`;\n\n return next(\n req.clone({\n url: requestUrl,\n })\n );\n }\n\n return next(req);\n}\n\nfunction sortAndConcatParams(params: HttpParams | URLSearchParams): string {\n return [...params.keys()]\n .sort()\n .map((k) => `${k}=${params.getAll(k)}`)\n .join('&');\n}\n\nfunction makeCacheKey(\n request: HttpRequest<any>,\n mappedRequestUrl: string\n): StateKey<unknown> {\n // make the params encoded same as a url so it's easy to identify\n const { params, method, responseType } = request;\n const encodedParams = sortAndConcatParams(params);\n\n let serializedBody = request.serializeBody();\n if (serializedBody instanceof URLSearchParams) {\n serializedBody = sortAndConcatParams(serializedBody);\n } else if (typeof serializedBody !== 'string') {\n serializedBody = '';\n }\n\n const key = [\n method,\n responseType,\n mappedRequestUrl,\n serializedBody,\n encodedParams,\n ].join('|');\n\n const hash = generateHash(key);\n\n return makeStateKey(hash);\n}\n\nfunction generateHash(str: string) {\n let hash = 0;\n for (let i = 0, len = str.length; i < len; i++) {\n let chr = str.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return `${hash}`;\n}\n","import { Directive, inject, input, output } from '@angular/core';\nimport { ActivatedRoute, Params, Router } from '@angular/router';\n\nimport { injectRouteEndpointURL } from './inject-route-endpoint-url';\n\n@Directive({\n selector: 'form[action],form[method]',\n host: {\n '(submit)': `submitted($event)`,\n },\n standalone: true,\n})\nexport class FormAction {\n action = input<string>('');\n onSuccess = output<unknown>();\n onError = output<unknown>();\n state = output<\n 'submitting' | 'error' | 'redirect' | 'success' | 'navigate'\n >();\n private router = inject(Router);\n private route = inject(ActivatedRoute);\n private path = this._getPath();\n\n submitted($event: { target: HTMLFormElement } & Event) {\n $event.preventDefault();\n\n this.state.emit('submitting');\n const body = new FormData($event.target);\n\n if ($event.target.method.toUpperCase() === 'GET') {\n this._handleGet(body, this.router.url);\n } else {\n this._handlePost(body, this.path, $event);\n }\n }\n\n private _handleGet(body: FormData, path: string) {\n const params: Params = {};\n body.forEach((formVal, formKey) => (params[formKey] = formVal));\n\n this.state.emit('navigate');\n const url = path.split('?')[0];\n this.router.navigate([url], {\n queryParams: params,\n onSameUrlNavigation: 'reload',\n });\n }\n\n private _handlePost(\n body: FormData,\n path: string,\n $event: { target: HTMLFormElement } & Event\n ) {\n fetch(path, {\n method: $event.target.method,\n body,\n })\n .then((res) => {\n if (res.ok) {\n if (res.redirected) {\n const redirectUrl = new URL(res.url).pathname;\n this.state.emit('redirect');\n this.router.navigate([redirectUrl]);\n } else if (res.headers.get('Content-type') === 'application/json') {\n res.json().then((result) => {\n this.onSuccess.emit(result);\n this.state.emit('success');\n });\n } else {\n res.text().then((result) => {\n this.onSuccess.emit(result);\n this.state.emit('success');\n });\n }\n } else {\n if (res.headers.get('X-Analog-Errors')) {\n res.json().then((errors: unknown) => {\n this.onError.emit(errors);\n this.state.emit('error');\n });\n } else {\n this.state.emit('error');\n }\n }\n })\n .catch((_) => {\n this.state.emit('error');\n });\n }\n\n private _getPath() {\n if (this.route) {\n return injectRouteEndpointURL(this.route.snapshot).pathname;\n }\n\n return `/api/_analog/pages${window.location.pathname}`;\n }\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport { Route } from '@angular/router';\n\nimport {\n ANALOG_CONTENT_ROUTE_FILES,\n ANALOG_ROUTE_FILES,\n createRoutes,\n} from '../routes';\n\nexport const DEBUG_ROUTES = new InjectionToken(\n '@analogjs/router debug routes',\n {\n providedIn: 'root',\n factory() {\n const debugRoutes = createRoutes(\n {\n ...ANALOG_ROUTE_FILES,\n ...ANALOG_CONTENT_ROUTE_FILES,\n },\n true\n );\n\n return debugRoutes as (Route & DebugRoute)[];\n },\n }\n);\n\nexport type DebugRoute = {\n path: string;\n filename: string;\n isLayout: boolean;\n children?: DebugRoute[];\n};\n\nexport function injectDebugRoutes() {\n return inject(DEBUG_ROUTES);\n}\n","import { ROUTES } from '@angular/router';\n\n/**\n * Provides routes that provide additional\n * pages for displaying and debugging\n * routes.\n */\nexport function withDebugRoutes() {\n const routes = [\n {\n path: '__analog/routes',\n loadComponent: () => import('./debug.page'),\n },\n ];\n\n return {\n ɵkind: 101 as number,\n ɵproviders: [{ provide: ROUTES, useValue: routes, multi: true }],\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["HTTP_ROOT_INTERCEPTOR_FNS"],"mappings":";;;;;;;;;;AAKO,MAAM,mBAAmB,GAAG,MAAM,CACvC,sCAAsC,CACvC;AAED,MAAM,WAAW,GAAG,SAAS;AAC7B,MAAM,cAAc,GAAG,WAAW;AAClC;AACA,MAAM,uBAAuB,GAAG,YAAY;AAC5C,MAAM,QAAQ,GAAG,MAAM;AACvB,MAAM,YAAY,GAAG,UAAU;AAC/B,MAAM,WAAW,GAAG,SAAS;SA8Bb,2BAA2B,GAAA;AACzC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC7B,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC;AAEhC,IAAA,MAAM,CAAC;AACJ,SAAA,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,YAAY,aAAa,CAAC;SACtD,SAAS,CAAC,MAAK;AACd,QAAA,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;AAElE,QAAA,KAAK,MAAM,eAAe,IAAI,UAAU,EAAE;AACxC,YAAA,MAAM,OAAO,GAAG,UAAU,CACxB,eAAkC,CACtB;AACd,YAAA,WAAW,CAAC,SAAS,CAAC,OAAO,EAAE,eAAe,CAAC;;AAEnD,KAAC,CAAC;AACN;AAEA,SAAS,aAAa,CAAC,KAA6B,EAAA;IAClD,MAAM,UAAU,GAAG,EAAgB;IACnC,IAAI,YAAY,GAAkC,KAAK;IAEvD,OAAO,YAAY,EAAE;QACnB,MAAM,QAAQ,GAAc,YAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE;AACxE,QAAA,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC9B,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC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,EAAE,CAAC;KACjE;AACH;;ACnBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"analogjs-router.mjs","sources":["../../../../packages/router/src/lib/meta-tags.ts","../../../../packages/router/src/lib/endpoints.ts","../../../../packages/router/src/lib/inject-route-endpoint-url.ts","../../../../packages/router/src/lib/route-config.ts","../../../../packages/router/src/lib/markdown-helpers.ts","../../../../packages/router/src/lib/constants.ts","../../../../packages/router/src/lib/routes.ts","../../../../packages/router/src/lib/define-route.ts","../../../../packages/router/src/lib/cookie-interceptor.ts","../../../../packages/router/src/lib/provide-file-router.ts","../../../../packages/router/src/lib/inject-load.ts","../../../../packages/router/src/lib/get-load-resolver.ts","../../../../packages/router/src/lib/cache-key.ts","../../../../packages/router/src/lib/request-context.ts","../../../../packages/router/src/lib/form-action.directive.ts","../../../../packages/router/src/lib/debug/routes.ts","../../../../packages/router/src/lib/debug/index.ts","../../../../packages/router/src/lib/server.component.ts","../../../../packages/router/src/analogjs-router.ts"],"sourcesContent":["import { inject } from '@angular/core';\nimport { Meta, MetaDefinition as NgMetaTag } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nexport const ROUTE_META_TAGS_KEY = Symbol(\n '@analogjs/router Route Meta Tags Key',\n);\n\nconst CHARSET_KEY = 'charset';\nconst HTTP_EQUIV_KEY = 'httpEquiv';\n// httpEquiv selector key needs to be in kebab case format\nconst HTTP_EQUIV_SELECTOR_KEY = 'http-equiv';\nconst NAME_KEY = 'name';\nconst PROPERTY_KEY = 'property';\nconst CONTENT_KEY = 'content';\n\nexport type MetaTag =\n | (CharsetMetaTag & ExcludeRestMetaTagKeys<typeof CHARSET_KEY>)\n | (HttpEquivMetaTag & ExcludeRestMetaTagKeys<typeof HTTP_EQUIV_KEY>)\n | (NameMetaTag & ExcludeRestMetaTagKeys<typeof NAME_KEY>)\n | (PropertyMetaTag & ExcludeRestMetaTagKeys<typeof PROPERTY_KEY>);\n\ntype CharsetMetaTag = { [CHARSET_KEY]: string };\ntype HttpEquivMetaTag = { [HTTP_EQUIV_KEY]: string; [CONTENT_KEY]: string };\ntype NameMetaTag = { [NAME_KEY]: string; [CONTENT_KEY]: string };\ntype PropertyMetaTag = { [PROPERTY_KEY]: string; [CONTENT_KEY]: string };\n\ntype MetaTagKey =\n | typeof CHARSET_KEY\n | typeof HTTP_EQUIV_KEY\n | typeof NAME_KEY\n | typeof PROPERTY_KEY;\ntype ExcludeRestMetaTagKeys<Key extends MetaTagKey> = {\n [K in Exclude<MetaTagKey, Key>]?: never;\n};\n\ntype MetaTagSelector =\n | typeof CHARSET_KEY\n | `${\n | typeof HTTP_EQUIV_SELECTOR_KEY\n | typeof NAME_KEY\n | typeof PROPERTY_KEY}=\"${string}\"`;\ntype MetaTagMap = Record<MetaTagSelector, MetaTag>;\n\nexport function updateMetaTagsOnRouteChange(): void {\n const router = inject(Router);\n const metaService = inject(Meta);\n\n router.events\n .pipe(filter((event) => event instanceof NavigationEnd))\n .subscribe(() => {\n const metaTagMap = getMetaTagMap(router.routerState.snapshot.root);\n\n for (const metaTagSelector in metaTagMap) {\n const metaTag = metaTagMap[\n metaTagSelector as MetaTagSelector\n ] as NgMetaTag;\n metaService.updateTag(metaTag, metaTagSelector);\n }\n });\n}\n\nfunction getMetaTagMap(route: ActivatedRouteSnapshot): MetaTagMap {\n const metaTagMap = {} as MetaTagMap;\n let currentRoute: ActivatedRouteSnapshot | null = route;\n\n while (currentRoute) {\n const metaTags: MetaTag[] = currentRoute.data[ROUTE_META_TAGS_KEY] ?? [];\n for (const metaTag of metaTags) {\n metaTagMap[getMetaTagSelector(metaTag)] = metaTag;\n }\n\n currentRoute = currentRoute.firstChild;\n }\n\n return metaTagMap;\n}\n\nfunction getMetaTagSelector(metaTag: MetaTag): MetaTagSelector {\n if (metaTag.name) {\n return `${NAME_KEY}=\"${metaTag.name}\"`;\n }\n\n if (metaTag.property) {\n return `${PROPERTY_KEY}=\"${metaTag.property}\"`;\n }\n\n if (metaTag.httpEquiv) {\n return `${HTTP_EQUIV_SELECTOR_KEY}=\"${metaTag.httpEquiv}\"`;\n }\n\n return CHARSET_KEY;\n}\n","export const ANALOG_META_KEY = Symbol(\n '@analogjs/router Analog Route Metadata Key',\n);\n\n/**\n * This variable reference is replaced with a glob of all route endpoints.\n */\nexport let ANALOG_PAGE_ENDPOINTS: any = {};\n","import type { ActivatedRouteSnapshot, Route } from '@angular/router';\nimport { injectBaseURL, injectAPIPrefix } from '@analogjs/router/tokens';\n\nimport { ANALOG_META_KEY } from './endpoints';\n\nexport function injectRouteEndpointURL(route: ActivatedRouteSnapshot) {\n const routeConfig = route.routeConfig as Route & {\n [ANALOG_META_KEY]: { endpoint: string; endpointKey: string };\n };\n\n const apiPrefix = injectAPIPrefix();\n const baseUrl = injectBaseURL();\n const { queryParams, fragment: hash, params, parent } = route;\n const segment = parent?.url.map((segment) => segment.path).join('/') || '';\n const url = new URL(\n '',\n import.meta.env['VITE_ANALOG_PUBLIC_BASE_URL'] ||\n baseUrl ||\n (typeof window !== 'undefined' && window.location.origin\n ? window.location.origin\n : ''),\n );\n url.pathname = `${\n url.pathname.endsWith('/') ? url.pathname : url.pathname + '/'\n }${apiPrefix}/_analog${routeConfig[ANALOG_META_KEY].endpoint}`;\n url.search = `${new URLSearchParams(queryParams).toString()}`;\n url.hash = hash ?? '';\n\n Object.keys(params).forEach((param) => {\n url.pathname = url.pathname.replace(`[${param}]`, params[param]);\n });\n url.pathname = url.pathname.replace('**', segment);\n\n return url;\n}\n","import { inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport type { Route } from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\n\nimport { RedirectRouteMeta, RouteConfig, RouteMeta } from './models';\nimport { ROUTE_META_TAGS_KEY } from './meta-tags';\nimport { ANALOG_PAGE_ENDPOINTS, ANALOG_META_KEY } from './endpoints';\nimport { injectRouteEndpointURL } from './inject-route-endpoint-url';\n\nexport function toRouteConfig(routeMeta: RouteMeta | undefined): RouteConfig {\n if (routeMeta && isRedirectRouteMeta(routeMeta)) {\n return routeMeta;\n }\n\n let { meta, ...routeConfig } = routeMeta ?? {};\n\n if (Array.isArray(meta)) {\n routeConfig.data = { ...routeConfig.data, [ROUTE_META_TAGS_KEY]: meta };\n } else if (typeof meta === 'function') {\n routeConfig.resolve = {\n ...routeConfig.resolve,\n [ROUTE_META_TAGS_KEY]: meta,\n };\n }\n\n if (!routeConfig) {\n routeConfig = {};\n }\n\n routeConfig.runGuardsAndResolvers =\n routeConfig.runGuardsAndResolvers ?? 'paramsOrQueryParamsChange';\n routeConfig.resolve = {\n ...routeConfig.resolve,\n load: async (route) => {\n const routeConfig = route.routeConfig as Route & {\n [ANALOG_META_KEY]: { endpoint: string; endpointKey: string };\n };\n\n if (ANALOG_PAGE_ENDPOINTS[routeConfig[ANALOG_META_KEY].endpointKey]) {\n const http = inject(HttpClient);\n const url = injectRouteEndpointURL(route);\n\n if (\n !!import.meta.env['VITE_ANALOG_PUBLIC_BASE_URL'] &&\n (globalThis as any).$fetch\n ) {\n return (globalThis as any).$fetch(url.pathname);\n }\n\n return firstValueFrom(http.get(`${url.href}`));\n }\n\n return {};\n },\n };\n\n return routeConfig;\n}\n\nfunction isRedirectRouteMeta(\n routeMeta: RouteMeta,\n): routeMeta is RedirectRouteMeta {\n return !!routeMeta.redirectTo;\n}\n","import { inject } from '@angular/core';\nimport { RouteExport } from './models';\n\ndeclare const Zone: any;\n\n// The Zone is currently enabled by default, so we wouldn't need this check.\n// However, leaving this open space will be useful if zone.js becomes optional\n// in the future. This means we won't have to modify the current code, and it will\n// continue to work seamlessly.\nconst isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.root;\n\nexport function toMarkdownModule(\n markdownFileFactory: () => Promise<string>,\n): () => Promise<RouteExport> {\n return async () => {\n const createLoader = () =>\n Promise.all([import('@analogjs/content'), markdownFileFactory()]);\n\n const [\n { parseRawContentFile, MarkdownRouteComponent, ContentRenderer },\n markdownFile,\n ]: [typeof import('@analogjs/content'), string] = await (isNgZoneEnabled\n ? // We are not able to use `runOutsideAngular` because we are not inside\n // an injection context to retrieve the `NgZone` instance.\n // The `Zone.root.run` is required when the code is running in the\n // browser since asynchronous tasks being scheduled in the current context\n // are a reason for unnecessary change detection cycles.\n Zone.root.run(createLoader)\n : createLoader());\n\n const { content, attributes } = parseRawContentFile(markdownFile);\n const { title, meta } = attributes;\n\n return {\n default: MarkdownRouteComponent,\n routeMeta: {\n data: { _analogContent: content },\n title,\n meta,\n resolve: {\n renderedAnalogContent: async () => {\n const contentRenderer = inject(ContentRenderer);\n return contentRenderer.render(content);\n },\n },\n },\n };\n };\n}\n","export const ENDPOINT_EXTENSION = '.server.ts';\nexport const APP_DIR = 'src/app';\n","import type { Route } from '@angular/router';\n\nimport type { RouteExport, RouteMeta } from './models';\nimport { toRouteConfig } from './route-config';\nimport { toMarkdownModule } from './markdown-helpers';\nimport { ENDPOINT_EXTENSION } from './constants';\nimport { ANALOG_META_KEY } from './endpoints';\n\n/**\n * This variable reference is replaced with a glob of all page routes.\n */\nexport let ANALOG_ROUTE_FILES = {};\n\n/**\n * This variable reference is replaced with a glob of all content routes.\n */\nexport let ANALOG_CONTENT_ROUTE_FILES = {};\n\nexport type Files = Record<string, () => Promise<RouteExport | string>>;\n\ntype RawRoute = {\n filename: string | null;\n rawSegment: string;\n ancestorRawSegments: string[];\n segment: string;\n level: number;\n children: RawRoute[];\n};\n\ntype RawRouteMap = Record<string, RawRoute>;\n\ntype RawRouteByLevelMap = Record<number, RawRouteMap>;\n\n/**\n * A function used to parse list of files and create configuration of routes.\n *\n * @param files\n * @returns Array of routes\n */\nexport function createRoutes(files: Files, debug = false): Route[] {\n const filenames = Object.keys(files);\n\n if (filenames.length === 0) {\n return [];\n }\n\n // map filenames to raw routes and group them by level\n const rawRoutesByLevelMap = filenames.reduce((acc, filename) => {\n const rawPath = toRawPath(filename);\n const rawSegments = rawPath.split('/');\n // nesting level starts at 0\n // rawPath: /products => level: 0\n // rawPath: /products/:id => level: 1\n const level = rawSegments.length - 1;\n const rawSegment = rawSegments[level];\n const ancestorRawSegments = rawSegments.slice(0, level);\n\n return {\n ...acc,\n [level]: {\n ...acc[level],\n [rawPath]: {\n filename,\n rawSegment,\n ancestorRawSegments,\n segment: toSegment(rawSegment),\n level,\n children: [],\n },\n },\n };\n }, {} as RawRouteByLevelMap);\n\n const allLevels = Object.keys(rawRoutesByLevelMap).map(Number);\n const maxLevel = Math.max(...allLevels);\n\n // add each raw route to its parent's children array\n for (let level = maxLevel; level > 0; level--) {\n const rawRoutesMap = rawRoutesByLevelMap[level];\n const rawPaths = Object.keys(rawRoutesMap);\n\n for (const rawPath of rawPaths) {\n const rawRoute = rawRoutesMap[rawPath];\n const parentRawPath = rawRoute.ancestorRawSegments.join('/');\n const parentRawSegmentIndex = rawRoute.ancestorRawSegments.length - 1;\n const parentRawSegment =\n rawRoute.ancestorRawSegments[parentRawSegmentIndex];\n\n // create the parent level and/or raw route if it does not exist\n // parent route won't exist for nested routes that don't have a layout route\n rawRoutesByLevelMap[level - 1] ||= {};\n rawRoutesByLevelMap[level - 1][parentRawPath] ||= {\n filename: null,\n rawSegment: parentRawSegment,\n ancestorRawSegments: rawRoute.ancestorRawSegments.slice(\n 0,\n parentRawSegmentIndex,\n ),\n segment: toSegment(parentRawSegment),\n level: level - 1,\n children: [],\n };\n\n rawRoutesByLevelMap[level - 1][parentRawPath].children.push(rawRoute);\n }\n }\n\n // only take raw routes from the root level\n // since they already contain nested routes as their children\n const rootRawRoutesMap = rawRoutesByLevelMap[0];\n const rawRoutes = Object.keys(rootRawRoutesMap).map(\n (segment) => rootRawRoutesMap[segment],\n );\n sortRawRoutes(rawRoutes);\n\n return toRoutes(rawRoutes, files, debug);\n}\n\nfunction toRawPath(filename: string): string {\n return filename\n .replace(\n // convert to relative path and remove file extension\n /^(?:[a-zA-Z]:[\\\\/])?(.*?)[\\\\/](?:routes|pages)[\\\\/]|(?:[\\\\/](?:app[\\\\/](?:routes|pages)[\\\\/]))|(\\.page\\.(js|ts|analog|ag)$)|(\\.(ts|md|analog|ag)$)/g,\n '',\n )\n .replace(/\\[\\.{3}.+\\]/, '**') // [...not-found] => **\n .replace(/\\[([^\\]]+)\\]/g, ':$1'); // [id] => :id\n}\n\nfunction toSegment(rawSegment: string): string {\n return rawSegment\n .replace(/index|\\(.*?\\)/g, '') // replace named empty segments\n .replace(/\\.|\\/+/g, '/') // replace dots with slashes and remove redundant slashes\n .replace(/^\\/+|\\/+$/g, ''); // remove trailing slashes\n}\n\nfunction toRoutes(rawRoutes: RawRoute[], files: Files, debug = false): Route[] {\n const routes: Route[] = [];\n\n for (const rawRoute of rawRoutes) {\n const children: Route[] | undefined =\n rawRoute.children.length > 0\n ? toRoutes(rawRoute.children, files, debug)\n : undefined;\n let module: (() => Promise<RouteExport>) | undefined = undefined;\n let analogMeta: { endpoint: string; endpointKey: string } | undefined =\n undefined;\n\n if (rawRoute.filename) {\n const isMarkdownFile = rawRoute.filename.endsWith('.md');\n\n if (!debug) {\n module = isMarkdownFile\n ? toMarkdownModule(files[rawRoute.filename] as () => Promise<string>)\n : (files[rawRoute.filename] as () => Promise<RouteExport>);\n }\n\n const endpointKey = rawRoute.filename.replace(\n /\\.page\\.(ts|analog|ag)$/,\n ENDPOINT_EXTENSION,\n );\n\n // get endpoint path\n const rawEndpoint = rawRoute.filename\n .replace(/\\.page\\.(ts|analog|ag)$/, '')\n .replace(/\\[\\.{3}.+\\]/, '**') // [...not-found] => **\n .replace(/^(.*?)\\/pages/, '/pages');\n\n // replace periods, remove (index) paths\n const endpoint = (rawEndpoint || '')\n .replace(/\\./g, '/')\n .replace(/\\/\\((.*?)\\)$/, '/-$1-');\n\n analogMeta = {\n endpoint,\n endpointKey,\n };\n }\n\n type DebugRoute = Route & {\n filename?: string | null | undefined;\n isLayout?: boolean;\n };\n\n const route: Route & { meta?: typeof analogMeta } & DebugRoute = module\n ? {\n path: rawRoute.segment,\n loadChildren: () =>\n module!().then((m) => {\n if (import.meta.env.DEV) {\n const hasModuleDefault = !!m.default;\n const hasRedirect = !!m.routeMeta?.redirectTo;\n\n if (!hasModuleDefault && !hasRedirect) {\n console.warn(\n `[Analog] Missing default export at ${rawRoute.filename}`,\n );\n }\n }\n\n return [\n {\n path: '',\n component: m.default,\n ...toRouteConfig(m.routeMeta as RouteMeta | undefined),\n children,\n [ANALOG_META_KEY]: analogMeta,\n },\n ];\n }),\n }\n : {\n path: rawRoute.segment,\n ...(debug\n ? {\n filename: rawRoute.filename ? rawRoute.filename : undefined,\n isLayout: children && children.length > 0 ? true : false,\n }\n : {}),\n children,\n };\n\n routes.push(route);\n }\n\n return routes;\n}\n\nfunction sortRawRoutes(rawRoutes: RawRoute[]): void {\n rawRoutes.sort((a, b) => {\n let segmentA = deprioritizeSegment(a.segment);\n let segmentB = deprioritizeSegment(b.segment);\n\n // prioritize routes with fewer children\n if (a.children.length > b.children.length) {\n segmentA = `~${segmentA}`;\n } else if (a.children.length < b.children.length) {\n segmentB = `~${segmentB}`;\n }\n\n return segmentA > segmentB ? 1 : -1;\n });\n\n for (const rawRoute of rawRoutes) {\n sortRawRoutes(rawRoute.children);\n }\n}\n\nfunction deprioritizeSegment(segment: string): string {\n // deprioritize param and wildcard segments\n return segment.replace(':', '~~').replace('**', '~~~~');\n}\n\nexport const routes: Route[] = createRoutes({\n ...ANALOG_ROUTE_FILES,\n ...ANALOG_CONTENT_ROUTE_FILES,\n});\n","import { inject } from '@angular/core';\nimport { Route as NgRoute, Router } from '@angular/router';\nimport { ActivatedRoute } from '@angular/router';\n\ntype RouteOmitted =\n | 'component'\n | 'loadComponent'\n | 'loadChildren'\n | 'path'\n | 'pathMatch';\n\ntype RestrictedRoute = Omit<NgRoute, RouteOmitted>;\n\n/**\n * @deprecated Use `RouteMeta` type instead.\n * For more info see: https://github.com/analogjs/analog/issues/223\n *\n * Defines additional route config metadata. This\n * object is merged into the route config with\n * the predefined file-based route.\n *\n * @usageNotes\n *\n * ```\n * import { Component } from '@angular/core';\n * import { defineRouteMeta } from '@analogjs/router';\n *\n * export const routeMeta = defineRouteMeta({\n * title: 'Welcome'\n * });\n *\n * @Component({\n * template: `Home`,\n * standalone: true,\n * })\n * export default class HomeComponent {}\n * ```\n *\n * @param route\n * @returns\n */\nexport const defineRouteMeta = (route: RestrictedRoute) => {\n return route;\n};\n\n/**\n * Returns the instance of Angular Router\n *\n * @returns The router\n */\nexport const injectRouter = () => {\n return inject(Router);\n};\n\n/**\n * Returns the instance of the Activate Route for the component\n *\n * @returns The activated route\n */\nexport const injectActivatedRoute = () => {\n return inject(ActivatedRoute);\n};\n","import { isPlatformServer } from '@angular/common';\nimport { HttpHandlerFn, HttpHeaders, HttpRequest } from '@angular/common/http';\nimport { PLATFORM_ID, inject } from '@angular/core';\nimport { injectRequest } from '@analogjs/router/tokens';\n\nexport function cookieInterceptor(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn,\n location = inject(PLATFORM_ID),\n serverRequest = injectRequest(),\n) {\n if (isPlatformServer(location) && req.url.includes('/_analog/')) {\n let headers = new HttpHeaders();\n const cookies = serverRequest?.headers.cookie;\n headers = headers.set('cookie', cookies ?? '');\n\n const cookiedRequest = req.clone({\n headers,\n });\n\n return next(cookiedRequest);\n } else {\n return next(req);\n }\n}\n","import {\n ENVIRONMENT_INITIALIZER,\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { provideRouter, RouterFeatures, ROUTES, Routes } from '@angular/router';\nimport { API_PREFIX } from '@analogjs/router/tokens';\nimport { ɵHTTP_ROOT_INTERCEPTOR_FNS as HTTP_ROOT_INTERCEPTOR_FNS } from '@angular/common/http';\n\nimport { routes } from './routes';\nimport { updateMetaTagsOnRouteChange } from './meta-tags';\nimport { cookieInterceptor } from './cookie-interceptor';\n\ndeclare const ANALOG_API_PREFIX: string;\n\n/**\n * Sets up providers for the Angular router, and registers\n * file-based routes. Additional features can be provided\n * to further configure the behavior of the router.\n *\n * @param features\n * @returns Providers and features to configure the router with routes\n */\nexport function provideFileRouter(\n ...features: RouterFeatures[]\n): EnvironmentProviders {\n const extraRoutesFeature = features.filter((feat) => feat.ɵkind >= 100);\n const routerFeatures = features.filter((feat) => feat.ɵkind < 100);\n\n return makeEnvironmentProviders([\n extraRoutesFeature.map((erf) => erf.ɵproviders),\n provideRouter(routes, ...routerFeatures),\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => updateMetaTagsOnRouteChange(),\n },\n {\n provide: HTTP_ROOT_INTERCEPTOR_FNS,\n multi: true,\n useValue: cookieInterceptor,\n },\n {\n provide: API_PREFIX,\n useFactory() {\n return typeof ANALOG_API_PREFIX !== 'undefined'\n ? ANALOG_API_PREFIX\n : 'api';\n },\n },\n ]);\n}\n\n/**\n * Provides extra custom routes in addition to the routes\n * discovered from the filesystem-based routing. These routes are\n * inserted before the filesystem-based routes, and take priority in\n * route matching.\n */\nexport function withExtraRoutes(routes: Routes): RouterFeatures {\n return {\n ɵkind: 100 as number,\n ɵproviders: [{ provide: ROUTES, useValue: routes, multi: true }],\n };\n}\n","import { Injector, inject } from '@angular/core';\nimport { ActivatedRoute, Data } from '@angular/router';\nimport { Observable, map } from 'rxjs';\n\nimport { PageServerLoad } from './route-types';\n\nexport function injectLoad<\n T extends (pageServerLoad: PageServerLoad) => Promise<any>,\n>(options?: { injector?: Injector }): Observable<Awaited<ReturnType<T>>> {\n const injector = options?.injector ?? inject(Injector);\n const route = injector.get(ActivatedRoute);\n\n return route.data.pipe(\n map<Data, Awaited<ReturnType<T>>>((data) => data['load']),\n );\n}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\n/**\n * Get server load resolver data for the route\n *\n * @param route Provides the route to get server load resolver\n * @returns Returns server load resolver data for the route\n */\nexport async function getLoadResolver<T>(\n route: ActivatedRouteSnapshot,\n): Promise<T> {\n return route.routeConfig?.resolve?.['load']?.(route);\n}\n","import { HttpParams, HttpRequest } from '@angular/common/http';\nimport { StateKey, makeStateKey } from '@angular/core';\n\nfunction sortAndConcatParams(params: HttpParams | URLSearchParams): string {\n return [...params.keys()]\n .sort()\n .map((k) => `${k}=${params.getAll(k)}`)\n .join('&');\n}\n\nexport function makeCacheKey(\n request: HttpRequest<any>,\n mappedRequestUrl: string,\n): StateKey<unknown> {\n // make the params encoded same as a url so it's easy to identify\n const { params, method, responseType } = request;\n const encodedParams = sortAndConcatParams(params);\n\n let serializedBody = request.serializeBody();\n if (serializedBody instanceof URLSearchParams) {\n serializedBody = sortAndConcatParams(serializedBody);\n } else if (typeof serializedBody !== 'string') {\n serializedBody = '';\n }\n\n const key = [\n method,\n responseType,\n mappedRequestUrl,\n serializedBody,\n encodedParams,\n ].join('|');\n\n const hash = generateHash(key);\n\n return makeStateKey(hash);\n}\n\nfunction generateHash(str: string) {\n let hash = 0;\n for (let i = 0, len = str.length; i < len; i++) {\n let chr = str.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return `${hash}`;\n}\n","import { TransferState, inject, makeStateKey } from '@angular/core';\nimport {\n HttpHandlerFn,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n} from '@angular/common/http';\n\nimport { from, of } from 'rxjs';\n\nimport { injectBaseURL, injectAPIPrefix } from '@analogjs/router/tokens';\n\nimport { makeCacheKey } from './cache-key';\n\n/**\n * Interceptor that is server-aware when making HttpClient requests.\n * Server-side requests use the full URL\n * Prerendering uses the internal Nitro $fetch function, along with state transfer\n * Client-side requests use the window.location.origin\n *\n * @param req HttpRequest<unknown>\n * @param next HttpHandlerFn\n * @returns\n */\nexport function requestContextInterceptor(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn,\n) {\n const apiPrefix = injectAPIPrefix();\n const baseUrl = injectBaseURL();\n const transferState = inject(TransferState);\n\n // during prerendering with Nitro\n if (\n typeof global !== 'undefined' &&\n global.$fetch &&\n baseUrl &&\n (req.url.startsWith('/') ||\n req.url.startsWith(baseUrl) ||\n req.url.startsWith(`/${apiPrefix}`))\n ) {\n const requestUrl = new URL(req.url, baseUrl);\n const cacheKey = makeCacheKey(req, new URL(requestUrl).pathname);\n const storeKey = makeStateKey<unknown>(`analog_${cacheKey}`);\n const fetchUrl = requestUrl.pathname;\n\n const responseType =\n req.responseType === 'arraybuffer' ? 'arrayBuffer' : req.responseType;\n\n return from(\n global.$fetch\n .raw(fetchUrl, {\n method: req.method as any,\n body: req.body ? req.body : undefined,\n params: requestUrl.searchParams,\n responseType,\n headers: req.headers.keys().reduce((hdrs, current) => {\n return {\n ...hdrs,\n [current]: req.headers.get(current),\n };\n }, {}),\n })\n .then((res) => {\n const cacheResponse = {\n body: res._data,\n headers: new HttpHeaders(res.headers),\n status: 200,\n statusText: 'OK',\n url: fetchUrl,\n };\n const transferResponse = new HttpResponse(cacheResponse);\n\n transferState.set(storeKey, cacheResponse);\n return transferResponse;\n }),\n );\n }\n\n // on the client\n if (\n !import.meta.env.SSR &&\n (req.url.startsWith('/') || req.url.includes('/_analog/'))\n ) {\n // /_analog/ requests are full URLs\n const requestUrl = req.url.includes('/_analog/')\n ? req.url\n : `${window.location.origin}${req.url}`;\n const cacheKey = makeCacheKey(req, new URL(requestUrl).pathname);\n const storeKey = makeStateKey<unknown>(`analog_${cacheKey}`);\n const cacheRestoreResponse = transferState.get(storeKey, null);\n\n if (cacheRestoreResponse) {\n transferState.remove(storeKey);\n return of(new HttpResponse(cacheRestoreResponse));\n }\n\n return next(\n req.clone({\n url: requestUrl,\n }),\n );\n }\n\n // on the server\n if (baseUrl && (req.url.startsWith('/') || req.url.startsWith(baseUrl))) {\n const requestUrl =\n req.url.startsWith(baseUrl) && !req.url.startsWith('/')\n ? req.url\n : `${baseUrl}${req.url}`;\n\n return next(\n req.clone({\n url: requestUrl,\n }),\n );\n }\n\n return next(req);\n}\n","import { Directive, inject, input, output } from '@angular/core';\nimport { ActivatedRoute, Params, Router } from '@angular/router';\n\nimport { injectRouteEndpointURL } from './inject-route-endpoint-url';\n\n@Directive({\n selector: 'form[action],form[method]',\n host: {\n '(submit)': `submitted($event)`,\n },\n standalone: true,\n})\nexport class FormAction {\n action = input<string>('');\n onSuccess = output<unknown>();\n onError = output<unknown>();\n state = output<\n 'submitting' | 'error' | 'redirect' | 'success' | 'navigate'\n >();\n private router = inject(Router);\n private route = inject(ActivatedRoute);\n private path = this._getPath();\n\n submitted($event: { target: HTMLFormElement } & Event) {\n $event.preventDefault();\n\n this.state.emit('submitting');\n const body = new FormData($event.target);\n\n if ($event.target.method.toUpperCase() === 'GET') {\n this._handleGet(body, this.router.url);\n } else {\n this._handlePost(body, this.path, $event);\n }\n }\n\n private _handleGet(body: FormData, path: string) {\n const params: Params = {};\n body.forEach((formVal, formKey) => (params[formKey] = formVal));\n\n this.state.emit('navigate');\n const url = path.split('?')[0];\n this.router.navigate([url], {\n queryParams: params,\n onSameUrlNavigation: 'reload',\n });\n }\n\n private _handlePost(\n body: FormData,\n path: string,\n $event: { target: HTMLFormElement } & Event,\n ) {\n fetch(path, {\n method: $event.target.method,\n body,\n })\n .then((res) => {\n if (res.ok) {\n if (res.redirected) {\n const redirectUrl = new URL(res.url).pathname;\n this.state.emit('redirect');\n this.router.navigate([redirectUrl]);\n } else if (this._isJSON(res.headers.get('Content-type'))) {\n res.json().then((result) => {\n this.onSuccess.emit(result);\n this.state.emit('success');\n });\n } else {\n res.text().then((result) => {\n this.onSuccess.emit(result);\n this.state.emit('success');\n });\n }\n } else {\n if (res.headers.get('X-Analog-Errors')) {\n res.json().then((errors: unknown) => {\n this.onError.emit(errors);\n this.state.emit('error');\n });\n } else {\n this.state.emit('error');\n }\n }\n })\n .catch((_) => {\n this.state.emit('error');\n });\n }\n\n private _getPath() {\n if (this.route) {\n return injectRouteEndpointURL(this.route.snapshot).pathname;\n }\n\n return `/api/_analog/pages${window.location.pathname}`;\n }\n\n private _isJSON(contentType: string | null): boolean {\n const mime = contentType ? contentType.split(';') : [];\n const essence = mime[0];\n\n return essence === 'application/json';\n }\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport { Route } from '@angular/router';\n\nimport {\n ANALOG_CONTENT_ROUTE_FILES,\n ANALOG_ROUTE_FILES,\n createRoutes,\n} from '../routes';\n\nexport const DEBUG_ROUTES = new InjectionToken(\n '@analogjs/router debug routes',\n {\n providedIn: 'root',\n factory() {\n const debugRoutes = createRoutes(\n {\n ...ANALOG_ROUTE_FILES,\n ...ANALOG_CONTENT_ROUTE_FILES,\n },\n true,\n );\n\n return debugRoutes as (Route & DebugRoute)[];\n },\n },\n);\n\nexport type DebugRoute = {\n path: string;\n filename: string;\n isLayout: boolean;\n children?: DebugRoute[];\n};\n\nexport function injectDebugRoutes() {\n return inject(DEBUG_ROUTES);\n}\n","import { ROUTES } from '@angular/router';\n\n/**\n * Provides routes that provide additional\n * pages for displaying and debugging\n * routes.\n */\nexport function withDebugRoutes() {\n const routes = [\n {\n path: '__analog/routes',\n loadComponent: () => import('./debug.page'),\n },\n ];\n\n return {\n ɵkind: 101 as number,\n ɵproviders: [{ provide: ROUTES, useValue: routes, multi: true }],\n };\n}\n","import {\n HttpClient,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n} from '@angular/common/http';\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n input,\n makeStateKey,\n output,\n signal,\n TransferState,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ActivatedRoute } from '@angular/router';\nimport { injectBaseURL } from '@analogjs/router/tokens';\nimport { catchError, map, of, throwError } from 'rxjs';\n\nimport { makeCacheKey } from './cache-key';\n\ntype ServerProps = Record<string, any>;\ntype ServerOutputs = Record<string, any>;\n\n/**\n * @description\n * Component that defines the bridge between the client and server-only\n * components. The component passes the component ID and props to the server\n * and retrieves the rendered HTML and outputs from the server-only component.\n *\n * Status: experimental\n */\n@Component({\n selector: 'server-only,ServerOnly,Server',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: ` <div [innerHTML]=\"content()\"></div> `,\n})\nexport class ServerOnly {\n component = input.required<string>();\n props = input<ServerProps>();\n outputs = output<ServerOutputs>();\n private http = inject(HttpClient);\n private sanitizer = inject(DomSanitizer);\n protected content = signal<SafeHtml>('');\n private route = inject(ActivatedRoute, { optional: true });\n private baseURL = injectBaseURL();\n private transferState = inject(TransferState);\n\n constructor() {\n effect(() => {\n const routeComponentId: string | undefined =\n this.route?.snapshot.data['component'];\n const props = this.props() || {};\n const componentId = routeComponentId || this.component();\n\n const headers = new HttpHeaders(\n new Headers({\n 'Content-type': 'application/json',\n 'X-Analog-Component': componentId,\n }),\n );\n\n const componentUrl = this.getComponentUrl(componentId);\n const httpRequest = new HttpRequest('POST', componentUrl, props, {\n headers,\n });\n const cacheKey = makeCacheKey(\n httpRequest,\n new URL(componentUrl).pathname,\n );\n const storeKey = makeStateKey<{ html: string; outputs: ServerOutputs }>(\n cacheKey,\n );\n const componentState = this.transferState.get<{\n html: string;\n outputs: ServerOutputs;\n } | null>(storeKey, null);\n\n if (componentState) {\n this.updateContent(componentState);\n this.transferState.remove(storeKey);\n } else {\n this.http\n .request(httpRequest)\n .pipe(\n map((response) => {\n if (response instanceof HttpResponse) {\n if (import.meta.env.SSR) {\n this.transferState.set(storeKey, response.body);\n }\n\n return response.body as {\n html: string;\n outputs: ServerOutputs;\n };\n }\n return throwError(\n () => ({}) as { html: string; outputs: ServerOutputs },\n );\n }),\n catchError((error: unknown) => {\n console.log(error);\n return of({\n html: '',\n outputs: {} as ServerOutputs,\n });\n }),\n )\n .subscribe((content) =>\n this.updateContent(\n content as { html: string; outputs: ServerOutputs },\n ),\n );\n }\n });\n }\n\n updateContent(content: { html: string; outputs: ServerOutputs }) {\n this.content.set(this.sanitizer.bypassSecurityTrustHtml(content.html));\n this.outputs.emit(content.outputs);\n }\n\n getComponentUrl(componentId: string) {\n let baseURL = this.baseURL;\n\n if (!baseURL && typeof window !== 'undefined') {\n baseURL = window.location.origin;\n }\n\n return `${baseURL}/_analog/components/${componentId}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n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} from './lib/inject-route-endpoint-url';
|
|
|
13
13
|
export { FormAction } from './lib/form-action.directive';
|
|
14
14
|
export { injectDebugRoutes } from './lib/debug/routes';
|
|
15
15
|
export { withDebugRoutes } from './lib/debug';
|
|
16
|
+
export { ServerOnly } from './lib/server.component';
|
|
@@ -13,6 +13,7 @@ export declare class FormAction {
|
|
|
13
13
|
private _handleGet;
|
|
14
14
|
private _handlePost;
|
|
15
15
|
private _getPath;
|
|
16
|
+
private _isJSON;
|
|
16
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormAction, never>;
|
|
17
18
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FormAction, "form[action],form[method]", never, { "action": { "alias": "action"; "required": false; "isSignal": true; }; }, { "onSuccess": "onSuccess"; "onError": "onError"; "state": "state"; }, never, never, true, never>;
|
|
18
19
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
type ServerProps = Record<string, any>;
|
|
4
|
+
type ServerOutputs = Record<string, any>;
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* Component that defines the bridge between the client and server-only
|
|
8
|
+
* components. The component passes the component ID and props to the server
|
|
9
|
+
* and retrieves the rendered HTML and outputs from the server-only component.
|
|
10
|
+
*
|
|
11
|
+
* Status: experimental
|
|
12
|
+
*/
|
|
13
|
+
export declare class ServerOnly {
|
|
14
|
+
component: import("@angular/core").InputSignal<string>;
|
|
15
|
+
props: import("@angular/core").InputSignal<ServerProps | undefined>;
|
|
16
|
+
outputs: import("@angular/core").OutputEmitterRef<ServerOutputs>;
|
|
17
|
+
private http;
|
|
18
|
+
private sanitizer;
|
|
19
|
+
protected content: import("@angular/core").WritableSignal<SafeHtml>;
|
|
20
|
+
private route;
|
|
21
|
+
private baseURL;
|
|
22
|
+
private transferState;
|
|
23
|
+
constructor();
|
|
24
|
+
updateContent(content: {
|
|
25
|
+
html: string;
|
|
26
|
+
outputs: ServerOutputs;
|
|
27
|
+
}): void;
|
|
28
|
+
getComponentUrl(componentId: string): string;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ServerOnly, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ServerOnly, "server-only,ServerOnly,Server", never, { "component": { "alias": "component"; "required": true; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; }, { "outputs": "outputs"; }, never, never, true, never>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@analogjs/router",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.11",
|
|
4
4
|
"description": "Filesystem-based routing for Angular",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/sponsors/brandonroberts"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@analogjs/content": "^2.0.0-alpha.
|
|
27
|
+
"@analogjs/content": "^2.0.0-alpha.11",
|
|
28
28
|
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
29
29
|
"@angular/router": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
30
30
|
},
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@analogjs/platform",
|
|
37
37
|
"@analogjs/content",
|
|
38
38
|
"@analogjs/router",
|
|
39
|
+
"@analogjs/storybook-angular",
|
|
39
40
|
"@analogjs/vite-plugin-angular",
|
|
40
41
|
"@analogjs/vite-plugin-nitro",
|
|
41
42
|
"@analogjs/vitest-angular"
|
package/server/index.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ApplicationConfig, Provider, Type } from '@angular/core';
|
|
2
|
+
import type { ServerContext } from '@analogjs/router/tokens';
|
|
3
|
+
/**
|
|
4
|
+
* Returns a function that accepts the navigation URL,
|
|
5
|
+
* the root HTML, and server context.
|
|
6
|
+
*
|
|
7
|
+
* @param rootComponent
|
|
8
|
+
* @param config
|
|
9
|
+
* @param platformProviders
|
|
10
|
+
* @returns Promise<string | Reponse>
|
|
11
|
+
*/
|
|
12
|
+
export declare function render(rootComponent: Type<unknown>, config: ApplicationConfig, platformProviders?: Provider[]): (url: string, document: string, serverContext: ServerContext) => Promise<string | Response>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ApplicationConfig } from '@angular/core';
|
|
2
|
+
import { ServerContext } from '@analogjs/router/tokens';
|
|
3
|
+
export declare function serverComponentRequest(serverContext: ServerContext): string | undefined;
|
|
4
|
+
export declare function renderServerComponent(url: string, serverContext: ServerContext, config?: ApplicationConfig): Promise<Response>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
2
|
+
export declare const STATIC_PROPS: InjectionToken<Record<string, any>>;
|
|
3
|
+
export declare function provideStaticProps<T = Record<string, any>>(props: T): Provider;
|
|
4
|
+
export declare function injectStaticProps(): Record<string, any>;
|
|
5
|
+
export declare function injectStaticOutputs<T>(): {
|
|
6
|
+
set(data: T): void;
|
|
7
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-router-debug.page-D4X8Jhux.mjs","sources":["../../../../packages/router/src/lib/debug/debug.page.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\nimport { injectDebugRoutes, DebugRoute } from './routes';\n\ntype CollectedRoute = {\n path: string;\n filename: string;\n file: string;\n isLayout: boolean;\n};\n\n@Component({\n selector: 'analogjs-debug-routes-page',\n standalone: true,\n template: `\n <h2>Routes</h2>\n\n <div class=\"table-container\">\n <div class=\"table-header\">\n <div class=\"header-cell\">Route Path</div>\n <div class=\"header-cell\">File</div>\n <div class=\"header-cell\">Type</div>\n </div>\n <div class=\"table-body\">\n @for(collectedRoute of collectedRoutes; track collectedRoute.filename) {\n <div class=\"table-row\">\n <div class=\"table-cell\">{{ collectedRoute.path }}</div>\n <div class=\"table-cell\" [title]=\"collectedRoute.filename\">\n {{ collectedRoute.file }}\n </div>\n <div class=\"table-cell\">\n {{ collectedRoute.isLayout ? 'Layout' : 'Page' }}\n </div>\n </div>\n }\n </div>\n </div>\n `,\n styles: `\n :host {\n width: 100%;\n }\n\n .table-container {\n width: 100%;\n max-width: 900px;\n margin: 0 auto;\n background: white;\n border-radius: 8px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n }\n\n .table-header {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n background: gray;\n border-bottom: 2px solid #e5e7eb;\n }\n\n .header-cell {\n padding: 16px 24px;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 14px;\n letter-spacing: 0.05em;\n color: white;\n }\n\n .table-body {\n display: flex;\n flex-direction: column;\n }\n\n .table-row {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n border-bottom: 1px solid #e5e7eb;\n transition: background-color 0.2s ease;\n }\n\n .table-row:last-child {\n border-bottom: none;\n }\n\n .table-row:hover {\n background-color: #f9fafb;\n }\n\n .table-cell {\n padding: 16px 24px;\n font-size: 16px;\n color: #4b5563;\n }\n\n @media (max-width: 640px) {\n .table-container {\n border-radius: 0;\n margin: 0;\n }\n\n .header-cell,\n .table-cell {\n padding: 12px 16px;\n }\n }\n `,\n})\nexport default class DebugRoutesComponent {\n collectedRoutes: CollectedRoute[] = [];\n debugRoutes = injectDebugRoutes();\n\n ngOnInit() {\n this.traverseRoutes(this.debugRoutes);\n }\n\n traverseRoutes(routes: DebugRoute[], parent?: string) {\n routes.forEach((route) => {\n this.collectedRoutes.push({\n path: route.isLayout\n ? `${parent ? `/${parent}` : ''}${route.path ? `/${route.path}` : ''}`\n : `${parent ? `/${parent}` : ''}${\n route.path ? `/${route.path}` : '/'\n }`,\n filename: route.filename,\n file: route.filename?.replace(/(^.*)pages\\//, '') || '',\n isLayout: route.isLayout,\n });\n\n if (route.children) {\n this.traverseRoutes(route.children, route.path || '');\n }\n });\n }\n}\n"],"names":[],"mappings":";;;;AA4Gc,MAAO,oBAAoB,CAAA;AAjGzC,IAAA,WAAA,GAAA;QAkGE,IAAe,CAAA,eAAA,GAAqB,EAAE;QACtC,IAAW,CAAA,WAAA,GAAG,iBAAiB,EAAE;AAwBlC;IAtBC,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC;;IAGvC,cAAc,CAAC,MAAoB,EAAE,MAAe,EAAA;AAClD,QAAA,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACvB,YAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;gBACxB,IAAI,EAAE,KAAK,CAAC;AACV,sBAAE,CAAA,EAAG,MAAM,GAAG,CAAI,CAAA,EAAA,MAAM,CAAE,CAAA,GAAG,EAAE,CAAA,EAAG,KAAK,CAAC,IAAI,GAAG,CAAI,CAAA,EAAA,KAAK,CAAC,IAAI,CAAE,CAAA,GAAG,EAAE,CAAE;AACtE,sBAAE,CAAA,EAAG,MAAM,GAAG,CAAI,CAAA,EAAA,MAAM,CAAE,CAAA,GAAG,EAAE,CAAA,EAC3B,KAAK,CAAC,IAAI,GAAG,CAAI,CAAA,EAAA,KAAK,CAAC,IAAI,CAAE,CAAA,GAAG,GAClC,CAAE,CAAA;gBACN,QAAQ,EAAE,KAAK,CAAC,QAAQ;AACxB,gBAAA,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,IAAI,EAAE;gBACvD,QAAQ,EAAE,KAAK,CAAC,QAAQ;AACzB,aAAA,CAAC;AAEF,YAAA,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,gBAAA,IAAI,CAAC,cAAc,CAAC,K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