@xtandard/kit 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +71 -2
- package/bin/xtandard-kit.mjs +3 -0
- package/dist/base-path-BJugWLNO.cjs +42 -0
- package/dist/base-path-BJugWLNO.cjs.map +1 -0
- package/dist/base-path-CDb4In5E.mjs +31 -0
- package/dist/base-path-CDb4In5E.mjs.map +1 -0
- package/dist/basic-Qtriv0xS.mjs +176 -0
- package/dist/basic-Qtriv0xS.mjs.map +1 -0
- package/dist/basic-ZaO92-lB.cjs +199 -0
- package/dist/basic-ZaO92-lB.cjs.map +1 -0
- package/dist/bin.cjs +126 -0
- package/dist/bin.cjs.map +1 -0
- package/dist/bin.d.cts +20 -0
- package/dist/bin.d.mts +20 -0
- package/dist/bin.mjs +125 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/cas-CuPSaXBV.cjs +23 -0
- package/dist/cas-CuPSaXBV.cjs.map +1 -0
- package/dist/cas-CzA-yECx.mjs +18 -0
- package/dist/cas-CzA-yECx.mjs.map +1 -0
- package/dist/chunk-DakpK96I.cjs +43 -0
- package/dist/contract-B3UPXXLx.d.cts +30 -0
- package/dist/contract-B3UPXXLx.d.mts +30 -0
- package/dist/contract-BDPNvjtp.d.mts +64 -0
- package/dist/contract-BEdfGTPs.mjs +85 -0
- package/dist/contract-BEdfGTPs.mjs.map +1 -0
- package/dist/contract-BIVzAn4f.d.cts +64 -0
- package/dist/contract-BvgtswLX.d.cts +75 -0
- package/dist/contract-BvgtswLX.d.mts +75 -0
- package/dist/contract-DUj9P3Vt.d.cts +72 -0
- package/dist/contract-DUj9P3Vt.d.mts +72 -0
- package/dist/contract-wAEMDmYG.cjs +132 -0
- package/dist/contract-wAEMDmYG.cjs.map +1 -0
- package/dist/drizzle-BElCHWri.d.mts +115 -0
- package/dist/drizzle-BXaQXCr0.cjs +232 -0
- package/dist/drizzle-BXaQXCr0.cjs.map +1 -0
- package/dist/drizzle-CEpahWQB.d.cts +115 -0
- package/dist/drizzle-DxnelsPT.mjs +197 -0
- package/dist/drizzle-DxnelsPT.mjs.map +1 -0
- package/dist/duration-7WpAK-xe.mjs +52 -0
- package/dist/duration-7WpAK-xe.mjs.map +1 -0
- package/dist/duration-DVA0Fzkx.cjs +63 -0
- package/dist/duration-DVA0Fzkx.cjs.map +1 -0
- package/dist/duration-FPwbmWIU.d.cts +35 -0
- package/dist/duration-FPwbmWIU.d.mts +35 -0
- package/dist/entry-adapters-bun.cjs +10 -0
- package/dist/entry-adapters-bun.cjs.map +1 -0
- package/dist/entry-adapters-bun.d.cts +10 -0
- package/dist/entry-adapters-bun.d.mts +10 -0
- package/dist/entry-adapters-bun.mjs +9 -0
- package/dist/entry-adapters-bun.mjs.map +1 -0
- package/dist/entry-adapters-elysia.cjs +54 -0
- package/dist/entry-adapters-elysia.cjs.map +1 -0
- package/dist/entry-adapters-elysia.d.cts +38 -0
- package/dist/entry-adapters-elysia.d.mts +38 -0
- package/dist/entry-adapters-elysia.mjs +53 -0
- package/dist/entry-adapters-elysia.mjs.map +1 -0
- package/dist/entry-adapters-express.cjs +27 -0
- package/dist/entry-adapters-express.cjs.map +1 -0
- package/dist/entry-adapters-express.d.cts +24 -0
- package/dist/entry-adapters-express.d.mts +24 -0
- package/dist/entry-adapters-express.mjs +26 -0
- package/dist/entry-adapters-express.mjs.map +1 -0
- package/dist/entry-adapters-hono.cjs +33 -0
- package/dist/entry-adapters-hono.cjs.map +1 -0
- package/dist/entry-adapters-hono.d.cts +36 -0
- package/dist/entry-adapters-hono.d.mts +36 -0
- package/dist/entry-adapters-hono.mjs +30 -0
- package/dist/entry-adapters-hono.mjs.map +1 -0
- package/dist/entry-adapters-next.cjs +19 -0
- package/dist/entry-adapters-next.cjs.map +1 -0
- package/dist/entry-adapters-next.d.cts +35 -0
- package/dist/entry-adapters-next.d.mts +35 -0
- package/dist/entry-adapters-next.mjs +18 -0
- package/dist/entry-adapters-next.mjs.map +1 -0
- package/dist/entry-adapters-node.cjs +7 -0
- package/dist/entry-adapters-node.d.cts +2 -0
- package/dist/entry-adapters-node.d.mts +2 -0
- package/dist/entry-adapters-node.mjs +2 -0
- package/dist/entry-auth-basic.cjs +5 -0
- package/dist/entry-auth-basic.d.cts +83 -0
- package/dist/entry-auth-basic.d.mts +83 -0
- package/dist/entry-auth-basic.mjs +2 -0
- package/dist/entry-auth-delegated.cjs +28 -0
- package/dist/entry-auth-delegated.cjs.map +1 -0
- package/dist/entry-auth-delegated.d.cts +36 -0
- package/dist/entry-auth-delegated.d.mts +36 -0
- package/dist/entry-auth-delegated.mjs +27 -0
- package/dist/entry-auth-delegated.mjs.map +1 -0
- package/dist/entry-auth-none.cjs +4 -0
- package/dist/entry-auth-none.d.cts +25 -0
- package/dist/entry-auth-none.d.mts +25 -0
- package/dist/entry-auth-none.mjs +2 -0
- package/dist/entry-auth.cjs +0 -0
- package/dist/entry-auth.d.cts +2 -0
- package/dist/entry-auth.d.mts +2 -0
- package/dist/entry-auth.mjs +1 -0
- package/dist/entry-authorization-delegated.cjs +27 -0
- package/dist/entry-authorization-delegated.cjs.map +1 -0
- package/dist/entry-authorization-delegated.d.cts +31 -0
- package/dist/entry-authorization-delegated.d.mts +31 -0
- package/dist/entry-authorization-delegated.mjs +26 -0
- package/dist/entry-authorization-delegated.mjs.map +1 -0
- package/dist/entry-authorization-none.cjs +3 -0
- package/dist/entry-authorization-none.d.cts +18 -0
- package/dist/entry-authorization-none.d.mts +18 -0
- package/dist/entry-authorization-none.mjs +2 -0
- package/dist/entry-authorization-roles.cjs +3 -0
- package/dist/entry-authorization-roles.d.cts +2 -0
- package/dist/entry-authorization-roles.d.mts +2 -0
- package/dist/entry-authorization-roles.mjs +2 -0
- package/dist/entry-authorization.cjs +35 -0
- package/dist/entry-authorization.cjs.map +1 -0
- package/dist/entry-authorization.d.cts +2 -0
- package/dist/entry-authorization.d.mts +2 -0
- package/dist/entry-authorization.mjs +34 -0
- package/dist/entry-authorization.mjs.map +1 -0
- package/dist/entry-build.cjs +481 -0
- package/dist/entry-build.cjs.map +1 -0
- package/dist/entry-build.d.cts +355 -0
- package/dist/entry-build.d.mts +355 -0
- package/dist/entry-build.mjs +460 -0
- package/dist/entry-build.mjs.map +1 -0
- package/dist/entry-cli.cjs +368 -0
- package/dist/entry-cli.cjs.map +1 -0
- package/dist/entry-cli.d.cts +275 -0
- package/dist/entry-cli.d.mts +275 -0
- package/dist/entry-cli.mjs +355 -0
- package/dist/entry-cli.mjs.map +1 -0
- package/dist/entry-drizzle-mysql.cjs +36 -0
- package/dist/entry-drizzle-mysql.cjs.map +1 -0
- package/dist/entry-drizzle-mysql.d.cts +55 -0
- package/dist/entry-drizzle-mysql.d.mts +55 -0
- package/dist/entry-drizzle-mysql.mjs +34 -0
- package/dist/entry-drizzle-mysql.mjs.map +1 -0
- package/dist/entry-drizzle-pg.cjs +38 -0
- package/dist/entry-drizzle-pg.cjs.map +1 -0
- package/dist/entry-drizzle-pg.d.cts +78 -0
- package/dist/entry-drizzle-pg.d.mts +78 -0
- package/dist/entry-drizzle-pg.mjs +36 -0
- package/dist/entry-drizzle-pg.mjs.map +1 -0
- package/dist/entry-drizzle-sqlite.cjs +20 -0
- package/dist/entry-drizzle-sqlite.cjs.map +1 -0
- package/dist/entry-drizzle-sqlite.d.cts +22 -0
- package/dist/entry-drizzle-sqlite.d.mts +22 -0
- package/dist/entry-drizzle-sqlite.mjs +19 -0
- package/dist/entry-drizzle-sqlite.mjs.map +1 -0
- package/dist/entry-hooks-log.cjs +32 -0
- package/dist/entry-hooks-log.cjs.map +1 -0
- package/dist/entry-hooks-log.d.cts +36 -0
- package/dist/entry-hooks-log.d.mts +36 -0
- package/dist/entry-hooks-log.mjs +31 -0
- package/dist/entry-hooks-log.mjs.map +1 -0
- package/dist/entry-hooks.cjs +10 -0
- package/dist/entry-hooks.d.cts +2 -0
- package/dist/entry-hooks.d.mts +2 -0
- package/dist/entry-hooks.mjs +2 -0
- package/dist/entry-server-router.cjs +235 -0
- package/dist/entry-server-router.cjs.map +1 -0
- package/dist/entry-server-router.d.cts +193 -0
- package/dist/entry-server-router.d.mts +193 -0
- package/dist/entry-server-router.mjs +228 -0
- package/dist/entry-server-router.mjs.map +1 -0
- package/dist/entry-server.cjs +344 -0
- package/dist/entry-server.cjs.map +1 -0
- package/dist/entry-server.d.cts +230 -0
- package/dist/entry-server.d.mts +230 -0
- package/dist/entry-server.mjs +322 -0
- package/dist/entry-server.mjs.map +1 -0
- package/dist/entry-site.cjs +1083 -0
- package/dist/entry-site.cjs.map +1 -0
- package/dist/entry-site.d.cts +336 -0
- package/dist/entry-site.d.mts +336 -0
- package/dist/entry-site.mjs +1060 -0
- package/dist/entry-site.mjs.map +1 -0
- package/dist/entry-storage-cloudflare-kv.cjs +51 -0
- package/dist/entry-storage-cloudflare-kv.cjs.map +1 -0
- package/dist/entry-storage-cloudflare-kv.d.cts +52 -0
- package/dist/entry-storage-cloudflare-kv.d.mts +52 -0
- package/dist/entry-storage-cloudflare-kv.mjs +50 -0
- package/dist/entry-storage-cloudflare-kv.mjs.map +1 -0
- package/dist/entry-storage-drizzle-internals.cjs +6 -0
- package/dist/entry-storage-drizzle-internals.d.cts +2 -0
- package/dist/entry-storage-drizzle-internals.d.mts +2 -0
- package/dist/entry-storage-drizzle-internals.mjs +2 -0
- package/dist/entry-storage-drizzle.cjs +4 -0
- package/dist/entry-storage-drizzle.d.cts +3 -0
- package/dist/entry-storage-drizzle.d.mts +3 -0
- package/dist/entry-storage-drizzle.mjs +2 -0
- package/dist/entry-storage-file.cjs +306 -0
- package/dist/entry-storage-file.cjs.map +1 -0
- package/dist/entry-storage-file.d.cts +76 -0
- package/dist/entry-storage-file.d.mts +76 -0
- package/dist/entry-storage-file.mjs +301 -0
- package/dist/entry-storage-file.mjs.map +1 -0
- package/dist/entry-storage-libsql-internals.cjs +7 -0
- package/dist/entry-storage-libsql-internals.d.cts +3 -0
- package/dist/entry-storage-libsql-internals.d.mts +3 -0
- package/dist/entry-storage-libsql-internals.mjs +3 -0
- package/dist/entry-storage-libsql.cjs +3 -0
- package/dist/entry-storage-libsql.d.cts +2 -0
- package/dist/entry-storage-libsql.d.mts +2 -0
- package/dist/entry-storage-libsql.mjs +2 -0
- package/dist/entry-storage-memory.cjs +78 -0
- package/dist/entry-storage-memory.cjs.map +1 -0
- package/dist/entry-storage-memory.d.cts +35 -0
- package/dist/entry-storage-memory.d.mts +35 -0
- package/dist/entry-storage-memory.mjs +77 -0
- package/dist/entry-storage-memory.mjs.map +1 -0
- package/dist/entry-storage-mongodb-internals.cjs +5 -0
- package/dist/entry-storage-mongodb-internals.d.cts +2 -0
- package/dist/entry-storage-mongodb-internals.d.mts +2 -0
- package/dist/entry-storage-mongodb-internals.mjs +2 -0
- package/dist/entry-storage-mongodb.cjs +3 -0
- package/dist/entry-storage-mongodb.d.cts +2 -0
- package/dist/entry-storage-mongodb.d.mts +2 -0
- package/dist/entry-storage-mongodb.mjs +2 -0
- package/dist/entry-storage-postgres-internals.cjs +6 -0
- package/dist/entry-storage-postgres-internals.d.cts +2 -0
- package/dist/entry-storage-postgres-internals.d.mts +2 -0
- package/dist/entry-storage-postgres-internals.mjs +2 -0
- package/dist/entry-storage-postgres.cjs +4 -0
- package/dist/entry-storage-postgres.d.cts +2 -0
- package/dist/entry-storage-postgres.d.mts +2 -0
- package/dist/entry-storage-postgres.mjs +2 -0
- package/dist/entry-storage-redis-internals.cjs +7 -0
- package/dist/entry-storage-redis-internals.d.cts +2 -0
- package/dist/entry-storage-redis-internals.d.mts +2 -0
- package/dist/entry-storage-redis-internals.mjs +2 -0
- package/dist/entry-storage-redis.cjs +4 -0
- package/dist/entry-storage-redis.d.cts +2 -0
- package/dist/entry-storage-redis.d.mts +2 -0
- package/dist/entry-storage-redis.mjs +2 -0
- package/dist/entry-storage-sqlite-internals.cjs +7 -0
- package/dist/entry-storage-sqlite-internals.d.cts +3 -0
- package/dist/entry-storage-sqlite-internals.d.mts +3 -0
- package/dist/entry-storage-sqlite-internals.mjs +3 -0
- package/dist/entry-storage-sqlite.cjs +3 -0
- package/dist/entry-storage-sqlite.d.cts +2 -0
- package/dist/entry-storage-sqlite.d.mts +2 -0
- package/dist/entry-storage-sqlite.mjs +2 -0
- package/dist/entry-storage-testing.cjs +801 -0
- package/dist/entry-storage-testing.cjs.map +1 -0
- package/dist/entry-storage-testing.d.cts +150 -0
- package/dist/entry-storage-testing.d.mts +150 -0
- package/dist/entry-storage-testing.mjs +790 -0
- package/dist/entry-storage-testing.mjs.map +1 -0
- package/dist/entry-storage-unstorage.cjs +78 -0
- package/dist/entry-storage-unstorage.cjs.map +1 -0
- package/dist/entry-storage-unstorage.d.cts +30 -0
- package/dist/entry-storage-unstorage.d.mts +30 -0
- package/dist/entry-storage-unstorage.mjs +77 -0
- package/dist/entry-storage-unstorage.mjs.map +1 -0
- package/dist/entry-storage.cjs +114 -0
- package/dist/entry-storage.cjs.map +1 -0
- package/dist/entry-storage.d.cts +152 -0
- package/dist/entry-storage.d.mts +152 -0
- package/dist/entry-storage.mjs +91 -0
- package/dist/entry-storage.mjs.map +1 -0
- package/dist/entry-testing.cjs +79 -0
- package/dist/entry-testing.cjs.map +1 -0
- package/dist/entry-testing.d.cts +55 -0
- package/dist/entry-testing.d.mts +55 -0
- package/dist/entry-testing.mjs +77 -0
- package/dist/entry-testing.mjs.map +1 -0
- package/dist/entry-tokens.cjs +4 -0
- package/dist/entry-tokens.d.cts +85 -0
- package/dist/entry-tokens.d.mts +85 -0
- package/dist/entry-tokens.mjs +2 -0
- package/dist/entry-ui-embed.cjs +131 -0
- package/dist/entry-ui-embed.cjs.map +1 -0
- package/dist/entry-ui-embed.d.cts +87 -0
- package/dist/entry-ui-embed.d.mts +87 -0
- package/dist/entry-ui-embed.mjs +127 -0
- package/dist/entry-ui-embed.mjs.map +1 -0
- package/dist/entry-ui.cjs +795 -0
- package/dist/entry-ui.cjs.map +1 -0
- package/dist/entry-ui.d.cts +574 -0
- package/dist/entry-ui.d.mts +574 -0
- package/dist/entry-ui.mjs +731 -0
- package/dist/entry-ui.mjs.map +1 -0
- package/dist/entry-util.cjs +145 -0
- package/dist/entry-util.cjs.map +1 -0
- package/dist/entry-util.d.cts +85 -0
- package/dist/entry-util.d.mts +85 -0
- package/dist/entry-util.mjs +130 -0
- package/dist/entry-util.mjs.map +1 -0
- package/dist/http-B_rTnLW9.cjs +235 -0
- package/dist/http-B_rTnLW9.cjs.map +1 -0
- package/dist/http-CxYM7kPT.d.mts +133 -0
- package/dist/http-DVdVI6kJ.mjs +164 -0
- package/dist/http-DVdVI6kJ.mjs.map +1 -0
- package/dist/http-XBVRk8uo.d.cts +133 -0
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -0
- package/dist/json-CCyzstIm.d.cts +44 -0
- package/dist/json-CCyzstIm.d.mts +44 -0
- package/dist/json-CM7TwYQ7.cjs +92 -0
- package/dist/json-CM7TwYQ7.cjs.map +1 -0
- package/dist/json-CmM1M5Kz.mjs +63 -0
- package/dist/json-CmM1M5Kz.mjs.map +1 -0
- package/dist/keys-Bwubabk0.mjs +73 -0
- package/dist/keys-Bwubabk0.mjs.map +1 -0
- package/dist/keys-DQrwxDKI.cjs +126 -0
- package/dist/keys-DQrwxDKI.cjs.map +1 -0
- package/dist/kv-sqlite-B6iTLOx2.d.cts +20 -0
- package/dist/kv-sqlite-CHOdIMJ-.cjs +77 -0
- package/dist/kv-sqlite-CHOdIMJ-.cjs.map +1 -0
- package/dist/kv-sqlite-DIIPfflJ.mjs +66 -0
- package/dist/kv-sqlite-DIIPfflJ.mjs.map +1 -0
- package/dist/kv-sqlite-Tx4UedJs.d.mts +20 -0
- package/dist/libsql-0160BubR.d.mts +65 -0
- package/dist/libsql-BZmRZIqt.d.cts +65 -0
- package/dist/libsql-CiBfVtbS.cjs +103 -0
- package/dist/libsql-CiBfVtbS.cjs.map +1 -0
- package/dist/libsql-CkOjQINi.mjs +86 -0
- package/dist/libsql-CkOjQINi.mjs.map +1 -0
- package/dist/mongodb--Cuj7V_9.cjs +150 -0
- package/dist/mongodb--Cuj7V_9.cjs.map +1 -0
- package/dist/mongodb-DGtsolQ2.d.cts +61 -0
- package/dist/mongodb-JMizy4Wg.mjs +127 -0
- package/dist/mongodb-JMizy4Wg.mjs.map +1 -0
- package/dist/mongodb-xGEU5Gwz.d.mts +61 -0
- package/dist/node-B1Djcwfi.d.cts +57 -0
- package/dist/node-B1Djcwfi.d.mts +57 -0
- package/dist/node-BYjocCbU.mjs +167 -0
- package/dist/node-BYjocCbU.mjs.map +1 -0
- package/dist/node-DFFqYRk-.cjs +201 -0
- package/dist/node-DFFqYRk-.cjs.map +1 -0
- package/dist/none-BEY7Kc_-.mjs +33 -0
- package/dist/none-BEY7Kc_-.mjs.map +1 -0
- package/dist/none-BoQ6-30P.cjs +33 -0
- package/dist/none-BoQ6-30P.cjs.map +1 -0
- package/dist/none-CHwVkQL-.cjs +49 -0
- package/dist/none-CHwVkQL-.cjs.map +1 -0
- package/dist/none-yu3qC47E.mjs +23 -0
- package/dist/none-yu3qC47E.mjs.map +1 -0
- package/dist/peer-BIjBFzwQ.cjs +56 -0
- package/dist/peer-BIjBFzwQ.cjs.map +1 -0
- package/dist/peer-CTHMzOdn.mjs +40 -0
- package/dist/peer-CTHMzOdn.mjs.map +1 -0
- package/dist/portal-container-CJIcau3B.mjs +610 -0
- package/dist/portal-container-CJIcau3B.mjs.map +1 -0
- package/dist/portal-container-Ca1NxrLE.cjs +774 -0
- package/dist/portal-container-Ca1NxrLE.cjs.map +1 -0
- package/dist/postgres-BJzxKBk0.d.cts +72 -0
- package/dist/postgres-CA8_XcAE.cjs +164 -0
- package/dist/postgres-CA8_XcAE.cjs.map +1 -0
- package/dist/postgres-RfQMgAsj.d.mts +72 -0
- package/dist/postgres-aDiBmNzr.mjs +135 -0
- package/dist/postgres-aDiBmNzr.mjs.map +1 -0
- package/dist/redis-B2AS4xAQ.cjs +259 -0
- package/dist/redis-B2AS4xAQ.cjs.map +1 -0
- package/dist/redis-B362ofBw.d.cts +159 -0
- package/dist/redis-CahNAVTW.d.mts +159 -0
- package/dist/redis-hdoKymfG.mjs +218 -0
- package/dist/redis-hdoKymfG.mjs.map +1 -0
- package/dist/roles-7JPrQXZa.mjs +46 -0
- package/dist/roles-7JPrQXZa.mjs.map +1 -0
- package/dist/roles-B_8QqJ3j.cjs +56 -0
- package/dist/roles-B_8QqJ3j.cjs.map +1 -0
- package/dist/roles-DLISB4T3.d.mts +41 -0
- package/dist/roles-DQbbtUPW.d.cts +41 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/scope-css-BN3jf0ly.cjs +315 -0
- package/dist/scope-css-BN3jf0ly.cjs.map +1 -0
- package/dist/scope-css-BuJfRCsE.mjs +256 -0
- package/dist/scope-css-BuJfRCsE.mjs.map +1 -0
- package/dist/scoped-BRoE1W1x.cjs +175 -0
- package/dist/scoped-BRoE1W1x.cjs.map +1 -0
- package/dist/scoped-cFBbotCh.mjs +164 -0
- package/dist/scoped-cFBbotCh.mjs.map +1 -0
- package/dist/sqlite-B2g1JJz1.d.cts +47 -0
- package/dist/sqlite-BIPIlxfj.d.mts +47 -0
- package/dist/sqlite-BntoYaXZ.cjs +79 -0
- package/dist/sqlite-BntoYaXZ.cjs.map +1 -0
- package/dist/sqlite-DYJDcu7p.mjs +62 -0
- package/dist/sqlite-DYJDcu7p.mjs.map +1 -0
- package/dist/table-BrioFSra.d.cts +11 -0
- package/dist/table-BrioFSra.d.mts +11 -0
- package/dist/theme-context-DzZ1otaD.d.cts +270 -0
- package/dist/theme-context-J65pythD.d.mts +270 -0
- package/dist/ui/styles.css +239 -0
- package/dist/util-Dnj5T-yw.mjs +39 -0
- package/dist/util-Dnj5T-yw.mjs.map +1 -0
- package/dist/util-dAnTK9x-.cjs +74 -0
- package/dist/util-dAnTK9x-.cjs.map +1 -0
- package/dist/validation-B-atP968.mjs +191 -0
- package/dist/validation-B-atP968.mjs.map +1 -0
- package/dist/validation-BJifGoB2.d.mts +122 -0
- package/dist/validation-DLnzBVJr.cjs +258 -0
- package/dist/validation-DLnzBVJr.cjs.map +1 -0
- package/dist/validation-tfV2qhbD.d.cts +122 -0
- package/package.json +715 -4
- package/tsconfig/assets.d.ts +21 -0
- package/tsconfig/base.json +21 -0
- package/tsconfig/react.json +9 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
//#region src/internal/peer.ts
|
|
3
|
+
var peer_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
importPeer: () => importPeer,
|
|
5
|
+
requirePeer: () => requirePeer
|
|
6
|
+
});
|
|
7
|
+
/**
|
|
8
|
+
* Optional-peer helpers shared by every subpath that needs a driver, framework or tool package.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Throw a clear, actionable error for a missing optional peer. The message names the package to
|
|
14
|
+
* install (what the user needs) and the kit subpath that asked for it.
|
|
15
|
+
*/
|
|
16
|
+
function requirePeer(name, subpath) {
|
|
17
|
+
throw new Error(`${subpath} requires the optional peer "${name}". Install it with: bun add ${name} (or npm install ${name})`);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `import(name)` an optional peer, turning a module-not-found error into {@link requirePeer}'s
|
|
21
|
+
* message. Other errors (a broken install, a throwing module) propagate unchanged.
|
|
22
|
+
*/
|
|
23
|
+
async function importPeer(name, subpath, load) {
|
|
24
|
+
try {
|
|
25
|
+
return await load();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
if (isModuleNotFound(error, name)) requirePeer(name, subpath);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function isModuleNotFound(error, name) {
|
|
32
|
+
if (!error || typeof error !== "object") return false;
|
|
33
|
+
const { code, message } = error;
|
|
34
|
+
if (code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND") return true;
|
|
35
|
+
return typeof message === "string" && /cannot find (module|package)/i.test(message) && message.includes(name);
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { peer_exports as n, requirePeer as r, importPeer as t };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=peer-CTHMzOdn.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peer-CTHMzOdn.mjs","names":[],"sources":["../src/internal/peer.ts"],"sourcesContent":["/**\n * Optional-peer helpers shared by every subpath that needs a driver, framework or tool package.\n *\n * @module\n */\n\n/**\n * Throw a clear, actionable error for a missing optional peer. The message names the package to\n * install (what the user needs) and the kit subpath that asked for it.\n */\nexport function requirePeer(name: string, subpath: string): never {\n throw new Error(\n `${subpath} requires the optional peer \"${name}\". Install it with: bun add ${name} (or npm install ${name})`,\n );\n}\n\n/**\n * `import(name)` an optional peer, turning a module-not-found error into {@link requirePeer}'s\n * message. Other errors (a broken install, a throwing module) propagate unchanged.\n */\nexport async function importPeer<T>(\n name: string,\n subpath: string,\n load: () => Promise<T>,\n): Promise<T> {\n try {\n return await load();\n } catch (error) {\n if (isModuleNotFound(error, name)) requirePeer(name, subpath);\n throw error;\n }\n}\n\nfunction isModuleNotFound(error: unknown, name: string): boolean {\n if (!error || typeof error !== \"object\") return false;\n const { code, message } = error as { code?: unknown; message?: unknown };\n if (code === \"ERR_MODULE_NOT_FOUND\" || code === \"MODULE_NOT_FOUND\") return true;\n return (\n typeof message === \"string\" &&\n /cannot find (module|package)/i.test(message) &&\n message.includes(name)\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAUA,SAAgB,YAAY,MAAc,SAAwB;CAChE,MAAM,IAAI,MACR,GAAG,QAAQ,+BAA+B,KAAK,8BAA8B,KAAK,mBAAmB,KAAK,EAC5G;AACF;;;;;AAMA,eAAsB,WACpB,MACA,SACA,MACY;CACZ,IAAI;EACF,OAAO,MAAM,KAAK;CACpB,SAAS,OAAO;EACd,IAAI,iBAAiB,OAAO,IAAI,GAAG,YAAY,MAAM,OAAO;EAC5D,MAAM;CACR;AACF;AAEA,SAAS,iBAAiB,OAAgB,MAAuB;CAC/D,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO;CAChD,MAAM,EAAE,MAAM,YAAY;CAC1B,IAAI,SAAS,0BAA0B,SAAS,oBAAoB,OAAO;CAC3E,OACE,OAAO,YAAY,YACnB,gCAAgC,KAAK,OAAO,KAC5C,QAAQ,SAAS,IAAI;AAEzB"}
|
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useReducer, useState } from "react";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { createRoot } from "react-dom/client";
|
|
5
|
+
import { QueryClient, QueryClientProvider, useQuery } from "@tanstack/react-query";
|
|
6
|
+
import { useBrowserLocation } from "wouter/use-browser-location";
|
|
7
|
+
import { Lock, Monitor, Moon, Sun, X } from "lucide-react";
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { twMerge } from "tailwind-merge";
|
|
10
|
+
import { useLocation, useSearchParams } from "wouter";
|
|
11
|
+
//#region src/ui/theme.ts
|
|
12
|
+
const DARK_QUERY = "(prefers-color-scheme: dark)";
|
|
13
|
+
function darkQuery() {
|
|
14
|
+
return typeof matchMedia !== "undefined" ? matchMedia(DARK_QUERY) : void 0;
|
|
15
|
+
}
|
|
16
|
+
function prefersDark() {
|
|
17
|
+
return darkQuery()?.matches ?? false;
|
|
18
|
+
}
|
|
19
|
+
/** The OS colour scheme right now (`light` when it can't be read, e.g. on the server). */
|
|
20
|
+
function systemTheme() {
|
|
21
|
+
return prefersDark() ? "dark" : "light";
|
|
22
|
+
}
|
|
23
|
+
/** Call `cb` when the OS colour scheme flips. Returns the unsubscribe function. */
|
|
24
|
+
function subscribeSystemTheme(cb) {
|
|
25
|
+
const mq = darkQuery();
|
|
26
|
+
mq?.addEventListener("change", cb);
|
|
27
|
+
return () => mq?.removeEventListener("change", cb);
|
|
28
|
+
}
|
|
29
|
+
/** The concrete theme a preference resolves to right now. */
|
|
30
|
+
function resolveTheme(pref) {
|
|
31
|
+
return pref === "system" ? systemTheme() : pref;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create the theme store for one product. `storageKey` is the product's localStorage key
|
|
35
|
+
* (`"xtandard-webhooks:theme"`…); it is a stored-data contract, so products pass it explicitly.
|
|
36
|
+
*/
|
|
37
|
+
function createThemeStore(storageKey) {
|
|
38
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
39
|
+
const getThemePref = () => {
|
|
40
|
+
try {
|
|
41
|
+
const v = localStorage.getItem(storageKey);
|
|
42
|
+
if (v === "light" || v === "dark" || v === "system") return v;
|
|
43
|
+
} catch {}
|
|
44
|
+
return "system";
|
|
45
|
+
};
|
|
46
|
+
const setThemePref = (pref) => {
|
|
47
|
+
try {
|
|
48
|
+
localStorage.setItem(storageKey, pref);
|
|
49
|
+
} catch {}
|
|
50
|
+
for (const cb of listeners) cb();
|
|
51
|
+
};
|
|
52
|
+
const getResolvedTheme = () => resolveTheme(getThemePref());
|
|
53
|
+
const subscribeThemePref = (cb) => {
|
|
54
|
+
listeners.add(cb);
|
|
55
|
+
const mq = darkQuery();
|
|
56
|
+
const onOs = () => {
|
|
57
|
+
if (getThemePref() === "system") cb();
|
|
58
|
+
};
|
|
59
|
+
mq?.addEventListener("change", onOs);
|
|
60
|
+
return () => {
|
|
61
|
+
listeners.delete(cb);
|
|
62
|
+
mq?.removeEventListener("change", onOs);
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const initTheme = () => {
|
|
66
|
+
if (typeof document === "undefined") return () => {};
|
|
67
|
+
const apply = () => {
|
|
68
|
+
document.documentElement.dataset.theme = getResolvedTheme();
|
|
69
|
+
};
|
|
70
|
+
apply();
|
|
71
|
+
return subscribeThemePref(apply);
|
|
72
|
+
};
|
|
73
|
+
return {
|
|
74
|
+
storageKey,
|
|
75
|
+
getThemePref,
|
|
76
|
+
setThemePref,
|
|
77
|
+
getResolvedTheme,
|
|
78
|
+
subscribeThemePref,
|
|
79
|
+
initTheme
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** The attributes {@link detectHostTheme} reads, in order. */
|
|
83
|
+
const THEME_ATTRIBUTES = [
|
|
84
|
+
"data-theme",
|
|
85
|
+
"data-mode",
|
|
86
|
+
"data-color-scheme"
|
|
87
|
+
];
|
|
88
|
+
function explicitTheme(el) {
|
|
89
|
+
if (!el) return void 0;
|
|
90
|
+
if (el.classList.contains("dark")) return "dark";
|
|
91
|
+
if (el.classList.contains("light")) return "light";
|
|
92
|
+
for (const attr of THEME_ATTRIBUTES) {
|
|
93
|
+
const v = el.getAttribute(attr);
|
|
94
|
+
if (v === "dark" || v === "light") return v;
|
|
95
|
+
}
|
|
96
|
+
const cs = el.style?.colorScheme?.trim();
|
|
97
|
+
if (cs === "dark" || cs === "light") return cs;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The host page's theme, for `theme="inherit"`: an explicit signal on `<html>` (then `<body>`) — a
|
|
101
|
+
* `dark`/`light` class, a `data-theme`/`data-mode`/`data-color-scheme` attribute, or an inline
|
|
102
|
+
* `color-scheme` — and, only when the host sets none, the OS `prefers-color-scheme`.
|
|
103
|
+
*
|
|
104
|
+
* Pass `root`/`body` to read other elements (tests, iframes); they default to the document's.
|
|
105
|
+
*/
|
|
106
|
+
function detectHostTheme(root = typeof document !== "undefined" ? document.documentElement : void 0, body = typeof document !== "undefined" ? document.body : void 0) {
|
|
107
|
+
return explicitTheme(root) ?? explicitTheme(body) ?? systemTheme();
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Watch the host page for theme switches: class/attribute/style changes on `<html>` and `<body>`,
|
|
111
|
+
* plus the OS scheme. Returns the unsubscribe function. Without a DOM or `MutationObserver` (SSR,
|
|
112
|
+
* old test environments) it only follows the OS scheme.
|
|
113
|
+
*/
|
|
114
|
+
function subscribeHostTheme(cb) {
|
|
115
|
+
const offOs = subscribeSystemTheme(cb);
|
|
116
|
+
if (typeof document === "undefined" || typeof MutationObserver === "undefined") return offOs;
|
|
117
|
+
const observer = new MutationObserver(cb);
|
|
118
|
+
const opts = {
|
|
119
|
+
attributes: true,
|
|
120
|
+
attributeFilter: [
|
|
121
|
+
"class",
|
|
122
|
+
"style",
|
|
123
|
+
...THEME_ATTRIBUTES
|
|
124
|
+
]
|
|
125
|
+
};
|
|
126
|
+
observer.observe(document.documentElement, opts);
|
|
127
|
+
if (document.body) observer.observe(document.body, opts);
|
|
128
|
+
return () => {
|
|
129
|
+
observer.disconnect();
|
|
130
|
+
offOs();
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/ui/theme-context.tsx
|
|
135
|
+
/**
|
|
136
|
+
* React bindings for the theme store: {@link ThemeProvider} resolves a {@link ThemeMode} to one
|
|
137
|
+
* concrete theme with `useSyncExternalStore`, and {@link useTheme} hands it (plus whether the
|
|
138
|
+
* dashboard owns the toggle) to any component below, so the toggle never has to be prop-drilled.
|
|
139
|
+
*
|
|
140
|
+
* @module
|
|
141
|
+
*/
|
|
142
|
+
const ThemeContext = React$1.createContext(null);
|
|
143
|
+
const serverLight = () => "light";
|
|
144
|
+
const noopSubscribe = () => () => {};
|
|
145
|
+
const hostTheme = () => detectHostTheme();
|
|
146
|
+
/** Resolve a {@link ThemeMode} against `store`, re-rendering on every relevant change. */
|
|
147
|
+
function useResolvedTheme(store, mode) {
|
|
148
|
+
const fromPref = useSyncStore(mode === "auto" ? store.subscribeThemePref : noopSubscribe, store.getResolvedTheme);
|
|
149
|
+
const fromHost = useSyncStore(mode === "inherit" ? subscribeHostTheme : noopSubscribe, hostTheme);
|
|
150
|
+
if (mode === "auto") return fromPref;
|
|
151
|
+
if (mode === "inherit") return fromHost;
|
|
152
|
+
return mode;
|
|
153
|
+
}
|
|
154
|
+
function useSyncStore(subscribe, read) {
|
|
155
|
+
return React$1.useSyncExternalStore(subscribe, read, serverLight);
|
|
156
|
+
}
|
|
157
|
+
/** Provide the resolved theme (and the store, for {@link ThemeToggle}) to the subtree. */
|
|
158
|
+
function ThemeProvider({ store, mode = "auto", children }) {
|
|
159
|
+
const resolved = useResolvedTheme(store, mode);
|
|
160
|
+
const value = React$1.useMemo(() => ({
|
|
161
|
+
resolved,
|
|
162
|
+
showToggle: mode === "auto",
|
|
163
|
+
store
|
|
164
|
+
}), [
|
|
165
|
+
resolved,
|
|
166
|
+
mode,
|
|
167
|
+
store
|
|
168
|
+
]);
|
|
169
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
170
|
+
value,
|
|
171
|
+
children: children(resolved)
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* The active theme. Outside a {@link ThemeProvider} it follows the OS scheme and reports no toggle
|
|
176
|
+
* (there is no store to persist a choice in).
|
|
177
|
+
*/
|
|
178
|
+
function useTheme() {
|
|
179
|
+
const ctx = React$1.useContext(ThemeContext);
|
|
180
|
+
const fromOs = React$1.useSyncExternalStore(ctx ? noopSubscribe : subscribeSystemTheme, systemTheme, serverLight);
|
|
181
|
+
return ctx ?? {
|
|
182
|
+
resolved: fromOs,
|
|
183
|
+
showToggle: false,
|
|
184
|
+
store: void 0
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/ui/token.ts
|
|
189
|
+
/**
|
|
190
|
+
* Portal-token hand-off for the standalone SPA: a host links its customer to
|
|
191
|
+
* `https://app.example.com/panel/#token=…` (the fragment never reaches servers or access logs);
|
|
192
|
+
* `?token=` works too. The token is removed from the address bar so it isn't bookmarked, shared or
|
|
193
|
+
* sent in a `Referer` header.
|
|
194
|
+
*
|
|
195
|
+
* @module
|
|
196
|
+
*/
|
|
197
|
+
/**
|
|
198
|
+
* Read a portal token from `#token=` (preferred) or `?token=`, and strip it from the URL through
|
|
199
|
+
* `replace` (e.g. `(url) => history.replaceState(null, "", url)`). Other query and hash parameters
|
|
200
|
+
* are kept. Returns the token, or `null` when the URL carries none (nothing is replaced then).
|
|
201
|
+
*/
|
|
202
|
+
function takeTokenFromUrl(location, replace) {
|
|
203
|
+
const rawHash = location.hash.replace(/^#/, "");
|
|
204
|
+
const hash = rawHash.startsWith("/") ? void 0 : new URLSearchParams(rawHash);
|
|
205
|
+
const search = new URLSearchParams(location.search);
|
|
206
|
+
const token = hash?.get("token") || search.get("token");
|
|
207
|
+
if (!token) return null;
|
|
208
|
+
let s = location.search.replace(/^\?/, "");
|
|
209
|
+
if (search.has("token")) {
|
|
210
|
+
search.delete("token");
|
|
211
|
+
s = search.toString();
|
|
212
|
+
}
|
|
213
|
+
let h = rawHash;
|
|
214
|
+
if (hash?.has("token")) {
|
|
215
|
+
hash.delete("token");
|
|
216
|
+
h = hash.toString();
|
|
217
|
+
}
|
|
218
|
+
replace(`${location.pathname}${s ? `?${s}` : ""}${h ? `#${h}` : ""}`);
|
|
219
|
+
return token;
|
|
220
|
+
}
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/ui/lib/utils.ts
|
|
223
|
+
/** Merge class names with Tailwind-aware de-duplication. */
|
|
224
|
+
function cn(...inputs) {
|
|
225
|
+
return twMerge(clsx(inputs));
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/ui/components/Toast.tsx
|
|
229
|
+
function reducer(state, action) {
|
|
230
|
+
switch (action.type) {
|
|
231
|
+
case "add": return { toasts: [...state.toasts, action.toast] };
|
|
232
|
+
case "remove": return { toasts: state.toasts.filter((t) => t.id !== action.id) };
|
|
233
|
+
default: return state;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const ToastContext = createContext(null);
|
|
237
|
+
/** `add(kind, message, detail?)` for the nearest {@link ToastProvider}; throws outside one. */
|
|
238
|
+
function useToast() {
|
|
239
|
+
const ctx = useContext(ToastContext);
|
|
240
|
+
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
241
|
+
return ctx;
|
|
242
|
+
}
|
|
243
|
+
const kindAccent = {
|
|
244
|
+
success: "bg-success",
|
|
245
|
+
error: "bg-destructive",
|
|
246
|
+
warning: "bg-warning",
|
|
247
|
+
info: "bg-accent"
|
|
248
|
+
};
|
|
249
|
+
const kindBorder = {
|
|
250
|
+
success: "border-l-[var(--success)]",
|
|
251
|
+
error: "border-l-[var(--destructive)]",
|
|
252
|
+
warning: "border-l-[var(--warning)]",
|
|
253
|
+
info: "border-l-[var(--accent)]"
|
|
254
|
+
};
|
|
255
|
+
function ToastItem({ toast, onRemove }) {
|
|
256
|
+
useEffect(() => {
|
|
257
|
+
const t = setTimeout(() => onRemove(toast.id), 4500);
|
|
258
|
+
return () => clearTimeout(t);
|
|
259
|
+
}, [toast.id, onRemove]);
|
|
260
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
261
|
+
role: "alert",
|
|
262
|
+
className: cn("flex min-w-[280px] max-w-sm items-start gap-2.5 rounded-lg border border-border bg-card px-3.5 py-3 shadow-lg", "border-l-[3px]", kindBorder[toast.kind]),
|
|
263
|
+
style: { animation: "toastIn 160ms ease-out" },
|
|
264
|
+
children: [
|
|
265
|
+
/* @__PURE__ */ jsx("span", {
|
|
266
|
+
className: cn("mt-1 size-2 shrink-0 rounded-full", kindAccent[toast.kind]),
|
|
267
|
+
"aria-hidden": true
|
|
268
|
+
}),
|
|
269
|
+
/* @__PURE__ */ jsxs("div", {
|
|
270
|
+
className: "flex-1 min-w-0",
|
|
271
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
272
|
+
className: "m-0 text-[13px] font-medium text-foreground leading-snug",
|
|
273
|
+
children: toast.message
|
|
274
|
+
}), toast.detail && /* @__PURE__ */ jsx("p", {
|
|
275
|
+
className: "mt-1 text-xs text-muted-foreground leading-snug",
|
|
276
|
+
children: toast.detail
|
|
277
|
+
})]
|
|
278
|
+
}),
|
|
279
|
+
/* @__PURE__ */ jsx("button", {
|
|
280
|
+
"aria-label": "Dismiss",
|
|
281
|
+
onClick: () => onRemove(toast.id),
|
|
282
|
+
className: "shrink-0 rounded-sm text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring outline-none",
|
|
283
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-3.5" })
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
286
|
+
@keyframes toastIn {
|
|
287
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
288
|
+
to { opacity: 1; transform: translateY(0); }
|
|
289
|
+
}
|
|
290
|
+
` })
|
|
291
|
+
]
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
/** Hosts the toast stack (inside the embed wrapper, so it gets the scoped styles and theme). */
|
|
295
|
+
function ToastProvider({ children }) {
|
|
296
|
+
const [state, dispatch] = useReducer(reducer, { toasts: [] });
|
|
297
|
+
const add = useCallback((kind, message, detail) => {
|
|
298
|
+
dispatch({
|
|
299
|
+
type: "add",
|
|
300
|
+
toast: {
|
|
301
|
+
id: `${Date.now()}-${Math.random()}`,
|
|
302
|
+
kind,
|
|
303
|
+
message,
|
|
304
|
+
detail
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}, []);
|
|
308
|
+
const remove = useCallback((id) => {
|
|
309
|
+
dispatch({
|
|
310
|
+
type: "remove",
|
|
311
|
+
id
|
|
312
|
+
});
|
|
313
|
+
}, []);
|
|
314
|
+
return /* @__PURE__ */ jsxs(ToastContext.Provider, {
|
|
315
|
+
value: { add },
|
|
316
|
+
children: [children, /* @__PURE__ */ jsx("div", {
|
|
317
|
+
"aria-live": "polite",
|
|
318
|
+
"aria-atomic": "false",
|
|
319
|
+
className: "fixed bottom-6 right-6 z-[9999] flex flex-col gap-2",
|
|
320
|
+
children: state.toasts.map((t) => /* @__PURE__ */ jsx(ToastItem, {
|
|
321
|
+
toast: t,
|
|
322
|
+
onRemove: remove
|
|
323
|
+
}, t.id))
|
|
324
|
+
})]
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/ui/components/ThemeToggle.tsx
|
|
329
|
+
const OPTIONS = [
|
|
330
|
+
{
|
|
331
|
+
value: "system",
|
|
332
|
+
label: "System theme",
|
|
333
|
+
Icon: Monitor
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
value: "light",
|
|
337
|
+
label: "Light theme",
|
|
338
|
+
Icon: Sun
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
value: "dark",
|
|
342
|
+
label: "Dark theme",
|
|
343
|
+
Icon: Moon
|
|
344
|
+
}
|
|
345
|
+
];
|
|
346
|
+
/**
|
|
347
|
+
* The system/light/dark switcher. It persists the choice in the product's theme store (the `store`
|
|
348
|
+
* prop, else the enclosing `ThemeProvider`'s).
|
|
349
|
+
*/
|
|
350
|
+
function ThemeToggle({ store: storeProp } = {}) {
|
|
351
|
+
const ctx = useTheme();
|
|
352
|
+
const store = storeProp ?? ctx.store;
|
|
353
|
+
if (!store) throw new Error("ThemeToggle needs a `store` prop or an enclosing <ThemeProvider>.");
|
|
354
|
+
const [pref, setPref] = useState(() => store.getThemePref());
|
|
355
|
+
const choose = (value) => {
|
|
356
|
+
setPref(value);
|
|
357
|
+
store.setThemePref(value);
|
|
358
|
+
};
|
|
359
|
+
return /* @__PURE__ */ jsx("div", {
|
|
360
|
+
role: "group",
|
|
361
|
+
"aria-label": "Theme",
|
|
362
|
+
className: "inline-flex gap-0.5 rounded-md border border-border bg-secondary/50 p-0.5",
|
|
363
|
+
children: OPTIONS.map(({ value, label, Icon }) => {
|
|
364
|
+
const active = pref === value;
|
|
365
|
+
return /* @__PURE__ */ jsx("button", {
|
|
366
|
+
type: "button",
|
|
367
|
+
title: label,
|
|
368
|
+
"aria-label": label,
|
|
369
|
+
"aria-pressed": active,
|
|
370
|
+
onClick: () => choose(value),
|
|
371
|
+
className: cn("inline-flex h-6 w-7 items-center justify-center rounded-[5px] outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-ring", active ? "bg-card text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"),
|
|
372
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "size-3.5" })
|
|
373
|
+
}, value);
|
|
374
|
+
})
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region src/ui/lib/nav-guard.ts
|
|
379
|
+
let active = null;
|
|
380
|
+
/** Register the current blocker (replaces any previous one). */
|
|
381
|
+
function setNavBlocker(blocker) {
|
|
382
|
+
active = blocker;
|
|
383
|
+
}
|
|
384
|
+
/** Clear `blocker` if it is still the active one (safe from stale cleanups). */
|
|
385
|
+
function clearNavBlocker(blocker) {
|
|
386
|
+
if (active === blocker) active = null;
|
|
387
|
+
}
|
|
388
|
+
/** Consult the active blocker. `true` when navigation may proceed. */
|
|
389
|
+
function canLeave() {
|
|
390
|
+
return active ? active() : true;
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region src/ui/shell.tsx
|
|
394
|
+
/**
|
|
395
|
+
* Read the bootstrap config the panel handler injects as `window[configGlobal]`
|
|
396
|
+
* (`"__WEBHOOKS_CONFIG__"`…). `{}` when it is missing (dev server, embed, SSR).
|
|
397
|
+
*/
|
|
398
|
+
function readConfigGlobal(configGlobal) {
|
|
399
|
+
if (typeof window === "undefined") return {};
|
|
400
|
+
const value = window[configGlobal];
|
|
401
|
+
return value && typeof value === "object" ? value : {};
|
|
402
|
+
}
|
|
403
|
+
const defaultIsPortal = (c) => c.portal === true || c.mode === "portal";
|
|
404
|
+
/**
|
|
405
|
+
* The `/config` query plus the shell's derived state, with both portal-race fixes: admin work waits
|
|
406
|
+
* for `/config` (`ready`/`adminReady`), and a token means portal from the first render.
|
|
407
|
+
*/
|
|
408
|
+
function useShellConfig(options) {
|
|
409
|
+
const bootstrap = options.bootstrap ?? {};
|
|
410
|
+
const query = useQuery({
|
|
411
|
+
queryKey: options.queryKey ?? ["config"],
|
|
412
|
+
queryFn: options.getConfig,
|
|
413
|
+
staleTime: options.staleTime ?? 6e4
|
|
414
|
+
});
|
|
415
|
+
const config = query.data ?? bootstrap;
|
|
416
|
+
const isPortal = options.isPortal ?? defaultIsPortal;
|
|
417
|
+
const portal = Boolean(options.forcePortal) || Boolean(options.token) || isPortal(config);
|
|
418
|
+
const ready = query.isSuccess;
|
|
419
|
+
const hasBootstrap = Boolean(bootstrap.title);
|
|
420
|
+
return {
|
|
421
|
+
config,
|
|
422
|
+
ready,
|
|
423
|
+
loading: query.isLoading && !hasBootstrap && !options.forcePortal,
|
|
424
|
+
failed: query.isError && !hasBootstrap,
|
|
425
|
+
portal,
|
|
426
|
+
readonly: config.readonly ?? false,
|
|
427
|
+
adminReady: ready && !portal,
|
|
428
|
+
query
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* In-app navigation for the shell: `go(path, params?)` consults the nav guard (a view with unsaved
|
|
433
|
+
* edits can veto the move), carries the sticky params over, then applies `params` (`""` removes
|
|
434
|
+
* one).
|
|
435
|
+
*/
|
|
436
|
+
function useShellNav(options = {}) {
|
|
437
|
+
const [, navigate] = useLocation();
|
|
438
|
+
const [searchParams] = useSearchParams();
|
|
439
|
+
const sticky = options.stickyParams ?? [];
|
|
440
|
+
return (path, params = {}) => {
|
|
441
|
+
if (!canLeave()) return;
|
|
442
|
+
const next = new URLSearchParams();
|
|
443
|
+
for (const key of sticky) {
|
|
444
|
+
const value = searchParams.get(key);
|
|
445
|
+
if (value) next.set(key, value);
|
|
446
|
+
}
|
|
447
|
+
for (const [key, value] of Object.entries(params)) if (value) next.set(key, value);
|
|
448
|
+
else next.delete(key);
|
|
449
|
+
const search = next.toString();
|
|
450
|
+
navigate(search ? `${path}?${search}` : path);
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
const defaultMatch = (path) => (location) => path === "/" ? location === "/" : location === path || location.startsWith(`${path}/`);
|
|
454
|
+
/** The shared admin chrome: sticky header (brand, switcher, badges, toggle), tabs and content. */
|
|
455
|
+
function ShellFrame({ title, logoUrl, brandMark, onBrandClick, switcher, readonly, portal, portalLabel = "Portal", headerExtra, showThemeToggle, tabs = [], onNavigate, fallback, children, className }) {
|
|
456
|
+
const [location] = useLocation();
|
|
457
|
+
const theme = useTheme();
|
|
458
|
+
const toggle = showThemeToggle ?? theme.showToggle;
|
|
459
|
+
if (fallback !== void 0 && fallback !== null && fallback !== false) return /* @__PURE__ */ jsx("div", {
|
|
460
|
+
className: "flex h-screen items-center justify-center bg-background px-4 text-center",
|
|
461
|
+
children: fallback
|
|
462
|
+
});
|
|
463
|
+
const brand = logoUrl ? /* @__PURE__ */ jsx("img", {
|
|
464
|
+
src: logoUrl,
|
|
465
|
+
alt: title,
|
|
466
|
+
className: "h-7 max-w-[320px] object-contain"
|
|
467
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [brandMark, /* @__PURE__ */ jsx("span", {
|
|
468
|
+
className: "text-sm font-semibold tracking-tight",
|
|
469
|
+
children: title
|
|
470
|
+
})] });
|
|
471
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
472
|
+
className: cn("flex h-screen flex-col overflow-hidden bg-background text-foreground", className),
|
|
473
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
474
|
+
className: "sticky top-0 z-40 border-b border-border bg-background/80 backdrop-blur",
|
|
475
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
476
|
+
className: "mx-auto flex h-14 max-w-6xl items-center gap-3 px-4 sm:px-6",
|
|
477
|
+
children: [
|
|
478
|
+
onBrandClick ? /* @__PURE__ */ jsx("a", {
|
|
479
|
+
href: "#",
|
|
480
|
+
"data-testid": "shell-brand",
|
|
481
|
+
onClick: (e) => {
|
|
482
|
+
e.preventDefault();
|
|
483
|
+
onBrandClick();
|
|
484
|
+
},
|
|
485
|
+
className: "flex shrink-0 items-center gap-2 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
486
|
+
children: brand
|
|
487
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
488
|
+
"data-testid": "shell-brand",
|
|
489
|
+
className: "flex shrink-0 items-center gap-2",
|
|
490
|
+
children: brand
|
|
491
|
+
}),
|
|
492
|
+
switcher ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
493
|
+
className: "select-none text-border",
|
|
494
|
+
children: "/"
|
|
495
|
+
}), switcher] }) : null,
|
|
496
|
+
/* @__PURE__ */ jsxs("div", {
|
|
497
|
+
className: "ml-auto flex items-center gap-2",
|
|
498
|
+
children: [
|
|
499
|
+
headerExtra,
|
|
500
|
+
readonly && /* @__PURE__ */ jsxs("span", {
|
|
501
|
+
className: "flex items-center gap-1 rounded-md border border-warning/30 bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",
|
|
502
|
+
children: [/* @__PURE__ */ jsx(Lock, { className: "size-3" }), "Read-only"]
|
|
503
|
+
}),
|
|
504
|
+
portal && /* @__PURE__ */ jsx("span", {
|
|
505
|
+
className: "rounded-md border border-accent/30 bg-accent/10 px-2 py-0.5 text-xs font-medium text-accent",
|
|
506
|
+
children: portalLabel
|
|
507
|
+
}),
|
|
508
|
+
toggle && /* @__PURE__ */ jsx(ThemeToggle, {})
|
|
509
|
+
]
|
|
510
|
+
})
|
|
511
|
+
]
|
|
512
|
+
}), tabs.length > 1 && /* @__PURE__ */ jsx("nav", {
|
|
513
|
+
className: "mx-auto flex max-w-6xl items-center gap-1 overflow-x-auto px-2 sm:px-4",
|
|
514
|
+
"aria-label": "Main navigation",
|
|
515
|
+
children: tabs.map(({ path, label, match }) => {
|
|
516
|
+
const active = (match ?? defaultMatch(path))(location);
|
|
517
|
+
return /* @__PURE__ */ jsx("button", {
|
|
518
|
+
type: "button",
|
|
519
|
+
onClick: () => onNavigate?.(path),
|
|
520
|
+
"aria-current": active ? "page" : void 0,
|
|
521
|
+
className: cn("whitespace-nowrap px-3 py-2.5 text-[13px] font-medium outline-none transition-colors focus-visible:text-foreground", active ? "relative text-foreground after:absolute after:inset-x-3 after:-bottom-px after:h-0.5 after:rounded-full after:bg-accent" : "text-muted-foreground hover:text-foreground"),
|
|
522
|
+
children: label
|
|
523
|
+
}, path);
|
|
524
|
+
})
|
|
525
|
+
})]
|
|
526
|
+
}), /* @__PURE__ */ jsx("main", {
|
|
527
|
+
className: "flex-1 overflow-y-auto overflow-x-hidden",
|
|
528
|
+
children
|
|
529
|
+
})]
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
/** The default message for a `/config` failure (pass it as {@link ShellFrameProps.fallback}). */
|
|
533
|
+
function ConfigError() {
|
|
534
|
+
return /* @__PURE__ */ jsx("p", {
|
|
535
|
+
className: "text-[13px] text-muted-foreground",
|
|
536
|
+
children: "Could not load the panel configuration. Check that the API is reachable and that you are signed in."
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
//#endregion
|
|
540
|
+
//#region src/ui/boot.tsx
|
|
541
|
+
/**
|
|
542
|
+
* The standalone SPA bootstrap (`src/ui/main.tsx` in every product): apply the theme before first
|
|
543
|
+
* paint, take a portal token from the URL, create the QueryClient, read the base path from the
|
|
544
|
+
* config global, and render the product's `App` with browser-history routing.
|
|
545
|
+
*
|
|
546
|
+
* @module
|
|
547
|
+
*/
|
|
548
|
+
/** A `QueryClient` with the shell's defaults: one retry, no refetch on window focus. */
|
|
549
|
+
function createShellQueryClient() {
|
|
550
|
+
return new QueryClient({ defaultOptions: { queries: {
|
|
551
|
+
retry: 1,
|
|
552
|
+
refetchOnWindowFocus: false
|
|
553
|
+
} } });
|
|
554
|
+
}
|
|
555
|
+
/** Boot the standalone admin SPA. Call once from the product's `main.tsx`. */
|
|
556
|
+
function bootSpa(options) {
|
|
557
|
+
const themeStore = typeof options.themeKey === "string" ? createThemeStore(options.themeKey) : options.themeKey;
|
|
558
|
+
themeStore.initTheme();
|
|
559
|
+
let token = null;
|
|
560
|
+
if (options.tokenFromUrl) {
|
|
561
|
+
if (!options.api) throw new Error("bootSpa: `tokenFromUrl` needs the product's `api` client.");
|
|
562
|
+
token = takeTokenFromUrl(window.location, (url) => window.history.replaceState(null, "", url));
|
|
563
|
+
if (token) options.api.setApiToken(token);
|
|
564
|
+
}
|
|
565
|
+
const queryClient = options.queryClient ?? createShellQueryClient();
|
|
566
|
+
const el = typeof options.root === "object" ? options.root : document.getElementById(options.root ?? "root");
|
|
567
|
+
if (!el) throw new Error("Root element not found");
|
|
568
|
+
const basePath = (readConfigGlobal(options.configGlobal).basePath ?? "").replace(/\/$/, "");
|
|
569
|
+
const { App } = options;
|
|
570
|
+
const appProps = options.appProps ?? {};
|
|
571
|
+
const tree = /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
572
|
+
client: queryClient,
|
|
573
|
+
children: /* @__PURE__ */ jsx(ThemeProvider, {
|
|
574
|
+
store: themeStore,
|
|
575
|
+
mode: "auto",
|
|
576
|
+
children: () => /* @__PURE__ */ jsx(ToastProvider, { children: /* @__PURE__ */ jsx(App, {
|
|
577
|
+
...appProps,
|
|
578
|
+
locationHook: useBrowserLocation,
|
|
579
|
+
base: basePath
|
|
580
|
+
}) })
|
|
581
|
+
})
|
|
582
|
+
});
|
|
583
|
+
const root = createRoot(el);
|
|
584
|
+
root.render(options.strictMode === false ? tree : /* @__PURE__ */ jsx(React$1.StrictMode, { children: tree }));
|
|
585
|
+
return {
|
|
586
|
+
root,
|
|
587
|
+
queryClient,
|
|
588
|
+
themeStore,
|
|
589
|
+
token
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
//#endregion
|
|
593
|
+
//#region src/ui/lib/portal-container.ts
|
|
594
|
+
let sharedRef;
|
|
595
|
+
/** Point portals at `ref` (the embed wrapper). Pass `undefined` to reset to the body default. */
|
|
596
|
+
function setPortalContainerRef(ref) {
|
|
597
|
+
sharedRef = ref;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* The current portal container ref, or `undefined` when none is set (Base UI
|
|
601
|
+
* then defaults to `document.body`). Pass the result to a Base UI
|
|
602
|
+
* `*.Portal container={…}` prop.
|
|
603
|
+
*/
|
|
604
|
+
function portalContainerRef() {
|
|
605
|
+
return sharedRef;
|
|
606
|
+
}
|
|
607
|
+
//#endregion
|
|
608
|
+
export { resolveTheme as C, systemTheme as E, detectHostTheme as S, subscribeSystemTheme as T, takeTokenFromUrl as _, ConfigError as a, useTheme as b, useShellConfig as c, clearNavBlocker as d, setNavBlocker as f, cn as g, useToast as h, createShellQueryClient as i, useShellNav as l, ToastProvider as m, setPortalContainerRef as n, ShellFrame as o, ThemeToggle as p, bootSpa as r, readConfigGlobal as s, portalContainerRef as t, canLeave as u, ThemeProvider as v, subscribeHostTheme as w, createThemeStore as x, useResolvedTheme as y };
|
|
609
|
+
|
|
610
|
+
//# sourceMappingURL=portal-container-CJIcau3B.mjs.map
|