@payloadcms/tanstack-start 4.0.0-internal.cea8867 → 4.0.0-internal.e387174
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/exports/client.d.ts +1 -1
- package/dist/exports/client.d.ts.map +1 -1
- package/dist/exports/client.js +1 -1
- package/dist/exports/client.js.map +1 -1
- package/dist/exports/server.d.ts +1 -1
- package/dist/exports/server.d.ts.map +1 -1
- package/dist/exports/server.js +1 -1
- package/dist/exports/server.js.map +1 -1
- package/dist/exports/vite.d.ts +2 -2
- package/dist/exports/vite.d.ts.map +1 -1
- package/dist/exports/vite.js +1 -1
- package/dist/exports/vite.js.map +1 -1
- package/dist/layouts/Root/getLayoutData.d.ts.map +1 -1
- package/dist/layouts/Root/getLayoutData.js +1 -1
- package/dist/layouts/Root/getLayoutData.js.map +1 -1
- package/dist/layouts/Root/index.js +2 -4
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/layouts/Root/withPayloadRoot.d.ts +31 -7
- package/dist/layouts/Root/withPayloadRoot.d.ts.map +1 -1
- package/dist/layouts/Root/withPayloadRoot.js +34 -33
- package/dist/layouts/Root/withPayloadRoot.js.map +1 -1
- package/dist/node/cssLoader.d.mts +2 -24
- package/dist/node/cssLoader.d.mts.map +1 -1
- package/dist/routes/adminRoutes.d.ts.map +1 -1
- package/dist/routes/layoutRoute.d.ts.map +1 -1
- package/dist/utilities/getRequestTheme.d.ts +10 -0
- package/dist/utilities/getRequestTheme.d.ts.map +1 -0
- package/dist/utilities/getRequestTheme.js +25 -0
- package/dist/utilities/getRequestTheme.js.map +1 -0
- package/dist/utilities/graphqlHandler.server.d.ts.map +1 -1
- package/dist/utilities/serverAdapter.server.d.ts.map +1 -1
- package/dist/vite/constants.d.ts +42 -0
- package/dist/vite/constants.d.ts.map +1 -0
- package/dist/vite/{config/optimizeDeps.js → constants.js} +63 -9
- package/dist/vite/constants.js.map +1 -0
- package/dist/vite/plugin.d.ts +38 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/plugin.js +177 -0
- package/dist/vite/plugin.js.map +1 -0
- package/dist/vite/plugins/clientModuleResolution.d.ts.map +1 -0
- package/dist/vite/plugins/clientModuleResolution.js.map +1 -0
- package/dist/vite/plugins/devTransforms.d.ts.map +1 -0
- package/dist/vite/{workarounds → plugins}/devTransforms.js +0 -5
- package/dist/vite/plugins/devTransforms.js.map +1 -0
- package/dist/vite/plugins/reactDomServerInRsc.d.ts.map +1 -0
- package/dist/vite/plugins/reactDomServerInRsc.js.map +1 -0
- package/dist/vite/plugins/stripDistStyleImports.d.ts.map +1 -0
- package/dist/vite/plugins/stripDistStyleImports.js.map +1 -0
- package/dist/vite/plugins/wrapCjsForClient.d.ts.map +1 -0
- package/dist/vite/plugins/wrapCjsForClient.js.map +1 -0
- package/package.json +5 -10
- package/dist/vite/config/external.d.ts +0 -11
- package/dist/vite/config/external.d.ts.map +0 -1
- package/dist/vite/config/external.js +0 -48
- package/dist/vite/config/external.js.map +0 -1
- package/dist/vite/config/optimizeDeps.d.ts +0 -25
- package/dist/vite/config/optimizeDeps.d.ts.map +0 -1
- package/dist/vite/config/optimizeDeps.js.map +0 -1
- package/dist/vite/config/scss.d.ts +0 -14
- package/dist/vite/config/scss.d.ts.map +0 -1
- package/dist/vite/config/scss.js +0 -28
- package/dist/vite/config/scss.js.map +0 -1
- package/dist/vite/index.d.ts +0 -99
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/index.js +0 -258
- package/dist/vite/index.js.map +0 -1
- package/dist/vite/workarounds/clientModuleResolution.d.ts.map +0 -1
- package/dist/vite/workarounds/clientModuleResolution.js.map +0 -1
- package/dist/vite/workarounds/devTransforms.d.ts.map +0 -1
- package/dist/vite/workarounds/devTransforms.js.map +0 -1
- package/dist/vite/workarounds/reactDomServerInRsc.d.ts.map +0 -1
- package/dist/vite/workarounds/reactDomServerInRsc.js.map +0 -1
- package/dist/vite/workarounds/stripDistStyleImports.d.ts.map +0 -1
- package/dist/vite/workarounds/stripDistStyleImports.js.map +0 -1
- package/dist/vite/workarounds/stubPrettierInClient.d.ts +0 -13
- package/dist/vite/workarounds/stubPrettierInClient.d.ts.map +0 -1
- package/dist/vite/workarounds/stubPrettierInClient.js +0 -32
- package/dist/vite/workarounds/stubPrettierInClient.js.map +0 -1
- package/dist/vite/workarounds/wrapCjsForClient.d.ts.map +0 -1
- package/dist/vite/workarounds/wrapCjsForClient.js.map +0 -1
- /package/dist/vite/{workarounds → plugins}/clientModuleResolution.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/clientModuleResolution.js +0 -0
- /package/dist/vite/{workarounds → plugins}/devTransforms.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/reactDomServerInRsc.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/reactDomServerInRsc.js +0 -0
- /package/dist/vite/{workarounds → plugins}/stripDistStyleImports.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/stripDistStyleImports.js +0 -0
- /package/dist/vite/{workarounds → plugins}/wrapCjsForClient.d.ts +0 -0
- /package/dist/vite/{workarounds → plugins}/wrapCjsForClient.js +0 -0
package/dist/exports/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { TanStackComponentRenderer } from '../elements/RenderComponent/index.js';
|
|
2
2
|
export { TanStackRouterAdapter } from '../elements/RouterAdapter/index.js';
|
|
3
|
-
export { PayloadAdminShell, type PayloadAdminShellProps, withPayloadRoot, type WithPayloadRootOptions, } from '../layouts/Root/withPayloadRoot.js';
|
|
3
|
+
export { buildThemeInitScript, PayloadAdminShell, type PayloadAdminShellProps, THEME_INIT_SCRIPT, withPayloadRoot, type WithPayloadRootOptions, } from '../layouts/Root/withPayloadRoot.js';
|
|
4
4
|
export { type AdminLoad, payloadAdminIndexRoute, payloadAdminSplatRoute, } from '../routes/adminRoutes.js';
|
|
5
5
|
export { type LayoutLoad, payloadLayoutRoute } from '../routes/layoutRoute.js';
|
|
6
6
|
export { viteDevReloadStrategy } from '../utilities/devReloadStrategy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/exports/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,eAAe,EACf,KAAK,sBAAsB,GAC5B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,KAAK,SAAS,EACd,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,sCAAsC,CAAA"}
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/exports/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,iBAAiB,EACjB,eAAe,EACf,KAAK,sBAAsB,GAC5B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,KAAK,SAAS,EACd,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,sCAAsC,CAAA"}
|
package/dist/exports/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
export { TanStackComponentRenderer } from '../elements/RenderComponent/index.js';
|
|
3
3
|
export { TanStackRouterAdapter } from '../elements/RouterAdapter/index.js';
|
|
4
|
-
export { PayloadAdminShell, withPayloadRoot } from '../layouts/Root/withPayloadRoot.js';
|
|
4
|
+
export { buildThemeInitScript, PayloadAdminShell, THEME_INIT_SCRIPT, withPayloadRoot } from '../layouts/Root/withPayloadRoot.js';
|
|
5
5
|
export { payloadAdminIndexRoute, payloadAdminSplatRoute } from '../routes/adminRoutes.js';
|
|
6
6
|
export { payloadLayoutRoute } from '../routes/layoutRoute.js';
|
|
7
7
|
export { viteDevReloadStrategy } from '../utilities/devReloadStrategy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\n\nexport { TanStackComponentRenderer } from '../elements/RenderComponent/index.js'\nexport { TanStackRouterAdapter } from '../elements/RouterAdapter/index.js'\nexport {\n PayloadAdminShell,\n type PayloadAdminShellProps,\n withPayloadRoot,\n type WithPayloadRootOptions,\n} from '../layouts/Root/withPayloadRoot.js'\nexport {\n type AdminLoad,\n payloadAdminIndexRoute,\n payloadAdminSplatRoute,\n} from '../routes/adminRoutes.js'\nexport { type LayoutLoad, payloadLayoutRoute } from '../routes/layoutRoute.js'\nexport { viteDevReloadStrategy } from '../utilities/devReloadStrategy.js'\nexport {\n createServerFunctionClient,\n stripUnserializable,\n} from '../utilities/serverFunctionClient.js'\n"],"names":["TanStackComponentRenderer","TanStackRouterAdapter","PayloadAdminShell","withPayloadRoot","payloadAdminIndexRoute","payloadAdminSplatRoute","payloadLayoutRoute","viteDevReloadStrategy","createServerFunctionClient","stripUnserializable"],"mappings":"AAAA;AAEA,SAASA,yBAAyB,QAAQ,uCAAsC;AAChF,SAASC,qBAAqB,QAAQ,qCAAoC;AAC1E,SACEC,iBAAiB,EAEjBC,eAAe,QAEV,qCAAoC;AAC3C,SAEEC,sBAAsB,EACtBC,sBAAsB,QACjB,2BAA0B;AACjC,SAA0BC,kBAAkB,QAAQ,2BAA0B;AAC9E,SAASC,qBAAqB,QAAQ,oCAAmC;AACzE,SACEC,0BAA0B,EAC1BC,mBAAmB,QACd,uCAAsC"}
|
|
1
|
+
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\n\nexport { TanStackComponentRenderer } from '../elements/RenderComponent/index.js'\nexport { TanStackRouterAdapter } from '../elements/RouterAdapter/index.js'\nexport {\n buildThemeInitScript,\n PayloadAdminShell,\n type PayloadAdminShellProps,\n THEME_INIT_SCRIPT,\n withPayloadRoot,\n type WithPayloadRootOptions,\n} from '../layouts/Root/withPayloadRoot.js'\nexport {\n type AdminLoad,\n payloadAdminIndexRoute,\n payloadAdminSplatRoute,\n} from '../routes/adminRoutes.js'\nexport { type LayoutLoad, payloadLayoutRoute } from '../routes/layoutRoute.js'\nexport { viteDevReloadStrategy } from '../utilities/devReloadStrategy.js'\nexport {\n createServerFunctionClient,\n stripUnserializable,\n} from '../utilities/serverFunctionClient.js'\n"],"names":["TanStackComponentRenderer","TanStackRouterAdapter","buildThemeInitScript","PayloadAdminShell","THEME_INIT_SCRIPT","withPayloadRoot","payloadAdminIndexRoute","payloadAdminSplatRoute","payloadLayoutRoute","viteDevReloadStrategy","createServerFunctionClient","stripUnserializable"],"mappings":"AAAA;AAEA,SAASA,yBAAyB,QAAQ,uCAAsC;AAChF,SAASC,qBAAqB,QAAQ,qCAAoC;AAC1E,SACEC,oBAAoB,EACpBC,iBAAiB,EAEjBC,iBAAiB,EACjBC,eAAe,QAEV,qCAAoC;AAC3C,SAEEC,sBAAsB,EACtBC,sBAAsB,QACjB,2BAA0B;AACjC,SAA0BC,kBAAkB,QAAQ,2BAA0B;AAC9E,SAASC,qBAAqB,QAAQ,oCAAmC;AACzE,SACEC,0BAA0B,EAC1BC,mBAAmB,QACd,uCAAsC"}
|
package/dist/exports/server.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { logout } from '../auth/logout.js';
|
|
|
3
3
|
export { refresh } from '../auth/refresh.js';
|
|
4
4
|
export { getRequestI18n } from '../utilities/getRequestI18n.server.js';
|
|
5
5
|
export { getRequestLocale } from '../utilities/getRequestLocale.js';
|
|
6
|
+
export { getRequestTheme } from '../utilities/getRequestTheme.js';
|
|
6
7
|
export { handleGraphQL } from '../utilities/graphqlHandler.server.js';
|
|
7
8
|
export { handleAPIRoute } from '../utilities/handleAPIRoute.js';
|
|
8
9
|
export { handleServerFunctions } from '../utilities/handleServerFunctions.js';
|
|
@@ -13,5 +14,4 @@ export { type AdminPageMetadata, getAdminMeta } from '../utilities/meta.js';
|
|
|
13
14
|
export { serializeForRsc } from '../utilities/serializeForRsc.js';
|
|
14
15
|
export { createPageRenderServerAdapter, type PageNavIntent, tanstackServerAdapter, } from '../utilities/serverAdapter.server.js';
|
|
15
16
|
export { toSerializable } from '../utilities/toSerializable.js';
|
|
16
|
-
export { getRequestTheme } from '@payloadcms/ui/utilities/getRequestTheme';
|
|
17
17
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/exports/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,EACL,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,KAAK,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EACL,6BAA6B,EAC7B,KAAK,aAAa,EAClB,qBAAqB,GACtB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/exports/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,EACL,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,KAAK,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EACL,6BAA6B,EAC7B,KAAK,aAAa,EAClB,qBAAqB,GACtB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA"}
|
package/dist/exports/server.js
CHANGED
|
@@ -3,6 +3,7 @@ export { logout } from '../auth/logout.js';
|
|
|
3
3
|
export { refresh } from '../auth/refresh.js';
|
|
4
4
|
export { getRequestI18n } from '../utilities/getRequestI18n.server.js';
|
|
5
5
|
export { getRequestLocale } from '../utilities/getRequestLocale.js';
|
|
6
|
+
export { getRequestTheme } from '../utilities/getRequestTheme.js';
|
|
6
7
|
export { handleGraphQL } from '../utilities/graphqlHandler.server.js';
|
|
7
8
|
export { handleAPIRoute } from '../utilities/handleAPIRoute.js';
|
|
8
9
|
export { handleServerFunctions } from '../utilities/handleServerFunctions.js';
|
|
@@ -13,6 +14,5 @@ export { getAdminMeta } from '../utilities/meta.js';
|
|
|
13
14
|
export { serializeForRsc } from '../utilities/serializeForRsc.js';
|
|
14
15
|
export { createPageRenderServerAdapter, tanstackServerAdapter } from '../utilities/serverAdapter.server.js';
|
|
15
16
|
export { toSerializable } from '../utilities/toSerializable.js';
|
|
16
|
-
export { getRequestTheme } from '@payloadcms/ui/utilities/getRequestTheme';
|
|
17
17
|
|
|
18
18
|
//# sourceMappingURL=server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/server.ts"],"sourcesContent":["export { login } from '../auth/login.js'\nexport { logout } from '../auth/logout.js'\nexport { refresh } from '../auth/refresh.js'\nexport { getRequestI18n } from '../utilities/getRequestI18n.server.js'\nexport { getRequestLocale } from '../utilities/getRequestLocale.js'\nexport { handleGraphQL } from '../utilities/graphqlHandler.server.js'\nexport { handleAPIRoute } from '../utilities/handleAPIRoute.js'\nexport { handleServerFunctions } from '../utilities/handleServerFunctions.js'\nexport { getImportMapOutputPath } from '../utilities/importMap.server.js'\nexport { initReq } from '../utilities/initReq.server.js'\nexport {\n loadAdminPage,\n type LoadAdminPageArgs,\n type LoadAdminPageResult,\n} from '../utilities/loadAdminPage.js'\nexport { type AdminPageMetadata, getAdminMeta } from '../utilities/meta.js'\nexport { serializeForRsc } from '../utilities/serializeForRsc.js'\nexport {\n createPageRenderServerAdapter,\n type PageNavIntent,\n tanstackServerAdapter,\n} from '../utilities/serverAdapter.server.js'\nexport { toSerializable } from '../utilities/toSerializable.js'\
|
|
1
|
+
{"version":3,"sources":["../../src/exports/server.ts"],"sourcesContent":["export { login } from '../auth/login.js'\nexport { logout } from '../auth/logout.js'\nexport { refresh } from '../auth/refresh.js'\nexport { getRequestI18n } from '../utilities/getRequestI18n.server.js'\nexport { getRequestLocale } from '../utilities/getRequestLocale.js'\nexport { getRequestTheme } from '../utilities/getRequestTheme.js'\nexport { handleGraphQL } from '../utilities/graphqlHandler.server.js'\nexport { handleAPIRoute } from '../utilities/handleAPIRoute.js'\nexport { handleServerFunctions } from '../utilities/handleServerFunctions.js'\nexport { getImportMapOutputPath } from '../utilities/importMap.server.js'\nexport { initReq } from '../utilities/initReq.server.js'\nexport {\n loadAdminPage,\n type LoadAdminPageArgs,\n type LoadAdminPageResult,\n} from '../utilities/loadAdminPage.js'\nexport { type AdminPageMetadata, getAdminMeta } from '../utilities/meta.js'\nexport { serializeForRsc } from '../utilities/serializeForRsc.js'\nexport {\n createPageRenderServerAdapter,\n type PageNavIntent,\n tanstackServerAdapter,\n} from '../utilities/serverAdapter.server.js'\nexport { toSerializable } from '../utilities/toSerializable.js'\n"],"names":["login","logout","refresh","getRequestI18n","getRequestLocale","getRequestTheme","handleGraphQL","handleAPIRoute","handleServerFunctions","getImportMapOutputPath","initReq","loadAdminPage","getAdminMeta","serializeForRsc","createPageRenderServerAdapter","tanstackServerAdapter","toSerializable"],"mappings":"AAAA,SAASA,KAAK,QAAQ,mBAAkB;AACxC,SAASC,MAAM,QAAQ,oBAAmB;AAC1C,SAASC,OAAO,QAAQ,qBAAoB;AAC5C,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,gBAAgB,QAAQ,mCAAkC;AACnE,SAASC,eAAe,QAAQ,kCAAiC;AACjE,SAASC,aAAa,QAAQ,wCAAuC;AACrE,SAASC,cAAc,QAAQ,iCAAgC;AAC/D,SAASC,qBAAqB,QAAQ,wCAAuC;AAC7E,SAASC,sBAAsB,QAAQ,mCAAkC;AACzE,SAASC,OAAO,QAAQ,iCAAgC;AACxD,SACEC,aAAa,QAGR,gCAA+B;AACtC,SAAiCC,YAAY,QAAQ,uBAAsB;AAC3E,SAASC,eAAe,QAAQ,kCAAiC;AACjE,SACEC,6BAA6B,EAE7BC,qBAAqB,QAChB,uCAAsC;AAC7C,SAASC,cAAc,QAAQ,iCAAgC"}
|
package/dist/exports/vite.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { PayloadPluginOptions
|
|
1
|
+
export { payloadPlugin } from '../vite/plugin.js';
|
|
2
|
+
export type { PayloadPluginOptions } from '../vite/plugin.js';
|
|
3
3
|
//# sourceMappingURL=vite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/exports/vite.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/exports/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/exports/vite.js
CHANGED
package/dist/exports/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/vite.ts"],"sourcesContent":["export {
|
|
1
|
+
{"version":3,"sources":["../../src/exports/vite.ts"],"sourcesContent":["export { payloadPlugin } from '../vite/plugin.js'\nexport type { PayloadPluginOptions } from '../vite/plugin.js'\n"],"names":["payloadPlugin"],"mappings":"AAAA,SAASA,aAAa,QAAQ,oBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLayoutData.d.ts","sourceRoot":"","sources":["../../../src/layouts/Root/getLayoutData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAmB,eAAe,EAAe,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"getLayoutData.d.ts","sourceRoot":"","sources":["../../../src/layouts/Root/getLayoutData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAmB,eAAe,EAAe,MAAM,SAAS,CAAA;AASvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAKhD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IACzD,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,EAClC,aAAa,EACb,SAAS,GACV,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAsF7C"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getNavPrefs } from '@payloadcms/ui/elements/Nav/getNavPrefs';
|
|
2
2
|
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
|
|
3
3
|
import { getClientConfig } from '@payloadcms/ui/utilities/getClientConfig';
|
|
4
|
-
import { getRequestTheme } from '@payloadcms/ui/utilities/getRequestTheme';
|
|
5
4
|
import { Outlet } from '@tanstack/react-router';
|
|
6
5
|
import { applyLocaleFiltering } from 'payload/shared';
|
|
7
6
|
import { createElement } from 'react';
|
|
7
|
+
import { getRequestTheme } from '../../utilities/getRequestTheme.js';
|
|
8
8
|
import { initReq } from '../../utilities/initReq.server.js';
|
|
9
9
|
/**
|
|
10
10
|
* Fetches all data needed by the root admin layout.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/layouts/Root/getLayoutData.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\nimport type { ImportMap, LanguageOptions, SanitizedConfig, ServerProps } from 'payload'\n\nimport { getNavPrefs } from '@payloadcms/ui/elements/Nav/getNavPrefs'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\nimport { getClientConfig } from '@payloadcms/ui/utilities/getClientConfig'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/layouts/Root/getLayoutData.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\nimport type { ImportMap, LanguageOptions, SanitizedConfig, ServerProps } from 'payload'\n\nimport { getNavPrefs } from '@payloadcms/ui/elements/Nav/getNavPrefs'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\nimport { getClientConfig } from '@payloadcms/ui/utilities/getClientConfig'\nimport { Outlet } from '@tanstack/react-router'\nimport { applyLocaleFiltering } from 'payload/shared'\nimport { createElement } from 'react'\n\nimport type { RootLayoutData } from './index.js'\n\nimport { getRequestTheme } from '../../utilities/getRequestTheme.js'\nimport { initReq } from '../../utilities/initReq.server.js'\n\nexport type GetLayoutDataArgs = {\n configPromise: Promise<SanitizedConfig> | SanitizedConfig\n importMap: ImportMap\n}\n\n/**\n * Fetches all data needed by the root admin layout.\n * Call this in your TanStack Start root route loader.\n */\nexport async function getLayoutData({\n configPromise,\n importMap,\n}: GetLayoutDataArgs): Promise<RootLayoutData> {\n const {\n cookies,\n headers,\n languageCode,\n permissions,\n req,\n req: {\n payload: { config },\n },\n } = await initReq({ configPromise, importMap })\n\n const theme = getRequestTheme({ config, cookies, headers })\n\n const languageOptions: LanguageOptions = Object.entries(\n config.i18n.supportedLanguages || {},\n ).reduce((acc, [language, languageConfig]) => {\n if (Object.keys(config.i18n.supportedLanguages).includes(language)) {\n acc.push({\n label: languageConfig.translations.general.thisLanguage,\n value: language as AcceptedLanguages,\n })\n }\n return acc\n }, [] as LanguageOptions)\n\n const navPrefs = await getNavPrefs(req)\n\n const clientConfig = getClientConfig({\n config,\n i18n: req.i18n,\n importMap,\n user: req.user ?? true,\n })\n\n await applyLocaleFiltering({ clientConfig, config, req })\n\n // Build the custom admin provider tree (`config.admin.components.providers`)\n // nested around the router `<Outlet />`, mirroring the Next adapter's\n // `NestProviders`. Returned as an unrendered element; the caller's server\n // function renders it to an RSC payload (so server-component providers run\n // server-side and client providers wrap the live Outlet). `undefined` when\n // no custom providers are configured — the caller falls back to `<Outlet />`.\n const providerPaths = config.admin?.components?.providers\n let providers: React.ReactNode = undefined\n if (Array.isArray(providerPaths) && providerPaths.length > 0) {\n const serverProps: ServerProps = {\n i18n: req.i18n,\n params: {},\n payload: req.payload,\n permissions,\n searchParams: {},\n server: req.server!,\n user: req.user ?? undefined,\n }\n // Mirror the Next adapter's `NestProviders`: render each configured provider\n // via `RenderServerComponent` so the entry's own `clientProps`/`serverProps`\n // (e.g. plugin-multi-tenant's `userHasAccessToAllTenants`) are merged in, and\n // server components receive `serverProps` while client components get only\n // `clientProps`. Nested around the router `<Outlet />` instead of `children`.\n providers = providerPaths.reduceRight<React.ReactNode>(\n (children, provider) =>\n RenderServerComponent({\n clientProps: { children },\n Component: provider,\n importMap,\n serverProps,\n }),\n createElement(Outlet),\n )\n }\n\n return {\n clientConfig,\n dateFNSKey: req.i18n.dateFNSKey,\n fallbackLang: config.i18n.fallbackLanguage,\n isNavOpen: navPrefs?.open ?? true,\n languageCode,\n languageOptions,\n locale: req.locale ?? undefined,\n permissions,\n providers,\n theme,\n translations: req.i18n.translations,\n user: req.user,\n }\n}\n"],"names":["getNavPrefs","RenderServerComponent","getClientConfig","Outlet","applyLocaleFiltering","createElement","getRequestTheme","initReq","getLayoutData","configPromise","importMap","cookies","headers","languageCode","permissions","req","payload","config","theme","languageOptions","Object","entries","i18n","supportedLanguages","reduce","acc","language","languageConfig","keys","includes","push","label","translations","general","thisLanguage","value","navPrefs","clientConfig","user","providerPaths","admin","components","providers","undefined","Array","isArray","length","serverProps","params","searchParams","server","reduceRight","children","provider","clientProps","Component","dateFNSKey","fallbackLang","fallbackLanguage","isNavOpen","open","locale"],"mappings":"AAGA,SAASA,WAAW,QAAQ,0CAAyC;AACrE,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,eAAe,QAAQ,2CAA0C;AAC1E,SAASC,MAAM,QAAQ,yBAAwB;AAC/C,SAASC,oBAAoB,QAAQ,iBAAgB;AACrD,SAASC,aAAa,QAAQ,QAAO;AAIrC,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,OAAO,QAAQ,oCAAmC;AAO3D;;;CAGC,GACD,OAAO,eAAeC,cAAc,EAClCC,aAAa,EACbC,SAAS,EACS;IAClB,MAAM,EACJC,OAAO,EACPC,OAAO,EACPC,YAAY,EACZC,WAAW,EACXC,GAAG,EACHA,KAAK,EACHC,SAAS,EAAEC,MAAM,EAAE,EACpB,EACF,GAAG,MAAMV,QAAQ;QAAEE;QAAeC;IAAU;IAE7C,MAAMQ,QAAQZ,gBAAgB;QAAEW;QAAQN;QAASC;IAAQ;IAEzD,MAAMO,kBAAmCC,OAAOC,OAAO,CACrDJ,OAAOK,IAAI,CAACC,kBAAkB,IAAI,CAAC,GACnCC,MAAM,CAAC,CAACC,KAAK,CAACC,UAAUC,eAAe;QACvC,IAAIP,OAAOQ,IAAI,CAACX,OAAOK,IAAI,CAACC,kBAAkB,EAAEM,QAAQ,CAACH,WAAW;YAClED,IAAIK,IAAI,CAAC;gBACPC,OAAOJ,eAAeK,YAAY,CAACC,OAAO,CAACC,YAAY;gBACvDC,OAAOT;YACT;QACF;QACA,OAAOD;IACT,GAAG,EAAE;IAEL,MAAMW,WAAW,MAAMpC,YAAYe;IAEnC,MAAMsB,eAAenC,gBAAgB;QACnCe;QACAK,MAAMP,IAAIO,IAAI;QACdZ;QACA4B,MAAMvB,IAAIuB,IAAI,IAAI;IACpB;IAEA,MAAMlC,qBAAqB;QAAEiC;QAAcpB;QAAQF;IAAI;IAEvD,6EAA6E;IAC7E,sEAAsE;IACtE,0EAA0E;IAC1E,2EAA2E;IAC3E,2EAA2E;IAC3E,8EAA8E;IAC9E,MAAMwB,gBAAgBtB,OAAOuB,KAAK,EAAEC,YAAYC;IAChD,IAAIA,YAA6BC;IACjC,IAAIC,MAAMC,OAAO,CAACN,kBAAkBA,cAAcO,MAAM,GAAG,GAAG;QAC5D,MAAMC,cAA2B;YAC/BzB,MAAMP,IAAIO,IAAI;YACd0B,QAAQ,CAAC;YACThC,SAASD,IAAIC,OAAO;YACpBF;YACAmC,cAAc,CAAC;YACfC,QAAQnC,IAAImC,MAAM;YAClBZ,MAAMvB,IAAIuB,IAAI,IAAIK;QACpB;QACA,6EAA6E;QAC7E,6EAA6E;QAC7E,8EAA8E;QAC9E,2EAA2E;QAC3E,8EAA8E;QAC9ED,YAAYH,cAAcY,WAAW,CACnC,CAACC,UAAUC,WACTpD,sBAAsB;gBACpBqD,aAAa;oBAAEF;gBAAS;gBACxBG,WAAWF;gBACX3C;gBACAqC;YACF,IACF1C,cAAcF;IAElB;IAEA,OAAO;QACLkC;QACAmB,YAAYzC,IAAIO,IAAI,CAACkC,UAAU;QAC/BC,cAAcxC,OAAOK,IAAI,CAACoC,gBAAgB;QAC1CC,WAAWvB,UAAUwB,QAAQ;QAC7B/C;QACAM;QACA0C,QAAQ9C,IAAI8C,MAAM,IAAIlB;QACtB7B;QACA4B;QACAxB;QACAc,cAAcjB,IAAIO,IAAI,CAACU,YAAY;QACnCM,MAAMvB,IAAIuB,IAAI;IAChB;AACF"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { rtlLanguages } from '@payloadcms/translations';
|
|
2
3
|
import { ProgressBar, RootProvider } from '@payloadcms/ui';
|
|
3
|
-
import { getLanguageDir } from '@payloadcms/ui/utilities/getLanguageDir';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import '@payloadcms/ui/scss/app.scss';
|
|
6
6
|
import { TanStackRouterAdapter } from '../../elements/RouterAdapter/index.js';
|
|
7
7
|
export function RootLayout({ children, data, serverFunction }) {
|
|
8
|
-
const dir =
|
|
9
|
-
languageCode: data.languageCode
|
|
10
|
-
});
|
|
8
|
+
const dir = rtlLanguages.includes(data.languageCode) ? 'RTL' : 'LTR';
|
|
11
9
|
return /*#__PURE__*/ _jsxs("html", {
|
|
12
10
|
"data-theme": data.theme,
|
|
13
11
|
dir: dir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/layouts/Root/index.tsx"],"sourcesContent":["import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations'\nimport type { Theme } from '@payloadcms/ui'\nimport type {\n ClientConfig,\n LanguageOptions,\n SanitizedPermissions,\n ServerFunctionClient,\n User,\n} from 'payload'\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/layouts/Root/index.tsx"],"sourcesContent":["import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations'\nimport type { Theme } from '@payloadcms/ui'\nimport type {\n ClientConfig,\n LanguageOptions,\n SanitizedPermissions,\n ServerFunctionClient,\n User,\n} from 'payload'\n\nimport { rtlLanguages } from '@payloadcms/translations'\nimport { ProgressBar, RootProvider } from '@payloadcms/ui'\nimport React from 'react'\nimport '@payloadcms/ui/scss/app.scss'\n\nimport { TanStackRouterAdapter } from '../../elements/RouterAdapter/index.js'\n\nexport type RootLayoutData = {\n clientConfig: ClientConfig\n dateFNSKey: I18nClient['dateFNSKey']\n fallbackLang: string\n isNavOpen: boolean\n languageCode: string\n languageOptions: LanguageOptions\n locale?: string\n permissions: SanitizedPermissions\n /**\n * Custom admin provider tree (`config.admin.components.providers`) nested\n * around the router `<Outlet />`. Built unrendered by `getLayoutData`; the\n * layout server function renders it to an RSC payload before it reaches the\n * client. `undefined` when no custom providers are configured.\n */\n providers?: React.ReactNode\n theme: Theme\n translations: I18nClient['translations']\n user: null | User\n}\n\nexport type RootLayoutProps = {\n readonly children: React.ReactNode\n readonly data: RootLayoutData\n readonly serverFunction: ServerFunctionClient\n}\n\nexport function RootLayout({ children, data, serverFunction }: RootLayoutProps) {\n const dir = (rtlLanguages as unknown as string[]).includes(data.languageCode) ? 'RTL' : 'LTR'\n\n return (\n <html data-theme={data.theme} dir={dir} lang={data.languageCode} suppressHydrationWarning>\n <head>\n <style>{`@layer payload-default, payload;`}</style>\n </head>\n <body>\n <RootProvider\n config={data.clientConfig}\n dateFNSKey={data.dateFNSKey}\n fallbackLang={data.fallbackLang as AcceptedLanguages}\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) as unknown as SanitizedPermissions}\n RouterAdapter={TanStackRouterAdapter}\n serverFunction={serverFunction}\n theme={data.theme}\n translations={data.translations}\n user={data.user}\n >\n <ProgressBar />\n {children}\n </RootProvider>\n <div id=\"portal\" />\n </body>\n </html>\n )\n}\n"],"names":["rtlLanguages","ProgressBar","RootProvider","React","TanStackRouterAdapter","RootLayout","children","data","serverFunction","dir","includes","languageCode","html","data-theme","theme","lang","suppressHydrationWarning","head","style","body","config","clientConfig","dateFNSKey","fallbackLang","highContrastMode","isNavOpen","languageOptions","locale","permissions","user","RouterAdapter","translations","div","id"],"mappings":";AAUA,SAASA,YAAY,QAAQ,2BAA0B;AACvD,SAASC,WAAW,EAAEC,YAAY,QAAQ,iBAAgB;AAC1D,OAAOC,WAAW,QAAO;AACzB,OAAO,+BAA8B;AAErC,SAASC,qBAAqB,QAAQ,wCAAuC;AA6B7E,OAAO,SAASC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,cAAc,EAAmB;IAC5E,MAAMC,MAAM,AAACT,aAAqCU,QAAQ,CAACH,KAAKI,YAAY,IAAI,QAAQ;IAExF,qBACE,MAACC;QAAKC,cAAYN,KAAKO,KAAK;QAAEL,KAAKA;QAAKM,MAAMR,KAAKI,YAAY;QAAEK,wBAAwB;;0BACvF,KAACC;0BACC,cAAA,KAACC;8BAAO,CAAC,gCAAgC,CAAC;;;0BAE5C,MAACC;;kCACC,MAACjB;wBACCkB,QAAQb,KAAKc,YAAY;wBACzBC,YAAYf,KAAKe,UAAU;wBAC3BC,cAAchB,KAAKgB,YAAY;wBAC/BC,kBAAkB;wBAClBC,WAAWlB,KAAKkB,SAAS;wBACzBd,cAAcJ,KAAKI,YAAY;wBAC/Be,iBAAiBnB,KAAKmB,eAAe;wBACrCC,QAAQpB,KAAKoB,MAAM;wBACnBC,aAAcrB,KAAKsB,IAAI,GAAGtB,KAAKqB,WAAW,GAAG;wBAC7CE,eAAe1B;wBACfI,gBAAgBA;wBAChBM,OAAOP,KAAKO,KAAK;wBACjBiB,cAAcxB,KAAKwB,YAAY;wBAC/BF,MAAMtB,KAAKsB,IAAI;;0CAEf,KAAC5B;4BACAK;;;kCAEH,KAAC0B;wBAAIC,IAAG;;;;;;AAIhB"}
|
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the blocking inline script that sets `data-theme`, `lang`, and `dir`
|
|
4
|
+
* on `<html>` synchronously, before first paint, from Payload's theme and
|
|
5
|
+
* language cookies. This is the no-flash equivalent of what `RootProvider`'s
|
|
6
|
+
* `ThemeProvider` does in a post-hydration effect, hoisted into the SSR'd
|
|
7
|
+
* document head so the admin panel never flashes light mode (or LTR for RTL
|
|
8
|
+
* locales) on the first render. Mirrors `detectTheme` in
|
|
9
|
+
* `@payloadcms/ui`'s `ThemeProvider`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildThemeInitScript(cookiePrefix?: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* The no-flash theme bootstrap script for the default (`payload`) cookie
|
|
14
|
+
* prefix. Inline this in a `<script dangerouslySetInnerHTML>` inside the
|
|
15
|
+
* document `<head>` to set `data-theme`/`lang`/`dir` before first paint.
|
|
16
|
+
*/
|
|
17
|
+
export declare const THEME_INIT_SCRIPT: string;
|
|
2
18
|
export type PayloadAdminShellProps = {
|
|
3
19
|
readonly children: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The `config.cookiePrefix` used to read the theme/language cookies in the
|
|
22
|
+
* no-flash bootstrap script. Defaults to `'payload'`.
|
|
23
|
+
*/
|
|
24
|
+
readonly cookiePrefix?: string;
|
|
4
25
|
};
|
|
5
26
|
/**
|
|
6
27
|
* The `<html>` document shell for Payload admin routes — the TanStack Start
|
|
7
|
-
* equivalent of `@payloadcms/next`'s root layout `<html>`.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* client bootstrap script — the same server-side path Next's `RootLayout`
|
|
12
|
-
* uses, sharing `getRequestTheme`/`getLanguageDir` from `@payloadcms/ui`.
|
|
28
|
+
* equivalent of `@payloadcms/next`'s root layout `<html>`. Owns the no-flash
|
|
29
|
+
* theme script, the `@layer` ordering style, `@payloadcms/ui` styles,
|
|
30
|
+
* `<HeadContent />`, and `<Scripts />`. Render `RootProvider` (and the rest of
|
|
31
|
+
* the admin tree) as `children`.
|
|
13
32
|
*/
|
|
14
|
-
export declare function PayloadAdminShell({ children }: PayloadAdminShellProps): React.JSX.Element;
|
|
33
|
+
export declare function PayloadAdminShell({ children, cookiePrefix }: PayloadAdminShellProps): React.JSX.Element;
|
|
15
34
|
export type WithPayloadRootOptions = {
|
|
16
35
|
/**
|
|
17
36
|
* Path prefix that mounts the Payload admin panel (`config.routes.admin`).
|
|
@@ -19,6 +38,11 @@ export type WithPayloadRootOptions = {
|
|
|
19
38
|
* renders your own shell. Defaults to `'/admin'`.
|
|
20
39
|
*/
|
|
21
40
|
adminRoute?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The `config.cookiePrefix` used by the no-flash theme bootstrap script.
|
|
43
|
+
* Defaults to `'payload'`.
|
|
44
|
+
*/
|
|
45
|
+
cookiePrefix?: string;
|
|
22
46
|
};
|
|
23
47
|
/**
|
|
24
48
|
* Wraps your application's root document shell so Payload owns its own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPayloadRoot.d.ts","sourceRoot":"","sources":["../../../src/layouts/Root/withPayloadRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withPayloadRoot.d.ts","sourceRoot":"","sources":["../../../src/layouts/Root/withPayloadRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,GAAE,MAAkB,GAAG,MAAM,CAG7E;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAA+B,CAAA;AAE/D,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IAClC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAC/B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,sBAAsB,qBAmBnF;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,EAC7D,OAAO,GAAE,sBAA2B,IAIH,cAAc;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,uBAc7E"}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { rtlLanguages } from '@payloadcms/translations';
|
|
4
4
|
import { HeadContent, Scripts, useRouterState } from '@tanstack/react-router';
|
|
5
5
|
import React from 'react';
|
|
6
|
+
/**
|
|
7
|
+
* Builds the blocking inline script that sets `data-theme`, `lang`, and `dir`
|
|
8
|
+
* on `<html>` synchronously, before first paint, from Payload's theme and
|
|
9
|
+
* language cookies. This is the no-flash equivalent of what `RootProvider`'s
|
|
10
|
+
* `ThemeProvider` does in a post-hydration effect, hoisted into the SSR'd
|
|
11
|
+
* document head so the admin panel never flashes light mode (or LTR for RTL
|
|
12
|
+
* locales) on the first render. Mirrors `detectTheme` in
|
|
13
|
+
* `@payloadcms/ui`'s `ThemeProvider`.
|
|
14
|
+
*/ export function buildThemeInitScript(cookiePrefix = 'payload') {
|
|
15
|
+
const rtl = JSON.stringify(rtlLanguages);
|
|
16
|
+
return `(function(){try{var d=document.documentElement;var c=document.cookie.split('; ');function r(n){var row=c.find(function(x){return x.indexOf(n+'=')===0});return row?row.split('=')[1]:null}var t=r('${cookiePrefix}-theme');if(t!=='light'&&t!=='dark'){t=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}d.setAttribute('data-theme',t);var l=r('${cookiePrefix}-lng');if(l){d.setAttribute('lang',l);d.setAttribute('dir',${rtl}.indexOf(l)!==-1?'rtl':'ltr')}}catch(e){}})()`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The no-flash theme bootstrap script for the default (`payload`) cookie
|
|
20
|
+
* prefix. Inline this in a `<script dangerouslySetInnerHTML>` inside the
|
|
21
|
+
* document `<head>` to set `data-theme`/`lang`/`dir` before first paint.
|
|
22
|
+
*/ export const THEME_INIT_SCRIPT = buildThemeInitScript();
|
|
6
23
|
/**
|
|
7
24
|
* The `<html>` document shell for Payload admin routes — the TanStack Start
|
|
8
|
-
* equivalent of `@payloadcms/next`'s root layout `<html>`.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
25
|
+
* equivalent of `@payloadcms/next`'s root layout `<html>`. Owns the no-flash
|
|
26
|
+
* theme script, the `@layer` ordering style, `@payloadcms/ui` styles,
|
|
27
|
+
* `<HeadContent />`, and `<Scripts />`. Render `RootProvider` (and the rest of
|
|
28
|
+
* the admin tree) as `children`.
|
|
29
|
+
*/ export function PayloadAdminShell({ children, cookiePrefix }) {
|
|
30
|
+
const themeInitScript = cookiePrefix ? buildThemeInitScript(cookiePrefix) : THEME_INIT_SCRIPT;
|
|
31
|
+
return(// `lang`/`dir` are set on `<html>` by `themeInitScript` before first paint
|
|
32
|
+
// from the `*-lng` cookie, so a static `lang` here would be incorrect.
|
|
33
|
+
// eslint-disable-next-line jsx-a11y/html-has-lang -- set dynamically by the inline bootstrap script
|
|
38
34
|
/*#__PURE__*/ _jsxs("html", {
|
|
39
|
-
...htmlProps,
|
|
40
35
|
suppressHydrationWarning: true,
|
|
41
36
|
children: [
|
|
42
37
|
/*#__PURE__*/ _jsxs("head", {
|
|
43
38
|
children: [
|
|
39
|
+
/*#__PURE__*/ _jsx("script", {
|
|
40
|
+
dangerouslySetInnerHTML: {
|
|
41
|
+
__html: themeInitScript
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
44
|
/*#__PURE__*/ _jsx("style", {
|
|
45
45
|
children: `@layer payload-default, payload;`
|
|
46
46
|
}),
|
|
@@ -69,7 +69,7 @@ import React from 'react';
|
|
|
69
69
|
* })
|
|
70
70
|
* ```
|
|
71
71
|
*/ export function withPayloadRoot(RootShell, options = {}) {
|
|
72
|
-
const { adminRoute = '/admin' } = options;
|
|
72
|
+
const { adminRoute = '/admin', cookiePrefix } = options;
|
|
73
73
|
return function PayloadRootShell({ children }) {
|
|
74
74
|
const isAdminRoute = useRouterState({
|
|
75
75
|
select: (s)=>{
|
|
@@ -79,6 +79,7 @@ import React from 'react';
|
|
|
79
79
|
});
|
|
80
80
|
if (isAdminRoute) {
|
|
81
81
|
return /*#__PURE__*/ _jsx(PayloadAdminShell, {
|
|
82
|
+
cookiePrefix: cookiePrefix,
|
|
82
83
|
children: children
|
|
83
84
|
});
|
|
84
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/layouts/Root/withPayloadRoot.tsx"],"sourcesContent":["'use client'\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/layouts/Root/withPayloadRoot.tsx"],"sourcesContent":["'use client'\nimport { rtlLanguages } from '@payloadcms/translations'\nimport { HeadContent, Scripts, useRouterState } from '@tanstack/react-router'\nimport React from 'react'\n\n/**\n * Builds the blocking inline script that sets `data-theme`, `lang`, and `dir`\n * on `<html>` synchronously, before first paint, from Payload's theme and\n * language cookies. This is the no-flash equivalent of what `RootProvider`'s\n * `ThemeProvider` does in a post-hydration effect, hoisted into the SSR'd\n * document head so the admin panel never flashes light mode (or LTR for RTL\n * locales) on the first render. Mirrors `detectTheme` in\n * `@payloadcms/ui`'s `ThemeProvider`.\n */\nexport function buildThemeInitScript(cookiePrefix: string = 'payload'): string {\n const rtl = JSON.stringify(rtlLanguages)\n return `(function(){try{var d=document.documentElement;var c=document.cookie.split('; ');function r(n){var row=c.find(function(x){return x.indexOf(n+'=')===0});return row?row.split('=')[1]:null}var t=r('${cookiePrefix}-theme');if(t!=='light'&&t!=='dark'){t=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}d.setAttribute('data-theme',t);var l=r('${cookiePrefix}-lng');if(l){d.setAttribute('lang',l);d.setAttribute('dir',${rtl}.indexOf(l)!==-1?'rtl':'ltr')}}catch(e){}})()`\n}\n\n/**\n * The no-flash theme bootstrap script for the default (`payload`) cookie\n * prefix. Inline this in a `<script dangerouslySetInnerHTML>` inside the\n * document `<head>` to set `data-theme`/`lang`/`dir` before first paint.\n */\nexport const THEME_INIT_SCRIPT: string = buildThemeInitScript()\n\nexport type PayloadAdminShellProps = {\n readonly children: React.ReactNode\n /**\n * The `config.cookiePrefix` used to read the theme/language cookies in the\n * no-flash bootstrap script. Defaults to `'payload'`.\n */\n readonly cookiePrefix?: string\n}\n\n/**\n * The `<html>` document shell for Payload admin routes — the TanStack Start\n * equivalent of `@payloadcms/next`'s root layout `<html>`. Owns the no-flash\n * theme script, the `@layer` ordering style, `@payloadcms/ui` styles,\n * `<HeadContent />`, and `<Scripts />`. Render `RootProvider` (and the rest of\n * the admin tree) as `children`.\n */\nexport function PayloadAdminShell({ children, cookiePrefix }: PayloadAdminShellProps) {\n const themeInitScript = cookiePrefix ? buildThemeInitScript(cookiePrefix) : THEME_INIT_SCRIPT\n\n return (\n // `lang`/`dir` are set on `<html>` by `themeInitScript` before first paint\n // from the `*-lng` cookie, so a static `lang` here would be incorrect.\n // eslint-disable-next-line jsx-a11y/html-has-lang -- set dynamically by the inline bootstrap script\n <html suppressHydrationWarning>\n <head>\n <script dangerouslySetInnerHTML={{ __html: themeInitScript }} />\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 * The `config.cookiePrefix` used by the no-flash theme bootstrap script.\n * Defaults to `'payload'`.\n */\n cookiePrefix?: 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', cookiePrefix } = 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 cookiePrefix={cookiePrefix}>{children}</PayloadAdminShell>\n }\n\n return <RootShell>{children}</RootShell>\n }\n}\n"],"names":["rtlLanguages","HeadContent","Scripts","useRouterState","React","buildThemeInitScript","cookiePrefix","rtl","JSON","stringify","THEME_INIT_SCRIPT","PayloadAdminShell","children","themeInitScript","html","suppressHydrationWarning","head","script","dangerouslySetInnerHTML","__html","style","body","withPayloadRoot","RootShell","options","adminRoute","PayloadRootShell","isAdminRoute","select","s","pathname","location","startsWith"],"mappings":"AAAA;;AACA,SAASA,YAAY,QAAQ,2BAA0B;AACvD,SAASC,WAAW,EAAEC,OAAO,EAAEC,cAAc,QAAQ,yBAAwB;AAC7E,OAAOC,WAAW,QAAO;AAEzB;;;;;;;;CAQC,GACD,OAAO,SAASC,qBAAqBC,eAAuB,SAAS;IACnE,MAAMC,MAAMC,KAAKC,SAAS,CAACT;IAC3B,OAAO,CAAC,mMAAmM,EAAEM,aAAa,2KAA2K,EAAEA,aAAa,2DAA2D,EAAEC,IAAI,6CAA6C,CAAC;AACrgB;AAEA;;;;CAIC,GACD,OAAO,MAAMG,oBAA4BL,uBAAsB;AAW/D;;;;;;CAMC,GACD,OAAO,SAASM,kBAAkB,EAAEC,QAAQ,EAAEN,YAAY,EAA0B;IAClF,MAAMO,kBAAkBP,eAAeD,qBAAqBC,gBAAgBI;IAE5E,OACE,2EAA2E;IAC3E,uEAAuE;IACvE,oGAAoG;kBACpG,MAACI;QAAKC,wBAAwB;;0BAC5B,MAACC;;kCACC,KAACC;wBAAOC,yBAAyB;4BAAEC,QAAQN;wBAAgB;;kCAC3D,KAACO;kCAAO,CAAC,gCAAgC,CAAC;;kCAC1C,KAACnB;;;0BAEH,MAACoB;;oBACET;kCACD,KAACV;;;;;AAIT;AAgBA;;;;;;;;;;;;CAYC,GACD,OAAO,SAASoB,gBACdC,SAA6D,EAC7DC,UAAkC,CAAC,CAAC;IAEpC,MAAM,EAAEC,aAAa,QAAQ,EAAEnB,YAAY,EAAE,GAAGkB;IAEhD,OAAO,SAASE,iBAAiB,EAAEd,QAAQ,EAAiC;QAC1E,MAAMe,eAAexB,eAAe;YAClCyB,QAAQ,CAACC;gBACP,MAAM,EAAEC,QAAQ,EAAE,GAAGD,EAAEE,QAAQ;gBAC/B,OAAOD,aAAaL,cAAcK,SAASE,UAAU,CAAC,GAAGP,WAAW,CAAC,CAAC;YACxE;QACF;QAEA,IAAIE,cAAc;YAChB,qBAAO,KAAChB;gBAAkBL,cAAcA;0BAAeM;;QACzD;QAEA,qBAAO,KAACW;sBAAWX;;IACrB;AACF"}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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>;
|
|
1
|
+
export function resolve(specifier: any, context: any, nextResolve: any): Promise<any>;
|
|
2
|
+
export function load(url: any, context: any, nextLoad: any): Promise<any>;
|
|
25
3
|
//# sourceMappingURL=cssLoader.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cssLoader.d.mts","sourceRoot":"","sources":["../../src/node/cssLoader.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cssLoader.d.mts","sourceRoot":"","sources":["../../src/node/cssLoader.mjs"],"names":[],"mappings":"AAsDA,sFASC;AAED,0EASC"}
|
|
@@ -1 +1 @@
|
|
|
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,gCAQjB;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;
|
|
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,gCAQjB;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;;2BAGzC;QAAE,UAAU,CAAC,EAAE,GAAG,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;wCAOH;YAAE,QAAQ,EAAE,GAAG,CAAC;YAAC,MAAM,EAAE,GAAG,CAAA;SAAE;;;6BAW7C;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;;;;6BAInC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;EAEnD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE;;2BAGzC;QAAE,UAAU,CAAC,EAAE,GAAG,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;gCAEX;YAAE,QAAQ,EAAE,GAAG,CAAA;SAAE;;;6BAUxB;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;;;6BAGnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;EAEnD"}
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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;;;;;;EAwCA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Theme } from '@payloadcms/ui';
|
|
2
|
+
import type { SanitizedConfig } from 'payload';
|
|
3
|
+
type GetRequestThemeArgs = {
|
|
4
|
+
config: SanitizedConfig;
|
|
5
|
+
cookies: Map<string, string>;
|
|
6
|
+
headers: Headers;
|
|
7
|
+
};
|
|
8
|
+
export declare function getRequestTheme({ config, cookies, headers }: GetRequestThemeArgs): Theme;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=getRequestTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRequestTheme.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAUD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,mBAAmB,GAAG,KAAK,CAkBxF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Defined locally rather than imported from `@payloadcms/ui` (a `'use client'`
|
|
2
|
+
// barrel) because its value exports resolve to non-serializable client
|
|
3
|
+
// references in this adapter's RSC server context. `Theme` is a type-only
|
|
4
|
+
// import and is safely erased at runtime.
|
|
5
|
+
const defaultTheme = 'light';
|
|
6
|
+
const acceptedThemes = [
|
|
7
|
+
'dark',
|
|
8
|
+
'light'
|
|
9
|
+
];
|
|
10
|
+
export function getRequestTheme({ config, cookies, headers }) {
|
|
11
|
+
if (config.admin.theme !== 'all' && acceptedThemes.includes(config.admin.theme)) {
|
|
12
|
+
return config.admin.theme;
|
|
13
|
+
}
|
|
14
|
+
const themeCookie = cookies.get(`${config.cookiePrefix || 'payload'}-theme`);
|
|
15
|
+
if (themeCookie && acceptedThemes.includes(themeCookie)) {
|
|
16
|
+
return themeCookie;
|
|
17
|
+
}
|
|
18
|
+
const themeFromHeader = headers.get('Sec-CH-Prefers-Color-Scheme');
|
|
19
|
+
if (themeFromHeader && acceptedThemes.includes(themeFromHeader)) {
|
|
20
|
+
return themeFromHeader;
|
|
21
|
+
}
|
|
22
|
+
return defaultTheme;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=getRequestTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/getRequestTheme.ts"],"sourcesContent":["import type { Theme } from '@payloadcms/ui'\nimport type { SanitizedConfig } from 'payload'\n\ntype GetRequestThemeArgs = {\n config: SanitizedConfig\n cookies: Map<string, string>\n headers: Headers\n}\n\n// Defined locally rather than imported from `@payloadcms/ui` (a `'use client'`\n// barrel) because its value exports resolve to non-serializable client\n// references in this adapter's RSC server context. `Theme` is a type-only\n// import and is safely erased at runtime.\nconst defaultTheme: Theme = 'light'\n\nconst acceptedThemes: Theme[] = ['dark', 'light']\n\nexport function getRequestTheme({ config, cookies, headers }: GetRequestThemeArgs): Theme {\n if (config.admin.theme !== 'all' && acceptedThemes.includes(config.admin.theme)) {\n return config.admin.theme\n }\n\n const themeCookie = cookies.get(`${config.cookiePrefix || 'payload'}-theme`)\n\n if (themeCookie && acceptedThemes.includes(themeCookie as Theme)) {\n return themeCookie as Theme\n }\n\n const themeFromHeader = headers.get('Sec-CH-Prefers-Color-Scheme') as Theme\n\n if (themeFromHeader && acceptedThemes.includes(themeFromHeader)) {\n return themeFromHeader\n }\n\n return defaultTheme\n}\n"],"names":["defaultTheme","acceptedThemes","getRequestTheme","config","cookies","headers","admin","theme","includes","themeCookie","get","cookiePrefix","themeFromHeader"],"mappings":"AASA,+EAA+E;AAC/E,uEAAuE;AACvE,0EAA0E;AAC1E,0CAA0C;AAC1C,MAAMA,eAAsB;AAE5B,MAAMC,iBAA0B;IAAC;IAAQ;CAAQ;AAEjD,OAAO,SAASC,gBAAgB,EAAEC,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAuB;IAC/E,IAAIF,OAAOG,KAAK,CAACC,KAAK,KAAK,SAASN,eAAeO,QAAQ,CAACL,OAAOG,KAAK,CAACC,KAAK,GAAG;QAC/E,OAAOJ,OAAOG,KAAK,CAACC,KAAK;IAC3B;IAEA,MAAME,cAAcL,QAAQM,GAAG,CAAC,GAAGP,OAAOQ,YAAY,IAAI,UAAU,MAAM,CAAC;IAE3E,IAAIF,eAAeR,eAAeO,QAAQ,CAACC,cAAuB;QAChE,OAAOA;IACT;IAEA,MAAMG,kBAAkBP,QAAQK,GAAG,CAAC;IAEpC,IAAIE,mBAAmBX,eAAeO,QAAQ,CAACI,kBAAkB;QAC/D,OAAOA;IACT;IAEA,OAAOZ;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlHandler.server.d.ts","sourceRoot":"","sources":["../../src/utilities/graphqlHandler.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,eAAe,EAAE,MAAM,SAAS,CAAA;AAyFvE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"graphqlHandler.server.d.ts","sourceRoot":"","sources":["../../src/utilities/graphqlHandler.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,eAAe,EAAE,MAAM,SAAS,CAAA;AAyFvE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAU,sBAGjC;IACD,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IAClD,OAAO,EAAE,OAAO,CAAA;CACjB,KAAG,OAAO,CAAC,QAAQ,CA2DnB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverAdapter.server.d.ts","sourceRoot":"","sources":["../../src/utilities/serverAdapter.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8B,aAAa,EAAE,MAAM,SAAS,CAAA;AAsDxE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,aA8CnC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"serverAdapter.server.d.ts","sourceRoot":"","sources":["../../src/utilities/serverAdapter.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8B,aAAa,EAAE,MAAM,SAAS,CAAA;AAsDxE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,aA8CnC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,GAAI,KAAK,aAAa,KAAG,aAgBjE,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vite-level configuration constants used by `payloadPlugin`. Kept separate so
|
|
3
|
+
* `plugin.ts` stays focused on wiring.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Server-only packages (Node-only or only ever used by the server bundle).
|
|
7
|
+
* These are the Vite equivalent of Next.js's `serverExternalPackages`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ssrExternalPackages: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Payload packages whose source must be processed by Vite even on the server
|
|
12
|
+
* (because they are workspace `.ts` files in dev). Server-only adapters
|
|
13
|
+
* (`@payloadcms/db-*`, `@payloadcms/email-*`, `@payloadcms/next`, etc.) are
|
|
14
|
+
* intentionally not included — those should stay external on the SSR side.
|
|
15
|
+
*/
|
|
16
|
+
export declare const payloadNoExternalPatterns: Array<RegExp | string>;
|
|
17
|
+
/**
|
|
18
|
+
* The subset of `payloadNoExternalPatterns` that needs to participate in the
|
|
19
|
+
* RSC environment. Plugins and storage adapters must be included: they register
|
|
20
|
+
* custom providers/components (e.g. `plugin-multi-tenant`'s `'use client'`
|
|
21
|
+
* `TenantSelectionProvider`) that render in the RSC graph via
|
|
22
|
+
* `RenderServerComponent`. If the package stays external to RSC, `plugin-rsc`
|
|
23
|
+
* never transforms its `'use client'` modules into client references, so the
|
|
24
|
+
* component executes server-side and crashes on the first hook
|
|
25
|
+
* (`Cannot read properties of null (reading 'useState')`).
|
|
26
|
+
*/
|
|
27
|
+
export declare const payloadRscNoExternalPatterns: Array<RegExp | string>;
|
|
28
|
+
/**
|
|
29
|
+
* Packages we know contain Node-only code or top-level side effects requiring
|
|
30
|
+
* Node APIs. Excluding them from the client optimizer prevents Vite from
|
|
31
|
+
* walking into their main entries and trying to bundle server-only imports
|
|
32
|
+
* for the browser.
|
|
33
|
+
*/
|
|
34
|
+
export declare const optimizeDepsExcludeDefaults: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Transitive dependencies of `@payloadcms/ui` and `payload` that need to be
|
|
37
|
+
* pre-bundled for the client. Vite's auto-discovery doesn't reliably pick
|
|
38
|
+
* these up because their parent packages are in `optimizeDeps.exclude`, so we
|
|
39
|
+
* list them explicitly using the `parent > child` syntax.
|
|
40
|
+
*/
|
|
41
|
+
export declare const optimizeDepsIncludeDefaults: string[];
|
|
42
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/vite/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,EA0BvC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAO5D,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAO/D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,EAsB/C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,EA8E/C,CAAA"}
|