@payloadcms/tanstack-start 4.0.0-internal.e7d4ebc → 4.0.0-internal.ea6e8f8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/handleServerFunctions.d.ts.map +1 -0
- package/dist/adapters/handleServerFunctions.js +9 -0
- package/dist/adapters/handleServerFunctions.js.map +1 -0
- package/dist/{layouts/Root/withPayloadRoot.d.ts → adapters/layout/index.d.ts} +29 -4
- package/dist/adapters/layout/index.d.ts.map +1 -0
- package/dist/adapters/layout/index.js +105 -0
- package/dist/adapters/layout/index.js.map +1 -0
- package/dist/adapters/layout/lazy.d.ts +11 -0
- package/dist/adapters/layout/lazy.d.ts.map +1 -0
- package/dist/adapters/layout/lazy.js +23 -0
- package/dist/adapters/layout/lazy.js.map +1 -0
- package/dist/adapters/layout/server.d.ts +29 -0
- package/dist/adapters/layout/server.d.ts.map +1 -0
- package/dist/adapters/layout/server.js +63 -0
- package/dist/adapters/layout/server.js.map +1 -0
- package/dist/{utilities/meta.d.ts → adapters/metadata.d.ts} +10 -1
- package/dist/adapters/metadata.d.ts.map +1 -0
- package/dist/{utilities/meta.js → adapters/metadata.js} +60 -1
- package/dist/adapters/metadata.js.map +1 -0
- package/dist/{elements/RouterAdapter/index.d.ts → adapters/router.d.ts} +1 -1
- package/dist/adapters/router.d.ts.map +1 -0
- package/dist/{elements/RouterAdapter/index.js → adapters/router.js} +26 -4
- package/dist/adapters/router.js.map +1 -0
- package/dist/{utilities/serverAdapter.server.d.ts → adapters/server.d.ts} +1 -1
- package/dist/adapters/server.d.ts.map +1 -0
- package/dist/{utilities/serverAdapter.server.js → adapters/server.js} +1 -1
- package/dist/adapters/server.js.map +1 -0
- package/dist/{routes/adminRoutes.d.ts → adapters/views/index.d.ts} +11 -18
- package/dist/adapters/views/index.d.ts.map +1 -0
- package/dist/{routes/adminRoutes.js → adapters/views/index.js} +33 -58
- package/dist/adapters/views/index.js.map +1 -0
- package/dist/adapters/views/lazy.d.ts +4 -0
- package/dist/adapters/views/lazy.d.ts.map +1 -0
- package/dist/adapters/views/lazy.js +43 -0
- package/dist/adapters/views/lazy.js.map +1 -0
- package/dist/{utilities/loadAdminPage.d.ts → adapters/views/server.d.ts} +9 -6
- package/dist/adapters/views/server.d.ts.map +1 -0
- package/dist/{utilities/loadAdminPage.js → adapters/views/server.js} +15 -86
- package/dist/adapters/views/server.js.map +1 -0
- package/dist/auth/login.d.ts +3 -16
- package/dist/auth/login.d.ts.map +1 -1
- package/dist/auth/login.js +6 -46
- package/dist/auth/login.js.map +1 -1
- package/dist/auth/logout.d.ts +2 -5
- package/dist/auth/logout.d.ts.map +1 -1
- package/dist/auth/logout.js +6 -47
- package/dist/auth/logout.js.map +1 -1
- package/dist/auth/refresh.d.ts +2 -4
- package/dist/auth/refresh.d.ts.map +1 -1
- package/dist/auth/refresh.js +6 -49
- package/dist/auth/refresh.js.map +1 -1
- package/dist/exports/client.d.ts +2 -6
- package/dist/exports/client.d.ts.map +1 -1
- package/dist/exports/client.js +2 -6
- package/dist/exports/client.js.map +1 -1
- package/dist/exports/layouts.d.ts +2 -5
- package/dist/exports/layouts.d.ts.map +1 -1
- package/dist/exports/layouts.js +1 -3
- package/dist/exports/layouts.js.map +1 -1
- package/dist/exports/rsc.browser.d.ts +4 -1
- package/dist/exports/rsc.browser.d.ts.map +1 -1
- package/dist/exports/rsc.browser.js +4 -1
- package/dist/exports/rsc.browser.js.map +1 -1
- package/dist/exports/rsc.d.ts +0 -1
- package/dist/exports/rsc.d.ts.map +1 -1
- package/dist/exports/rsc.js +0 -1
- package/dist/exports/rsc.js.map +1 -1
- package/dist/exports/server.d.ts +8 -11
- package/dist/exports/server.d.ts.map +1 -1
- package/dist/exports/server.js +7 -10
- package/dist/exports/server.js.map +1 -1
- package/dist/{utilities/graphqlHandler.server.d.ts → routes/graphql/handler.server.d.ts} +1 -3
- package/dist/routes/graphql/handler.server.d.ts.map +1 -0
- package/dist/{utilities/graphqlHandler.server.js → routes/graphql/handler.server.js} +9 -6
- package/dist/routes/graphql/handler.server.js.map +1 -0
- package/dist/{utilities/handleAPIRoute.server.d.ts → routes/rest/handler.server.d.ts} +1 -1
- package/dist/routes/rest/handler.server.d.ts.map +1 -0
- package/dist/{utilities/handleAPIRoute.server.js → routes/rest/handler.server.js} +1 -1
- package/dist/routes/rest/handler.server.js.map +1 -0
- package/dist/routes/{apiRoute.d.ts → rest/index.d.ts} +1 -1
- package/dist/routes/rest/index.d.ts.map +1 -0
- package/dist/routes/{apiRoute.js → rest/index.js} +2 -2
- package/dist/routes/rest/index.js.map +1 -0
- package/dist/rsc/CollectionCards.js +1 -1
- package/dist/rsc/CollectionCards.js.map +1 -1
- package/dist/utilities/devConfigReload.server.d.ts +2 -0
- package/dist/utilities/devConfigReload.server.d.ts.map +1 -0
- package/dist/utilities/devConfigReload.server.js +63 -0
- package/dist/utilities/devConfigReload.server.js.map +1 -0
- package/dist/utilities/devConfigReloadEvent.d.ts +9 -0
- package/dist/utilities/devConfigReloadEvent.d.ts.map +1 -0
- package/dist/utilities/devConfigReloadEvent.js +9 -0
- package/dist/utilities/devConfigReloadEvent.js.map +1 -0
- package/dist/utilities/getRequestI18n.server.d.ts +1 -1
- package/dist/utilities/getRequestI18n.server.js +1 -1
- package/dist/utilities/getRequestI18n.server.js.map +1 -1
- package/dist/utilities/initAdminContext.server.d.ts +9 -0
- package/dist/utilities/initAdminContext.server.d.ts.map +1 -0
- package/dist/utilities/initAdminContext.server.js +13 -0
- package/dist/utilities/initAdminContext.server.js.map +1 -0
- package/dist/utilities/serializeForRsc.d.ts.map +1 -1
- package/dist/utilities/serializeForRsc.js +6 -1
- package/dist/utilities/serializeForRsc.js.map +1 -1
- package/dist/utilities/serverFunctionClient.d.ts.map +1 -1
- package/dist/utilities/serverFunctionClient.js +6 -1
- package/dist/utilities/serverFunctionClient.js.map +1 -1
- package/dist/utilities/toSerializable.d.ts +9 -0
- package/dist/utilities/toSerializable.d.ts.map +1 -1
- package/dist/utilities/toSerializable.js +19 -3
- package/dist/utilities/toSerializable.js.map +1 -1
- package/dist/withPayload/config/external.d.ts +16 -8
- package/dist/withPayload/config/external.d.ts.map +1 -1
- package/dist/withPayload/config/external.js +24 -10
- package/dist/withPayload/config/external.js.map +1 -1
- package/dist/withPayload/config/optimizeDeps.d.ts.map +1 -1
- package/dist/withPayload/config/optimizeDeps.js +44 -7
- package/dist/withPayload/config/optimizeDeps.js.map +1 -1
- package/dist/withPayload/devConfigReload.d.ts +14 -0
- package/dist/withPayload/devConfigReload.d.ts.map +1 -0
- package/dist/withPayload/devConfigReload.js +84 -0
- package/dist/withPayload/devConfigReload.js.map +1 -0
- package/dist/withPayload/importProtection.d.ts.map +1 -1
- package/dist/withPayload/importProtection.js +2 -2
- package/dist/withPayload/importProtection.js.map +1 -1
- package/dist/withPayload/index.d.ts +21 -10
- package/dist/withPayload/index.d.ts.map +1 -1
- package/dist/withPayload/index.js +39 -16
- package/dist/withPayload/index.js.map +1 -1
- package/dist/withPayload/workarounds/stripDistStyleImports.js +2 -2
- package/dist/withPayload/workarounds/stripDistStyleImports.js.map +1 -1
- package/package.json +15 -12
- package/dist/elements/DocumentHeaderClient/index.d.ts +0 -16
- package/dist/elements/DocumentHeaderClient/index.d.ts.map +0 -1
- package/dist/elements/DocumentHeaderClient/index.js +0 -116
- package/dist/elements/DocumentHeaderClient/index.js.map +0 -1
- package/dist/elements/RenderComponent/index.d.ts +0 -10
- package/dist/elements/RenderComponent/index.d.ts.map +0 -1
- package/dist/elements/RenderComponent/index.js +0 -12
- package/dist/elements/RenderComponent/index.js.map +0 -1
- package/dist/elements/RouterAdapter/index.d.ts.map +0 -1
- package/dist/elements/RouterAdapter/index.js.map +0 -1
- package/dist/layouts/Root/getLayoutData.d.ts +0 -12
- package/dist/layouts/Root/getLayoutData.d.ts.map +0 -1
- package/dist/layouts/Root/getLayoutData.js +0 -91
- package/dist/layouts/Root/getLayoutData.js.map +0 -1
- package/dist/layouts/Root/index.d.ts +0 -32
- package/dist/layouts/Root/index.d.ts.map +0 -1
- package/dist/layouts/Root/index.js +0 -53
- package/dist/layouts/Root/index.js.map +0 -1
- package/dist/layouts/Root/withPayloadRoot.d.ts.map +0 -1
- package/dist/layouts/Root/withPayloadRoot.js +0 -91
- package/dist/layouts/Root/withPayloadRoot.js.map +0 -1
- package/dist/node/cssLoader.d.mts +0 -25
- package/dist/node/cssLoader.d.mts.map +0 -1
- package/dist/node/cssLoader.js +0 -70
- package/dist/node/cssLoader.js.map +0 -1
- package/dist/node/cssLoader.mjs +0 -75
- package/dist/node/registerCssLoader.d.mts +0 -2
- package/dist/node/registerCssLoader.d.mts.map +0 -1
- package/dist/node/registerCssLoader.js +0 -10
- package/dist/node/registerCssLoader.js.map +0 -1
- package/dist/node/registerCssLoader.mjs +0 -10
- package/dist/routes/adminRoutes.d.ts.map +0 -1
- package/dist/routes/adminRoutes.js.map +0 -1
- package/dist/routes/apiRoute.d.ts.map +0 -1
- package/dist/routes/apiRoute.js.map +0 -1
- package/dist/routes/layoutRoute.d.ts +0 -26
- package/dist/routes/layoutRoute.d.ts.map +0 -1
- package/dist/routes/layoutRoute.js +0 -57
- package/dist/routes/layoutRoute.js.map +0 -1
- package/dist/rsc/renderPayloadRSC.d.ts +0 -6
- package/dist/rsc/renderPayloadRSC.d.ts.map +0 -1
- package/dist/rsc/renderPayloadRSC.js +0 -6
- package/dist/rsc/renderPayloadRSC.js.map +0 -1
- package/dist/utilities/devReloadStrategy.d.ts +0 -10
- package/dist/utilities/devReloadStrategy.d.ts.map +0 -1
- package/dist/utilities/devReloadStrategy.js +0 -27
- package/dist/utilities/devReloadStrategy.js.map +0 -1
- package/dist/utilities/getExistingAuthToken.d.ts +0 -7
- package/dist/utilities/getExistingAuthToken.d.ts.map +0 -1
- package/dist/utilities/getExistingAuthToken.js +0 -18
- package/dist/utilities/getExistingAuthToken.js.map +0 -1
- package/dist/utilities/getPreferences.d.ts +0 -10
- package/dist/utilities/getPreferences.d.ts.map +0 -1
- package/dist/utilities/getPreferences.js +0 -33
- package/dist/utilities/getPreferences.js.map +0 -1
- package/dist/utilities/getRequestLocale.d.ts +0 -7
- package/dist/utilities/getRequestLocale.d.ts.map +0 -1
- package/dist/utilities/getRequestLocale.js +0 -20
- package/dist/utilities/getRequestLocale.js.map +0 -1
- package/dist/utilities/graphqlHandler.server.d.ts.map +0 -1
- package/dist/utilities/graphqlHandler.server.js.map +0 -1
- package/dist/utilities/handleAPIRoute.server.d.ts.map +0 -1
- package/dist/utilities/handleAPIRoute.server.js.map +0 -1
- package/dist/utilities/handleServerFunctions.d.ts.map +0 -1
- package/dist/utilities/handleServerFunctions.js +0 -12
- package/dist/utilities/handleServerFunctions.js.map +0 -1
- package/dist/utilities/importMap.server.d.ts +0 -8
- package/dist/utilities/importMap.server.d.ts.map +0 -1
- package/dist/utilities/importMap.server.js +0 -11
- package/dist/utilities/importMap.server.js.map +0 -1
- package/dist/utilities/initReq.server.d.ts +0 -19
- package/dist/utilities/initReq.server.d.ts.map +0 -1
- package/dist/utilities/initReq.server.js +0 -87
- package/dist/utilities/initReq.server.js.map +0 -1
- package/dist/utilities/loadAdminPage.d.ts.map +0 -1
- package/dist/utilities/loadAdminPage.js.map +0 -1
- package/dist/utilities/loadLayoutData.d.ts +0 -15
- package/dist/utilities/loadLayoutData.d.ts.map +0 -1
- package/dist/utilities/loadLayoutData.js +0 -23
- package/dist/utilities/loadLayoutData.js.map +0 -1
- package/dist/utilities/meta.d.ts.map +0 -1
- package/dist/utilities/meta.js.map +0 -1
- package/dist/utilities/serverAdapter.server.d.ts.map +0 -1
- package/dist/utilities/serverAdapter.server.js.map +0 -1
- package/dist/utilities/setPayloadAuthCookie.d.ts +0 -9
- package/dist/utilities/setPayloadAuthCookie.d.ts.map +0 -1
- package/dist/utilities/setPayloadAuthCookie.js +0 -31
- package/dist/utilities/setPayloadAuthCookie.js.map +0 -1
- /package/dist/{utilities → adapters}/handleServerFunctions.d.ts +0 -0
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { getLanguageDir } from '@payloadcms/ui/utilities/getLanguageDir';
|
|
4
|
-
import { HeadContent, Scripts, useRouterState } from '@tanstack/react-router';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
/**
|
|
7
|
-
* The `<html>` document shell for Payload admin routes — the TanStack Start
|
|
8
|
-
* equivalent of `@payloadcms/next`'s root layout `<html>`. Sets
|
|
9
|
-
* `data-theme`/`lang`/`dir` on `<html>` from the server-computed layout data
|
|
10
|
-
* (`getLayoutData`, exposed on the `/_payload` route loader), so the admin
|
|
11
|
-
* panel renders themed with the correct text direction on the first paint with no
|
|
12
|
-
* client bootstrap script — the same server-side path Next's `RootLayout`
|
|
13
|
-
* uses, sharing `getRequestTheme`/`getLanguageDir` from `@payloadcms/ui`.
|
|
14
|
-
*/ export function PayloadAdminShell({ children }) {
|
|
15
|
-
const htmlProps = useRouterState({
|
|
16
|
-
select: (state)=>{
|
|
17
|
-
for (const match of state.matches){
|
|
18
|
-
const data = match.loaderData;
|
|
19
|
-
if (data?.theme && data?.languageCode) {
|
|
20
|
-
return {
|
|
21
|
-
'data-theme': data.theme,
|
|
22
|
-
dir: getLanguageDir({
|
|
23
|
-
languageCode: data.languageCode
|
|
24
|
-
}),
|
|
25
|
-
lang: data.languageCode
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
// No layout data yet (fresh session before the loader resolves): default
|
|
30
|
-
// to `ltr` so the `[dir='ltr']`-scoped admin layout rules (e.g. the
|
|
31
|
-
// document sidebar divider) still match, matching Next's `ltr` default.
|
|
32
|
-
return {
|
|
33
|
-
dir: 'ltr'
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return(// eslint-disable-next-line jsx-a11y/html-has-lang -- `lang` is set from server-computed layout data when available
|
|
38
|
-
/*#__PURE__*/ _jsxs("html", {
|
|
39
|
-
...htmlProps,
|
|
40
|
-
suppressHydrationWarning: true,
|
|
41
|
-
children: [
|
|
42
|
-
/*#__PURE__*/ _jsxs("head", {
|
|
43
|
-
children: [
|
|
44
|
-
/*#__PURE__*/ _jsx("style", {
|
|
45
|
-
children: `@layer payload-default, payload;`
|
|
46
|
-
}),
|
|
47
|
-
/*#__PURE__*/ _jsx(HeadContent, {})
|
|
48
|
-
]
|
|
49
|
-
}),
|
|
50
|
-
/*#__PURE__*/ _jsxs("body", {
|
|
51
|
-
children: [
|
|
52
|
-
children,
|
|
53
|
-
/*#__PURE__*/ _jsx(Scripts, {})
|
|
54
|
-
]
|
|
55
|
-
})
|
|
56
|
-
]
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Wraps your application's root document shell so Payload owns its own
|
|
61
|
-
* `<html>` chrome on admin routes while your shell renders everywhere else.
|
|
62
|
-
*
|
|
63
|
-
* Attach the result to the root route's `shellComponent`; it is the single
|
|
64
|
-
* integration touch point — no root loader and no manual data threading:
|
|
65
|
-
*
|
|
66
|
-
* ```tsx
|
|
67
|
-
* export const Route = createRootRoute({
|
|
68
|
-
* shellComponent: withPayloadRoot(MarketingRoot),
|
|
69
|
-
* })
|
|
70
|
-
* ```
|
|
71
|
-
*/ export function withPayloadRoot(RootShell, options = {}) {
|
|
72
|
-
const { adminRoute = '/admin' } = options;
|
|
73
|
-
return function PayloadRootShell({ children }) {
|
|
74
|
-
const isAdminRoute = useRouterState({
|
|
75
|
-
select: (s)=>{
|
|
76
|
-
const { pathname } = s.location;
|
|
77
|
-
return pathname === adminRoute || pathname.startsWith(`${adminRoute}/`);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
if (isAdminRoute) {
|
|
81
|
-
return /*#__PURE__*/ _jsx(PayloadAdminShell, {
|
|
82
|
-
children: children
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
return /*#__PURE__*/ _jsx(RootShell, {
|
|
86
|
-
children: children
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
//# sourceMappingURL=withPayloadRoot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/layouts/Root/withPayloadRoot.tsx"],"sourcesContent":["'use client'\nimport type { Theme } from '@payloadcms/ui'\n\nimport { getLanguageDir } from '@payloadcms/ui/utilities/getLanguageDir'\nimport { HeadContent, Scripts, useRouterState } from '@tanstack/react-router'\nimport React from 'react'\n\ntype AdminHTMLProps = {\n 'data-theme'?: Theme\n dir: 'ltr' | 'rtl'\n lang?: string\n}\n\nexport type PayloadAdminShellProps = {\n readonly children: React.ReactNode\n}\n\n/**\n * The `<html>` document shell for Payload admin routes — the TanStack Start\n * equivalent of `@payloadcms/next`'s root layout `<html>`. Sets\n * `data-theme`/`lang`/`dir` on `<html>` from the server-computed layout data\n * (`getLayoutData`, exposed on the `/_payload` route loader), so the admin\n * panel renders themed with the correct text direction on the first paint with no\n * client bootstrap script — the same server-side path Next's `RootLayout`\n * uses, sharing `getRequestTheme`/`getLanguageDir` from `@payloadcms/ui`.\n */\nexport function PayloadAdminShell({ children }: PayloadAdminShellProps) {\n const htmlProps = useRouterState({\n select: (state): AdminHTMLProps => {\n for (const match of state.matches) {\n const data = match.loaderData as { languageCode?: string; theme?: Theme } | undefined\n\n if (data?.theme && data?.languageCode) {\n return {\n 'data-theme': data.theme,\n dir: getLanguageDir({ languageCode: data.languageCode }),\n lang: data.languageCode,\n }\n }\n }\n\n // No layout data yet (fresh session before the loader resolves): default\n // to `ltr` so the `[dir='ltr']`-scoped admin layout rules (e.g. the\n // document sidebar divider) still match, matching Next's `ltr` default.\n return { dir: 'ltr' }\n },\n })\n\n return (\n // eslint-disable-next-line jsx-a11y/html-has-lang -- `lang` is set from server-computed layout data when available\n <html {...htmlProps} suppressHydrationWarning>\n <head>\n <style>{`@layer payload-default, payload;`}</style>\n <HeadContent />\n </head>\n <body>\n {children}\n <Scripts />\n </body>\n </html>\n )\n}\n\nexport type WithPayloadRootOptions = {\n /**\n * Path prefix that mounts the Payload admin panel (`config.routes.admin`).\n * Routes under it render the Payload admin document shell; everything else\n * renders your own shell. Defaults to `'/admin'`.\n */\n adminRoute?: string\n}\n\n/**\n * Wraps your application's root document shell so Payload owns its own\n * `<html>` chrome on admin routes while your shell renders everywhere else.\n *\n * Attach the result to the root route's `shellComponent`; it is the single\n * integration touch point — no root loader and no manual data threading:\n *\n * ```tsx\n * export const Route = createRootRoute({\n * shellComponent: withPayloadRoot(MarketingRoot),\n * })\n * ```\n */\nexport function withPayloadRoot(\n RootShell: React.ComponentType<{ children: React.ReactNode }>,\n options: WithPayloadRootOptions = {},\n) {\n const { adminRoute = '/admin' } = options\n\n return function PayloadRootShell({ children }: { children: React.ReactNode }) {\n const isAdminRoute = useRouterState({\n select: (s) => {\n const { pathname } = s.location\n return pathname === adminRoute || pathname.startsWith(`${adminRoute}/`)\n },\n })\n\n if (isAdminRoute) {\n return <PayloadAdminShell>{children}</PayloadAdminShell>\n }\n\n return <RootShell>{children}</RootShell>\n }\n}\n"],"names":["getLanguageDir","HeadContent","Scripts","useRouterState","React","PayloadAdminShell","children","htmlProps","select","state","match","matches","data","loaderData","theme","languageCode","dir","lang","html","suppressHydrationWarning","head","style","body","withPayloadRoot","RootShell","options","adminRoute","PayloadRootShell","isAdminRoute","s","pathname","location","startsWith"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,0CAAyC;AACxE,SAASC,WAAW,EAAEC,OAAO,EAAEC,cAAc,QAAQ,yBAAwB;AAC7E,OAAOC,WAAW,QAAO;AAYzB;;;;;;;;CAQC,GACD,OAAO,SAASC,kBAAkB,EAAEC,QAAQ,EAA0B;IACpE,MAAMC,YAAYJ,eAAe;QAC/BK,QAAQ,CAACC;YACP,KAAK,MAAMC,SAASD,MAAME,OAAO,CAAE;gBACjC,MAAMC,OAAOF,MAAMG,UAAU;gBAE7B,IAAID,MAAME,SAASF,MAAMG,cAAc;oBACrC,OAAO;wBACL,cAAcH,KAAKE,KAAK;wBACxBE,KAAKhB,eAAe;4BAAEe,cAAcH,KAAKG,YAAY;wBAAC;wBACtDE,MAAML,KAAKG,YAAY;oBACzB;gBACF;YACF;YAEA,yEAAyE;YACzE,oEAAoE;YACpE,wEAAwE;YACxE,OAAO;gBAAEC,KAAK;YAAM;QACtB;IACF;IAEA,OACE,mHAAmH;kBACnH,MAACE;QAAM,GAAGX,SAAS;QAAEY,wBAAwB;;0BAC3C,MAACC;;kCACC,KAACC;kCAAO,CAAC,gCAAgC,CAAC;;kCAC1C,KAACpB;;;0BAEH,MAACqB;;oBACEhB;kCACD,KAACJ;;;;;AAIT;AAWA;;;;;;;;;;;;CAYC,GACD,OAAO,SAASqB,gBACdC,SAA6D,EAC7DC,UAAkC,CAAC,CAAC;IAEpC,MAAM,EAAEC,aAAa,QAAQ,EAAE,GAAGD;IAElC,OAAO,SAASE,iBAAiB,EAAErB,QAAQ,EAAiC;QAC1E,MAAMsB,eAAezB,eAAe;YAClCK,QAAQ,CAACqB;gBACP,MAAM,EAAEC,QAAQ,EAAE,GAAGD,EAAEE,QAAQ;gBAC/B,OAAOD,aAAaJ,cAAcI,SAASE,UAAU,CAAC,GAAGN,WAAW,CAAC,CAAC;YACxE;QACF;QAEA,IAAIE,cAAc;YAChB,qBAAO,KAACvB;0BAAmBC;;QAC7B;QAEA,qBAAO,KAACkB;sBAAWlB;;IACrB;AACF"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node ESM loader hook that swallows static asset imports (CSS/SCSS/LESS,
|
|
3
|
-
* images, fonts, audio, video, etc.) encountered while running the dev
|
|
4
|
-
* server.
|
|
5
|
-
*
|
|
6
|
-
* Vite is supposed to intercept asset imports during SSR/RSC by treating
|
|
7
|
-
* the package as `noExternal`, but that resolution path silently breaks down
|
|
8
|
-
* when a dependency is installed from a packed tarball under
|
|
9
|
-
* `node_modules/.pnpm/<pkg>@file+packed+...`. In that scenario Vite hands the
|
|
10
|
-
* import to Node's native ESM loader, which has no opinion about `.css` /
|
|
11
|
-
* `.svg` / `.png` files and throws `ERR_UNKNOWN_FILE_EXTENSION`. That single
|
|
12
|
-
* throw cascades into every admin route showing "Something went wrong!"
|
|
13
|
-
* because the SSR tree dies inside `<MatchInnerImpl>`.
|
|
14
|
-
*
|
|
15
|
-
* Registering this loader (with `--import` or `register()`) makes Node treat
|
|
16
|
-
* any asset specifier as an empty ES module, which is exactly what we
|
|
17
|
-
* already do client-side for SSR.
|
|
18
|
-
*
|
|
19
|
-
* The loader is intentionally minimal and side-effect free; it only kicks in
|
|
20
|
-
* for asset specifiers and falls through to the default loader for
|
|
21
|
-
* everything else.
|
|
22
|
-
*/
|
|
23
|
-
export declare function resolve(specifier: any, context: any, nextResolve: any): Promise<any>;
|
|
24
|
-
export declare function load(url: any, context: any, nextLoad: any): Promise<any>;
|
|
25
|
-
//# sourceMappingURL=cssLoader.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cssLoader.d.mts","sourceRoot":"","sources":["../../src/node/cssLoader.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAiCH,wBAAsB,OAAO,CAAC,SAAS,KAAA,EAAE,OAAO,KAAA,EAAE,WAAW,KAAA,gBAS5D;AAED,wBAAsB,IAAI,CAAC,GAAG,KAAA,EAAE,OAAO,KAAA,EAAE,QAAQ,KAAA,gBAShD"}
|
package/dist/node/cssLoader.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node ESM loader hook that swallows static asset imports (CSS/SCSS/LESS,
|
|
3
|
-
* images, fonts, audio, video, etc.) encountered while running the dev
|
|
4
|
-
* server.
|
|
5
|
-
*
|
|
6
|
-
* Vite is supposed to intercept asset imports during SSR/RSC by treating
|
|
7
|
-
* the package as `noExternal`, but that resolution path silently breaks down
|
|
8
|
-
* when a dependency is installed from a packed tarball under
|
|
9
|
-
* `node_modules/.pnpm/<pkg>@file+packed+...`. In that scenario Vite hands the
|
|
10
|
-
* import to Node's native ESM loader, which has no opinion about `.css` /
|
|
11
|
-
* `.svg` / `.png` files and throws `ERR_UNKNOWN_FILE_EXTENSION`. That single
|
|
12
|
-
* throw cascades into every admin route showing "Something went wrong!"
|
|
13
|
-
* because the SSR tree dies inside `<MatchInnerImpl>`.
|
|
14
|
-
*
|
|
15
|
-
* Registering this loader (with `--import` or `register()`) makes Node treat
|
|
16
|
-
* any asset specifier as an empty ES module, which is exactly what we
|
|
17
|
-
* already do client-side for SSR.
|
|
18
|
-
*
|
|
19
|
-
* The loader is intentionally minimal and side-effect free; it only kicks in
|
|
20
|
-
* for asset specifiers and falls through to the default loader for
|
|
21
|
-
* everything else.
|
|
22
|
-
*/ const STYLE_EXTENSION_RE = /\.(?:s?css|less)(?:\?[^#]*)?(?:#.*)?$/i;
|
|
23
|
-
const ASSET_EXTENSION_RE = /\.(?:svg|png|jpe?g|gif|webp|avif|ico|bmp|tiff?|woff2?|ttf|otf|eot|mp[34]|webm|ogg|oga|wav|flac|m4a|m4v|mov|pdf)(?:\?[^#]*)?(?:#.*)?$/i;
|
|
24
|
-
const isStylesheet = (s)=>STYLE_EXTENSION_RE.test(s);
|
|
25
|
-
const isStaticAsset = (s)=>ASSET_EXTENSION_RE.test(s);
|
|
26
|
-
const stubSource = (specifier)=>{
|
|
27
|
-
if (isStylesheet(specifier)) {
|
|
28
|
-
// Stylesheet imports usually have no JS-visible exports, so an empty
|
|
29
|
-
// module is fine and matches Vite's `?inline` / extracted-css behaviour.
|
|
30
|
-
return '';
|
|
31
|
-
}
|
|
32
|
-
// Treat every other static asset like Vite's default asset pipeline:
|
|
33
|
-
// expose the (escaped) specifier as both a default export and a `src`
|
|
34
|
-
// property. This lets code like
|
|
35
|
-
// import logo from './logo.svg' -> uses the default export
|
|
36
|
-
// import { src } from './logo.png' -> Next.js `StaticImageData` shim
|
|
37
|
-
// logo === '/logo.svg' -> truthy, sufficient for tests
|
|
38
|
-
// continue to work without crashing during SSR.
|
|
39
|
-
const value = JSON.stringify(specifier);
|
|
40
|
-
return `const __asset = ${value};
|
|
41
|
-
export default __asset;
|
|
42
|
-
export const src = __asset;
|
|
43
|
-
export const height = 0;
|
|
44
|
-
export const width = 0;
|
|
45
|
-
export const blurWidth = 0;
|
|
46
|
-
export const blurHeight = 0;
|
|
47
|
-
`;
|
|
48
|
-
};
|
|
49
|
-
export async function resolve(specifier, context, nextResolve) {
|
|
50
|
-
if (isStylesheet(specifier) || isStaticAsset(specifier)) {
|
|
51
|
-
return {
|
|
52
|
-
format: 'module',
|
|
53
|
-
shortCircuit: true,
|
|
54
|
-
url: `data:text/javascript;base64,${Buffer.from(stubSource(specifier)).toString('base64')}`
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
return nextResolve(specifier, context);
|
|
58
|
-
}
|
|
59
|
-
export async function load(url, context, nextLoad) {
|
|
60
|
-
if (isStylesheet(url) || isStaticAsset(url)) {
|
|
61
|
-
return {
|
|
62
|
-
format: 'module',
|
|
63
|
-
shortCircuit: true,
|
|
64
|
-
source: stubSource(url)
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
return nextLoad(url, context);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
//# sourceMappingURL=cssLoader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/node/cssLoader.mjs"],"sourcesContent":["/**\n * Node ESM loader hook that swallows static asset imports (CSS/SCSS/LESS,\n * images, fonts, audio, video, etc.) encountered while running the dev\n * server.\n *\n * Vite is supposed to intercept asset imports during SSR/RSC by treating\n * the package as `noExternal`, but that resolution path silently breaks down\n * when a dependency is installed from a packed tarball under\n * `node_modules/.pnpm/<pkg>@file+packed+...`. In that scenario Vite hands the\n * import to Node's native ESM loader, which has no opinion about `.css` /\n * `.svg` / `.png` files and throws `ERR_UNKNOWN_FILE_EXTENSION`. That single\n * throw cascades into every admin route showing \"Something went wrong!\"\n * because the SSR tree dies inside `<MatchInnerImpl>`.\n *\n * Registering this loader (with `--import` or `register()`) makes Node treat\n * any asset specifier as an empty ES module, which is exactly what we\n * already do client-side for SSR.\n *\n * The loader is intentionally minimal and side-effect free; it only kicks in\n * for asset specifiers and falls through to the default loader for\n * everything else.\n */\n\nconst STYLE_EXTENSION_RE = /\\.(?:s?css|less)(?:\\?[^#]*)?(?:#.*)?$/i\nconst ASSET_EXTENSION_RE =\n /\\.(?:svg|png|jpe?g|gif|webp|avif|ico|bmp|tiff?|woff2?|ttf|otf|eot|mp[34]|webm|ogg|oga|wav|flac|m4a|m4v|mov|pdf)(?:\\?[^#]*)?(?:#.*)?$/i\n\nconst isStylesheet = (s) => STYLE_EXTENSION_RE.test(s)\nconst isStaticAsset = (s) => ASSET_EXTENSION_RE.test(s)\n\nconst stubSource = (specifier) => {\n if (isStylesheet(specifier)) {\n // Stylesheet imports usually have no JS-visible exports, so an empty\n // module is fine and matches Vite's `?inline` / extracted-css behaviour.\n return ''\n }\n // Treat every other static asset like Vite's default asset pipeline:\n // expose the (escaped) specifier as both a default export and a `src`\n // property. This lets code like\n // import logo from './logo.svg' -> uses the default export\n // import { src } from './logo.png' -> Next.js `StaticImageData` shim\n // logo === '/logo.svg' -> truthy, sufficient for tests\n // continue to work without crashing during SSR.\n const value = JSON.stringify(specifier)\n return `const __asset = ${value};\nexport default __asset;\nexport const src = __asset;\nexport const height = 0;\nexport const width = 0;\nexport const blurWidth = 0;\nexport const blurHeight = 0;\n`\n}\n\nexport async function resolve(specifier, context, nextResolve) {\n if (isStylesheet(specifier) || isStaticAsset(specifier)) {\n return {\n format: 'module',\n shortCircuit: true,\n url: `data:text/javascript;base64,${Buffer.from(stubSource(specifier)).toString('base64')}`,\n }\n }\n return nextResolve(specifier, context)\n}\n\nexport async function load(url, context, nextLoad) {\n if (isStylesheet(url) || isStaticAsset(url)) {\n return {\n format: 'module',\n shortCircuit: true,\n source: stubSource(url),\n }\n }\n return nextLoad(url, context)\n}\n"],"names":["STYLE_EXTENSION_RE","ASSET_EXTENSION_RE","isStylesheet","s","test","isStaticAsset","stubSource","specifier","value","JSON","stringify","resolve","context","nextResolve","format","shortCircuit","url","Buffer","from","toString","load","nextLoad","source"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;CAqBC,GAED,MAAMA,qBAAqB;AAC3B,MAAMC,qBACJ;AAEF,MAAMC,eAAe,CAACC,IAAMH,mBAAmBI,IAAI,CAACD;AACpD,MAAME,gBAAgB,CAACF,IAAMF,mBAAmBG,IAAI,CAACD;AAErD,MAAMG,aAAa,CAACC;IAClB,IAAIL,aAAaK,YAAY;QAC3B,qEAAqE;QACrE,yEAAyE;QACzE,OAAO;IACT;IACA,qEAAqE;IACrE,sEAAsE;IACtE,gCAAgC;IAChC,oEAAoE;IACpE,2EAA2E;IAC3E,yEAAyE;IACzE,gDAAgD;IAChD,MAAMC,QAAQC,KAAKC,SAAS,CAACH;IAC7B,OAAO,CAAC,gBAAgB,EAAEC,MAAM;;;;;;;AAOlC,CAAC;AACD;AAEA,OAAO,eAAeG,QAAQJ,SAAS,EAAEK,OAAO,EAAEC,WAAW;IAC3D,IAAIX,aAAaK,cAAcF,cAAcE,YAAY;QACvD,OAAO;YACLO,QAAQ;YACRC,cAAc;YACdC,KAAK,CAAC,4BAA4B,EAAEC,OAAOC,IAAI,CAACZ,WAAWC,YAAYY,QAAQ,CAAC,WAAW;QAC7F;IACF;IACA,OAAON,YAAYN,WAAWK;AAChC;AAEA,OAAO,eAAeQ,KAAKJ,GAAG,EAAEJ,OAAO,EAAES,QAAQ;IAC/C,IAAInB,aAAac,QAAQX,cAAcW,MAAM;QAC3C,OAAO;YACLF,QAAQ;YACRC,cAAc;YACdO,QAAQhB,WAAWU;QACrB;IACF;IACA,OAAOK,SAASL,KAAKJ;AACvB"}
|
package/dist/node/cssLoader.mjs
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node ESM loader hook that swallows static asset imports (CSS/SCSS/LESS,
|
|
3
|
-
* images, fonts, audio, video, etc.) encountered while running the dev
|
|
4
|
-
* server.
|
|
5
|
-
*
|
|
6
|
-
* Vite is supposed to intercept asset imports during SSR/RSC by treating
|
|
7
|
-
* the package as `noExternal`, but that resolution path silently breaks down
|
|
8
|
-
* when a dependency is installed from a packed tarball under
|
|
9
|
-
* `node_modules/.pnpm/<pkg>@file+packed+...`. In that scenario Vite hands the
|
|
10
|
-
* import to Node's native ESM loader, which has no opinion about `.css` /
|
|
11
|
-
* `.svg` / `.png` files and throws `ERR_UNKNOWN_FILE_EXTENSION`. That single
|
|
12
|
-
* throw cascades into every admin route showing "Something went wrong!"
|
|
13
|
-
* because the SSR tree dies inside `<MatchInnerImpl>`.
|
|
14
|
-
*
|
|
15
|
-
* Registering this loader (with `--import` or `register()`) makes Node treat
|
|
16
|
-
* any asset specifier as an empty ES module, which is exactly what we
|
|
17
|
-
* already do client-side for SSR.
|
|
18
|
-
*
|
|
19
|
-
* The loader is intentionally minimal and side-effect free; it only kicks in
|
|
20
|
-
* for asset specifiers and falls through to the default loader for
|
|
21
|
-
* everything else.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const STYLE_EXTENSION_RE = /\.(?:s?css|less)(?:\?[^#]*)?(?:#.*)?$/i
|
|
25
|
-
const ASSET_EXTENSION_RE =
|
|
26
|
-
/\.(?:svg|png|jpe?g|gif|webp|avif|ico|bmp|tiff?|woff2?|ttf|otf|eot|mp[34]|webm|ogg|oga|wav|flac|m4a|m4v|mov|pdf)(?:\?[^#]*)?(?:#.*)?$/i
|
|
27
|
-
|
|
28
|
-
const isStylesheet = (s) => STYLE_EXTENSION_RE.test(s)
|
|
29
|
-
const isStaticAsset = (s) => ASSET_EXTENSION_RE.test(s)
|
|
30
|
-
|
|
31
|
-
const stubSource = (specifier) => {
|
|
32
|
-
if (isStylesheet(specifier)) {
|
|
33
|
-
// Stylesheet imports usually have no JS-visible exports, so an empty
|
|
34
|
-
// module is fine and matches Vite's `?inline` / extracted-css behaviour.
|
|
35
|
-
return ''
|
|
36
|
-
}
|
|
37
|
-
// Treat every other static asset like Vite's default asset pipeline:
|
|
38
|
-
// expose the (escaped) specifier as both a default export and a `src`
|
|
39
|
-
// property. This lets code like
|
|
40
|
-
// import logo from './logo.svg' -> uses the default export
|
|
41
|
-
// import { src } from './logo.png' -> Next.js `StaticImageData` shim
|
|
42
|
-
// logo === '/logo.svg' -> truthy, sufficient for tests
|
|
43
|
-
// continue to work without crashing during SSR.
|
|
44
|
-
const value = JSON.stringify(specifier)
|
|
45
|
-
return `const __asset = ${value};
|
|
46
|
-
export default __asset;
|
|
47
|
-
export const src = __asset;
|
|
48
|
-
export const height = 0;
|
|
49
|
-
export const width = 0;
|
|
50
|
-
export const blurWidth = 0;
|
|
51
|
-
export const blurHeight = 0;
|
|
52
|
-
`
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export async function resolve(specifier, context, nextResolve) {
|
|
56
|
-
if (isStylesheet(specifier) || isStaticAsset(specifier)) {
|
|
57
|
-
return {
|
|
58
|
-
format: 'module',
|
|
59
|
-
shortCircuit: true,
|
|
60
|
-
url: `data:text/javascript;base64,${Buffer.from(stubSource(specifier)).toString('base64')}`,
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return nextResolve(specifier, context)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export async function load(url, context, nextLoad) {
|
|
67
|
-
if (isStylesheet(url) || isStaticAsset(url)) {
|
|
68
|
-
return {
|
|
69
|
-
format: 'module',
|
|
70
|
-
shortCircuit: true,
|
|
71
|
-
source: stubSource(url),
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return nextLoad(url, context)
|
|
75
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registerCssLoader.d.mts","sourceRoot":"","sources":["../../src/node/registerCssLoader.mjs"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tiny shim that registers `./cssLoader.mjs` as a Node ESM loader hook.
|
|
3
|
-
*
|
|
4
|
-
* Used by the test dev-server runner via `node --import ./registerCssLoader.mjs`
|
|
5
|
-
* so the spawned Vite process can swallow stylesheet imports it would
|
|
6
|
-
* otherwise hand to Node's native ESM loader (which throws on `.css`).
|
|
7
|
-
*/ import { register } from 'node:module';
|
|
8
|
-
register('./cssLoader.mjs', import.meta.url);
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=registerCssLoader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/node/registerCssLoader.mjs"],"sourcesContent":["/**\n * Tiny shim that registers `./cssLoader.mjs` as a Node ESM loader hook.\n *\n * Used by the test dev-server runner via `node --import ./registerCssLoader.mjs`\n * so the spawned Vite process can swallow stylesheet imports it would\n * otherwise hand to Node's native ESM loader (which throws on `.css`).\n */\nimport { register } from 'node:module'\n\nregister('./cssLoader.mjs', import.meta.url)\n"],"names":["register","url"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,QAAQ,QAAQ,cAAa;AAEtCA,SAAS,mBAAmB,YAAYC,GAAG"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tiny shim that registers `./cssLoader.mjs` as a Node ESM loader hook.
|
|
3
|
-
*
|
|
4
|
-
* Used by the test dev-server runner via `node --import ./registerCssLoader.mjs`
|
|
5
|
-
* so the spawned Vite process can swallow stylesheet imports it would
|
|
6
|
-
* otherwise hand to Node's native ESM loader (which throws on `.css`).
|
|
7
|
-
*/
|
|
8
|
-
import { register } from 'node:module'
|
|
9
|
-
|
|
10
|
-
register('./cssLoader.mjs', import.meta.url)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adminRoutes.d.ts","sourceRoot":"","sources":["../../src/routes/adminRoutes.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIhD;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE;IAC7B,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CACpE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;AAclB,iBAAS,SAAS,gCAKjB;AAED,iBAAS,aAAa,CAAC,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,SAAS,CAAA;KAAE,CAAA;CAAE,+BAMrF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE;IAEhE,SAAS;IACT,IAAI,mBAAmB;QAAE,UAAU,CAAC,EAAE,GAAG,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;IAM3C,MAAM;QACJ,OAAO,yBAA+B;YAAE,QAAQ,EAAE,GAAG,CAAC;YAAC,MAAM,EAAE,GAAG,CAAA;SAAE;QAQpE,eAAe;;IAGjB,UAAU,eAAe;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;QAC1D,SAAS;;IAEX,iBAAiB;IACjB,cAAc,WAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;EAEnD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE;IAEhE,SAAS;IACT,IAAI,mBAAmB;QAAE,UAAU,CAAC,EAAE,GAAG,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;IAC3C,MAAM;QACJ,OAAO,iBAAuB;YAAE,QAAQ,EAAE,GAAG,CAAA;SAAE;QAQ/C,eAAe;;IAEjB,UAAU,eAAe;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;QAC1D,SAAS;;IAEX,cAAc,WAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;EAEnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/adminRoutes.tsx"],"sourcesContent":["'use client'\n\nimport { NotFoundClient } from '@payloadcms/ui'\nimport { notFound, redirect, useLoaderData } from '@tanstack/react-router'\nimport { Fragment, type ReactNode } from 'react'\n\nimport { getAdminMeta } from '../utilities/meta.js'\n\n/**\n * Loader supplied by the app — a TanStack Start `createServerFn` that delegates\n * to `loadAdminPage`. Typed loosely because the server-fn's call signature is\n * generated by the Start compiler.\n */\nexport type AdminLoad = (opts: {\n data: { _splat: string; search: Record<string, string | string[]> }\n}) => Promise<any>\n\nconst searchToRecord = (searchStr: string): Record<string, string | string[]> =>\n Object.fromEntries(new URLSearchParams(searchStr)) as Record<string, string | string[]>\n\nconst runLoader = async (load: AdminLoad, splat: string, searchStr: string) => {\n const data = await load({ data: { _splat: splat, search: searchToRecord(searchStr) } })\n if (data?._redirect) {\n // eslint-disable-next-line @typescript-eslint/only-throw-error -- TanStack Router requires throwing redirect objects\n throw redirect({ to: data._redirect })\n }\n return data\n}\n\nfunction AdminPage() {\n // Note: React key intentionally omitted here so the persistent template (nav, header) doesn't remount and flash on navigation.\n // The per-route view key is attached server-side to the view subtree instead, via `renderRoot`'s `key` in `loadAdminPage`.\n const data = useLoaderData({ strict: false })\n return <Fragment>{data?.rscPayload}</Fragment>\n}\n\nfunction AdminNotFound(props: { data?: { routeKey?: string; rscPayload?: ReactNode } }) {\n const rscPayload = props?.data?.rscPayload\n if (!rscPayload) {\n return <NotFoundClient />\n }\n return <Fragment key={props?.data?.routeKey}>{rscPayload}</Fragment>\n}\n\n/**\n * Route options for the admin splat route (`/_payload/admin/$`). Renders Payload's\n * server-built NotFound page (shipped via the `notFound()` error's\n * `data.rscPayload`) for unknown/access-denied routes, falling back to the bare\n * client view.\n */\nexport function payloadAdminSplatRoute({ load }: { load: AdminLoad }) {\n return {\n component: AdminPage,\n head: ({ loaderData }: { loaderData?: any }) => getAdminMeta(loaderData?.metadata),\n // `staleReloadMode: 'blocking'` (a property of the loader *object*, not a\n // sibling route option — router-core only reads it off a non-function loader)\n // makes stale-match revalidation await the fresh loader before committing,\n // instead of the default background SWR that flashes the pre-navigation list\n // (e.g. a just-created doc missing) until the reload lands.\n loader: {\n handler: async ({ location, params }: { location: any; params: any }) => {\n const data = await runLoader(load, params._splat ?? '', location.searchStr)\n if (data?._notFound) {\n // eslint-disable-next-line @typescript-eslint/only-throw-error -- TanStack Router requires throwing notFound objects\n throw notFound({ data: { routeKey: data.routeKey, rscPayload: data.rscPayload } })\n }\n return data\n },\n staleReloadMode: 'blocking',\n },\n // Surface query params in `loaderDeps` so `?locale=es` re-runs the loader.\n loaderDeps: ({ search }: { search: Record<string, unknown> }) => ({\n searchKey: JSON.stringify(search),\n }),\n notFoundComponent: AdminNotFound,\n validateSearch: (search: Record<string, unknown>) => search,\n }\n}\n\n/**\n * Route options for the admin index route (`/_payload/admin/`). Same loader as the\n * splat route but throws a bare `notFound()` (no rscPayload) on miss.\n */\nexport function payloadAdminIndexRoute({ load }: { load: AdminLoad }) {\n return {\n component: AdminPage,\n head: ({ loaderData }: { loaderData?: any }) => getAdminMeta(loaderData?.metadata),\n loader: {\n handler: async ({ location }: { location: any }) => {\n const data = await runLoader(load, '', location.searchStr)\n if (data?._notFound) {\n // eslint-disable-next-line @typescript-eslint/only-throw-error -- TanStack Router requires throwing notFound objects\n throw notFound()\n }\n return data\n },\n staleReloadMode: 'blocking',\n },\n loaderDeps: ({ search }: { search: Record<string, unknown> }) => ({\n searchKey: JSON.stringify(search),\n }),\n validateSearch: (search: Record<string, unknown>) => search,\n }\n}\n"],"names":["NotFoundClient","notFound","redirect","useLoaderData","Fragment","getAdminMeta","searchToRecord","searchStr","Object","fromEntries","URLSearchParams","runLoader","load","splat","data","_splat","search","_redirect","to","AdminPage","strict","rscPayload","AdminNotFound","props","routeKey","payloadAdminSplatRoute","component","head","loaderData","metadata","loader","handler","location","params","_notFound","staleReloadMode","loaderDeps","searchKey","JSON","stringify","notFoundComponent","validateSearch","payloadAdminIndexRoute"],"mappings":"AAAA;;AAEA,SAASA,cAAc,QAAQ,iBAAgB;AAC/C,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,yBAAwB;AAC1E,SAASC,QAAQ,QAAwB,QAAO;AAEhD,SAASC,YAAY,QAAQ,uBAAsB;AAWnD,MAAMC,iBAAiB,CAACC,YACtBC,OAAOC,WAAW,CAAC,IAAIC,gBAAgBH;AAEzC,MAAMI,YAAY,OAAOC,MAAiBC,OAAeN;IACvD,MAAMO,OAAO,MAAMF,KAAK;QAAEE,MAAM;YAAEC,QAAQF;YAAOG,QAAQV,eAAeC;QAAW;IAAE;IACrF,IAAIO,MAAMG,WAAW;QACnB,qHAAqH;QACrH,MAAMf,SAAS;YAAEgB,IAAIJ,KAAKG,SAAS;QAAC;IACtC;IACA,OAAOH;AACT;AAEA,SAASK;IACP,+HAA+H;IAC/H,2HAA2H;IAC3H,MAAML,OAAOX,cAAc;QAAEiB,QAAQ;IAAM;IAC3C,qBAAO,KAAChB;kBAAUU,MAAMO;;AAC1B;AAEA,SAASC,cAAcC,KAA+D;IACpF,MAAMF,aAAaE,OAAOT,MAAMO;IAChC,IAAI,CAACA,YAAY;QACf,qBAAO,KAACrB;IACV;IACA,qBAAO,KAACI;kBAAsCiB;OAAxBE,OAAOT,MAAMU;AACrC;AAEA;;;;;CAKC,GACD,OAAO,SAASC,uBAAuB,EAAEb,IAAI,EAAuB;IAClE,OAAO;QACLc,WAAWP;QACXQ,MAAM,CAAC,EAAEC,UAAU,EAAwB,GAAKvB,aAAauB,YAAYC;QACzE,0EAA0E;QAC1E,8EAA8E;QAC9E,2EAA2E;QAC3E,6EAA6E;QAC7E,4DAA4D;QAC5DC,QAAQ;YACNC,SAAS,OAAO,EAAEC,QAAQ,EAAEC,MAAM,EAAkC;gBAClE,MAAMnB,OAAO,MAAMH,UAAUC,MAAMqB,OAAOlB,MAAM,IAAI,IAAIiB,SAASzB,SAAS;gBAC1E,IAAIO,MAAMoB,WAAW;oBACnB,qHAAqH;oBACrH,MAAMjC,SAAS;wBAAEa,MAAM;4BAAEU,UAAUV,KAAKU,QAAQ;4BAAEH,YAAYP,KAAKO,UAAU;wBAAC;oBAAE;gBAClF;gBACA,OAAOP;YACT;YACAqB,iBAAiB;QACnB;QACA,2EAA2E;QAC3EC,YAAY,CAAC,EAAEpB,MAAM,EAAuC,GAAM,CAAA;gBAChEqB,WAAWC,KAAKC,SAAS,CAACvB;YAC5B,CAAA;QACAwB,mBAAmBlB;QACnBmB,gBAAgB,CAACzB,SAAoCA;IACvD;AACF;AAEA;;;CAGC,GACD,OAAO,SAAS0B,uBAAuB,EAAE9B,IAAI,EAAuB;IAClE,OAAO;QACLc,WAAWP;QACXQ,MAAM,CAAC,EAAEC,UAAU,EAAwB,GAAKvB,aAAauB,YAAYC;QACzEC,QAAQ;YACNC,SAAS,OAAO,EAAEC,QAAQ,EAAqB;gBAC7C,MAAMlB,OAAO,MAAMH,UAAUC,MAAM,IAAIoB,SAASzB,SAAS;gBACzD,IAAIO,MAAMoB,WAAW;oBACnB,qHAAqH;oBACrH,MAAMjC;gBACR;gBACA,OAAOa;YACT;YACAqB,iBAAiB;QACnB;QACAC,YAAY,CAAC,EAAEpB,MAAM,EAAuC,GAAM,CAAA;gBAChEqB,WAAWC,KAAKC,SAAS,CAACvB;YAC5B,CAAA;QACAyB,gBAAgB,CAACzB,SAAoCA;IACvD;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiRoute.d.ts","sourceRoot":"","sources":["../../src/routes/apiRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,KAAK,eAAe,GAAG,CAAC,GAAG,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,GACV,EAAE;IACD,SAAS,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAA;CAC1C,GAAG,MAAM,CAAC,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,EAAE,eAAe,CAAC,CAcnF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/apiRoute.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\ntype ApiRouteHandler = (ctx: { request: Request }) => Promise<Response>\n\n/**\n * Builds the method handlers for the Payload REST/GraphQL catch-all\n * (`/_payload/api/$`). The app supplies `getConfig` (an `@payload-config`\n * import) since the package cannot resolve the consumer's config.\n *\n * Imported from `@payloadcms/tanstack-start/server` (not the root barrel) so\n * the server-only `handleAPIRoute` graph never reaches the client bundle.\n *\n * Spread the result into a literal `server.handlers` key so TanStack Start's\n * client compiler can statically see — and prune — the server-only route:\n *\n * ```ts\n * import { payloadApiHandlers } from '@payloadcms/tanstack-start/server'\n *\n * export const Route = createFileRoute('/_payload/api/$')({\n * server: {\n * handlers: payloadApiHandlers({ getConfig: async () => (await import('@payload-config')).default }),\n * },\n * })\n * ```\n *\n * The compiler only strips a literal `server:` key from a route-options object\n * expression; wrapping the whole options object in a factory call hides the\n * key, leaking the config graph into the client bundle.\n */\nexport function payloadApiHandlers({\n getConfig,\n}: {\n getConfig: () => Promise<SanitizedConfig>\n}): Record<'DELETE' | 'GET' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT', ApiRouteHandler> {\n const handler: ApiRouteHandler = async ({ request }) => {\n const { handleAPIRoute } = await import('../utilities/handleAPIRoute.server.js')\n return handleAPIRoute({ config: await getConfig(), request })\n }\n\n return {\n DELETE: handler,\n GET: handler,\n OPTIONS: handler,\n PATCH: handler,\n POST: handler,\n PUT: handler,\n }\n}\n"],"names":["payloadApiHandlers","getConfig","handler","request","handleAPIRoute","config","DELETE","GET","OPTIONS","PATCH","POST","PUT"],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,SAASA,mBAAmB,EACjCC,SAAS,EAGV;IACC,MAAMC,UAA2B,OAAO,EAAEC,OAAO,EAAE;QACjD,MAAM,EAAEC,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC;QACxC,OAAOA,eAAe;YAAEC,QAAQ,MAAMJ;YAAaE;QAAQ;IAC7D;IAEA,OAAO;QACLG,QAAQJ;QACRK,KAAKL;QACLM,SAASN;QACTO,OAAOP;QACPQ,MAAMR;QACNS,KAAKT;IACP;AACF"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from 'react';
|
|
2
|
-
import { RootProvider } from '@payloadcms/ui';
|
|
3
|
-
/**
|
|
4
|
-
* Loader supplied by the app — a TanStack Start `createServerFn` that delegates
|
|
5
|
-
* to `loadLayoutData`. Typed loosely because the server-fn's call signature is
|
|
6
|
-
* generated by the Start compiler.
|
|
7
|
-
*/
|
|
8
|
-
export type LayoutLoad = () => Promise<Record<string, unknown>>;
|
|
9
|
-
/**
|
|
10
|
-
* Route options for the Payload admin layout (`/_payload`). Maps the layout
|
|
11
|
-
* loader data onto `RootProvider` and renders the admin chrome (progress bar,
|
|
12
|
-
* custom-provider tree or router `<Outlet />`, portal mount). The app supplies
|
|
13
|
-
* `load` (the layout-data server fn) and `serverFunction` (the server-function
|
|
14
|
-
* client wired into `RootProvider`); everything else is adapter-owned.
|
|
15
|
-
*/
|
|
16
|
-
export declare function payloadLayoutRoute({ load, serverFunction, }: {
|
|
17
|
-
load: LayoutLoad;
|
|
18
|
-
serverFunction: ComponentProps<typeof RootProvider>['serverFunction'];
|
|
19
|
-
}): {
|
|
20
|
-
component: () => import("react").JSX.Element;
|
|
21
|
-
loader: {
|
|
22
|
-
handler: () => Promise<Record<string, unknown>>;
|
|
23
|
-
staleReloadMode: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=layoutRoute.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layoutRoute.d.ts","sourceRoot":"","sources":["../../src/routes/layoutRoute.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAe,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAK1D;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAE/D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,cAAc,GACf,EAAE;IACD,IAAI,EAAE,UAAU,CAAA;IAChB,cAAc,EAAE,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,gBAAgB,CAAC,CAAA;CACtE;IAqCG,SAAS;IACT,MAAM;QAAI,OAAO;QAAgB,eAAe;;EAEnD"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { ProgressBar, RootProvider } from '@payloadcms/ui';
|
|
4
|
-
import { Outlet, useLoaderData } from '@tanstack/react-router';
|
|
5
|
-
import { TanStackRouterAdapter } from '../elements/RouterAdapter/index.js';
|
|
6
|
-
/**
|
|
7
|
-
* Route options for the Payload admin layout (`/_payload`). Maps the layout
|
|
8
|
-
* loader data onto `RootProvider` and renders the admin chrome (progress bar,
|
|
9
|
-
* custom-provider tree or router `<Outlet />`, portal mount). The app supplies
|
|
10
|
-
* `load` (the layout-data server fn) and `serverFunction` (the server-function
|
|
11
|
-
* client wired into `RootProvider`); everything else is adapter-owned.
|
|
12
|
-
*/ export function payloadLayoutRoute({ load, serverFunction }) {
|
|
13
|
-
function PayloadLayout() {
|
|
14
|
-
const data = useLoaderData({
|
|
15
|
-
strict: false
|
|
16
|
-
});
|
|
17
|
-
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
18
|
-
children: [
|
|
19
|
-
/*#__PURE__*/ _jsxs(RootProvider, {
|
|
20
|
-
config: data.clientConfig,
|
|
21
|
-
dateFNSKey: data.dateFNSKey,
|
|
22
|
-
fallbackLang: data.fallbackLang,
|
|
23
|
-
highContrastMode: false,
|
|
24
|
-
isNavOpen: data.isNavOpen,
|
|
25
|
-
languageCode: data.languageCode,
|
|
26
|
-
languageOptions: data.languageOptions,
|
|
27
|
-
locale: data.locale,
|
|
28
|
-
permissions: data.user ? data.permissions : null,
|
|
29
|
-
RouterAdapter: TanStackRouterAdapter,
|
|
30
|
-
serverFunction: serverFunction,
|
|
31
|
-
theme: data.theme,
|
|
32
|
-
translations: data.translations,
|
|
33
|
-
user: data.user,
|
|
34
|
-
children: [
|
|
35
|
-
/*#__PURE__*/ _jsx(ProgressBar, {}),
|
|
36
|
-
data.providers ?? /*#__PURE__*/ _jsx(Outlet, {})
|
|
37
|
-
]
|
|
38
|
-
}),
|
|
39
|
-
/*#__PURE__*/ _jsx("div", {
|
|
40
|
-
id: "portal"
|
|
41
|
-
})
|
|
42
|
-
]
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
// `staleReloadMode` lives on the loader *object* — router-core only reads it
|
|
46
|
-
// off a non-function loader — so stale-match revalidation blocks on the fresh
|
|
47
|
-
// loader instead of flashing stale layout data via the default background SWR.
|
|
48
|
-
return {
|
|
49
|
-
component: PayloadLayout,
|
|
50
|
-
loader: {
|
|
51
|
-
handler: ()=>load(),
|
|
52
|
-
staleReloadMode: 'blocking'
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
//# sourceMappingURL=layoutRoute.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/layoutRoute.tsx"],"sourcesContent":["'use client'\n\nimport type { ComponentProps } from 'react'\n\nimport { ProgressBar, RootProvider } from '@payloadcms/ui'\nimport { Outlet, useLoaderData } from '@tanstack/react-router'\n\nimport { TanStackRouterAdapter } from '../elements/RouterAdapter/index.js'\n\n/**\n * Loader supplied by the app — a TanStack Start `createServerFn` that delegates\n * to `loadLayoutData`. Typed loosely because the server-fn's call signature is\n * generated by the Start compiler.\n */\nexport type LayoutLoad = () => Promise<Record<string, unknown>>\n\n/**\n * Route options for the Payload admin layout (`/_payload`). Maps the layout\n * loader data onto `RootProvider` and renders the admin chrome (progress bar,\n * custom-provider tree or router `<Outlet />`, portal mount). The app supplies\n * `load` (the layout-data server fn) and `serverFunction` (the server-function\n * client wired into `RootProvider`); everything else is adapter-owned.\n */\nexport function payloadLayoutRoute({\n load,\n serverFunction,\n}: {\n load: LayoutLoad\n serverFunction: ComponentProps<typeof RootProvider>['serverFunction']\n}) {\n function PayloadLayout() {\n const data = useLoaderData({ strict: false })\n\n return (\n <>\n <RootProvider\n config={data.clientConfig}\n dateFNSKey={data.dateFNSKey}\n fallbackLang={data.fallbackLang}\n highContrastMode={false}\n isNavOpen={data.isNavOpen}\n languageCode={data.languageCode}\n languageOptions={data.languageOptions}\n locale={data.locale}\n permissions={data.user ? data.permissions : null}\n RouterAdapter={TanStackRouterAdapter}\n serverFunction={serverFunction}\n theme={data.theme}\n translations={data.translations}\n user={data.user}\n >\n <ProgressBar />\n {/* `data.providers` is the custom-provider tree (config.admin.components.providers)\n already wrapping the router <Outlet />; falls back to a bare <Outlet /> when\n no custom providers are configured. */}\n {data.providers ?? <Outlet />}\n </RootProvider>\n <div id=\"portal\" />\n </>\n )\n }\n\n // `staleReloadMode` lives on the loader *object* — router-core only reads it\n // off a non-function loader — so stale-match revalidation blocks on the fresh\n // loader instead of flashing stale layout data via the default background SWR.\n return {\n component: PayloadLayout,\n loader: { handler: () => load(), staleReloadMode: 'blocking' },\n }\n}\n"],"names":["ProgressBar","RootProvider","Outlet","useLoaderData","TanStackRouterAdapter","payloadLayoutRoute","load","serverFunction","PayloadLayout","data","strict","config","clientConfig","dateFNSKey","fallbackLang","highContrastMode","isNavOpen","languageCode","languageOptions","locale","permissions","user","RouterAdapter","theme","translations","providers","div","id","component","loader","handler","staleReloadMode"],"mappings":"AAAA;;AAIA,SAASA,WAAW,EAAEC,YAAY,QAAQ,iBAAgB;AAC1D,SAASC,MAAM,EAAEC,aAAa,QAAQ,yBAAwB;AAE9D,SAASC,qBAAqB,QAAQ,qCAAoC;AAS1E;;;;;;CAMC,GACD,OAAO,SAASC,mBAAmB,EACjCC,IAAI,EACJC,cAAc,EAIf;IACC,SAASC;QACP,MAAMC,OAAON,cAAc;YAAEO,QAAQ;QAAM;QAE3C,qBACE;;8BACE,MAACT;oBACCU,QAAQF,KAAKG,YAAY;oBACzBC,YAAYJ,KAAKI,UAAU;oBAC3BC,cAAcL,KAAKK,YAAY;oBAC/BC,kBAAkB;oBAClBC,WAAWP,KAAKO,SAAS;oBACzBC,cAAcR,KAAKQ,YAAY;oBAC/BC,iBAAiBT,KAAKS,eAAe;oBACrCC,QAAQV,KAAKU,MAAM;oBACnBC,aAAaX,KAAKY,IAAI,GAAGZ,KAAKW,WAAW,GAAG;oBAC5CE,eAAelB;oBACfG,gBAAgBA;oBAChBgB,OAAOd,KAAKc,KAAK;oBACjBC,cAAcf,KAAKe,YAAY;oBAC/BH,MAAMZ,KAAKY,IAAI;;sCAEf,KAACrB;wBAIAS,KAAKgB,SAAS,kBAAI,KAACvB;;;8BAEtB,KAACwB;oBAAIC,IAAG;;;;IAGd;IAEA,6EAA6E;IAC7E,8EAA8E;IAC9E,+EAA+E;IAC/E,OAAO;QACLC,WAAWpB;QACXqB,QAAQ;YAAEC,SAAS,IAAMxB;YAAQyB,iBAAiB;QAAW;IAC/D;AACF"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Import `RenderServerComponent` from `@payloadcms/ui/elements/RenderServerComponent` directly.
|
|
3
|
-
* This re-export will be removed in a future major version.
|
|
4
|
-
*/
|
|
5
|
-
export { RenderServerComponent as RenderRSCComponent } from '@payloadcms/ui/elements/RenderServerComponent';
|
|
6
|
-
//# sourceMappingURL=renderPayloadRSC.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderPayloadRSC.d.ts","sourceRoot":"","sources":["../../src/rsc/renderPayloadRSC.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,qBAAqB,IAAI,kBAAkB,EAAE,MAAM,+CAA+C,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Import `RenderServerComponent` from `@payloadcms/ui/elements/RenderServerComponent` directly.
|
|
3
|
-
* This re-export will be removed in a future major version.
|
|
4
|
-
*/ export { RenderServerComponent as RenderRSCComponent } from '@payloadcms/ui/elements/RenderServerComponent';
|
|
5
|
-
|
|
6
|
-
//# sourceMappingURL=renderPayloadRSC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rsc/renderPayloadRSC.tsx"],"sourcesContent":["/**\n * @deprecated Import `RenderServerComponent` from `@payloadcms/ui/elements/RenderServerComponent` directly.\n * This re-export will be removed in a future major version.\n */\nexport { RenderServerComponent as RenderRSCComponent } from '@payloadcms/ui/elements/RenderServerComponent'\n"],"names":["RenderServerComponent","RenderRSCComponent"],"mappings":"AAAA;;;CAGC,GACD,SAASA,yBAAyBC,kBAAkB,QAAQ,gDAA+C"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DevReloadStrategy } from 'payload';
|
|
2
|
-
/**
|
|
3
|
-
* Dev reload strategy for Vite (used by TanStack Start).
|
|
4
|
-
*
|
|
5
|
-
* Connects to Vite's HMR WebSocket and triggers a callback on full reloads.
|
|
6
|
-
* In development, Vite sends HMR updates over a WebSocket connection at
|
|
7
|
-
* the configured HMR path (defaults to root).
|
|
8
|
-
*/
|
|
9
|
-
export declare const viteDevReloadStrategy: DevReloadStrategy;
|
|
10
|
-
//# sourceMappingURL=devReloadStrategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devReloadStrategy.d.ts","sourceRoot":"","sources":["../../src/utilities/devReloadStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,iBAuBnC,CAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dev reload strategy for Vite (used by TanStack Start).
|
|
3
|
-
*
|
|
4
|
-
* Connects to Vite's HMR WebSocket and triggers a callback on full reloads.
|
|
5
|
-
* In development, Vite sends HMR updates over a WebSocket connection at
|
|
6
|
-
* the configured HMR path (defaults to root).
|
|
7
|
-
*/ export const viteDevReloadStrategy = {
|
|
8
|
-
connect: (onReload)=>{
|
|
9
|
-
if (typeof window === 'undefined') {
|
|
10
|
-
return ()=>{};
|
|
11
|
-
}
|
|
12
|
-
// Vite injects import.meta.hot in development builds
|
|
13
|
-
const hot = import.meta.hot;
|
|
14
|
-
if (!hot) {
|
|
15
|
-
return ()=>{};
|
|
16
|
-
}
|
|
17
|
-
const handleUpdate = ()=>{
|
|
18
|
-
onReload();
|
|
19
|
-
};
|
|
20
|
-
hot.on('vite:beforeFullReload', handleUpdate);
|
|
21
|
-
return ()=>{
|
|
22
|
-
hot.off('vite:beforeFullReload', handleUpdate);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=devReloadStrategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/devReloadStrategy.ts"],"sourcesContent":["import type { DevReloadStrategy } from 'payload'\n\n/**\n * Dev reload strategy for Vite (used by TanStack Start).\n *\n * Connects to Vite's HMR WebSocket and triggers a callback on full reloads.\n * In development, Vite sends HMR updates over a WebSocket connection at\n * the configured HMR path (defaults to root).\n */\nexport const viteDevReloadStrategy: DevReloadStrategy = {\n connect: (onReload) => {\n if (typeof window === 'undefined') {\n return () => {}\n }\n\n // Vite injects import.meta.hot in development builds\n const hot = (import.meta as unknown as { hot?: ViteHotContext }).hot\n\n if (!hot) {\n return () => {}\n }\n\n const handleUpdate = () => {\n onReload()\n }\n\n hot.on('vite:beforeFullReload', handleUpdate)\n\n return () => {\n hot.off('vite:beforeFullReload', handleUpdate)\n }\n },\n}\n\ntype ViteHotContext = {\n off: (event: string, cb: () => void) => void\n on: (event: string, cb: () => void) => void\n}\n"],"names":["viteDevReloadStrategy","connect","onReload","window","hot","handleUpdate","on","off"],"mappings":"AAEA;;;;;;CAMC,GACD,OAAO,MAAMA,wBAA2C;IACtDC,SAAS,CAACC;QACR,IAAI,OAAOC,WAAW,aAAa;YACjC,OAAO,KAAO;QAChB;QAEA,qDAAqD;QACrD,MAAMC,MAAM,AAAC,YAAoDA,GAAG;QAEpE,IAAI,CAACA,KAAK;YACR,OAAO,KAAO;QAChB;QAEA,MAAMC,eAAe;YACnBH;QACF;QAEAE,IAAIE,EAAE,CAAC,yBAAyBD;QAEhC,OAAO;YACLD,IAAIG,GAAG,CAAC,yBAAyBF;QACnC;IACF;AACF,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getExistingAuthToken.d.ts","sourceRoot":"","sources":["../../src/utilities/getExistingAuthToken.ts"],"names":[],"mappings":"AAGA,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY7E"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getRequest } from '@tanstack/react-start/server';
|
|
2
|
-
import { parseCookies } from 'payload';
|
|
3
|
-
export function getExistingAuthToken(cookiePrefix) {
|
|
4
|
-
const request = getRequest();
|
|
5
|
-
const headers = new Headers(request.headers);
|
|
6
|
-
const cookies = parseCookies(headers);
|
|
7
|
-
for (const [name, value] of cookies.entries()){
|
|
8
|
-
if (name.startsWith(cookiePrefix)) {
|
|
9
|
-
return {
|
|
10
|
-
name,
|
|
11
|
-
value
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=getExistingAuthToken.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/getExistingAuthToken.ts"],"sourcesContent":["import { getRequest } from '@tanstack/react-start/server'\nimport { parseCookies } from 'payload'\n\ntype Cookie = {\n name: string\n value: string\n}\n\nexport function getExistingAuthToken(cookiePrefix: string): Cookie | undefined {\n const request = getRequest()\n const headers = new Headers(request.headers)\n const cookies = parseCookies(headers)\n\n for (const [name, value] of cookies.entries()) {\n if (name.startsWith(cookiePrefix)) {\n return { name, value }\n }\n }\n\n return undefined\n}\n"],"names":["getRequest","parseCookies","getExistingAuthToken","cookiePrefix","request","headers","Headers","cookies","name","value","entries","startsWith","undefined"],"mappings":"AAAA,SAASA,UAAU,QAAQ,+BAA8B;AACzD,SAASC,YAAY,QAAQ,UAAS;AAOtC,OAAO,SAASC,qBAAqBC,YAAoB;IACvD,MAAMC,UAAUJ;IAChB,MAAMK,UAAU,IAAIC,QAAQF,QAAQC,OAAO;IAC3C,MAAME,UAAUN,aAAaI;IAE7B,KAAK,MAAM,CAACG,MAAMC,MAAM,IAAIF,QAAQG,OAAO,GAAI;QAC7C,IAAIF,KAAKG,UAAU,CAACR,eAAe;YACjC,OAAO;gBAAEK;gBAAMC;YAAM;QACvB;IACF;IAEA,OAAOG;AACT"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DefaultDocumentIDType, Payload } from 'payload';
|
|
2
|
-
/**
|
|
3
|
-
* Fetches a user's preference by key. Unlike the Next.js version, this does not
|
|
4
|
-
* use `React.cache()` since TanStack Start has no RSC request-level memoization.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getPreferences<T>(key: string, payload: Payload, userID: DefaultDocumentIDType, userSlug: string): Promise<{
|
|
7
|
-
id: DefaultDocumentIDType;
|
|
8
|
-
value: T;
|
|
9
|
-
}>;
|
|
10
|
-
//# sourceMappingURL=getPreferences.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPreferences.d.ts","sourceRoot":"","sources":["../../src/utilities/getPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAE7D;;;GAGG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACpC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,qBAAqB,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,EAAE,EAAE,qBAAqB,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC,CA8BlD"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetches a user's preference by key. Unlike the Next.js version, this does not
|
|
3
|
-
* use `React.cache()` since TanStack Start has no RSC request-level memoization.
|
|
4
|
-
*/ export async function getPreferences(key, payload, userID, userSlug) {
|
|
5
|
-
const result = await payload.find({
|
|
6
|
-
collection: 'payload-preferences',
|
|
7
|
-
depth: 0,
|
|
8
|
-
limit: 1,
|
|
9
|
-
pagination: false,
|
|
10
|
-
where: {
|
|
11
|
-
and: [
|
|
12
|
-
{
|
|
13
|
-
key: {
|
|
14
|
-
equals: key
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
'user.relationTo': {
|
|
19
|
-
equals: userSlug
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
'user.value': {
|
|
24
|
-
equals: userID
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
}).then((res)=>res.docs?.[0]);
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=getPreferences.js.map
|