@trebired/frontend 6.5.0 → 6.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/server/assets.d.ts +28 -0
  3. package/dist/server/assets.d.ts.map +1 -0
  4. package/dist/server/assets.js +157 -0
  5. package/dist/server/assets.js.map +1 -0
  6. package/dist/server/index.d.ts +4 -0
  7. package/dist/server/index.d.ts.map +1 -1
  8. package/dist/server/index.js +4 -0
  9. package/dist/server/index.js.map +1 -1
  10. package/dist/server/locale.d.ts +22 -0
  11. package/dist/server/locale.d.ts.map +1 -0
  12. package/dist/server/locale.js +74 -0
  13. package/dist/server/locale.js.map +1 -0
  14. package/dist/server/page-task.d.ts +36 -0
  15. package/dist/server/page-task.d.ts.map +1 -0
  16. package/dist/server/page-task.js +91 -0
  17. package/dist/server/page-task.js.map +1 -0
  18. package/dist/server/react/document.d.ts +29 -0
  19. package/dist/server/react/document.d.ts.map +1 -0
  20. package/dist/server/react/document.js +123 -0
  21. package/dist/server/react/document.js.map +1 -0
  22. package/dist/server/react/render.d.ts +15 -0
  23. package/dist/server/react/render.d.ts.map +1 -0
  24. package/dist/server/react/render.js +60 -0
  25. package/dist/server/react/render.js.map +1 -0
  26. package/dist/server/react/shell.d.ts +7 -0
  27. package/dist/server/react/shell.d.ts.map +1 -0
  28. package/dist/server/react/shell.js +49 -0
  29. package/dist/server/react/shell.js.map +1 -0
  30. package/dist/server/react/types.d.ts +71 -0
  31. package/dist/server/react/types.d.ts.map +1 -0
  32. package/dist/server/react/types.js +2 -0
  33. package/dist/server/react/types.js.map +1 -0
  34. package/dist/src/server/assets.d.ts +28 -0
  35. package/dist/src/server/assets.d.ts.map +1 -0
  36. package/dist/src/server/assets.js +157 -0
  37. package/dist/src/server/assets.js.map +1 -0
  38. package/dist/src/server/index.d.ts +4 -0
  39. package/dist/src/server/index.d.ts.map +1 -1
  40. package/dist/src/server/index.js +4 -0
  41. package/dist/src/server/index.js.map +1 -1
  42. package/dist/src/server/locale.d.ts +22 -0
  43. package/dist/src/server/locale.d.ts.map +1 -0
  44. package/dist/src/server/locale.js +74 -0
  45. package/dist/src/server/locale.js.map +1 -0
  46. package/dist/src/server/page-task.d.ts +36 -0
  47. package/dist/src/server/page-task.d.ts.map +1 -0
  48. package/dist/src/server/page-task.js +91 -0
  49. package/dist/src/server/page-task.js.map +1 -0
  50. package/dist/src/server/react/document.d.ts +29 -0
  51. package/dist/src/server/react/document.d.ts.map +1 -0
  52. package/dist/src/server/react/document.js +123 -0
  53. package/dist/src/server/react/document.js.map +1 -0
  54. package/dist/src/server/react/render.d.ts +15 -0
  55. package/dist/src/server/react/render.d.ts.map +1 -0
  56. package/dist/src/server/react/render.js +60 -0
  57. package/dist/src/server/react/render.js.map +1 -0
  58. package/dist/src/server/react/shell.d.ts +7 -0
  59. package/dist/src/server/react/shell.d.ts.map +1 -0
  60. package/dist/src/server/react/shell.js +49 -0
  61. package/dist/src/server/react/shell.js.map +1 -0
  62. package/dist/src/server/react/types.d.ts +71 -0
  63. package/dist/src/server/react/types.d.ts.map +1 -0
  64. package/dist/src/server/react/types.js +2 -0
  65. package/dist/src/server/react/types.js.map +1 -0
  66. package/package.json +1 -1
@@ -0,0 +1,123 @@
1
+ import { escapeHtml, toText } from "../../components/index.js";
2
+ import { serverObject, } from "../http.js";
3
+ import { buildReactRenderShell } from "./shell.js";
4
+ function defaultNormalizePageId(pageId) {
5
+ const normalized = toText(pageId)
6
+ .replace(/\\/g, "/")
7
+ .replace(/^\/+|\/+$/g, "");
8
+ if (!normalized)
9
+ return "";
10
+ const parts = normalized.split("/").filter(Boolean);
11
+ for (const part of parts) {
12
+ if (!part || part === "." || part === "..") {
13
+ throw new Error(`Invalid React page id: ${toText(pageId)}`);
14
+ }
15
+ }
16
+ return parts.join("/");
17
+ }
18
+ function applyScriptNonce(html, nonce) {
19
+ const nextNonce = toText(nonce);
20
+ if (!nextNonce)
21
+ return String(html || "");
22
+ const escaped = escapeHtml(nextNonce);
23
+ return String(html || "").replace(/<script\b(?![^>]*\bnonce\s*=)([^>]*)>/gi, (_match, attrs) => `<script nonce="${escaped}"${String(attrs || "")}>`);
24
+ }
25
+ function countHtmlTags(html, tagName) {
26
+ const normalizedTag = toText(tagName).toLowerCase();
27
+ if (!normalizedTag)
28
+ return 0;
29
+ return String(html || "").match(new RegExp(`<${normalizedTag}\\b`, "gi"))?.length || 0;
30
+ }
31
+ function readResponseRequestRoute(res) {
32
+ const request = res?.req || null;
33
+ return toText(request?.originalUrl || request?.url || request?.path, "/");
34
+ }
35
+ function documentEntries(pageId, componentId, normalizePageId) {
36
+ const normalizedPageId = normalizePageId(pageId);
37
+ const normalizedComponentId = normalizePageId(componentId);
38
+ return {
39
+ componentId: normalizedComponentId,
40
+ entryIds: normalizedComponentId !== normalizedPageId
41
+ ? [normalizedPageId, normalizedComponentId]
42
+ : [normalizedPageId],
43
+ pageId: normalizedPageId,
44
+ };
45
+ }
46
+ function fallbackPageTitle(pageId) {
47
+ return (pageId
48
+ .split("/")
49
+ .filter(Boolean)
50
+ .pop()
51
+ ?.replace(/[-_]+/g, " ") || "Page");
52
+ }
53
+ function pageTitleForContext(context, options) {
54
+ return (toText(context.seo.title) ||
55
+ toText(options.resolvePageTitle?.(context)) ||
56
+ fallbackPageTitle(context.pageId));
57
+ }
58
+ function buildDocumentContext(res, pageId, componentId, props, options, shellInput) {
59
+ const normalize = options.normalizePageId || defaultNormalizePageId;
60
+ const entries = documentEntries(pageId, componentId, normalize);
61
+ const shell = buildReactRenderShell(res, props, options, shellInput);
62
+ const links = options.buildAssetLinks(entries.entryIds);
63
+ const context = {
64
+ ...entries,
65
+ currentUrl: readResponseRequestRoute(res),
66
+ cssLinks: toText(links.cssLinks),
67
+ fontPreloadLinks: toText(links.fontPreloadLinks),
68
+ jsLinks: toText(links.jsLinks),
69
+ locale: serverObject(shell.locale),
70
+ pageTitle: "",
71
+ security: serverObject(shell.security),
72
+ seo: serverObject(shell.seo),
73
+ shell,
74
+ ui: serverObject(shell.ui),
75
+ };
76
+ context.pageTitle = pageTitleForContext(context, options);
77
+ return context;
78
+ }
79
+ function documentTitleForContext(context, options) {
80
+ return toText(options.resolveTitle?.(context), context.pageTitle);
81
+ }
82
+ function faviconHrefForContext(context, options) {
83
+ return typeof options.faviconHref === "function"
84
+ ? options.faviconHref(context)
85
+ : toText(options.faviconHref, "/favicon.svg");
86
+ }
87
+ function rootDocumentProps(body, context, options) {
88
+ return {
89
+ body,
90
+ cssLinks: context.cssLinks,
91
+ csrfToken: toText(context.security.csrfToken),
92
+ currentUrl: context.currentUrl,
93
+ faviconHref: faviconHrefForContext(context, options),
94
+ fontPreloadLinks: context.fontPreloadLinks,
95
+ jsLinks: context.jsLinks,
96
+ lang: toText(context.shell.lang || context.locale.effective, options.defaultLang || "en"),
97
+ nonce: toText(context.shell.nonce),
98
+ pageId: context.pageId,
99
+ pageTitle: context.pageTitle,
100
+ seo: context.seo,
101
+ shell: context.shell,
102
+ theme: toText(context.shell.theme),
103
+ themeKey: toText(context.shell.theme || context.ui.theme, options.defaultTheme || "dark"),
104
+ title: documentTitleForContext(context, options),
105
+ viewerId: toText(context.shell.viewer?.id),
106
+ };
107
+ }
108
+ function logDocumentStart(context, res, options) {
109
+ options.log?.info?.("rendering react document", {
110
+ component_id: context.componentId,
111
+ css_link_count: countHtmlTags(context.cssLinks, "link"),
112
+ js_link_count: countHtmlTags(context.jsLinks, "script"),
113
+ locale: toText(context.locale.effective),
114
+ method: toText(res?.req?.method),
115
+ page_id: context.pageId,
116
+ route: context.currentUrl,
117
+ status: Number(res?.statusCode) || 200,
118
+ theme: toText(context.shell.theme || context.ui.theme),
119
+ viewer_id: toText(context.shell.viewer?.id),
120
+ });
121
+ }
122
+ export { applyScriptNonce, buildDocumentContext, countHtmlTags, defaultNormalizePageId, logDocumentStart, readResponseRequestRoute, rootDocumentProps, };
123
+ //# sourceMappingURL=document.js.map
@@ -0,0 +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from "./document.d.ts";
2
+ import { buildReactRenderShell } from "./shell.d.ts";
3
+ import type { FrontendReactRendererOptions, FrontendRenderShell, RenderReactPageOptions } from "./types.d.ts";
4
+ import type { ServerResponseLike } from "../http.d.ts";
5
+ declare function sendDocument(res: ServerResponseLike, pageId: string, body: unknown, componentId: string, props: Record<string, unknown>, options: FrontendReactRendererOptions, shellInput?: FrontendRenderShell): unknown;
6
+ declare function renderPage(res: ServerResponseLike, pageId: string, propsInput: Record<string, unknown>, options: FrontendReactRendererOptions, renderOptions?: RenderReactPageOptions): unknown;
7
+ declare function createFrontendReactRenderer(options: FrontendReactRendererOptions): {
8
+ buildShell: typeof buildReactRenderShell;
9
+ renderFragment: (component: any, props: Record<string, unknown>) => string;
10
+ renderPage: (res: ServerResponseLike, pageId: string, props: Record<string, unknown>, renderOptions?: RenderReactPageOptions) => unknown;
11
+ sendDocument: (res: ServerResponseLike, pageId: string, body: unknown, componentId: string, props: Record<string, unknown>, shellInput?: FrontendRenderShell) => unknown;
12
+ };
13
+ export { buildReactRenderShell, createFrontendReactRenderer, defaultNormalizePageId, renderPage as renderFrontendReactPage, sendDocument as sendFrontendReactDocument, };
14
+ export type { FrontendAssetLinkSet, FrontendDocumentContext, FrontendReactRendererOptions, FrontendRenderShell, RenderReactPageOptions, } from "./types.d.ts";
15
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/server/react/render.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,sBAAsB,EAGvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACtB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,4BAA4B,EAC5B,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAsDxD,iBAAS,YAAY,CACnB,GAAG,EAAE,kBAAkB,EACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,EAAE,4BAA4B,EACrC,UAAU,CAAC,EAAE,mBAAmB,WAgBjC;AAED,iBAAS,UAAU,CACjB,GAAG,EAAE,kBAAkB,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,EAAE,4BAA4B,EACrC,aAAa,GAAE,sBAA2B,WAiB3C;AAED,iBAAS,2BAA2B,CAAC,OAAO,EAAE,4BAA4B;;gCAG1C,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;sBAGxD,kBAAkB,UACf,MAAM,SACP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBACf,sBAAsB;wBAGhC,kBAAkB,UACf,MAAM,QACR,OAAO,eACA,MAAM,SACZ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eACjB,mBAAmB;EAGrC;AAED,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,EACtB,UAAU,IAAI,uBAAuB,EACrC,YAAY,IAAI,yBAAyB,GAC1C,CAAC;AACF,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,4BAA4B,EAC5B,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { withIconServerRenderer } from "../../icons/server-context.js";
2
+ import { applyScriptNonce, buildDocumentContext, defaultNormalizePageId, logDocumentStart, rootDocumentProps, } from "./document.js";
3
+ import { buildReactRenderShell, } from "./shell.js";
4
+ function renderWithIcons(render, iconRenderer) {
5
+ return withIconServerRenderer(iconRenderer, render);
6
+ }
7
+ function timedRender(render, options) {
8
+ const startedAt = performance.now();
9
+ try {
10
+ return render();
11
+ }
12
+ finally {
13
+ options.recordRender?.(Math.max(0, performance.now() - startedAt));
14
+ }
15
+ }
16
+ function renderBody(componentId, props, options) {
17
+ return options.createElement(options.resolvePageComponent(componentId), props);
18
+ }
19
+ function renderFragment(component, props, options) {
20
+ if (!options.renderToStaticMarkup) {
21
+ throw new Error("React static markup renderer is not configured.");
22
+ }
23
+ return timedRender(() => renderWithIcons(() => options.renderToStaticMarkup(options.createElement(component, props)), options.createIconRenderer?.()), options);
24
+ }
25
+ function withAutoPageLang(res, propsInput) {
26
+ const props = propsInput && typeof propsInput === "object" ? propsInput : {};
27
+ if ("lang" in props)
28
+ return props;
29
+ const lang = res?.locals && typeof res.locals === "object" ? res.locals.lang : undefined;
30
+ return lang ? { ...props, lang } : props;
31
+ }
32
+ function sendDocument(res, pageId, body, componentId, props, options, shellInput) {
33
+ const context = buildDocumentContext(res, pageId, componentId, props, options, shellInput);
34
+ const root = options.resolveRootDocument();
35
+ logDocumentStart(context, res, options);
36
+ const html = timedRender(() => renderWithIcons(() => options.renderToString(options.createElement(root, rootDocumentProps(body, context, options))), options.createIconRenderer?.()), options);
37
+ if (typeof res.type === "function")
38
+ res.type("html");
39
+ return res.send?.(`<!DOCTYPE html>${applyScriptNonce(html, context.shell.nonce)}`);
40
+ }
41
+ function renderPage(res, pageId, propsInput, options, renderOptions = {}) {
42
+ const normalizePageId = options.normalizePageId || defaultNormalizePageId;
43
+ const normalizedPageId = normalizePageId(pageId);
44
+ const componentId = normalizePageId(renderOptions.componentId || normalizedPageId);
45
+ const props = withAutoPageLang(res, propsInput);
46
+ if (!res.locals || typeof res.locals !== "object")
47
+ res.locals = {};
48
+ res.locals.reactPageProps = props;
49
+ return sendDocument(res, normalizedPageId, renderBody(componentId, props, options), componentId, props, options, renderOptions.shell);
50
+ }
51
+ function createFrontendReactRenderer(options) {
52
+ return {
53
+ buildShell: buildReactRenderShell,
54
+ renderFragment: (component, props) => renderFragment(component, props, options),
55
+ renderPage: (res, pageId, props, renderOptions = {}) => renderPage(res, pageId, props, options, renderOptions),
56
+ sendDocument: (res, pageId, body, componentId, props, shellInput) => sendDocument(res, pageId, body, componentId, props, options, shellInput),
57
+ };
58
+ }
59
+ export { buildReactRenderShell, createFrontendReactRenderer, defaultNormalizePageId, renderPage as renderFrontendReactPage, sendDocument as sendFrontendReactDocument, };
60
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../../../../src/server/react/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAQvB,SAAS,eAAe,CACtB,MAAoB,EACpB,YAAsD;IAEtD,OAAO,sBAAsB,CAAC,YAAmB,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,WAAW,CAAC,MAAoB,EAAE,OAAqC;IAC9E,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IACpC,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC;IAClB,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CACjB,WAAmB,EACnB,KAA8B,EAC9B,OAAqC;IAErC,OAAO,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,cAAc,CACrB,SAAc,EACd,KAA8B,EAC9B,OAAqC;IAErC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;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E,KAAK,EAAE,OAAO,CAAC;QACzC,UAAU,EAAE,CACV,GAAuB,EACvB,MAAc,EACd,KAA8B,EAC9B,gBAAwC,EAAE,EAC1C,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC;QAC3D,YAAY,EAAE,CACZ,GAAuB,EACvB,MAAc,EACd,IAAa,EACb,WAAmB,EACnB,KAA8B,EAC9B,UAAgC,EAChC,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC;KAC9E,CAAC;AACJ,CAAC;AAED,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,EACtB,UAAU,IAAI,uBAAuB,EACrC,YAAY,IAAI,yBAAyB,GAC1C,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type ServerResponseLike } from "../http.d.ts";
2
+ import type { FrontendReactRendererOptions, FrontendRenderShell } from "./types.d.ts";
3
+ declare function objectWithFallback(value: unknown, fallback: unknown): Record<string, unknown>;
4
+ declare function readDefaultUi(options: FrontendReactRendererOptions): Record<string, unknown>;
5
+ declare function buildReactRenderShell(res: ServerResponseLike, props: Record<string, unknown>, options: FrontendReactRendererOptions, shellInput?: FrontendRenderShell): FrontendRenderShell;
6
+ export { buildReactRenderShell, objectWithFallback, readDefaultUi };
7
+ //# sourceMappingURL=shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../../src/server/react/shell.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,4BAA4B,EAC5B,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAEvB,iBAAS,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,2BAG5D;AAED,iBAAS,aAAa,CAAC,OAAO,EAAE,4BAA4B,2BAI3D;AA8BD,iBAAS,qBAAqB,CAC5B,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,EAAE,4BAA4B,EACrC,UAAU,CAAC,EAAE,mBAAmB,GAC/B,mBAAmB,CAqBrB;AAED,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { toText } from "../../components/index.js";
2
+ import { defaultNavigationState, } from "../navigation.js";
3
+ import { serverObject, } from "../http.js";
4
+ function objectWithFallback(value, fallback) {
5
+ const object = serverObject(value);
6
+ return Object.keys(object).length ? object : serverObject(fallback);
7
+ }
8
+ function readDefaultUi(options) {
9
+ return typeof options.defaultUi === "function"
10
+ ? options.defaultUi()
11
+ : options.defaultUi || {};
12
+ }
13
+ function shellPageProps(shellInput, props) {
14
+ return objectWithFallback(shellInput?.pageProps, props);
15
+ }
16
+ function shellSecurity(locals, shellInput, nonce) {
17
+ return objectWithFallback(shellInput?.security, {
18
+ csrfToken: locals.csrfToken ?? null,
19
+ nonce,
20
+ });
21
+ }
22
+ function shellPermissionState(res, options, shellInput) {
23
+ return shellInput?.permissionState && typeof shellInput.permissionState === "object"
24
+ ? shellInput.permissionState
25
+ : options.buildPermissionState?.({ res, shellInput }) || {};
26
+ }
27
+ function buildReactRenderShell(res, props, options, shellInput) {
28
+ const locals = serverObject(res?.locals);
29
+ const nonce = typeof shellInput?.nonce === "string" ? shellInput.nonce : toText(locals.nonce);
30
+ return {
31
+ dev: objectWithFallback(shellInput?.dev, options.dev || {}),
32
+ lang: typeof shellInput?.lang === "string" ? shellInput.lang : toText(locals.lang, options.defaultLang || "en"),
33
+ locale: objectWithFallback(shellInput?.locale, locals.locale),
34
+ navigation: objectWithFallback(shellInput?.navigation, locals.navigation || defaultNavigationState),
35
+ nonce,
36
+ pageProps: shellPageProps(shellInput, props),
37
+ permissionState: shellPermissionState(res, options, shellInput),
38
+ product: objectWithFallback(shellInput?.product, options.product || {}),
39
+ renderMode: objectWithFallback(shellInput?.renderMode, locals.renderMode),
40
+ requirePermission: objectWithFallback(shellInput?.requirePermission, locals.requirePermission),
41
+ security: shellSecurity(locals, shellInput, nonce),
42
+ seo: objectWithFallback(shellInput?.seo, locals.seo),
43
+ theme: typeof shellInput?.theme === "string" ? shellInput.theme : toText(locals.theme),
44
+ ui: objectWithFallback(shellInput?.ui, locals.ui || readDefaultUi(options)),
45
+ viewer: shellInput?.viewer || serverObject(locals.viewer) || null,
46
+ };
47
+ }
48
+ export { buildReactRenderShell, objectWithFallback, readDefaultUi };
49
+ //# sourceMappingURL=shell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.js","sourceRoot":"","sources":["../../../../src/server/react/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EACL,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,GAEb,MAAM,eAAe,CAAC;AAMvB,SAAS,kBAAkB,CAAC,KAAc,EAAE,QAAiB;IAC3D,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,aAAa,CAAC,OAAqC;IAC1D,OAAO,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU;QAC9C,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE;QACrB,CAAC,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED,SAAS,cAAc,CACrB,UAA2C,EAC3C,KAA8B;IAE9B,OAAO,kBAAkB,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,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MAAM,CAAC,UAAU,IAAI,sBAAsB,CAAC;QACnG,KAAK;QACL,SAAS,EAAE,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC;QAC5C,eAAe,EAAE,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC;QAC/D,OAAO,EAAE,kBAAkB,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;QACvE,UAAU,EAAE,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;QACzE,iBAAiB,EAAE,kBAAkB,CAAC,UAAU,EAAE,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,CAAC;QAC9F,QAAQ,EAAE,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC;QAClD,GAAG,EAAE,kBAAkB,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC;QACpD,KAAK,EAAE,OAAO,UAAU,EAAE,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QACtF,EAAE,EAAE,kBAAkB,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;QAC3E,MAAM,EAAE,UAAU,EAAE,MAAM,IAAK,YAAY,CAAC,MAAM,CAAC,MAAM,CAAS,IAAI,IAAI;KAC3E,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { ServerResponseLike } from "../http.d.ts";
2
+ type FrontendRenderShell = {
3
+ dev?: Record<string, unknown>;
4
+ lang?: string;
5
+ locale?: Record<string, unknown>;
6
+ navigation?: Record<string, unknown>;
7
+ nonce?: string;
8
+ pageProps?: Record<string, unknown>;
9
+ permissionState?: Record<string, unknown>;
10
+ requirePermission?: Record<string, unknown>;
11
+ renderMode?: Record<string, unknown>;
12
+ security?: Record<string, unknown>;
13
+ product?: Record<string, unknown>;
14
+ theme?: string;
15
+ ui?: Record<string, unknown>;
16
+ viewer?: Record<string, unknown> | null;
17
+ seo?: Record<string, unknown>;
18
+ };
19
+ type FrontendAssetLinkSet = {
20
+ cssLinks?: string;
21
+ fontPreloadLinks?: string;
22
+ jsLinks?: string;
23
+ };
24
+ type FrontendDocumentContext = {
25
+ componentId: string;
26
+ currentUrl: string;
27
+ cssLinks: string;
28
+ entryIds: string[];
29
+ fontPreloadLinks: string;
30
+ jsLinks: string;
31
+ locale: Record<string, unknown>;
32
+ pageId: string;
33
+ pageTitle: string;
34
+ security: Record<string, unknown>;
35
+ seo: Record<string, unknown>;
36
+ shell: FrontendRenderShell;
37
+ ui: Record<string, unknown>;
38
+ };
39
+ type FrontendReactRendererOptions = {
40
+ buildAssetLinks: (entryIds: string[]) => FrontendAssetLinkSet;
41
+ buildPermissionState?: (context: {
42
+ res: ServerResponseLike;
43
+ shellInput?: FrontendRenderShell;
44
+ }) => Record<string, unknown>;
45
+ createElement: (component: any, props: Record<string, unknown>) => unknown;
46
+ createIconRenderer?: () => ((spec: string) => unknown) | undefined;
47
+ defaultLang?: string;
48
+ defaultTheme?: string;
49
+ defaultUi?: Record<string, unknown> | (() => Record<string, unknown>);
50
+ dev?: Record<string, unknown>;
51
+ faviconHref?: string | ((context: FrontendDocumentContext) => string);
52
+ log?: {
53
+ info?: (message: string, metadata?: Record<string, unknown>) => unknown;
54
+ };
55
+ normalizePageId?: (pageId: unknown) => string;
56
+ product?: Record<string, unknown>;
57
+ recordRender?: (durationMs: number) => unknown;
58
+ renderToStaticMarkup?: (node: unknown) => string;
59
+ renderToString: (node: unknown) => string;
60
+ resolvePageComponent: (pageId: string) => any;
61
+ resolvePageTitle?: (context: FrontendDocumentContext) => string;
62
+ resolveRootDocument: () => any;
63
+ resolveTitle?: (context: FrontendDocumentContext) => string;
64
+ };
65
+ type RenderReactPageOptions = {
66
+ componentId?: string;
67
+ shell?: FrontendRenderShell;
68
+ viewName?: string;
69
+ };
70
+ export type { FrontendAssetLinkSet, FrontendDocumentContext, FrontendReactRendererOptions, FrontendRenderShell, RenderReactPageOptions, };
71
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/server/react/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,KAAK,mBAAmB,GAAG;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAC,IAAI,CAAC;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AK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,4BAA4B,EAC5B,mBAAmB,EACnB,sBAAsB,GACvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/server/react/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { type ServerRequestLike, type ServerResponseLike } from "./http.js";
2
+ type FrontendAsset = {
3
+ body?: Buffer | string;
4
+ contentType?: string;
5
+ etag?: string;
6
+ };
7
+ type FrontendAssetOptions = {
8
+ brotliQuality?: number;
9
+ contentType?: string;
10
+ gzipLevel?: number;
11
+ immutable?: boolean;
12
+ isImmutablePath?: (path: string) => boolean;
13
+ minCompressBytes?: number;
14
+ precompress?: boolean;
15
+ record?: (durationMs: number) => unknown;
16
+ };
17
+ declare function assetBodyBuffer(asset: FrontendAsset | null | undefined): Buffer<ArrayBufferLike>;
18
+ declare function assetContentType(asset: FrontendAsset | null | undefined, fallback?: string): string;
19
+ declare function assetIsCompressible(asset: FrontendAsset | null | undefined, fallback?: string): boolean;
20
+ declare function prepareAsset(asset: FrontendAsset, options?: FrontendAssetOptions): FrontendAsset;
21
+ declare function sendAsset(req: ServerRequestLike, res: ServerResponseLike, asset: FrontendAsset, options?: FrontendAssetOptions): boolean;
22
+ declare function cacheControlForPercent(percent: unknown): {
23
+ immutable: boolean;
24
+ value: string;
25
+ };
26
+ export { assetBodyBuffer, assetContentType, assetIsCompressible, cacheControlForPercent, prepareAsset, sendAsset, };
27
+ export type { FrontendAsset, FrontendAssetOptions };
28
+ //# sourceMappingURL=assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/server/assets.ts"],"names":[],"mappings":"AAEA,OA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,SAAS,GACV,CAAC;AACF,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,157 @@
1
+ import zlib from "node:zlib";
2
+ import { requestHeader, setResponseHeader, } from "./http.js";
3
+ const encodedCache = new WeakMap();
4
+ const preparedAssets = new WeakSet();
5
+ function assetBodyBuffer(asset) {
6
+ const body = asset && asset.body != null ? asset.body : "";
7
+ return Buffer.isBuffer(body) ? body : Buffer.from(String(body), "utf8");
8
+ }
9
+ function assetContentType(asset, fallback = "") {
10
+ return String(asset && asset.contentType ? asset.contentType : fallback);
11
+ }
12
+ function assetIsCompressible(asset, fallback = "") {
13
+ const type = assetContentType(asset, fallback).toLowerCase();
14
+ return (type.includes("text/css") ||
15
+ type.includes("javascript") ||
16
+ type.includes("application/json") ||
17
+ type.includes("text/plain"));
18
+ }
19
+ function cacheEncodedAsset(asset, encoding, encoded, rawLength) {
20
+ if (!encoding || !encoded || encoded.length >= rawLength)
21
+ return;
22
+ const cache = encodedCache.get(asset) || {};
23
+ cache[encoding] = encoded;
24
+ encodedCache.set(asset, cache);
25
+ }
26
+ function boundedInteger(value, fallback, min, max) {
27
+ const parsed = Math.floor(Number(value));
28
+ if (!Number.isFinite(parsed))
29
+ return fallback;
30
+ return Math.max(min, Math.min(max, parsed));
31
+ }
32
+ function prepareBrotliAsset(asset, raw, options) {
33
+ try {
34
+ cacheEncodedAsset(asset, "br", zlib.brotliCompressSync(raw, {
35
+ params: {
36
+ [zlib.constants.BROTLI_PARAM_QUALITY]: boundedInteger(options.brotliQuality, 5, 0, 11),
37
+ [zlib.constants.BROTLI_PARAM_SIZE_HINT]: raw.length,
38
+ },
39
+ }), raw.length);
40
+ }
41
+ catch { }
42
+ }
43
+ function prepareGzipAsset(asset, raw, options) {
44
+ try {
45
+ cacheEncodedAsset(asset, "gzip", zlib.gzipSync(raw, {
46
+ level: boundedInteger(options.gzipLevel, 6, 1, 9),
47
+ }), raw.length);
48
+ }
49
+ catch { }
50
+ }
51
+ function prepareAsset(asset, options = {}) {
52
+ if (!asset || typeof asset !== "object")
53
+ return asset;
54
+ if (preparedAssets.has(asset))
55
+ return asset;
56
+ preparedAssets.add(asset);
57
+ if (options.precompress === false || !assetIsCompressible(asset, options.contentType)) {
58
+ return asset;
59
+ }
60
+ const raw = assetBodyBuffer(asset);
61
+ if (raw.length < Math.max(0, Number(options.minCompressBytes) || 1024)) {
62
+ return asset;
63
+ }
64
+ prepareBrotliAsset(asset, raw, options);
65
+ prepareGzipAsset(asset, raw, options);
66
+ return asset;
67
+ }
68
+ function requestAssetPath(req) {
69
+ return String((req && (req.path || req.originalUrl || req.url)) || "")
70
+ .split("?")[0];
71
+ }
72
+ function isHashedAssetPath(path) {
73
+ return /^\/(?:css|js)\/.+-[a-f0-9]{8,64}\.(?:css|js)$/i.test(path);
74
+ }
75
+ function shouldUseImmutableCache(req, options) {
76
+ if (options.immutable === false)
77
+ return false;
78
+ const path = requestAssetPath(req);
79
+ return options.isImmutablePath ? options.isImmutablePath(path) : isHashedAssetPath(path);
80
+ }
81
+ function applyAssetCacheHeaders(req, res, options) {
82
+ if (shouldUseImmutableCache(req, options)) {
83
+ setResponseHeader(res, "Cache-Control", "public, max-age=31536000, immutable");
84
+ return;
85
+ }
86
+ setResponseHeader(res, "Cache-Control", "no-store, no-cache, must-revalidate, proxy-revalidate");
87
+ setResponseHeader(res, "Pragma", "no-cache");
88
+ setResponseHeader(res, "Expires", "0");
89
+ }
90
+ function preferredAssetEncoding(req) {
91
+ const accept = requestHeader(req, "accept-encoding").toLowerCase();
92
+ if (accept.includes("br"))
93
+ return "br";
94
+ if (accept.includes("gzip"))
95
+ return "gzip";
96
+ return "";
97
+ }
98
+ function encodedAssetBody(asset, encoding) {
99
+ if (!encoding || !assetIsCompressible(asset))
100
+ return null;
101
+ return encodedCache.get(asset)?.[encoding] || null;
102
+ }
103
+ function sendPreparedAssetBody(req, res, asset) {
104
+ const encoding = preferredAssetEncoding(req);
105
+ const encoded = encodedAssetBody(asset, encoding);
106
+ const body = encoded || assetBodyBuffer(asset);
107
+ if (encoded) {
108
+ setResponseHeader(res, "Content-Encoding", encoding);
109
+ setResponseHeader(res, "Vary", "Accept-Encoding");
110
+ }
111
+ setResponseHeader(res, "Content-Length", String(body.length));
112
+ if (typeof res.send === "function")
113
+ return res.send(body);
114
+ return res.end?.(body);
115
+ }
116
+ function sendAsset(req, res, asset, options = {}) {
117
+ const startedAt = performance.now();
118
+ try {
119
+ const etag = asset && typeof asset.etag === "string" ? asset.etag : "";
120
+ if (etag)
121
+ setResponseHeader(res, "ETag", etag);
122
+ if (etag && requestHeader(req, "if-none-match") === etag) {
123
+ if (typeof res.status === "function")
124
+ res.status(304);
125
+ res.end?.();
126
+ return true;
127
+ }
128
+ const type = assetContentType(asset, options.contentType);
129
+ if (type)
130
+ setResponseHeader(res, "Content-Type", type);
131
+ applyAssetCacheHeaders(req, res, options);
132
+ sendPreparedAssetBody(req, res, prepareAsset(asset, options));
133
+ return true;
134
+ }
135
+ finally {
136
+ options.record?.(Math.max(0, performance.now() - startedAt));
137
+ }
138
+ }
139
+ function cacheControlForPercent(percent) {
140
+ const parsed = Number(percent);
141
+ const value = Math.max(0, Math.min(100, Math.floor(Number.isFinite(parsed) ? parsed : 100)));
142
+ if (value === 0)
143
+ return { immutable: false, value: "no-store, must-revalidate" };
144
+ if (value <= 10)
145
+ return { immutable: false, value: "public, max-age=0, must-revalidate" };
146
+ if (value <= 40)
147
+ return { immutable: false, value: "public, max-age=600" };
148
+ if (value <= 70)
149
+ return { immutable: false, value: "public, max-age=3600" };
150
+ if (value <= 90)
151
+ return { immutable: false, value: "public, max-age=86400" };
152
+ if (value < 100)
153
+ return { immutable: false, value: "public, max-age=31536000" };
154
+ return { immutable: true, value: "public, max-age=31536000, immutable" };
155
+ }
156
+ export { assetBodyBuffer, assetContentType, assetIsCompressible, cacheControlForPercent, prepareAsset, sendAsset, };
157
+ //# sourceMappingURL=assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3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AAI,KAAK,IAAI,EAAE;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,oCAAoC,EAAE,CAAC;IAC1F,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC3E,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAC5E,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,uBAAuB,EAAE,CAAC;IAC7E,IAAI,KAAK,GAAG,GAAG;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC;IAChF,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,qCAAqC,EAAE,CAAC;AAC3E,CAAC;AAED,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,SAAS,GACV,CAAC"}
@@ -4,9 +4,13 @@ export * from "../../icons/server-context.d.ts";
4
4
  export * from "../../icons/shared.d.ts";
5
5
  export * from "./favicon.js";
6
6
  export * from "./http.js";
7
+ export * from "./assets.js";
7
8
  export * from "./language.js";
9
+ export * from "./locale.js";
8
10
  export * from "./live.js";
9
11
  export * from "./navigation.js";
12
+ export * from "./page-task.js";
13
+ export * from "../../server/react/render.d.ts";
10
14
  export * from "./render-mode.js";
11
15
  export * from "./security.js";
12
16
  export * from "./seo.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -4,9 +4,13 @@ export * from "../../icons/server-context.js";
4
4
  export * from "../../icons/shared.js";
5
5
  export * from "./favicon.js";
6
6
  export * from "./http.js";
7
+ export * from "./assets.js";
7
8
  export * from "./language.js";
9
+ export * from "./locale.js";
8
10
  export * from "./live.js";
9
11
  export * from "./navigation.js";
12
+ export * from "./page-task.js";
13
+ export * from "../../server/react/render.js";
10
14
  export * from "./render-mode.js";
11
15
  export * from "./security.js";
12
16
  export * from "./seo.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}