@agimon-ai/po-web-components 0.0.0-alpha.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 +22 -0
- package/README.md +165 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/_virtual/_rolldown/runtime.mjs +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.mjs +1 -0
- package/dist/mcpWidget.cjs +1 -0
- package/dist/mcpWidget.d.mts +3 -0
- package/dist/mcpWidget.mjs +1 -0
- package/dist/nativeTheme.cjs +1 -0
- package/dist/nativeTheme.d.mts +3 -0
- package/dist/nativeTheme.mjs +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.2.0/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CfX6zgs1.d.mts +27 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.2.0/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CfX6zgs1.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.2.0/node_modules/@modelcontextprotocol/server/dist/index.d.mts +2 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.d.mts +20 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/compat.d.mts +50 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/compat.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/deep-partial.d.mts +10 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/deep-partial.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.d.mts +33 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/external.d.mts +28 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/external.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/from-json-schema.d.mts +14 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/from-json-schema.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/in-out.d.mts +13 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/in-out.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.d.mts +13 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.d.mts +54 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.d.mts +775 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.d.mts +331 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.d.mts +296 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/compile.d.mts +67 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/compile.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.d.mts +85 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.d.mts +18 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.d.mts +219 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/index.d.mts +24 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/index.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-generator.d.mts +67 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-generator.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.d.mts +12 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema.d.mts +95 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.d.mts +18 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.d.mts +54 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.d.mts +94 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.d.mts +35 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.d.mts +1201 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/standard-schema.d.mts +120 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/standard-schema.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.d.mts +157 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.d.mts +237 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/index.d.mts +29 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/index.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ar.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ar.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/az.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/az.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bg.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bg.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bn.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bn.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ca.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ca.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ckb.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ckb.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/cs.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/cs.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/da.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/da.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/de.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/de.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/el.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/el.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/eo.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/eo.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/es.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/es.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fa.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fa.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fi.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fi.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr-CA.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr-CA.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/gu.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/gu.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/he.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/he.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hi.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hi.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hr.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hr.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hu.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hu.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/id.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/id.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/index.d.mts +69 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/index.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/is.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/is.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/it.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/it.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ja.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ja.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ka.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ka.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kh.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kh.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/km.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/km.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kn.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kn.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ko.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ko.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/lt.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/lt.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/mk.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/mk.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ms.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ms.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ne.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ne.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nl.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nl.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nn.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nn.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/no.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/no.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ota.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ota.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pl.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pl.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ps.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ps.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt-BR.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt-BR.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ro.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ro.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sk.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sk.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sl.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sl.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sv.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sv.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ta.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ta.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tg.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tg.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/th.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/th.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tk.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tk.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tr.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tr.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ua.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ua.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uk.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uk.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ur.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ur.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uz.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uz.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/vi.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/vi.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/yo.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/yo.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-CN.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-CN.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-TW.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-TW.d.mts.map +1 -0
- package/dist/packages/core/po-core/dist/mcpWidget.d.mts +2 -0
- package/dist/packages/core/po-core/dist/src/extensions/webPlugin.d.mts +2 -0
- package/dist/packages/core/po-core/dist/src/web/models/globalStore.d.mts +1 -0
- package/dist/packages/core/po-core/dist/src/web/models/sessionStore.d.mts +1 -0
- package/dist/packages/core/po-core/dist/src/web/models/workspaceStore.d.mts +1 -0
- package/dist/packages/core/po-core/dist/src/web/schemas/template.d.mts +2 -0
- package/dist/packages/core/po-core/dist/src/web/services/mcpWidget.d.mts +1 -0
- package/dist/packages/core/po-core/dist/src/web/types/extensionFile.d.mts +3 -0
- package/dist/packages/core/po-core/dist/src/web/types/mcpWidget.d.mts +17 -0
- package/dist/packages/core/po-core/dist/src/web/types/mcpWidget.d.mts.map +1 -0
- package/dist/packages/core/po-core/dist/src/web/types/nativeTemplate.d.mts +2 -0
- package/dist/packages/core/po-core/dist/src/web/types/template.d.mts +1 -0
- package/dist/packages/core/po-core/dist/src/web/types/webPlugin.d.mts +3 -0
- package/dist/packages/core/po-core/dist/web.d.mts +12 -0
- package/dist/packages/core/po-web-components/src/components/Accordion.d.mts +11 -0
- package/dist/packages/core/po-web-components/src/components/Accordion.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Accordion.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Accordion.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/AnsiText.d.mts +16 -0
- package/dist/packages/core/po-web-components/src/components/AnsiText.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/AnsiText.mjs +4 -0
- package/dist/packages/core/po-web-components/src/components/AnsiText.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Avatar.d.mts +10 -0
- package/dist/packages/core/po-web-components/src/components/Avatar.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Avatar.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Avatar.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Badge.d.mts +17 -0
- package/dist/packages/core/po-web-components/src/components/Badge.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Badge.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Badge.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Breadcrumb.d.mts +36 -0
- package/dist/packages/core/po-web-components/src/components/Breadcrumb.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Breadcrumb.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Breadcrumb.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Button.d.mts +24 -0
- package/dist/packages/core/po-web-components/src/components/Button.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Button.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Button.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Checkbox.d.mts +8 -0
- package/dist/packages/core/po-web-components/src/components/Checkbox.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Checkbox.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Checkbox.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/CodeBlock.d.mts +23 -0
- package/dist/packages/core/po-web-components/src/components/CodeBlock.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/CodeBlock.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/CodeBlock.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/CodeEditor.d.mts +5 -0
- package/dist/packages/core/po-web-components/src/components/CodeEditor.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/CodeEditor.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/CodeEditor.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/CodeEditorView.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/CodeEditorView.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Collapsible.d.mts +10 -0
- package/dist/packages/core/po-web-components/src/components/Collapsible.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Collapsible.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Collapsible.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Command.d.mts +41 -0
- package/dist/packages/core/po-web-components/src/components/Command.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Command.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Command.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/CopyButton.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/CopyButton.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Dialog.d.mts +39 -0
- package/dist/packages/core/po-web-components/src/components/Dialog.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Dialog.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Dialog.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/DiffView.d.mts +16 -0
- package/dist/packages/core/po-web-components/src/components/DiffView.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/DiffView.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/DiffView.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Dot.d.mts +15 -0
- package/dist/packages/core/po-web-components/src/components/Dot.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Dot.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Dot.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Drawer.d.mts +17 -0
- package/dist/packages/core/po-web-components/src/components/Drawer.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Drawer.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Drawer.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/DropdownMenu.d.mts +34 -0
- package/dist/packages/core/po-web-components/src/components/DropdownMenu.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/DropdownMenu.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/DropdownMenu.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/EmptyState.d.mts +17 -0
- package/dist/packages/core/po-web-components/src/components/EmptyState.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/EmptyState.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/EmptyState.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/HashlineLines.d.mts +23 -0
- package/dist/packages/core/po-web-components/src/components/HashlineLines.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/HashlineLines.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/HashlineLines.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Input.d.mts +19 -0
- package/dist/packages/core/po-web-components/src/components/Input.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Input.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Input.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Kbd.d.mts +6 -0
- package/dist/packages/core/po-web-components/src/components/Kbd.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Kbd.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Kbd.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Label.d.mts +8 -0
- package/dist/packages/core/po-web-components/src/components/Label.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Label.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Label.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Markdown.d.mts +22 -0
- package/dist/packages/core/po-web-components/src/components/Markdown.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Markdown.mjs +3 -0
- package/dist/packages/core/po-web-components/src/components/Markdown.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/McpApp.d.mts +18 -0
- package/dist/packages/core/po-web-components/src/components/McpApp.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/McpApp.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/McpApp.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/McpToolWidget.d.mts +15 -0
- package/dist/packages/core/po-web-components/src/components/McpToolWidget.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/McpToolWidget.mjs +3 -0
- package/dist/packages/core/po-web-components/src/components/McpToolWidget.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/MediaPreview.d.mts +63 -0
- package/dist/packages/core/po-web-components/src/components/MediaPreview.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/MediaPreview.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/MediaPreview.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/MermaidDiagram.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/MermaidDiagram.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/MessageItem.d.mts +108 -0
- package/dist/packages/core/po-web-components/src/components/MessageItem.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/MessageItem.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/MessageItem.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/MessageLines.d.mts +23 -0
- package/dist/packages/core/po-web-components/src/components/MessageLines.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/MessageLines.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/MessageLines.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/OptionList.d.mts +49 -0
- package/dist/packages/core/po-web-components/src/components/OptionList.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/OptionList.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/OptionList.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Panel.d.mts +14 -0
- package/dist/packages/core/po-web-components/src/components/Panel.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Panel.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Panel.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/PdfPreview.d.mts +52 -0
- package/dist/packages/core/po-web-components/src/components/PdfPreview.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/PdfPreview.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/PdfPreview.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Picker.d.mts +52 -0
- package/dist/packages/core/po-web-components/src/components/Picker.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Picker.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Picker.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Popover.d.mts +19 -0
- package/dist/packages/core/po-web-components/src/components/Popover.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Popover.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Popover.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Progress.d.mts +8 -0
- package/dist/packages/core/po-web-components/src/components/Progress.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Progress.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Progress.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/RadioGroup.d.mts +15 -0
- package/dist/packages/core/po-web-components/src/components/RadioGroup.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/RadioGroup.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/RadioGroup.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/ReviewCommentDraft.d.mts +24 -0
- package/dist/packages/core/po-web-components/src/components/ReviewCommentDraft.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/ReviewCommentDraft.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/ReviewCommentDraft.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/ScrollArea.d.mts +13 -0
- package/dist/packages/core/po-web-components/src/components/ScrollArea.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/ScrollArea.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/ScrollArea.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/SectionLabel.d.mts +6 -0
- package/dist/packages/core/po-web-components/src/components/SectionLabel.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/SectionLabel.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/SectionLabel.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Select.d.mts +19 -0
- package/dist/packages/core/po-web-components/src/components/Select.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Select.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Select.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Separator.d.mts +13 -0
- package/dist/packages/core/po-web-components/src/components/Separator.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Separator.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Separator.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Settings.d.mts +56 -0
- package/dist/packages/core/po-web-components/src/components/Settings.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Settings.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Settings.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Sheet.d.mts +35 -0
- package/dist/packages/core/po-web-components/src/components/Sheet.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Sheet.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Sheet.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Skeleton.d.mts +10 -0
- package/dist/packages/core/po-web-components/src/components/Skeleton.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Skeleton.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Skeleton.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Spinner.d.mts +14 -0
- package/dist/packages/core/po-web-components/src/components/Spinner.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Spinner.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Spinner.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/StatusBadge.d.mts +23 -0
- package/dist/packages/core/po-web-components/src/components/StatusBadge.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/StatusBadge.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/StatusBadge.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/StreamCursor.d.mts +6 -0
- package/dist/packages/core/po-web-components/src/components/StreamCursor.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/StreamCursor.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/StreamCursor.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Switch.d.mts +8 -0
- package/dist/packages/core/po-web-components/src/components/Switch.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Switch.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Switch.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/SyntaxText.d.mts +50 -0
- package/dist/packages/core/po-web-components/src/components/SyntaxText.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/SyntaxText.mjs +4 -0
- package/dist/packages/core/po-web-components/src/components/SyntaxText.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Tabs.d.mts +36 -0
- package/dist/packages/core/po-web-components/src/components/Tabs.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Tabs.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Tabs.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/TerminalView.d.mts +31 -0
- package/dist/packages/core/po-web-components/src/components/TerminalView.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/TerminalView.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/TerminalView.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Textarea.d.mts +9 -0
- package/dist/packages/core/po-web-components/src/components/Textarea.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Textarea.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Textarea.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Toast.d.mts +24 -0
- package/dist/packages/core/po-web-components/src/components/Toast.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Toast.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Toast.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/ToolPathLink.d.mts +22 -0
- package/dist/packages/core/po-web-components/src/components/ToolPathLink.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/ToolPathLink.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/ToolPathLink.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Tooltip.d.mts +11 -0
- package/dist/packages/core/po-web-components/src/components/Tooltip.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/Tooltip.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/Tooltip.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/icons/icons.d.mts +2 -0
- package/dist/packages/core/po-web-components/src/icons/icons.mjs +1 -0
- package/dist/packages/core/po-web-components/src/lib/ansiSpans.d.mts +42 -0
- package/dist/packages/core/po-web-components/src/lib/ansiSpans.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/ansiSpans.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/ansiSpans.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/cn.d.mts +6 -0
- package/dist/packages/core/po-web-components/src/lib/cn.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/cn.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/cn.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/collapse.d.mts +14 -0
- package/dist/packages/core/po-web-components/src/lib/collapse.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/collapse.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/collapse.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/editorController.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/editorController.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/editorLanguage.d.mts +21 -0
- package/dist/packages/core/po-web-components/src/lib/editorLanguage.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/editorLanguage.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/editorLanguage.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/editorTheme.d.mts +76 -0
- package/dist/packages/core/po-web-components/src/lib/editorTheme.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/editorTheme.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/editorTheme.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/fenceGrammar.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/fenceGrammar.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/hashlineHighlight.d.mts +30 -0
- package/dist/packages/core/po-web-components/src/lib/hashlineHighlight.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/hashlineHighlight.mjs +3 -0
- package/dist/packages/core/po-web-components/src/lib/hashlineHighlight.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/hashlineView.d.mts +60 -0
- package/dist/packages/core/po-web-components/src/lib/hashlineView.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/hashlineView.mjs +6 -0
- package/dist/packages/core/po-web-components/src/lib/hashlineView.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/media.d.mts +11 -0
- package/dist/packages/core/po-web-components/src/lib/media.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/media.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/media.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/mediaPlayback.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/mediaPlayback.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/mermaidDiagram.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/mermaidDiagram.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/optionList.d.mts +21 -0
- package/dist/packages/core/po-web-components/src/lib/optionList.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/optionList.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/optionList.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/pathGroups.d.mts +23 -0
- package/dist/packages/core/po-web-components/src/lib/pathGroups.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/pathGroups.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/pathGroups.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/picker.d.mts +10 -0
- package/dist/packages/core/po-web-components/src/lib/picker.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/picker.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/picker.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/review.d.mts +40 -0
- package/dist/packages/core/po-web-components/src/lib/review.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/review.mjs +8 -0
- package/dist/packages/core/po-web-components/src/lib/review.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/syntaxHighlight.d.mts +54 -0
- package/dist/packages/core/po-web-components/src/lib/syntaxHighlight.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/syntaxHighlight.mjs +3 -0
- package/dist/packages/core/po-web-components/src/lib/syntaxHighlight.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/tone.d.mts +25 -0
- package/dist/packages/core/po-web-components/src/lib/tone.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/lib/tone.mjs +2 -0
- package/dist/packages/core/po-web-components/src/lib/tone.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/apply.d.mts +25 -0
- package/dist/packages/core/po-web-components/src/theme/apply.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/apply.mjs +3 -0
- package/dist/packages/core/po-web-components/src/theme/apply.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/builtinThemes.d.mts +11 -0
- package/dist/packages/core/po-web-components/src/theme/builtinThemes.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/builtinThemes.mjs +2 -0
- package/dist/packages/core/po-web-components/src/theme/builtinThemes.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/derive.d.mts +14 -0
- package/dist/packages/core/po-web-components/src/theme/derive.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/derive.mjs +2 -0
- package/dist/packages/core/po-web-components/src/theme/derive.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/nativeTheme.d.mts +131 -0
- package/dist/packages/core/po-web-components/src/theme/nativeTheme.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/nativeTheme.mjs +2 -0
- package/dist/packages/core/po-web-components/src/theme/nativeTheme.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/parse.d.mts +10 -0
- package/dist/packages/core/po-web-components/src/theme/parse.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/parse.mjs +2 -0
- package/dist/packages/core/po-web-components/src/theme/parse.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/piTheme.d.mts +19 -0
- package/dist/packages/core/po-web-components/src/theme/piTheme.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/piTheme.mjs +2 -0
- package/dist/packages/core/po-web-components/src/theme/piTheme.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/preference.d.mts +15 -0
- package/dist/packages/core/po-web-components/src/theme/preference.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/theme/preference.mjs +2 -0
- package/dist/packages/core/po-web-components/src/theme/preference.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/types/diff.d.mts +46 -0
- package/dist/packages/core/po-web-components/src/types/diff.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/types/editor.d.mts +78 -0
- package/dist/packages/core/po-web-components/src/types/editor.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/types/editor.mjs +2 -0
- package/dist/packages/core/po-web-components/src/types/editor.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/types/theme.d.mts +38 -0
- package/dist/packages/core/po-web-components/src/types/theme.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/types/theme.mjs +2 -0
- package/dist/packages/core/po-web-components/src/types/theme.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/types/tone.d.mts +28 -0
- package/dist/packages/core/po-web-components/src/types/tone.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/types/tone.mjs +2 -0
- package/dist/packages/core/po-web-components/src/types/tone.mjs.map +1 -0
- package/dist/packages/core/po-web-components/themes/doom-nord-dark.mjs +2 -0
- package/dist/packages/core/po-web-components/themes/doom-nord-dark.mjs.map +1 -0
- package/dist/packages/core/po-web-components/themes/doom-one-dark.mjs +2 -0
- package/dist/packages/core/po-web-components/themes/doom-one-dark.mjs.map +1 -0
- package/dist/packages/core/po-web-components/themes/doom-one-light.mjs +2 -0
- package/dist/packages/core/po-web-components/themes/doom-one-light.mjs.map +1 -0
- package/dist/src/components/Accordion.cjs +2 -0
- package/dist/src/components/Accordion.cjs.map +1 -0
- package/dist/src/components/AnsiText.cjs +4 -0
- package/dist/src/components/AnsiText.cjs.map +1 -0
- package/dist/src/components/Avatar.cjs +2 -0
- package/dist/src/components/Avatar.cjs.map +1 -0
- package/dist/src/components/Badge.cjs +2 -0
- package/dist/src/components/Badge.cjs.map +1 -0
- package/dist/src/components/Breadcrumb.cjs +2 -0
- package/dist/src/components/Breadcrumb.cjs.map +1 -0
- package/dist/src/components/Button.cjs +2 -0
- package/dist/src/components/Button.cjs.map +1 -0
- package/dist/src/components/Checkbox.cjs +2 -0
- package/dist/src/components/Checkbox.cjs.map +1 -0
- package/dist/src/components/CodeBlock.cjs +2 -0
- package/dist/src/components/CodeBlock.cjs.map +1 -0
- package/dist/src/components/CodeEditor.cjs +2 -0
- package/dist/src/components/CodeEditor.cjs.map +1 -0
- package/dist/src/components/CodeEditorView.cjs +2 -0
- package/dist/src/components/CodeEditorView.cjs.map +1 -0
- package/dist/src/components/Collapsible.cjs +2 -0
- package/dist/src/components/Collapsible.cjs.map +1 -0
- package/dist/src/components/Command.cjs +2 -0
- package/dist/src/components/Command.cjs.map +1 -0
- package/dist/src/components/CopyButton.cjs +2 -0
- package/dist/src/components/CopyButton.cjs.map +1 -0
- package/dist/src/components/Dialog.cjs +2 -0
- package/dist/src/components/Dialog.cjs.map +1 -0
- package/dist/src/components/DiffView.cjs +2 -0
- package/dist/src/components/DiffView.cjs.map +1 -0
- package/dist/src/components/Dot.cjs +2 -0
- package/dist/src/components/Dot.cjs.map +1 -0
- package/dist/src/components/Drawer.cjs +2 -0
- package/dist/src/components/Drawer.cjs.map +1 -0
- package/dist/src/components/DropdownMenu.cjs +2 -0
- package/dist/src/components/DropdownMenu.cjs.map +1 -0
- package/dist/src/components/EmptyState.cjs +2 -0
- package/dist/src/components/EmptyState.cjs.map +1 -0
- package/dist/src/components/HashlineLines.cjs +2 -0
- package/dist/src/components/HashlineLines.cjs.map +1 -0
- package/dist/src/components/Input.cjs +2 -0
- package/dist/src/components/Input.cjs.map +1 -0
- package/dist/src/components/Kbd.cjs +2 -0
- package/dist/src/components/Kbd.cjs.map +1 -0
- package/dist/src/components/Label.cjs +2 -0
- package/dist/src/components/Label.cjs.map +1 -0
- package/dist/src/components/Markdown.cjs +3 -0
- package/dist/src/components/Markdown.cjs.map +1 -0
- package/dist/src/components/McpApp.cjs +2 -0
- package/dist/src/components/McpApp.cjs.map +1 -0
- package/dist/src/components/McpToolWidget.cjs +3 -0
- package/dist/src/components/McpToolWidget.cjs.map +1 -0
- package/dist/src/components/MediaPreview.cjs +2 -0
- package/dist/src/components/MediaPreview.cjs.map +1 -0
- package/dist/src/components/MermaidDiagram.cjs +2 -0
- package/dist/src/components/MermaidDiagram.cjs.map +1 -0
- package/dist/src/components/MessageItem.cjs +2 -0
- package/dist/src/components/MessageItem.cjs.map +1 -0
- package/dist/src/components/MessageLines.cjs +2 -0
- package/dist/src/components/MessageLines.cjs.map +1 -0
- package/dist/src/components/OptionList.cjs +2 -0
- package/dist/src/components/OptionList.cjs.map +1 -0
- package/dist/src/components/Panel.cjs +2 -0
- package/dist/src/components/Panel.cjs.map +1 -0
- package/dist/src/components/PdfPreview.cjs +2 -0
- package/dist/src/components/PdfPreview.cjs.map +1 -0
- package/dist/src/components/Picker.cjs +2 -0
- package/dist/src/components/Picker.cjs.map +1 -0
- package/dist/src/components/Popover.cjs +2 -0
- package/dist/src/components/Popover.cjs.map +1 -0
- package/dist/src/components/Progress.cjs +2 -0
- package/dist/src/components/Progress.cjs.map +1 -0
- package/dist/src/components/RadioGroup.cjs +2 -0
- package/dist/src/components/RadioGroup.cjs.map +1 -0
- package/dist/src/components/ReviewCommentDraft.cjs +2 -0
- package/dist/src/components/ReviewCommentDraft.cjs.map +1 -0
- package/dist/src/components/ScrollArea.cjs +2 -0
- package/dist/src/components/ScrollArea.cjs.map +1 -0
- package/dist/src/components/SectionLabel.cjs +2 -0
- package/dist/src/components/SectionLabel.cjs.map +1 -0
- package/dist/src/components/Select.cjs +2 -0
- package/dist/src/components/Select.cjs.map +1 -0
- package/dist/src/components/Separator.cjs +2 -0
- package/dist/src/components/Separator.cjs.map +1 -0
- package/dist/src/components/Settings.cjs +2 -0
- package/dist/src/components/Settings.cjs.map +1 -0
- package/dist/src/components/Sheet.cjs +2 -0
- package/dist/src/components/Sheet.cjs.map +1 -0
- package/dist/src/components/Skeleton.cjs +2 -0
- package/dist/src/components/Skeleton.cjs.map +1 -0
- package/dist/src/components/Spinner.cjs +2 -0
- package/dist/src/components/Spinner.cjs.map +1 -0
- package/dist/src/components/StatusBadge.cjs +2 -0
- package/dist/src/components/StatusBadge.cjs.map +1 -0
- package/dist/src/components/StreamCursor.cjs +2 -0
- package/dist/src/components/StreamCursor.cjs.map +1 -0
- package/dist/src/components/Switch.cjs +2 -0
- package/dist/src/components/Switch.cjs.map +1 -0
- package/dist/src/components/SyntaxText.cjs +4 -0
- package/dist/src/components/SyntaxText.cjs.map +1 -0
- package/dist/src/components/Tabs.cjs +2 -0
- package/dist/src/components/Tabs.cjs.map +1 -0
- package/dist/src/components/TerminalView.cjs +2 -0
- package/dist/src/components/TerminalView.cjs.map +1 -0
- package/dist/src/components/Textarea.cjs +2 -0
- package/dist/src/components/Textarea.cjs.map +1 -0
- package/dist/src/components/Toast.cjs +2 -0
- package/dist/src/components/Toast.cjs.map +1 -0
- package/dist/src/components/ToolPathLink.cjs +2 -0
- package/dist/src/components/ToolPathLink.cjs.map +1 -0
- package/dist/src/components/Tooltip.cjs +2 -0
- package/dist/src/components/Tooltip.cjs.map +1 -0
- package/dist/src/icons/icons.cjs +1 -0
- package/dist/src/lib/ansiSpans.cjs +2 -0
- package/dist/src/lib/ansiSpans.cjs.map +1 -0
- package/dist/src/lib/cn.cjs +2 -0
- package/dist/src/lib/cn.cjs.map +1 -0
- package/dist/src/lib/collapse.cjs +2 -0
- package/dist/src/lib/collapse.cjs.map +1 -0
- package/dist/src/lib/editorController.cjs +2 -0
- package/dist/src/lib/editorController.cjs.map +1 -0
- package/dist/src/lib/editorLanguage.cjs +2 -0
- package/dist/src/lib/editorLanguage.cjs.map +1 -0
- package/dist/src/lib/editorTheme.cjs +2 -0
- package/dist/src/lib/editorTheme.cjs.map +1 -0
- package/dist/src/lib/fenceGrammar.cjs +2 -0
- package/dist/src/lib/fenceGrammar.cjs.map +1 -0
- package/dist/src/lib/hashlineHighlight.cjs +3 -0
- package/dist/src/lib/hashlineHighlight.cjs.map +1 -0
- package/dist/src/lib/hashlineView.cjs +6 -0
- package/dist/src/lib/hashlineView.cjs.map +1 -0
- package/dist/src/lib/media.cjs +2 -0
- package/dist/src/lib/media.cjs.map +1 -0
- package/dist/src/lib/mediaPlayback.cjs +2 -0
- package/dist/src/lib/mediaPlayback.cjs.map +1 -0
- package/dist/src/lib/mermaidDiagram.cjs +2 -0
- package/dist/src/lib/mermaidDiagram.cjs.map +1 -0
- package/dist/src/lib/optionList.cjs +2 -0
- package/dist/src/lib/optionList.cjs.map +1 -0
- package/dist/src/lib/pathGroups.cjs +2 -0
- package/dist/src/lib/pathGroups.cjs.map +1 -0
- package/dist/src/lib/picker.cjs +2 -0
- package/dist/src/lib/picker.cjs.map +1 -0
- package/dist/src/lib/review.cjs +8 -0
- package/dist/src/lib/review.cjs.map +1 -0
- package/dist/src/lib/syntaxHighlight.cjs +3 -0
- package/dist/src/lib/syntaxHighlight.cjs.map +1 -0
- package/dist/src/lib/tone.cjs +2 -0
- package/dist/src/lib/tone.cjs.map +1 -0
- package/dist/src/theme/apply.cjs +3 -0
- package/dist/src/theme/apply.cjs.map +1 -0
- package/dist/src/theme/builtinThemes.cjs +2 -0
- package/dist/src/theme/builtinThemes.cjs.map +1 -0
- package/dist/src/theme/derive.cjs +2 -0
- package/dist/src/theme/derive.cjs.map +1 -0
- package/dist/src/theme/nativeTheme.cjs +2 -0
- package/dist/src/theme/nativeTheme.cjs.map +1 -0
- package/dist/src/theme/parse.cjs +2 -0
- package/dist/src/theme/parse.cjs.map +1 -0
- package/dist/src/theme/piTheme.cjs +2 -0
- package/dist/src/theme/piTheme.cjs.map +1 -0
- package/dist/src/theme/preference.cjs +2 -0
- package/dist/src/theme/preference.cjs.map +1 -0
- package/dist/src/types/editor.cjs +2 -0
- package/dist/src/types/editor.cjs.map +1 -0
- package/dist/src/types/theme.cjs +2 -0
- package/dist/src/types/theme.cjs.map +1 -0
- package/dist/src/types/tone.cjs +2 -0
- package/dist/src/types/tone.cjs.map +1 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.d.mts +8 -0
- package/dist/theme.mjs +1 -0
- package/dist/themes/doom-nord-dark.cjs +2 -0
- package/dist/themes/doom-nord-dark.cjs.map +1 -0
- package/dist/themes/doom-one-dark.cjs +2 -0
- package/dist/themes/doom-one-dark.cjs.map +1 -0
- package/dist/themes/doom-one-light.cjs +2 -0
- package/dist/themes/doom-one-light.cjs.map +1 -0
- package/llms.txt +8 -0
- package/package.json +130 -0
- package/styles/mcp.css +22 -0
- package/styles/preview.css +17 -0
- package/styles/theme.css +311 -0
- package/styles/tokens.css +15 -0
- package/themes/doom-nord-dark.json +27 -0
- package/themes/doom-one-dark.json +30 -0
- package/themes/doom-one-light.json +28 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker.mjs","names":["filterPickerItems","needle","filter","items","item","initialPickerCursor","value","toggleDraft","next","draft","draftChanged","appliedValues","pickerHint","multiple","filterable","pickerKeyAction","state","key","count","cursor","index"],"sources":["../../../../../../src/lib/picker.ts"],"sourcesContent":["import { MAX_DIGIT_SHORTCUT } from './optionList';\n\n/** What a picker row needs for matching and ordering; the view adds its own presentation. */\nexport interface PickerChoice {\n value: string;\n title: string;\n subtitle?: string;\n disabledReason?: string;\n}\n\n/** What a key does to a picker, decided apart from the DOM so it can be tested. */\nexport type PickerKeyAction = { kind: 'move'; cursor: number } | { kind: 'pick'; index: number };\n\n/** Rows whose title, subtitle or value contain the filter, case-insensitively. */\nexport function filterPickerItems<T extends PickerChoice>(items: readonly T[], filter: string): readonly T[] {\n const needle = filter.trim().toLowerCase();\n if (needle === '') return items;\n return items.filter((item) => `${item.title} ${item.subtitle ?? ''} ${item.value}`.toLowerCase().includes(needle));\n}\n\n/** Open on what is in effect, so Enter on a single choice keeps it. */\nexport function initialPickerCursor(items: readonly PickerChoice[], value: readonly string[]): number {\n return Math.max(\n 0,\n items.findIndex((item) => value.includes(item.value)),\n );\n}\n\n/** The draft with one value flipped. */\nexport function toggleDraft(draft: ReadonlySet<string>, value: string): Set<string> {\n const next = new Set(draft);\n if (!next.delete(value)) next.add(value);\n return next;\n}\n\n/** Whether the draft differs from what is in effect, which is what makes Apply worth pressing. */\nexport function draftChanged(draft: ReadonlySet<string>, value: readonly string[]): boolean {\n return draft.size !== value.length || value.some((item) => !draft.has(item));\n}\n\n/** The drafted values in the order they were offered, not the order they were clicked. */\nexport function appliedValues(items: readonly PickerChoice[], draft: ReadonlySet<string>): string[] {\n return items.filter((item) => draft.has(item.value)).map((item) => item.value);\n}\n\n/** The keys the footer promises, given the mode and whether a filter takes typing. */\nexport function pickerHint(multiple: boolean, filterable: boolean): string {\n if (multiple) return filterable ? 'enter toggles · tab to Apply' : '1-9, space or enter toggles · tab to Apply';\n return filterable ? 'type to filter · enter picks' : '1-9 or enter picks';\n}\n\n/**\n * The action a key asks for, or null to leave it alone. Digits jump to a row\n * only without a filter, which would otherwise take them as typing; space\n * toggles a multiple choice for the same reason.\n */\nexport function pickerKeyAction(\n key: string,\n state: { count: number; cursor: number; multiple: boolean; filterable: boolean },\n): PickerKeyAction | null {\n const { count, cursor, multiple, filterable } = state;\n if (key === 'ArrowDown' || key === 'ArrowUp') {\n if (count === 0) return null;\n return { kind: 'move', cursor: (cursor + (key === 'ArrowDown' ? 1 : -1) + count) % count };\n }\n if (key === 'Enter') return count === 0 ? null : { kind: 'pick', index: cursor };\n if (filterable) return null;\n if (key === ' ' && multiple) return count === 0 ? null : { kind: 'pick', index: cursor };\n const index = Number.parseInt(key, 10) - 1;\n if (!Number.isInteger(index) || index < 0 || index >= Math.min(count, MAX_DIGIT_SHORTCUT)) return null;\n return { kind: 'pick', index };\n}\n"],"mappings":"yBAcA,SAAgBA,EAA0C,EAAqB,EAA8B,CAC3G,IAAMC,EAASC,EAAO,KAAK,CAAC,CAAC,YAAY,EAEzC,OADID,IAAW,GAAWE,EACnBA,EAAM,OAAQ,GAAS,GAAGC,EAAK,MAAM,GAAGA,EAAK,UAAY,GAAG,GAAGA,EAAK,QAAQ,YAAY,CAAC,CAAC,SAASH,CAAM,CAAC,CACnH,CAGA,SAAgBI,EAAoB,EAAgC,EAAkC,CACpG,OAAO,KAAK,IACV,EACAF,EAAM,UAAW,GAASG,EAAM,SAASF,EAAK,KAAK,CAAC,CACtD,CACF,CAGA,SAAgBG,EAAY,EAA4B,EAA4B,CAClF,IAAMC,EAAO,IAAI,IAAIC,CAAK,EAE1B,OADKD,EAAK,OAAOF,CAAK,GAAGE,EAAK,IAAIF,CAAK,EAChCE,CACT,CAGA,SAAgBE,EAAa,EAA4B,EAAmC,CAC1F,OAAOD,EAAM,OAASH,EAAM,QAAUA,EAAM,KAAM,GAAS,CAACG,EAAM,IAAIL,CAAI,CAAC,CAC7E,CAGA,SAAgBO,EAAc,EAAgC,EAAsC,CAClG,OAAOR,EAAM,OAAQ,GAASM,EAAM,IAAIL,EAAK,KAAK,CAAC,CAAC,CAAC,IAAK,GAASA,EAAK,KAAK,CAC/E,CAGA,SAAgBQ,EAAW,EAAmB,EAA6B,CAEzE,OADIC,EAAiBC,EAAa,+BAAiC,6CAC5DA,EAAa,+BAAiC,oBACvD,CAOA,SAAgBC,EACd,EACA,EACwB,CACxB,GAAM,CAAE,QAAO,SAAQ,WAAU,cAAeC,EAChD,GAAIC,IAAQ,aAAeA,IAAQ,UAEjC,OADIC,IAAU,EAAU,KACjB,CAAE,KAAM,OAAQ,QAASC,GAAUF,IAAQ,YAAc,EAAI,IAAMC,GAASA,CAAM,EAE3F,GAAID,IAAQ,QAAS,OAAOC,IAAU,EAAI,KAAO,CAAE,KAAM,OAAQ,MAAOC,CAAO,EAC/E,GAAIL,EAAY,OAAO,KACvB,GAAIG,IAAQ,KAAOJ,EAAU,OAAOK,IAAU,EAAI,KAAO,CAAE,KAAM,OAAQ,MAAOC,CAAO,EACvF,IAAMC,EAAQ,OAAO,SAASH,EAAK,EAAE,EAAI,EAEzC,MADI,CAAC,OAAO,UAAUG,CAAK,GAAKA,EAAQ,GAAKA,GAAS,KAAK,IAAIF,EAAA,CAAyB,EAAU,KAC3F,CAAE,KAAM,OAAQ,OAAM,CAC/B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DiffHunk, DiffMarker, DiffSide, ReviewComment } from "../types/diff.mjs";
|
|
2
|
+
//#region src/lib/review.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Pure review logic shared by every surface that comments on a diff: sizing a
|
|
5
|
+
* gutter, deciding which side a selection is on, naming an anchor, and folding
|
|
6
|
+
* a set of notes into one message.
|
|
7
|
+
*/
|
|
8
|
+
/** The widest line number in a diff, in characters, which sizes the gutter. */
|
|
9
|
+
export declare function diffGutterWidth(hunks: readonly DiffHunk[]): number;
|
|
10
|
+
/**
|
|
11
|
+
* The line range a set of touched rows covers, and the side it is on.
|
|
12
|
+
*
|
|
13
|
+
* Any context or added row puts the selection on the new side, and then the
|
|
14
|
+
* removed rows in it are ignored: their numbers belong to the other file and
|
|
15
|
+
* would stretch the range over lines that have nothing to do with it. Only a
|
|
16
|
+
* selection made entirely of removed rows lands on the old side.
|
|
17
|
+
*/
|
|
18
|
+
export declare function diffRangeOf(rows: readonly {
|
|
19
|
+
marker: DiffMarker;
|
|
20
|
+
line: number;
|
|
21
|
+
}[]): {
|
|
22
|
+
side: DiffSide;
|
|
23
|
+
startLine: number;
|
|
24
|
+
endLine: number;
|
|
25
|
+
} | undefined;
|
|
26
|
+
/** Trims a quoted snippet to something a prompt can carry without drowning it. */
|
|
27
|
+
export declare function trimSnippet(snippet: string, maxLines?: number, maxChars?: number): string;
|
|
28
|
+
/** How a comment names the place it is about. New-side anchors keep the `path:line` form. */
|
|
29
|
+
export declare function reviewCommentAnchor(comment: ReviewComment): string;
|
|
30
|
+
/** The opening line of a review when the caller names no context of its own. */
|
|
31
|
+
export declare function defaultReviewHeading(count: number): string;
|
|
32
|
+
/**
|
|
33
|
+
* The one message a review sends.
|
|
34
|
+
*
|
|
35
|
+
* Every note goes in a single message rather than one each: N notes then cost
|
|
36
|
+
* one turn, and the agent sees the whole review before it changes anything.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildReviewPrompt(comments: readonly ReviewComment[], heading?: string): string;
|
|
39
|
+
//#endregion
|
|
40
|
+
//# sourceMappingURL=review.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.mts","names":[],"sources":["../../../../../../src/lib/review.ts"],"mappings":";;;;;;;;wBASgB,gBAAgB,gBAAgB;;;;;;;;;wBAgBhC,YACd;EAAiB,QAAQ;EAAY;;EAClC,MAAM;EAAU;EAAmB;;;wBAUxB,YAAY,iBAAiB,mBAAe;;wBAQ5C,oBAAoB,SAAS;;wBAc7B,qBAAqB;;;;;;;wBAYrB,kBAAkB,mBAAmB,iBAAiB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
function e(e){let t=1;for(let n of e)for(let e of n.rows)t=Math.max(t,String(e.line).length);return t}function t(e){let t=e.filter(e=>Number.isFinite(e.line)&&e.line>0),n=t.filter(e=>e.marker!==`-`),r=n.length>0?`new`:`old`,i=(n.length>0?n:t).map(e=>e.line);if(i.length!==0)return{side:r,startLine:Math.min(...i),endLine:Math.max(...i)}}function n(e,t=20,n=2e3){let r=e.split(`
|
|
2
|
+
`),i=(r.length>t?[...r.slice(0,t),`…`]:r).join(`
|
|
3
|
+
`);return i.length>n?`${i.slice(0,n)}…`:i}function r(e){if(e.startLine===void 0)return e.relPath;let t=e.endLine===void 0||e.endLine===e.startLine;return e.side===`old`?t?`${e.relPath} (removed line ${e.startLine})`:`${e.relPath} (removed lines ${e.startLine}-${e.endLine})`:t?`${e.relPath}:${e.startLine}`:`${e.relPath}:${e.startLine}-${e.endLine}`}function i(e){return e===1?`I left one review comment on a file you changed. Please address it.`:`I left ${e} review comments on files you changed. Please address them.`}function a(e,t){if(e.length===0)return``;let a=e.map(e=>{let t=n(e.snippet).split(`
|
|
4
|
+
`).map(e=>`> ${e}`).join(`
|
|
5
|
+
`);return`### ${r(e)}\n\n${t}\n\n${e.body.trim()}`}).join(`
|
|
6
|
+
|
|
7
|
+
`);return`${t??i(e.length)}\n\n${a}`}export{a as buildReviewPrompt,i as defaultReviewHeading,e as diffGutterWidth,t as diffRangeOf,r as reviewCommentAnchor,n as trimSnippet};
|
|
8
|
+
//# sourceMappingURL=review.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.mjs","names":["diffGutterWidth","widest","hunk","hunks","row","diffRangeOf","numbered","rows","kept","side","lines","trimSnippet","snippet","text","maxLines","maxChars","reviewCommentAnchor","comment","single","defaultReviewHeading","count","buildReviewPrompt","comments","body","quoted","line","heading"],"sources":["../../../../../../src/lib/review.ts"],"sourcesContent":["import type { DiffHunk, DiffMarker, DiffSide, ReviewComment } from '../types/diff';\n\n/**\n * Pure review logic shared by every surface that comments on a diff: sizing a\n * gutter, deciding which side a selection is on, naming an anchor, and folding\n * a set of notes into one message.\n */\n\n/** The widest line number in a diff, in characters, which sizes the gutter. */\nexport function diffGutterWidth(hunks: readonly DiffHunk[]): number {\n let widest = 1;\n for (const hunk of hunks) {\n for (const row of hunk.rows) widest = Math.max(widest, String(row.line).length);\n }\n return widest;\n}\n\n/**\n * The line range a set of touched rows covers, and the side it is on.\n *\n * Any context or added row puts the selection on the new side, and then the\n * removed rows in it are ignored: their numbers belong to the other file and\n * would stretch the range over lines that have nothing to do with it. Only a\n * selection made entirely of removed rows lands on the old side.\n */\nexport function diffRangeOf(\n rows: readonly { marker: DiffMarker; line: number }[],\n): { side: DiffSide; startLine: number; endLine: number } | undefined {\n const numbered = rows.filter((row) => Number.isFinite(row.line) && row.line > 0);\n const kept = numbered.filter((row) => row.marker !== '-');\n const side: DiffSide = kept.length > 0 ? 'new' : 'old';\n const lines = (kept.length > 0 ? kept : numbered).map((row) => row.line);\n if (lines.length === 0) return undefined;\n return { side, startLine: Math.min(...lines), endLine: Math.max(...lines) };\n}\n\n/** Trims a quoted snippet to something a prompt can carry without drowning it. */\nexport function trimSnippet(snippet: string, maxLines = 20, maxChars = 2000): string {\n const lines = snippet.split('\\n');\n const clipped = lines.length > maxLines ? [...lines.slice(0, maxLines), '…'] : lines;\n const text = clipped.join('\\n');\n return text.length > maxChars ? `${text.slice(0, maxChars)}…` : text;\n}\n\n/** How a comment names the place it is about. New-side anchors keep the `path:line` form. */\nexport function reviewCommentAnchor(comment: ReviewComment): string {\n if (comment.startLine === undefined) return comment.relPath;\n const single = comment.endLine === undefined || comment.endLine === comment.startLine;\n if (comment.side === 'old') {\n return single\n ? `${comment.relPath} (removed line ${comment.startLine})`\n : `${comment.relPath} (removed lines ${comment.startLine}-${comment.endLine})`;\n }\n return single\n ? `${comment.relPath}:${comment.startLine}`\n : `${comment.relPath}:${comment.startLine}-${comment.endLine}`;\n}\n\n/** The opening line of a review when the caller names no context of its own. */\nexport function defaultReviewHeading(count: number): string {\n return count === 1\n ? 'I left one review comment on a file you changed. Please address it.'\n : `I left ${count} review comments on files you changed. Please address them.`;\n}\n\n/**\n * The one message a review sends.\n *\n * Every note goes in a single message rather than one each: N notes then cost\n * one turn, and the agent sees the whole review before it changes anything.\n */\nexport function buildReviewPrompt(comments: readonly ReviewComment[], heading?: string): string {\n if (comments.length === 0) return '';\n const body = comments\n .map((comment) => {\n const quoted = trimSnippet(comment.snippet)\n .split('\\n')\n .map((line) => `> ${line}`)\n .join('\\n');\n return `### ${reviewCommentAnchor(comment)}\\n\\n${quoted}\\n\\n${comment.body.trim()}`;\n })\n .join('\\n\\n');\n return `${heading ?? defaultReviewHeading(comments.length)}\\n\\n${body}`;\n}\n"],"mappings":"AASA,SAAgBA,EAAgB,EAAoC,CAClE,IAAIC,EAAS,EACb,IAAK,IAAMC,KAAQC,EACjB,IAAK,IAAMC,KAAOF,EAAK,KAAM,EAAS,KAAK,IAAID,EAAQ,OAAOG,EAAI,IAAI,CAAC,CAAC,MAAM,EAEhF,OAAOH,CACT,CAUA,SAAgBI,EACd,EACoE,CACpE,IAAMC,EAAWC,EAAK,OAAQ,GAAQ,OAAO,SAASH,EAAI,IAAI,GAAKA,EAAI,KAAO,CAAC,EACzEI,EAAOF,EAAS,OAAQ,GAAQF,EAAI,SAAW,GAAG,EAClDK,EAAiBD,EAAK,OAAS,EAAI,MAAQ,MAC3CE,GAASF,EAAK,OAAS,EAAIA,EAAOF,EAAA,CAAU,IAAK,GAAQF,EAAI,IAAI,EACvE,GAAIM,EAAM,SAAW,EACrB,MAAO,CAAE,OAAM,UAAW,KAAK,IAAI,GAAGA,CAAK,EAAG,QAAS,KAAK,IAAI,GAAGA,CAAK,CAAE,CAC5E,CAGA,SAAgBC,EAAY,EAAiB,EAAW,GAAI,EAAW,IAAc,CACnF,IAAMD,EAAQE,EAAQ,MAAM;CAAI,EAE1BC,GADUH,EAAM,OAASI,EAAW,CAAC,GAAGJ,EAAM,MAAM,EAAGI,CAAQ,EAAG,GAAG,EAAIJ,EAAA,CAC1D,KAAK;CAAI,EAC9B,OAAOG,EAAK,OAASE,EAAW,GAAGF,EAAK,MAAM,EAAGE,CAAQ,EAAE,GAAKF,CAClE,CAGA,SAAgBG,EAAoB,EAAgC,CAClE,GAAIC,EAAQ,YAAc,IAAA,GAAW,OAAOA,EAAQ,QACpD,IAAMC,EAASD,EAAQ,UAAY,IAAA,IAAaA,EAAQ,UAAYA,EAAQ,UAM5E,OALIA,EAAQ,OAAS,MACZC,EACH,GAAGD,EAAQ,QAAQ,iBAAiBA,EAAQ,UAAU,GACtD,GAAGA,EAAQ,QAAQ,kBAAkBA,EAAQ,UAAU,GAAGA,EAAQ,QAAQ,GAEzEC,EACH,GAAGD,EAAQ,QAAQ,GAAGA,EAAQ,YAC9B,GAAGA,EAAQ,QAAQ,GAAGA,EAAQ,UAAU,GAAGA,EAAQ,SACzD,CAGA,SAAgBE,EAAqB,EAAuB,CAC1D,OAAOC,IAAU,EACb,sEACA,UAAUA,EAAM,4DACtB,CAQA,SAAgBC,EAAkB,EAAoC,EAA0B,CAC9F,GAAIC,EAAS,SAAW,EAAG,MAAO,GAClC,IAAMC,EAAOD,EACV,IAAK,GAAY,CAChB,IAAME,EAASb,EAAYM,EAAQ,OAAO,CAAC,CACxC,MAAM;CAAI,CAAC,CACX,IAAK,GAAS,KAAKQ,GAAM,CAAC,CAC1B,KAAK;CAAI,EACZ,MAAO,OAAOT,EAAoBC,CAAO,EAAE,MAAMO,EAAO,MAAMP,EAAQ,KAAK,KAAK,GAClF,CAAC,CAAC,CACD,KAAK;;CAAM,EACd,MAAO,GAAGS,GAAWP,EAAqBG,EAAS,MAAM,EAAE,MAAMC,GACnE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { GrammarKey } from "./editorLanguage.mjs";
|
|
2
|
+
import { DOOM_SYNTAX_STYLES } from "./editorTheme.mjs";
|
|
3
|
+
import { CSSProperties } from "react";
|
|
4
|
+
//#region src/lib/syntaxHighlight.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Static syntax highlighting for read-only code, the timeline's half of the
|
|
7
|
+
* editor's `syntaxHighlighting`.
|
|
8
|
+
*
|
|
9
|
+
* A tool card shows code it cannot edit, so it needs the colours without the
|
|
10
|
+
* editor: the same grammars `editorLanguage.ts` loads and the same token
|
|
11
|
+
* palette `editorTheme.ts` names, run once over a string and handed back as
|
|
12
|
+
* spans. Everything CodeMirror-shaped is behind a dynamic import, so a session
|
|
13
|
+
* that never opens a code result never downloads a parser, and the caller
|
|
14
|
+
* always has plain text to show first.
|
|
15
|
+
*/
|
|
16
|
+
/** The palette keys a token can land on; the styles themselves are the editor's. */
|
|
17
|
+
export type SyntaxToken = keyof typeof DOOM_SYNTAX_STYLES;
|
|
18
|
+
/** One run of same-styled text inside a line. `token` absent means unstyled. */
|
|
19
|
+
export interface SyntaxSpan {
|
|
20
|
+
text: string;
|
|
21
|
+
token?: SyntaxToken;
|
|
22
|
+
}
|
|
23
|
+
/** Lines of spans, one array per source line, so a gutter can pair with them. */
|
|
24
|
+
export type SyntaxLines = readonly (readonly SyntaxSpan[])[];
|
|
25
|
+
export interface GrammarQuery {
|
|
26
|
+
/** The file the text came from, when the tool knows one. */
|
|
27
|
+
path?: string | undefined;
|
|
28
|
+
/** The text itself, used only when the path settles nothing. */
|
|
29
|
+
text?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Which grammar to colour a result with.
|
|
33
|
+
*
|
|
34
|
+
* The path decides whenever it can, because a name is evidence and a body is a
|
|
35
|
+
* guess. Sniffing only answers for text that arrived without a usable name: a
|
|
36
|
+
* shebang says what runs the script, and a document that opens and closes with
|
|
37
|
+
* brackets is treated as JSON. Anything else stays plain rather than being
|
|
38
|
+
* coloured as the wrong language.
|
|
39
|
+
*/
|
|
40
|
+
export declare function detectGrammar(query: GrammarQuery): GrammarKey | undefined;
|
|
41
|
+
/** The inline style a token wears. Colours come from the editor palette, which names theme tokens. */
|
|
42
|
+
export declare function syntaxStyleOf(token: SyntaxToken | undefined): CSSProperties | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Colours `text` as `grammar`, as lines of spans.
|
|
45
|
+
*
|
|
46
|
+
* The whole text is parsed at once even though the caller may render it line
|
|
47
|
+
* by line, because a template literal or a block comment only makes sense with
|
|
48
|
+
* its neighbours. Text past the size cap, and a grammar whose extension turns
|
|
49
|
+
* out to carry no parser, come back unhighlighted rather than throwing: colour
|
|
50
|
+
* is decoration, and the caller already has the plain text on screen.
|
|
51
|
+
*/
|
|
52
|
+
export declare function highlightToLines(text: string, grammar: GrammarKey): Promise<SyntaxLines | undefined>;
|
|
53
|
+
//#endregion
|
|
54
|
+
//# sourceMappingURL=syntaxHighlight.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntaxHighlight.d.mts","names":[],"sources":["../../../../../../src/lib/syntaxHighlight.ts"],"mappings":";;;;;;;;;;;;;;;;YAkBY,2BAA2B;;iBAGtB;EACf;EACA,QAAQ;;;YAIE,iCAAiC;iBAqB5B;;EAEf;;EAEA;;;;;;;;;;;wBAYc,cAAc,OAAO,eAAe;;wBAkBpC,cAAc,OAAO,0BAA0B;;;;;;;;;;wBA4DzC,iBAAiB,cAAc,SAAS,aAAa,QAAQ"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{grammarKeyOf as e,loadGrammar as t}from"./editorLanguage.mjs";import{DOOM_SYNTAX_STYLES as n}from"./editorTheme.mjs";const r=[{pattern:/^#!.*\b(?:bash|sh|zsh|dash|ksh)\b/,grammar:`shell`},{pattern:/^#!.*\bpython[\d.]*\b/,grammar:`python`},{pattern:/^#!.*\b(?:node|bun|deno)\b/,grammar:`javascript`}],i=/^\s*[[{][\s\S]*[\]}]\s*$/;function a(t){let n=t.path===void 0||t.path.length===0?void 0:e(t.path);if(n!==void 0)return n;let a=t.text??``;if(a.length===0)return;let o=a.slice(0,200);if(o.startsWith(`#!`)){let e=o.split(`
|
|
2
|
+
`,1)[0]??``;for(let t of r)if(t.pattern.test(e))return t.grammar;return`shell`}return i.test(a)?`json`:void 0}function o(e){return e===void 0?void 0:n[e]}async function s(){let{tagHighlighter:e,tags:t}=await import(`@lezer/highlight`);return e([{tag:t.comment,class:`comment`},{tag:t.keyword,class:`keyword`},{tag:[t.atom,t.bool,t.null,t.self],class:`constant`},{tag:t.number,class:`literal`},{tag:[t.string,t.special(t.string)],class:`string`},{tag:t.regexp,class:`regexp`},{tag:[t.operator,t.operatorKeyword],class:`operator`},{tag:[t.punctuation,t.separator,t.bracket],class:`punctuation`},{tag:[t.variableName,t.definition(t.variableName)],class:`variable`},{tag:[t.propertyName,t.definition(t.propertyName)],class:`property`},{tag:[t.function(t.variableName),t.function(t.propertyName)],class:`callable`},{tag:[t.typeName,t.className,t.namespace],class:`type`},{tag:[t.tagName,t.angleBracket],class:`tag`},{tag:t.attributeName,class:`attribute`},{tag:[t.meta,t.processingInstruction,t.documentMeta],class:`meta`},{tag:t.heading,class:`heading`},{tag:[t.link,t.url],class:`link`},{tag:t.emphasis,class:`emphasis`},{tag:t.strong,class:`strong`},{tag:t.strikethrough,class:`strikethrough`},{tag:t.invalid,class:`invalid`}])}async function c(e){let[{Language:n,LanguageSupport:r},i]=await Promise.all([import(`@codemirror/language`),t(e)]);if(i instanceof r)return i.language.parser;if(i instanceof n)return i.parser}async function l(e,t){if(e.length===0||e.length>2e5)return;let[{highlightCode:n},r,i]=await Promise.all([import(`@lezer/highlight`),s(),c(t)]);if(i===void 0)return;let a=[[]];return n(e,i.parse(e),r,(e,t)=>{a[a.length-1]?.push(t===``?{text:e}:{text:e,token:t})},()=>a.push([])),a}export{a as detectGrammar,l as highlightToLines,o as syntaxStyleOf};
|
|
3
|
+
//# sourceMappingURL=syntaxHighlight.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntaxHighlight.mjs","names":["SHEBANG_GRAMMARS","JSON_SHAPE","detectGrammar","byPath","query","grammarKeyOf","text","head","firstLine","entry","syntaxStyleOf","token","DOOM_SYNTAX_STYLES","doomHighlighter","tagHighlighter","tags","parserFor","extension","loadGrammar","grammar","LanguageSupport","Language","highlightToLines","highlighter","parser","lines","highlightCode","classes","code"],"sources":["../../../../../../src/lib/syntaxHighlight.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { type GrammarKey, grammarKeyOf, loadGrammar } from './editorLanguage';\nimport { DOOM_SYNTAX_STYLES } from './editorTheme';\n\n/**\n * Static syntax highlighting for read-only code, the timeline's half of the\n * editor's `syntaxHighlighting`.\n *\n * A tool card shows code it cannot edit, so it needs the colours without the\n * editor: the same grammars `editorLanguage.ts` loads and the same token\n * palette `editorTheme.ts` names, run once over a string and handed back as\n * spans. Everything CodeMirror-shaped is behind a dynamic import, so a session\n * that never opens a code result never downloads a parser, and the caller\n * always has plain text to show first.\n */\n\n/** The palette keys a token can land on; the styles themselves are the editor's. */\nexport type SyntaxToken = keyof typeof DOOM_SYNTAX_STYLES;\n\n/** One run of same-styled text inside a line. `token` absent means unstyled. */\nexport interface SyntaxSpan {\n text: string;\n token?: SyntaxToken;\n}\n\n/** Lines of spans, one array per source line, so a gutter can pair with them. */\nexport type SyntaxLines = readonly (readonly SyntaxSpan[])[];\n\n/**\n * Above this the parse costs more than the colour is worth. Tool results are\n * bounded well below it; a pasted file is not, and blocking the frame to paint\n * a wall of text nobody reads is the worse outcome.\n */\nconst MAX_HIGHLIGHT_CHARS = 200_000;\n\n/** Only the first line is needed to spot a shebang, and reading more of a big string is waste. */\nconst SNIFF_CHARS = 200;\n\nconst SHEBANG_GRAMMARS: ReadonlyArray<{ readonly pattern: RegExp; readonly grammar: GrammarKey }> = [\n { pattern: /^#!.*\\b(?:bash|sh|zsh|dash|ksh)\\b/, grammar: 'shell' },\n { pattern: /^#!.*\\bpython[\\d.]*\\b/, grammar: 'python' },\n { pattern: /^#!.*\\b(?:node|bun|deno)\\b/, grammar: 'javascript' },\n];\n\n/** JSON is the one shape worth guessing from the body: a document is an object or an array. */\nconst JSON_SHAPE = /^\\s*[[{][\\s\\S]*[\\]}]\\s*$/;\n\nexport interface GrammarQuery {\n /** The file the text came from, when the tool knows one. */\n path?: string | undefined;\n /** The text itself, used only when the path settles nothing. */\n text?: string | undefined;\n}\n\n/**\n * Which grammar to colour a result with.\n *\n * The path decides whenever it can, because a name is evidence and a body is a\n * guess. Sniffing only answers for text that arrived without a usable name: a\n * shebang says what runs the script, and a document that opens and closes with\n * brackets is treated as JSON. Anything else stays plain rather than being\n * coloured as the wrong language.\n */\nexport function detectGrammar(query: GrammarQuery): GrammarKey | undefined {\n const byPath = query.path === undefined || query.path.length === 0 ? undefined : grammarKeyOf(query.path);\n if (byPath !== undefined) return byPath;\n const text = query.text ?? '';\n if (text.length === 0) return undefined;\n const head = text.slice(0, SNIFF_CHARS);\n if (head.startsWith('#!')) {\n const firstLine = head.split('\\n', 1)[0] ?? '';\n for (const entry of SHEBANG_GRAMMARS) {\n if (entry.pattern.test(firstLine)) return entry.grammar;\n }\n // A shebang naming something with no grammar here is still a script.\n return 'shell';\n }\n return JSON_SHAPE.test(text) ? 'json' : undefined;\n}\n\n/** The inline style a token wears. Colours come from the editor palette, which names theme tokens. */\nexport function syntaxStyleOf(token: SyntaxToken | undefined): CSSProperties | undefined {\n return token === undefined ? undefined : DOOM_SYNTAX_STYLES[token];\n}\n\n/**\n * Every tag the palette answers for, in the order the editor lists them. The\n * class each entry carries is a palette key rather than a CSS class: the\n * result is rendered as inline styles, so nothing has to be mounted in the\n * document for a card to show colour.\n */\nasync function doomHighlighter() {\n const { tagHighlighter, tags } = await import('@lezer/highlight');\n return tagHighlighter([\n { tag: tags.comment, class: 'comment' satisfies SyntaxToken },\n { tag: tags.keyword, class: 'keyword' satisfies SyntaxToken },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], class: 'constant' satisfies SyntaxToken },\n { tag: tags.number, class: 'literal' satisfies SyntaxToken },\n { tag: [tags.string, tags.special(tags.string)], class: 'string' satisfies SyntaxToken },\n { tag: tags.regexp, class: 'regexp' satisfies SyntaxToken },\n { tag: [tags.operator, tags.operatorKeyword], class: 'operator' satisfies SyntaxToken },\n { tag: [tags.punctuation, tags.separator, tags.bracket], class: 'punctuation' satisfies SyntaxToken },\n { tag: [tags.variableName, tags.definition(tags.variableName)], class: 'variable' satisfies SyntaxToken },\n { tag: [tags.propertyName, tags.definition(tags.propertyName)], class: 'property' satisfies SyntaxToken },\n {\n tag: [tags.function(tags.variableName), tags.function(tags.propertyName)],\n class: 'callable' satisfies SyntaxToken,\n },\n { tag: [tags.typeName, tags.className, tags.namespace], class: 'type' satisfies SyntaxToken },\n { tag: [tags.tagName, tags.angleBracket], class: 'tag' satisfies SyntaxToken },\n { tag: tags.attributeName, class: 'attribute' satisfies SyntaxToken },\n { tag: [tags.meta, tags.processingInstruction, tags.documentMeta], class: 'meta' satisfies SyntaxToken },\n { tag: tags.heading, class: 'heading' satisfies SyntaxToken },\n { tag: [tags.link, tags.url], class: 'link' satisfies SyntaxToken },\n { tag: tags.emphasis, class: 'emphasis' satisfies SyntaxToken },\n { tag: tags.strong, class: 'strong' satisfies SyntaxToken },\n { tag: tags.strikethrough, class: 'strikethrough' satisfies SyntaxToken },\n { tag: tags.invalid, class: 'invalid' satisfies SyntaxToken },\n ]);\n}\n\n/** The parser behind a grammar. `loadGrammar` hands back an editor extension, which wraps one. */\nasync function parserFor(grammar: GrammarKey) {\n const [{ Language, LanguageSupport }, extension] = await Promise.all([\n import('@codemirror/language'),\n loadGrammar(grammar),\n ]);\n if (extension instanceof LanguageSupport) return extension.language.parser;\n if (extension instanceof Language) return extension.parser;\n return undefined;\n}\n\n/**\n * Colours `text` as `grammar`, as lines of spans.\n *\n * The whole text is parsed at once even though the caller may render it line\n * by line, because a template literal or a block comment only makes sense with\n * its neighbours. Text past the size cap, and a grammar whose extension turns\n * out to carry no parser, come back unhighlighted rather than throwing: colour\n * is decoration, and the caller already has the plain text on screen.\n */\nexport async function highlightToLines(text: string, grammar: GrammarKey): Promise<SyntaxLines | undefined> {\n if (text.length === 0 || text.length > MAX_HIGHLIGHT_CHARS) return undefined;\n const [{ highlightCode }, highlighter, parser] = await Promise.all([\n import('@lezer/highlight'),\n doomHighlighter(),\n parserFor(grammar),\n ]);\n if (parser === undefined) return undefined;\n\n const lines: SyntaxSpan[][] = [[]];\n highlightCode(\n text,\n parser.parse(text),\n highlighter,\n (code, classes) => {\n const current = lines[lines.length - 1];\n // `classes` is the palette key this module handed the tag highlighter,\n // or empty for text no tag claimed.\n current?.push(classes === '' ? { text: code } : { text: code, token: classes as SyntaxToken });\n },\n () => lines.push([]),\n );\n return lines;\n}\n"],"mappings":"4HAkCA,MAKMA,EAA8F,CAClG,CAAE,QAAS,oCAAqC,QAAS,OAAQ,EACjE,CAAE,QAAS,wBAAyB,QAAS,QAAS,EACtD,CAAE,QAAS,6BAA8B,QAAS,YAAa,CACjE,EAGMC,EAAa,2BAkBnB,SAAgBC,EAAc,EAA6C,CACzE,IAAMC,EAASC,EAAM,OAAS,IAAA,IAAaA,EAAM,KAAK,SAAW,EAAI,IAAA,GAAYC,EAAaD,EAAM,IAAI,EACxG,GAAID,IAAW,IAAA,GAAW,OAAOA,EACjC,IAAMG,EAAOF,EAAM,MAAQ,GAC3B,GAAIE,EAAK,SAAW,EAAG,OACvB,IAAMC,EAAOD,EAAK,MAAM,EAAG,GAAW,EACtC,GAAIC,EAAK,WAAW,IAAI,EAAG,CACzB,IAAMC,EAAYD,EAAK,MAAM;EAAM,CAAC,CAAC,CAAC,IAAM,GAC5C,IAAK,IAAME,KAAST,EAClB,GAAIS,EAAM,QAAQ,KAAKD,CAAS,EAAG,OAAOC,EAAM,QAGlD,MAAO,OACT,CACA,OAAOR,EAAW,KAAKK,CAAI,EAAI,OAAS,IAAA,EAC1C,CAGA,SAAgBI,EAAc,EAA2D,CACvF,OAAOC,IAAU,IAAA,GAAY,IAAA,GAAYC,EAAmBD,EAC9D,CAQA,eAAeE,GAAkB,CAC/B,GAAM,CAAE,iBAAgB,QAAS,MAAM,OAAO,oBAC9C,OAAOC,EAAe,CACpB,CAAE,IAAKC,EAAK,QAAS,MAAO,SAAgC,EAC5D,CAAE,IAAKA,EAAK,QAAS,MAAO,SAAgC,EAC5D,CAAE,IAAK,CAACA,EAAK,KAAMA,EAAK,KAAMA,EAAK,KAAMA,EAAK,IAAI,EAAG,MAAO,UAAiC,EAC7F,CAAE,IAAKA,EAAK,OAAQ,MAAO,SAAgC,EAC3D,CAAE,IAAK,CAACA,EAAK,OAAQA,EAAK,QAAQA,EAAK,MAAM,CAAC,EAAG,MAAO,QAA+B,EACvF,CAAE,IAAKA,EAAK,OAAQ,MAAO,QAA+B,EAC1D,CAAE,IAAK,CAACA,EAAK,SAAUA,EAAK,eAAe,EAAG,MAAO,UAAiC,EACtF,CAAE,IAAK,CAACA,EAAK,YAAaA,EAAK,UAAWA,EAAK,OAAO,EAAG,MAAO,aAAoC,EACpG,CAAE,IAAK,CAACA,EAAK,aAAcA,EAAK,WAAWA,EAAK,YAAY,CAAC,EAAG,MAAO,UAAiC,EACxG,CAAE,IAAK,CAACA,EAAK,aAAcA,EAAK,WAAWA,EAAK,YAAY,CAAC,EAAG,MAAO,UAAiC,EACxG,CACE,IAAK,CAACA,EAAK,SAASA,EAAK,YAAY,EAAGA,EAAK,SAASA,EAAK,YAAY,CAAC,EACxE,MAAO,UACT,EACA,CAAE,IAAK,CAACA,EAAK,SAAUA,EAAK,UAAWA,EAAK,SAAS,EAAG,MAAO,MAA6B,EAC5F,CAAE,IAAK,CAACA,EAAK,QAASA,EAAK,YAAY,EAAG,MAAO,KAA4B,EAC7E,CAAE,IAAKA,EAAK,cAAe,MAAO,WAAkC,EACpE,CAAE,IAAK,CAACA,EAAK,KAAMA,EAAK,sBAAuBA,EAAK,YAAY,EAAG,MAAO,MAA6B,EACvG,CAAE,IAAKA,EAAK,QAAS,MAAO,SAAgC,EAC5D,CAAE,IAAK,CAACA,EAAK,KAAMA,EAAK,GAAG,EAAG,MAAO,MAA6B,EAClE,CAAE,IAAKA,EAAK,SAAU,MAAO,UAAiC,EAC9D,CAAE,IAAKA,EAAK,OAAQ,MAAO,QAA+B,EAC1D,CAAE,IAAKA,EAAK,cAAe,MAAO,eAAsC,EACxE,CAAE,IAAKA,EAAK,QAAS,MAAO,SAAgC,CAC9D,CAAC,CACH,CAGA,eAAeC,EAAU,EAAqB,CAC5C,GAAM,CAAC,CAAE,WAAU,mBAAmBC,GAAa,MAAM,QAAQ,IAAI,CACnE,OAAO,wBACPC,EAAYC,CAAO,CACrB,CAAC,EACD,GAAIF,aAAqBG,EAAiB,OAAOH,EAAU,SAAS,OACpE,GAAIA,aAAqBI,EAAU,OAAOJ,EAAU,MAEtD,CAWA,eAAsBK,EAAiB,EAAc,EAAuD,CAC1G,GAAIhB,EAAK,SAAW,GAAKA,EAAK,OAAS,IAAqB,OAC5D,GAAM,CAAC,CAAE,iBAAiBiB,EAAaC,GAAU,MAAM,QAAQ,IAAI,CACjE,OAAO,oBACPX,EAAgB,EAChBG,EAAUG,CAAO,CACnB,CAAC,EACD,GAAIK,IAAW,IAAA,GAAW,OAE1B,IAAMC,EAAwB,CAAC,CAAC,CAAC,EAajC,OAZAC,EACEpB,EACAkB,EAAO,MAAMlB,CAAI,EACjBiB,GACC,EAAM,IAAY,CAIjBE,EAHsBA,EAAM,OAAS,EAG9B,EAAE,KAAKE,IAAY,GAAK,CAAE,KAAMC,CAAK,EAAI,CAAE,KAAMA,EAAM,MAAOD,CAAuB,CAAC,CAC/F,MACMF,EAAM,KAAK,CAAC,CAAC,CACrB,EACOA,CACT"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ChipTone, DotTone, MessageLineTone, StatusTone } from "../types/tone.mjs";
|
|
2
|
+
//#region src/lib/tone.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Translations between the tone vocabularies.
|
|
5
|
+
*
|
|
6
|
+
* Every surface that shows an outcome used to carry its own
|
|
7
|
+
* `Record<Tone, string>` table mapping a state onto a colour class. Those
|
|
8
|
+
* tables disagreed as often as they agreed. These maps are the one place the
|
|
9
|
+
* translation lives, so a card picks a status tone from its own domain and
|
|
10
|
+
* asks here what colour that reads as.
|
|
11
|
+
*/
|
|
12
|
+
/** The colour a status reads as, for the chip and border families. */
|
|
13
|
+
export declare const STATUS_TO_CHIP: Readonly<Record<StatusTone, ChipTone>>;
|
|
14
|
+
/** The dot a status reads as; a neutral status is present but not live. */
|
|
15
|
+
export declare const STATUS_TO_DOT: Readonly<Record<StatusTone, DotTone>>;
|
|
16
|
+
/**
|
|
17
|
+
* The status a colour stands for, for a caller that has only a chip tone.
|
|
18
|
+
* Lossy on purpose: the palette has more colours than there are outcomes, and
|
|
19
|
+
* a colour with no outcome of its own reads as neutral.
|
|
20
|
+
*/
|
|
21
|
+
export declare const CHIP_TO_STATUS: Readonly<Record<ChipTone, StatusTone>>;
|
|
22
|
+
/** The status a body line's role corresponds to, for a card that badges its worst line. */
|
|
23
|
+
export declare const LINE_TONE_TO_STATUS: Readonly<Record<MessageLineTone, StatusTone>>;
|
|
24
|
+
//#endregion
|
|
25
|
+
//# sourceMappingURL=tone.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tone.d.mts","names":[],"sources":["../../../../../../src/lib/tone.ts"],"mappings":";;;;;;;;;;;;qBAaa,gBAAgB,SAAS,OAAO,YAAY;;qBAU5C,eAAe,SAAS,OAAO,YAAY;;;;;;qBAc3C,gBAAgB,SAAS,OAAO,UAAU;;qBAc1C,qBAAqB,SAAS,OAAO,iBAAiB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e={neutral:`neutral`,running:`yellow`,ok:`green`,error:`red`,info:`blue`,accent:`magenta`},t={neutral:`muted`,running:`yellow`,ok:`green`,error:`red`,info:`blue`,accent:`magenta`},n={neutral:`neutral`,blue:`info`,green:`ok`,yellow:`running`,red:`error`,magenta:`accent`,violet:`accent`,cyan:`info`,orange:`running`,teal:`info`},r={hi:`neutral`,text:`neutral`,dim:`neutral`,muted:`neutral`,success:`ok`,error:`error`,warning:`running`,accent:`info`};export{n as CHIP_TO_STATUS,r as LINE_TONE_TO_STATUS,e as STATUS_TO_CHIP,t as STATUS_TO_DOT};
|
|
2
|
+
//# sourceMappingURL=tone.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tone.mjs","names":["STATUS_TO_CHIP","STATUS_TO_DOT","CHIP_TO_STATUS","LINE_TONE_TO_STATUS"],"sources":["../../../../../../src/lib/tone.ts"],"sourcesContent":["import type { ChipTone, DotTone, MessageLineTone, StatusTone } from '../types/tone';\n\n/**\n * Translations between the tone vocabularies.\n *\n * Every surface that shows an outcome used to carry its own\n * `Record<Tone, string>` table mapping a state onto a colour class. Those\n * tables disagreed as often as they agreed. These maps are the one place the\n * translation lives, so a card picks a status tone from its own domain and\n * asks here what colour that reads as.\n */\n\n/** The colour a status reads as, for the chip and border families. */\nexport const STATUS_TO_CHIP: Readonly<Record<StatusTone, ChipTone>> = {\n neutral: 'neutral',\n running: 'yellow',\n ok: 'green',\n error: 'red',\n info: 'blue',\n accent: 'magenta',\n};\n\n/** The dot a status reads as; a neutral status is present but not live. */\nexport const STATUS_TO_DOT: Readonly<Record<StatusTone, DotTone>> = {\n neutral: 'muted',\n running: 'yellow',\n ok: 'green',\n error: 'red',\n info: 'blue',\n accent: 'magenta',\n};\n\n/**\n * The status a colour stands for, for a caller that has only a chip tone.\n * Lossy on purpose: the palette has more colours than there are outcomes, and\n * a colour with no outcome of its own reads as neutral.\n */\nexport const CHIP_TO_STATUS: Readonly<Record<ChipTone, StatusTone>> = {\n neutral: 'neutral',\n blue: 'info',\n green: 'ok',\n yellow: 'running',\n red: 'error',\n magenta: 'accent',\n violet: 'accent',\n cyan: 'info',\n orange: 'running',\n teal: 'info',\n};\n\n/** The status a body line's role corresponds to, for a card that badges its worst line. */\nexport const LINE_TONE_TO_STATUS: Readonly<Record<MessageLineTone, StatusTone>> = {\n hi: 'neutral',\n text: 'neutral',\n dim: 'neutral',\n muted: 'neutral',\n success: 'ok',\n error: 'error',\n warning: 'running',\n accent: 'info',\n};\n"],"mappings":"AAaA,MAAaA,EAAyD,CACpE,QAAS,UACT,QAAS,SACT,GAAI,QACJ,MAAO,MACP,KAAM,OACN,OAAQ,SACV,EAGaC,EAAuD,CAClE,QAAS,QACT,QAAS,SACT,GAAI,QACJ,MAAO,MACP,KAAM,OACN,OAAQ,SACV,EAOaC,EAAyD,CACpE,QAAS,UACT,KAAM,OACN,MAAO,KACP,OAAQ,UACR,IAAK,QACL,QAAS,SACT,OAAQ,SACR,KAAM,OACN,OAAQ,UACR,KAAM,MACR,EAGaC,EAAqE,CAChF,GAAI,UACJ,KAAM,UACN,IAAK,UACL,MAAO,UACP,QAAS,KACT,MAAO,QACP,QAAS,UACT,OAAQ,MACV"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ThemeConfig } from "../types/theme.mjs";
|
|
2
|
+
//#region src/theme/apply.d.ts
|
|
3
|
+
/** The attribute the active theme's name is stamped on, for CSS that keys off a theme. */
|
|
4
|
+
export declare const THEME_ATTRIBUTE = "data-theme";
|
|
5
|
+
/** Every custom property a theme publishes, keyed by property name. */
|
|
6
|
+
export declare function themeCssVariables(theme: ThemeConfig): Record<string, string>;
|
|
7
|
+
/** The theme as a stylesheet rule, for a server that wants to inline it. */
|
|
8
|
+
export declare function themeCssText(theme: ThemeConfig, selector?: string): string;
|
|
9
|
+
/** The subset of an element the theme touches, so tests can pass a plain object. */
|
|
10
|
+
export interface ThemeRoot {
|
|
11
|
+
style: {
|
|
12
|
+
setProperty(name: string, value: string): void;
|
|
13
|
+
colorScheme: string;
|
|
14
|
+
};
|
|
15
|
+
setAttribute(name: string, value: string): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Applies a theme to the page: every token becomes a custom property on the
|
|
19
|
+
* root, the colour scheme follows, and the theme name is stamped so a style
|
|
20
|
+
* may key off it. Idempotent and synchronous, so calling it before the first
|
|
21
|
+
* render avoids a flash of the default theme.
|
|
22
|
+
*/
|
|
23
|
+
export declare function applyTheme(theme: ThemeConfig, root: ThemeRoot): void;
|
|
24
|
+
//#endregion
|
|
25
|
+
//# sourceMappingURL=apply.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.mts","names":[],"sources":["../../../../../../src/theme/apply.ts"],"mappings":";;;qBAIa;;wBAGG,kBAAkB,OAAO,cAAc;;wBAQvC,aAAa,OAAO,aAAa;;iBAMhC;EACf;IAAS,YAAY,cAAc;IAAsB;;EACzD,aAAa,cAAc;;;;;;;;wBASb,WAAW,OAAO,aAAa,MAAM"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{PALETTE_TOKENS as e,themeVariable as t}from"../types/theme.mjs";import{derivedTokens as n,tokenValue as r}from"./derive.mjs";const i=`data-theme`;function a(i){let a={};for(let n of e)a[t(n)]=i.tokens[n];for(let e of n())a[t(e)]=r(i,e);return a}function o(e,t=`:root`){let n=Object.entries(a(e)).map(([e,t])=>` ${e}: ${t};`);return`${t} {\n color-scheme: ${e.scheme};\n${n.join(`
|
|
2
|
+
`)}\n}\n`}function s(e,t){for(let[n,r]of Object.entries(a(e)))t.style.setProperty(n,r);t.style.colorScheme=e.scheme,t.setAttribute(i,e.name)}export{i as THEME_ATTRIBUTE,s as applyTheme,o as themeCssText,a as themeCssVariables};
|
|
3
|
+
//# sourceMappingURL=apply.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.mjs","names":["THEME_ATTRIBUTE","themeCssVariables","variables","token","PALETTE_TOKENS","themeVariable","theme","derivedTokens","tokenValue","themeCssText","declarations","name","value","selector","applyTheme","root"],"sources":["../../../../../../src/theme/apply.ts"],"sourcesContent":["import { PALETTE_TOKENS, type ThemeConfig, themeVariable } from '../types/theme';\nimport { derivedTokens, tokenValue } from './derive';\n\n/** The attribute the active theme's name is stamped on, for CSS that keys off a theme. */\nexport const THEME_ATTRIBUTE = 'data-theme';\n\n/** Every custom property a theme publishes, keyed by property name. */\nexport function themeCssVariables(theme: ThemeConfig): Record<string, string> {\n const variables: Record<string, string> = {};\n for (const token of PALETTE_TOKENS) variables[themeVariable(token)] = theme.tokens[token];\n for (const token of derivedTokens()) variables[themeVariable(token)] = tokenValue(theme, token);\n return variables;\n}\n\n/** The theme as a stylesheet rule, for a server that wants to inline it. */\nexport function themeCssText(theme: ThemeConfig, selector = ':root'): string {\n const declarations = Object.entries(themeCssVariables(theme)).map(([name, value]) => ` ${name}: ${value};`);\n return `${selector} {\\n color-scheme: ${theme.scheme};\\n${declarations.join('\\n')}\\n}\\n`;\n}\n\n/** The subset of an element the theme touches, so tests can pass a plain object. */\nexport interface ThemeRoot {\n style: { setProperty(name: string, value: string): void; colorScheme: string };\n setAttribute(name: string, value: string): void;\n}\n\n/**\n * Applies a theme to the page: every token becomes a custom property on the\n * root, the colour scheme follows, and the theme name is stamped so a style\n * may key off it. Idempotent and synchronous, so calling it before the first\n * render avoids a flash of the default theme.\n */\nexport function applyTheme(theme: ThemeConfig, root: ThemeRoot): void {\n for (const [name, value] of Object.entries(themeCssVariables(theme))) root.style.setProperty(name, value);\n root.style.colorScheme = theme.scheme;\n root.setAttribute(THEME_ATTRIBUTE, theme.name);\n}\n"],"mappings":"oIAIA,MAAaA,EAAkB,aAG/B,SAAgBC,EAAkB,EAA4C,CAC5E,IAAMC,EAAoC,CAAC,EAC3C,IAAK,IAAMC,KAASC,EAAgB,EAAUC,EAAcF,CAAK,GAAKG,EAAM,OAAOH,GACnF,IAAK,IAAMA,KAASI,EAAc,EAAG,EAAUF,EAAcF,CAAK,GAAKK,EAAWF,EAAOH,CAAK,EAC9F,OAAOD,CACT,CAGA,SAAgBO,EAAa,EAAoB,EAAW,QAAiB,CAC3E,IAAMC,EAAe,OAAO,QAAQT,EAAkBK,CAAK,CAAC,CAAC,CAAC,KAAK,CAACK,EAAMC,KAAW,KAAKD,EAAK,IAAIC,EAAM,EAAE,EAC3G,MAAO,GAAGC,EAAS,sBAAsBP,EAAM,OAAO,KAAKI,EAAa,KAAK;CAAI,EAAE,MACrF,CAcA,SAAgBI,EAAW,EAAoB,EAAuB,CACpE,IAAK,GAAM,CAACH,EAAMC,KAAU,OAAO,QAAQX,EAAkBK,CAAK,CAAC,EAAGS,EAAK,MAAM,YAAYJ,EAAMC,CAAK,EACxG,EAAK,MAAM,YAAcN,EAAM,OAC/BS,EAAK,aAAaf,EAAiBM,EAAM,IAAI,CAC/C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ThemeConfig } from "../types/theme.mjs";
|
|
2
|
+
//#region src/theme/builtinThemes.d.ts
|
|
3
|
+
/** The theme the cockpit renders with until a preference says otherwise. */
|
|
4
|
+
export declare const DEFAULT_THEME_NAME = "doom-one-dark";
|
|
5
|
+
/** The themes this package ships, default first. */
|
|
6
|
+
export declare const BUILTIN_THEMES: readonly ThemeConfig[];
|
|
7
|
+
export declare const DEFAULT_THEME: ThemeConfig;
|
|
8
|
+
/** A shipped theme by name, or undefined for a name nothing shipped under. */
|
|
9
|
+
export declare function builtinTheme(name: string): ThemeConfig | undefined;
|
|
10
|
+
//#endregion
|
|
11
|
+
//# sourceMappingURL=builtinThemes.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtinThemes.d.mts","names":[],"sources":["../../../../../../src/theme/builtinThemes.ts"],"mappings":";;;qBAaa;;qBAGA,yBAAyB;qBAMzB,eAAe;;wBAGZ,aAAa,eAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"../../themes/doom-nord-dark.mjs";import t from"../../themes/doom-one-dark.mjs";import n from"../../themes/doom-one-light.mjs";import{parseThemeConfig as r}from"./parse.mjs";function i(e,t){let n=r(e);if(n===null)throw Error(`The shipped theme ${t} is malformed.`);return n}const a=`doom-one-dark`,o=[i(t,`doom-one-dark.json`),i(n,`doom-one-light.json`),i(e,`doom-nord-dark.json`)],s=o[0];function c(e){return o.find(t=>t.name===e)}export{o as BUILTIN_THEMES,s as DEFAULT_THEME,a as DEFAULT_THEME_NAME,c as builtinTheme};
|
|
2
|
+
//# sourceMappingURL=builtinThemes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtinThemes.mjs","names":["doomOneDark","doomOneLight","doomNordDark","doom_nord_dark_default","doom_one_dark_default","doom_one_light_default","shipped","theme","parseThemeConfig","input","file","DEFAULT_THEME_NAME","BUILTIN_THEMES","DEFAULT_THEME","builtinTheme","name"],"sources":["../../../../../../src/theme/builtinThemes.ts"],"sourcesContent":["import doomNordDark from '../../themes/doom-nord-dark.json' with { type: 'json' };\nimport doomOneDark from '../../themes/doom-one-dark.json' with { type: 'json' };\nimport doomOneLight from '../../themes/doom-one-light.json' with { type: 'json' };\nimport type { ThemeConfig } from '../types/theme';\nimport { parseThemeConfig } from './parse';\n\nfunction shipped(input: unknown, file: string): ThemeConfig {\n const theme = parseThemeConfig(input);\n if (theme === null) throw new Error(`The shipped theme ${file} is malformed.`);\n return theme;\n}\n\n/** The theme the cockpit renders with until a preference says otherwise. */\nexport const DEFAULT_THEME_NAME = 'doom-one-dark';\n\n/** The themes this package ships, default first. */\nexport const BUILTIN_THEMES: readonly ThemeConfig[] = [\n shipped(doomOneDark, 'doom-one-dark.json'),\n shipped(doomOneLight, 'doom-one-light.json'),\n shipped(doomNordDark, 'doom-nord-dark.json'),\n];\n\nexport const DEFAULT_THEME: ThemeConfig = BUILTIN_THEMES[0];\n\n/** A shipped theme by name, or undefined for a name nothing shipped under. */\nexport function builtinTheme(name: string): ThemeConfig | undefined {\n return BUILTIN_THEMES.find((theme) => theme.name === name);\n}\n"],"mappings":"2LAMA,SAASM,EAAQ,EAAgB,EAA2B,CAC1D,IAAMC,EAAQC,EAAiBC,CAAK,EACpC,GAAIF,IAAU,KAAM,MAAU,MAAM,qBAAqBG,EAAK,eAAe,EAC7E,OAAOH,CACT,CAGA,MAAaI,EAAqB,gBAGrBC,EAAyC,CACpDN,EAAQN,EAAa,oBAAoB,EACzCM,EAAQL,EAAc,qBAAqB,EAC3CK,EAAQJ,EAAc,qBAAqB,CAC7C,EAEaW,EAA6BD,EAAe,GAGzD,SAAgBE,EAAa,EAAuC,CAClE,OAAOF,EAAe,KAAM,GAAUL,EAAM,OAASQ,CAAI,CAC3D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DerivedToken, ThemeConfig, ThemeToken } from "../types/theme.mjs";
|
|
2
|
+
//#region src/theme/derive.d.ts
|
|
3
|
+
export declare const DEFAULT_FONT_MONO = "'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace";
|
|
4
|
+
/**
|
|
5
|
+
* A derived token's fallback: a CSS colour expression over the palette, so a
|
|
6
|
+
* theme that supplies only its palette still gets coherent tints and edges.
|
|
7
|
+
*/
|
|
8
|
+
export declare function derivedFallback(token: DerivedToken): string;
|
|
9
|
+
/** Every derived token, in a stable order. */
|
|
10
|
+
export declare function derivedTokens(): DerivedToken[];
|
|
11
|
+
/** The value a theme publishes for a token: its own, or the derived fallback. */
|
|
12
|
+
export declare function tokenValue(theme: ThemeConfig, token: ThemeToken): string;
|
|
13
|
+
//#endregion
|
|
14
|
+
//# sourceMappingURL=derive.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive.d.mts","names":[],"sources":["../../../../../../src/theme/derive.ts"],"mappings":";;qBASa;;;;;wBAOG,gBAAgB,OAAO;;wBAWvB,iBAAiB;;wBASjB,WAAW,OAAO,aAAa,OAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ACCENT_TOKENS as e}from"../types/theme.mjs";const t=`'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`;function n(e){if(e===`font-mono`)return t;if(e===`on-selected`)return`color-mix(in srgb, var(--doom-selected) 12%, white)`;let[n,r]=e.split(`-`);return n===`tint`?`color-mix(in srgb, var(--doom-${r}) 16%, var(--doom-panel))`:`color-mix(in srgb, var(--doom-${r}) 40%, var(--doom-border))`}function r(){let t=[];for(let n of e)t.push(`tint-${n}`);for(let n of e)t.push(`edge-${n}`);return t.push(`on-selected`,`font-mono`),t}function i(e,t){let r=e.tokens[t];return r===void 0?n(t):r}export{t as DEFAULT_FONT_MONO,n as derivedFallback,r as derivedTokens,i as tokenValue};
|
|
2
|
+
//# sourceMappingURL=derive.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive.mjs","names":["DEFAULT_FONT_MONO","derivedFallback","token","kind","accent","derivedTokens","tokens","ACCENT_TOKENS","tokenValue","own","theme"],"sources":["../../../../../../src/theme/derive.ts"],"sourcesContent":["import { ACCENT_TOKENS, type AccentToken, type DerivedToken, type ThemeConfig, type ThemeToken } from '../types/theme';\n\n/** How much of an accent goes into its tinted background; the rest is the panel. */\nexport const TINT_MIX_PERCENT = 16;\n/** How much of an accent goes into its accented border; the rest is the border. */\nexport const EDGE_MIX_PERCENT = 40;\n/** How much of the selection tints its foreground; the rest is white, so the label stays legible on it. */\nexport const ON_SELECTED_MIX_PERCENT = 12;\n\nexport const DEFAULT_FONT_MONO =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace\";\n\n/**\n * A derived token's fallback: a CSS colour expression over the palette, so a\n * theme that supplies only its palette still gets coherent tints and edges.\n */\nexport function derivedFallback(token: DerivedToken): string {\n if (token === 'font-mono') return DEFAULT_FONT_MONO;\n if (token === 'on-selected')\n return `color-mix(in srgb, var(--doom-selected) ${String(ON_SELECTED_MIX_PERCENT)}%, white)`;\n const [kind, accent] = token.split('-') as ['tint' | 'edge', AccentToken];\n return kind === 'tint'\n ? `color-mix(in srgb, var(--doom-${accent}) ${String(TINT_MIX_PERCENT)}%, var(--doom-panel))`\n : `color-mix(in srgb, var(--doom-${accent}) ${String(EDGE_MIX_PERCENT)}%, var(--doom-border))`;\n}\n\n/** Every derived token, in a stable order. */\nexport function derivedTokens(): DerivedToken[] {\n const tokens: DerivedToken[] = [];\n for (const accent of ACCENT_TOKENS) tokens.push(`tint-${accent}`);\n for (const accent of ACCENT_TOKENS) tokens.push(`edge-${accent}`);\n tokens.push('on-selected', 'font-mono');\n return tokens;\n}\n\n/** The value a theme publishes for a token: its own, or the derived fallback. */\nexport function tokenValue(theme: ThemeConfig, token: ThemeToken): string {\n const own = (theme.tokens as Partial<Record<ThemeToken, string>>)[token];\n if (own !== undefined) return own;\n return derivedFallback(token as DerivedToken);\n}\n"],"mappings":"mDASA,MAAaA,EACX,mHAMF,SAAgBC,EAAgB,EAA6B,CAC3D,GAAIC,IAAU,YAAa,OAAOF,EAClC,GAAIE,IAAU,cACZ,MAAO,sDACT,GAAM,CAACC,EAAMC,GAAUF,EAAM,MAAM,GAAG,EACtC,OAAOC,IAAS,OACZ,iCAAiCC,EAAO,2BACxC,iCAAiCA,EAAO,2BAC9C,CAGA,SAAgBC,GAAgC,CAC9C,IAAMC,EAAyB,CAAC,EAChC,IAAK,IAAMF,KAAUG,EAAeD,EAAO,KAAK,QAAQF,GAAQ,EAChE,IAAK,IAAMA,KAAUG,EAAeD,EAAO,KAAK,QAAQF,GAAQ,EAEhE,OADAE,EAAO,KAAK,cAAe,WAAW,EAC/BA,CACT,CAGA,SAAgBE,EAAW,EAAoB,EAA2B,CACxE,IAAMC,EAAOC,EAAM,OAA+CR,GAElE,OADIO,IAAQ,IAAA,GACLR,EAAgBC,CAAqB,EADdO,CAEhC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { ThemeConfig, ThemeScheme, ThemeToken } from "../types/theme.mjs";
|
|
2
|
+
//#region src/theme/nativeTheme.d.ts
|
|
3
|
+
/** The spacing unit, matching `--spacing: 0.25rem` at a 16px root. */
|
|
4
|
+
export declare const NATIVE_SPACING_BASE = 4;
|
|
5
|
+
/** Corner radii in px, matching `--radius-*`. */
|
|
6
|
+
export declare const NATIVE_RADII: {
|
|
7
|
+
readonly xs: 2;
|
|
8
|
+
readonly sm: 3;
|
|
9
|
+
readonly md: 5;
|
|
10
|
+
readonly lg: 10;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Every radius a native style may name: the retunable `--radius-*` steps, plus
|
|
14
|
+
* Tailwind's hardcoded bare `rounded` (4px) and `rounded-full`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const NATIVE_BORDER_RADIUS: {
|
|
17
|
+
readonly xs: 2;
|
|
18
|
+
readonly sm: 3;
|
|
19
|
+
readonly md: 5;
|
|
20
|
+
readonly lg: 10;
|
|
21
|
+
readonly DEFAULT: 4;
|
|
22
|
+
readonly full: 9999;
|
|
23
|
+
};
|
|
24
|
+
/** The type ramp, matching `--text-*` (px) and `--text-*--line-height` (a multiple of the size). */
|
|
25
|
+
export declare const NATIVE_TYPE_RAMP: {
|
|
26
|
+
readonly '2xs': {
|
|
27
|
+
readonly size: 9;
|
|
28
|
+
readonly leading: 1.45;
|
|
29
|
+
};
|
|
30
|
+
readonly xs: {
|
|
31
|
+
readonly size: 10;
|
|
32
|
+
readonly leading: 1.45;
|
|
33
|
+
};
|
|
34
|
+
readonly sm: {
|
|
35
|
+
readonly size: 12;
|
|
36
|
+
readonly leading: 1.45;
|
|
37
|
+
};
|
|
38
|
+
readonly base: {
|
|
39
|
+
readonly size: 13;
|
|
40
|
+
readonly leading: 1.5;
|
|
41
|
+
};
|
|
42
|
+
readonly lg: {
|
|
43
|
+
readonly size: 15;
|
|
44
|
+
readonly leading: 1.4;
|
|
45
|
+
};
|
|
46
|
+
readonly xl: {
|
|
47
|
+
readonly size: 18;
|
|
48
|
+
readonly leading: 1.3;
|
|
49
|
+
};
|
|
50
|
+
readonly '2xl': {
|
|
51
|
+
readonly size: 22;
|
|
52
|
+
readonly leading: 1.25;
|
|
53
|
+
};
|
|
54
|
+
readonly '3xl': {
|
|
55
|
+
readonly size: 28;
|
|
56
|
+
readonly leading: 1.2;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/** Title tracking in em, matching `--text-*--letter-spacing`; steps not listed track at 0. */
|
|
60
|
+
export declare const NATIVE_LETTER_SPACING_EM: {
|
|
61
|
+
readonly xl: -0.01;
|
|
62
|
+
readonly '2xl': -0.01;
|
|
63
|
+
readonly '3xl': -0.01;
|
|
64
|
+
};
|
|
65
|
+
/** Tailwind's `leading-relaxed` multiple, which theme.css does not override. */
|
|
66
|
+
export declare const NATIVE_LEADING_RELAXED = 1.625;
|
|
67
|
+
/** Font weights as React Native takes them, matching `font-normal`, `font-medium` and `font-semibold`. */
|
|
68
|
+
export declare const NATIVE_FONT_WEIGHT: {
|
|
69
|
+
readonly regular: '400';
|
|
70
|
+
readonly medium: '500';
|
|
71
|
+
readonly semibold: '600';
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Durations in ms and the shared easing curve of `--animate-doom-*`. `slide`
|
|
75
|
+
* covers both slide directions; `easing` is the `cubic-bezier()` control points
|
|
76
|
+
* for Reanimated's `Easing.bezier`.
|
|
77
|
+
*/
|
|
78
|
+
export declare const NATIVE_MOTION: {
|
|
79
|
+
readonly fade: 140;
|
|
80
|
+
readonly pop: 160;
|
|
81
|
+
readonly rise: 160;
|
|
82
|
+
readonly slide: 180;
|
|
83
|
+
readonly easing: readonly [0.16, 1, 0.3, 1];
|
|
84
|
+
};
|
|
85
|
+
/** A font as native styles name it: one family, plus the platform font to use until it is bundled. */
|
|
86
|
+
export interface NativeFontStack {
|
|
87
|
+
family: string;
|
|
88
|
+
ios: string;
|
|
89
|
+
android: string;
|
|
90
|
+
}
|
|
91
|
+
/** The sans and mono families of `--font-sans` and `--doom-font-mono`, with system fallbacks. */
|
|
92
|
+
export declare const NATIVE_FONT_FAMILY: {
|
|
93
|
+
readonly sans: NativeFontStack;
|
|
94
|
+
readonly mono: NativeFontStack;
|
|
95
|
+
};
|
|
96
|
+
export type NativeColorToken = Exclude<ThemeToken, 'font-mono'>;
|
|
97
|
+
export type NativeTypeStep = keyof typeof NATIVE_TYPE_RAMP;
|
|
98
|
+
export type NativeNamedTheme = 'dark' | 'light';
|
|
99
|
+
export interface PoNativeTheme {
|
|
100
|
+
scheme: ThemeScheme;
|
|
101
|
+
colors: Record<NativeColorToken, string>;
|
|
102
|
+
/** `spacing(n)` is n steps of the 4px base, as Tailwind's `p-n`. */
|
|
103
|
+
spacing: (steps: number) => number;
|
|
104
|
+
borderRadius: typeof NATIVE_BORDER_RADIUS;
|
|
105
|
+
fontSize: Record<NativeTypeStep, number>;
|
|
106
|
+
/** Absolute line heights in px, since native styles take no unitless multiple. */
|
|
107
|
+
lineHeight: Record<NativeTypeStep, number>;
|
|
108
|
+
/** `leading-relaxed` line heights in px, for reading text such as markdown bodies. */
|
|
109
|
+
lineHeightRelaxed: Record<NativeTypeStep, number>;
|
|
110
|
+
/** Letter spacing in px per step; titles track slightly tight, the rest at 0. */
|
|
111
|
+
letterSpacing: Record<NativeTypeStep, number>;
|
|
112
|
+
fontWeight: typeof NATIVE_FONT_WEIGHT;
|
|
113
|
+
fontFamily: typeof NATIVE_FONT_FAMILY;
|
|
114
|
+
motion: typeof NATIVE_MOTION;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* `color-mix(in srgb, first percent%, second)` for hex inputs: a straight
|
|
118
|
+
* per-channel blend, rounded to the nearest 8-bit value.
|
|
119
|
+
*/
|
|
120
|
+
export declare function mixHex(first: string, percent: number, second: string): string;
|
|
121
|
+
/**
|
|
122
|
+
* A hex colour at `percent` opacity as `#rrggbbaa`: the native form of
|
|
123
|
+
* Tailwind's `/40`-style opacity modifiers.
|
|
124
|
+
*/
|
|
125
|
+
export declare function withAlpha(hex: string, percent: number): string;
|
|
126
|
+
/** Resolves a web theme config to native values; tokens the theme pins win over the derived mix. */
|
|
127
|
+
export declare function nativeTheme(config: ThemeConfig): PoNativeTheme;
|
|
128
|
+
/** The native themes by the names the native shell registers: `dark` and `light`. */
|
|
129
|
+
export declare const NATIVE_THEMES: Readonly<Record<NativeNamedTheme, PoNativeTheme>>;
|
|
130
|
+
//#endregion
|
|
131
|
+
//# sourceMappingURL=nativeTheme.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeTheme.d.mts","names":[],"sources":["../../../../../../src/theme/nativeTheme.ts"],"mappings":";;;qBAuBa;;qBAGA;WAAiB;WAAO;WAAO;WAAO;;;;;;qBAMtC;WANqB;WAAO;WAAO;WAAO;WAMS;WAAS;;;qBAG5D;WACX;aAAS;aAAS;;WAClB;aAAM;aAAU;;WAChB;aAAM;aAAU;;WAChB;aAAQ;aAAU;;WAClB;aAAM;aAAU;;WAChB;aAAM;aAAU;;WAChB;aAAS;aAAU;;WACnB;aAAS;aAAU;;;;qBAIR;WAA6B;WAAW;WAAc;;;qBAGtD;;qBAGA;WAAuB;WAAgB;WAAe;;;;;;;qBAOtD;WACX;WACA;WACA;WACA;WACA;;;iBAIe;EACf;EACA;EACA;;;qBAIW;WAA+B,MAAM;WAA0B,MAAM;;YAatE,mBAAmB,QAAQ;YAC3B,8BAA8B;YAC9B;iBAEK;EACf,QAAQ;EACR,QAAQ,OAAO;;EAEf,UAAU;EACV,qBAAqB;EACrB,UAAU,OAAO;;EAEjB,YAAY,OAAO;;EAEnB,mBAAmB,OAAO;;EAE1B,eAAe,OAAO;EACtB,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;;;;;;wBAoBD,OAAO,eAAe,iBAAiB;;;;;wBAgBvC,UAAU,aAAa;;wBAavB,YAAY,QAAQ,cAAc;;qBAwCrC,eAAe,SAAS,OAAO,kBAAkB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ACCENT_TOKENS as e,PALETTE_TOKENS as t}from"../types/theme.mjs";import{builtinTheme as n}from"./builtinThemes.mjs";import"./derive.mjs";const r=4,i={xs:2,sm:3,md:5,lg:10},a={...i,DEFAULT:4,full:9999},o={"2xs":{size:9,leading:1.45},xs:{size:10,leading:1.45},sm:{size:12,leading:1.45},base:{size:13,leading:1.5},lg:{size:15,leading:1.4},xl:{size:18,leading:1.3},"2xl":{size:22,leading:1.25},"3xl":{size:28,leading:1.2}},s={xl:-.01,"2xl":-.01,"3xl":-.01},c=1.625,l={regular:`400`,medium:`500`,semibold:`600`},u={fade:140,pop:160,rise:160,slide:180,easing:[.16,1,.3,1]},d={sans:{family:`IBM Plex Sans`,ios:`System`,android:`sans-serif`},mono:{family:`JetBrains Mono`,ios:`Menlo`,android:`monospace`}},f=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function p(e){if(!f.test(e))throw Error(`Native themes need hex colours; got "${e}".`);let t=e.length===4?e.slice(1).split(``).map(e=>e+e).join(``):e.slice(1);return[0,2,4].map(e=>Number.parseInt(t.slice(e,e+2),16))}function m(e,t,n){let r=t/100,i=p(e),a=p(n);return`#${i.map((e,t)=>{let n=Math.round(e*r+a[t]*(1-r));return Math.min(255,Math.max(0,n)).toString(16).padStart(2,`0`)}).join(``)}`}function h(e,t){let n=Math.min(255,Math.max(0,Math.round(t/100*255)));return`#${[...p(e),n].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function g(e){let t={};for(let n of Object.keys(o))t[n]=e(n);return t}function _(n){let r=n.tokens,i={};for(let e of t)i[e]=n.tokens[e];let f=(e,t)=>{i[e]=r[e]??t()};for(let t of e)f(`tint-${t}`,()=>m(i[t],16,i.panel));for(let t of e)f(`edge-${t}`,()=>m(i[t],40,i.border));return f(`on-selected`,()=>m(i.selected,12,`#ffffff`)),{scheme:n.scheme,colors:i,spacing:e=>e*4,borderRadius:a,fontSize:g(e=>o[e].size),lineHeight:g(e=>Math.round(o[e].size*o[e].leading)),lineHeightRelaxed:g(e=>Math.round(o[e].size*c)),letterSpacing:g(e=>{let t=s[e]??0;return Math.round(o[e].size*t*100)/100}),fontWeight:l,fontFamily:d,motion:u}}function v(e){let t=n(e);if(t===void 0)throw Error(`The shipped theme ${e} is missing.`);return _(t)}const y={dark:v(`doom-one-dark`),light:v(`doom-one-light`)};export{a as NATIVE_BORDER_RADIUS,d as NATIVE_FONT_FAMILY,l as NATIVE_FONT_WEIGHT,c as NATIVE_LEADING_RELAXED,s as NATIVE_LETTER_SPACING_EM,u as NATIVE_MOTION,i as NATIVE_RADII,r as NATIVE_SPACING_BASE,y as NATIVE_THEMES,o as NATIVE_TYPE_RAMP,m as mixHex,_ as nativeTheme,h as withAlpha};
|
|
2
|
+
//# sourceMappingURL=nativeTheme.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeTheme.mjs","names":["NATIVE_SPACING_BASE","NATIVE_RADII","NATIVE_BORDER_RADIUS","NATIVE_TYPE_RAMP","NATIVE_LETTER_SPACING_EM","NATIVE_LEADING_RELAXED","NATIVE_FONT_WEIGHT","NATIVE_MOTION","NATIVE_FONT_FAMILY","HEX_COLOR","hexChannels","hex","digits","digit","offset","mixHex","weight","percent","a","first","b","second","mixed","channel","index","withAlpha","alpha","rampValues","values","step","pick","nativeTheme","pinned","config","colors","token","PALETTE_TOKENS","resolve","fallback","accent","ACCENT_TOKENS","steps","em","shippedNative","theme","builtinTheme","name","NATIVE_THEMES"],"sources":["../../../../../../src/theme/nativeTheme.ts"],"sourcesContent":["import { ACCENT_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme, type ThemeToken } from '../types/theme';\nimport { builtinTheme } from './builtinThemes';\nimport { EDGE_MIX_PERCENT, ON_SELECTED_MIX_PERCENT, TINT_MIX_PERCENT } from './derive';\n\n/*\n * The React Native copy of the web theme. Native styles cannot read CSS\n * custom properties or evaluate color-mix(), so this module resolves the same\n * tokens to plain values. The scales below mirror styles/theme.css by hand\n * (CSS cannot import TypeScript); tests/nativeTheme.test.ts fails when the two\n * drift.\n *\n * ponytail: bundle IBM Plex Sans and JetBrains Mono through expo-font when the\n * native visual review starts; until then the named families fall back to the\n * platform fonts below.\n * ponytail: add a native theme picker later; the shell follows the system\n * scheme between `light` and `dark` for now.\n * ponytail: `--tracking-*` (tracked uppercase micro-labels) is not ported;\n * docs/design.md bans tracked uppercase on new surfaces.\n * ponytail: `shadow-2xl` is not ported; native surfaces (sheets, modals,\n * headers) draw their own platform shadows.\n */\n\n/** The spacing unit, matching `--spacing: 0.25rem` at a 16px root. */\nexport const NATIVE_SPACING_BASE = 4;\n\n/** Corner radii in px, matching `--radius-*`. */\nexport const NATIVE_RADII = { xs: 2, sm: 3, md: 5, lg: 10 } as const;\n\n/**\n * Every radius a native style may name: the retunable `--radius-*` steps, plus\n * Tailwind's hardcoded bare `rounded` (4px) and `rounded-full`.\n */\nexport const NATIVE_BORDER_RADIUS = { ...NATIVE_RADII, DEFAULT: 4, full: 9999 } as const;\n\n/** The type ramp, matching `--text-*` (px) and `--text-*--line-height` (a multiple of the size). */\nexport const NATIVE_TYPE_RAMP = {\n '2xs': { size: 9, leading: 1.45 },\n xs: { size: 10, leading: 1.45 },\n sm: { size: 12, leading: 1.45 },\n base: { size: 13, leading: 1.5 },\n lg: { size: 15, leading: 1.4 },\n xl: { size: 18, leading: 1.3 },\n '2xl': { size: 22, leading: 1.25 },\n '3xl': { size: 28, leading: 1.2 },\n} as const;\n\n/** Title tracking in em, matching `--text-*--letter-spacing`; steps not listed track at 0. */\nexport const NATIVE_LETTER_SPACING_EM = { xl: -0.01, '2xl': -0.01, '3xl': -0.01 } as const;\n\n/** Tailwind's `leading-relaxed` multiple, which theme.css does not override. */\nexport const NATIVE_LEADING_RELAXED = 1.625;\n\n/** Font weights as React Native takes them, matching `font-normal`, `font-medium` and `font-semibold`. */\nexport const NATIVE_FONT_WEIGHT = { regular: '400', medium: '500', semibold: '600' } as const;\n\n/**\n * Durations in ms and the shared easing curve of `--animate-doom-*`. `slide`\n * covers both slide directions; `easing` is the `cubic-bezier()` control points\n * for Reanimated's `Easing.bezier`.\n */\nexport const NATIVE_MOTION = {\n fade: 140,\n pop: 160,\n rise: 160,\n slide: 180,\n easing: [0.16, 1, 0.3, 1],\n} as const;\n\n/** A font as native styles name it: one family, plus the platform font to use until it is bundled. */\nexport interface NativeFontStack {\n family: string;\n ios: string;\n android: string;\n}\n\n/** The sans and mono families of `--font-sans` and `--doom-font-mono`, with system fallbacks. */\nexport const NATIVE_FONT_FAMILY: { readonly sans: NativeFontStack; readonly mono: NativeFontStack } = {\n sans: { family: 'IBM Plex Sans', ios: 'System', android: 'sans-serif' },\n mono: { family: 'JetBrains Mono', ios: 'Menlo', android: 'monospace' },\n};\n\n/** The foreground `on-selected` mixes toward, as `white` in derive.ts. */\nconst ON_SELECTED_BASE = '#ffffff';\nconst HEX_COLOR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst PERCENT = 100;\nconst CHANNEL_MAX = 255;\n/** Rounds px values to hundredths so `18 * -0.01` reads -0.18, not a float tail. */\nconst PX_PRECISION = 100;\n\nexport type NativeColorToken = Exclude<ThemeToken, 'font-mono'>;\nexport type NativeTypeStep = keyof typeof NATIVE_TYPE_RAMP;\nexport type NativeNamedTheme = 'dark' | 'light';\n\nexport interface PoNativeTheme {\n scheme: ThemeScheme;\n colors: Record<NativeColorToken, string>;\n /** `spacing(n)` is n steps of the 4px base, as Tailwind's `p-n`. */\n spacing: (steps: number) => number;\n borderRadius: typeof NATIVE_BORDER_RADIUS;\n fontSize: Record<NativeTypeStep, number>;\n /** Absolute line heights in px, since native styles take no unitless multiple. */\n lineHeight: Record<NativeTypeStep, number>;\n /** `leading-relaxed` line heights in px, for reading text such as markdown bodies. */\n lineHeightRelaxed: Record<NativeTypeStep, number>;\n /** Letter spacing in px per step; titles track slightly tight, the rest at 0. */\n letterSpacing: Record<NativeTypeStep, number>;\n fontWeight: typeof NATIVE_FONT_WEIGHT;\n fontFamily: typeof NATIVE_FONT_FAMILY;\n motion: typeof NATIVE_MOTION;\n}\n\nfunction hexChannels(hex: string): [number, number, number] {\n if (!HEX_COLOR.test(hex)) throw new Error(`Native themes need hex colours; got \"${hex}\".`);\n const digits =\n hex.length === 4\n ? hex\n .slice(1)\n .split('')\n .map((digit) => digit + digit)\n .join('')\n : hex.slice(1);\n return [0, 2, 4].map((offset) => Number.parseInt(digits.slice(offset, offset + 2), 16)) as [number, number, number];\n}\n\n/**\n * `color-mix(in srgb, first percent%, second)` for hex inputs: a straight\n * per-channel blend, rounded to the nearest 8-bit value.\n */\nexport function mixHex(first: string, percent: number, second: string): string {\n const weight = percent / PERCENT;\n const a = hexChannels(first);\n const b = hexChannels(second);\n return `#${a\n .map((channel, index) => {\n const mixed = Math.round(channel * weight + b[index]! * (1 - weight));\n return Math.min(CHANNEL_MAX, Math.max(0, mixed)).toString(16).padStart(2, '0');\n })\n .join('')}`;\n}\n\n/**\n * A hex colour at `percent` opacity as `#rrggbbaa`: the native form of\n * Tailwind's `/40`-style opacity modifiers.\n */\nexport function withAlpha(hex: string, percent: number): string {\n const alpha = Math.min(CHANNEL_MAX, Math.max(0, Math.round((percent / PERCENT) * CHANNEL_MAX)));\n const channels = [...hexChannels(hex), alpha];\n return `#${channels.map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\nfunction rampValues(pick: (step: NativeTypeStep) => number): Record<NativeTypeStep, number> {\n const values = {} as Record<NativeTypeStep, number>;\n for (const step of Object.keys(NATIVE_TYPE_RAMP) as NativeTypeStep[]) values[step] = pick(step);\n return values;\n}\n\n/** Resolves a web theme config to native values; tokens the theme pins win over the derived mix. */\nexport function nativeTheme(config: ThemeConfig): PoNativeTheme {\n const pinned = config.tokens as Partial<Record<ThemeToken, string>>;\n const colors = {} as Record<NativeColorToken, string>;\n for (const token of PALETTE_TOKENS) colors[token] = config.tokens[token];\n const resolve = (token: NativeColorToken, fallback: () => string): void => {\n colors[token] = pinned[token] ?? fallback();\n };\n for (const accent of ACCENT_TOKENS) {\n resolve(`tint-${accent}`, () => mixHex(colors[accent], TINT_MIX_PERCENT, colors.panel));\n }\n for (const accent of ACCENT_TOKENS) {\n resolve(`edge-${accent}`, () => mixHex(colors[accent], EDGE_MIX_PERCENT, colors.border));\n }\n resolve('on-selected', () => mixHex(colors.selected, ON_SELECTED_MIX_PERCENT, ON_SELECTED_BASE));\n\n return {\n scheme: config.scheme,\n colors,\n spacing: (steps) => steps * NATIVE_SPACING_BASE,\n borderRadius: NATIVE_BORDER_RADIUS,\n fontSize: rampValues((step) => NATIVE_TYPE_RAMP[step].size),\n lineHeight: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_TYPE_RAMP[step].leading)),\n lineHeightRelaxed: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_LEADING_RELAXED)),\n letterSpacing: rampValues((step) => {\n const em = (NATIVE_LETTER_SPACING_EM as Partial<Record<NativeTypeStep, number>>)[step] ?? 0;\n return Math.round(NATIVE_TYPE_RAMP[step].size * em * PX_PRECISION) / PX_PRECISION;\n }),\n fontWeight: NATIVE_FONT_WEIGHT,\n fontFamily: NATIVE_FONT_FAMILY,\n motion: NATIVE_MOTION,\n };\n}\n\nfunction shippedNative(name: string): PoNativeTheme {\n const theme = builtinTheme(name);\n if (theme === undefined) throw new Error(`The shipped theme ${name} is missing.`);\n return nativeTheme(theme);\n}\n\n/** The native themes by the names the native shell registers: `dark` and `light`. */\nexport const NATIVE_THEMES: Readonly<Record<NativeNamedTheme, PoNativeTheme>> = {\n dark: shippedNative('doom-one-dark'),\n light: shippedNative('doom-one-light'),\n};\n"],"mappings":"+IAuBA,MAAaA,EAAsB,EAGtBC,EAAe,CAAE,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,EAM7CC,EAAuB,CAAE,GAAGD,EAAc,QAAS,EAAG,KAAM,IAAK,EAGjEE,EAAmB,CAC9B,MAAO,CAAE,KAAM,EAAG,QAAS,IAAK,EAChC,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,KAAM,CAAE,KAAM,GAAI,QAAS,GAAI,EAC/B,GAAI,CAAE,KAAM,GAAI,QAAS,GAAI,EAC7B,GAAI,CAAE,KAAM,GAAI,QAAS,GAAI,EAC7B,MAAO,CAAE,KAAM,GAAI,QAAS,IAAK,EACjC,MAAO,CAAE,KAAM,GAAI,QAAS,GAAI,CAClC,EAGaC,EAA2B,CAAE,GAAI,KAAO,MAAO,KAAO,MAAO,IAAM,EAGnEC,EAAyB,MAGzBC,EAAqB,CAAE,QAAS,MAAO,OAAQ,MAAO,SAAU,KAAM,EAOtEC,EAAgB,CAC3B,KAAM,IACN,IAAK,IACL,KAAM,IACN,MAAO,IACP,OAAQ,CAAC,IAAM,EAAG,GAAK,CAAC,CAC1B,EAUaC,EAAyF,CACpG,KAAM,CAAE,OAAQ,gBAAiB,IAAK,SAAU,QAAS,YAAa,EACtE,KAAM,CAAE,OAAQ,iBAAkB,IAAK,QAAS,QAAS,WAAY,CACvE,EAIMC,EAAY,kCA4BlB,SAASC,EAAY,EAAuC,CAC1D,GAAI,CAACD,EAAU,KAAKE,CAAG,EAAG,MAAU,MAAM,wCAAwCA,EAAI,GAAG,EACzF,IAAMC,EACJD,EAAI,SAAW,EACXA,EACG,MAAM,CAAC,CAAC,CACR,MAAM,EAAE,CAAC,CACT,IAAK,GAAUE,EAAQA,CAAK,CAAC,CAC7B,KAAK,EAAE,EACVF,EAAI,MAAM,CAAC,EACjB,MAAO,CAAC,EAAG,EAAG,CAAC,CAAC,CAAC,IAAK,GAAW,OAAO,SAASC,EAAO,MAAME,EAAQA,EAAS,CAAC,EAAG,EAAE,CAAC,CACxF,CAMA,SAAgBC,EAAO,EAAe,EAAiB,EAAwB,CAC7E,IAAMC,EAASC,EAAU,IACnBC,EAAIR,EAAYS,CAAK,EACrBC,EAAIV,EAAYW,CAAM,EAC5B,MAAO,IAAIH,EACR,KAAK,EAAS,IAAU,CACvB,IAAMI,EAAQ,KAAK,MAAMC,EAAUP,EAASI,EAAEI,IAAW,EAAIR,EAAO,EACpE,OAAO,KAAK,IAAI,IAAa,KAAK,IAAI,EAAGM,CAAK,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,EAAG,GAAG,CAC/E,CAAC,CAAC,CACD,KAAK,EAAE,GACZ,CAMA,SAAgBG,EAAU,EAAa,EAAyB,CAC9D,IAAMC,EAAQ,KAAK,IAAI,IAAa,KAAK,IAAI,EAAG,KAAK,MAAOT,EAAU,IAAW,GAAW,CAAC,CAAC,EAE9F,MAAO,IAAI,CADO,GAAGP,EAAYC,CAAG,EAAGe,CACrB,CAAC,CAAC,IAAK,GAAYH,EAAQ,SAAS,EAAE,CAAC,CAAC,SAAS,EAAG,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,GACrF,CAEA,SAASI,EAAW,EAAwE,CAC1F,IAAMC,EAAS,CAAC,EAChB,IAAK,IAAMC,KAAQ,OAAO,KAAK1B,CAAgB,EAAuB,EAAO0B,GAAQC,EAAKD,CAAI,EAC9F,OAAOD,CACT,CAGA,SAAgBG,EAAY,EAAoC,CAC9D,IAAMC,EAASC,EAAO,OAChBC,EAAS,CAAC,EAChB,IAAK,IAAMC,KAASC,EAAgB,EAAOD,GAASF,EAAO,OAAOE,GAClE,IAAME,GAAW,EAAyB,IAAiC,CACzE,EAAOF,GAASH,EAAOG,IAAUG,EAAS,CAC5C,EACA,IAAK,IAAMC,KAAUC,EACnBH,EAAQ,QAAQE,QAAgBxB,EAAOmB,EAAOK,GAAA,GAA2BL,EAAO,KAAK,CAAC,EAExF,IAAK,IAAMK,KAAUC,EACnBH,EAAQ,QAAQE,QAAgBxB,EAAOmB,EAAOK,GAAA,GAA2BL,EAAO,MAAM,CAAC,EAIzF,OAFAG,EAAQ,kBAAqBtB,EAAOmB,EAAO,SAAA,GAAmC,SAAgB,CAAC,EAExF,CACL,OAAQD,EAAO,OACf,SACA,QAAU,GAAUQ,EAAA,EACpB,aAAcvC,EACd,SAAUyB,EAAY,GAASxB,EAAiB0B,EAAK,CAAC,IAAI,EAC1D,WAAYF,EAAY,GAAS,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAO1B,EAAiB0B,EAAK,CAAC,OAAO,CAAC,EACzG,kBAAmBF,EAAY,GAAS,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAOxB,CAAsB,CAAC,EACxG,cAAesB,EAAY,GAAS,CAClC,IAAMe,EAAMtC,EAAqEyB,IAAS,EAC1F,OAAO,KAAK,MAAM1B,EAAiB0B,EAAK,CAAC,KAAOa,EAAK,GAAY,EAAI,GACvE,CAAC,EACD,WAAYpC,EACZ,WAAYE,EACZ,OAAQD,CACV,CACF,CAEA,SAASoC,EAAc,EAA6B,CAClD,IAAMC,EAAQC,EAAaC,CAAI,EAC/B,GAAIF,IAAU,IAAA,GAAW,MAAU,MAAM,qBAAqBE,EAAK,aAAa,EAChF,OAAOf,EAAYa,CAAK,CAC1B,CAGA,MAAaG,EAAmE,CAC9E,KAAMJ,EAAc,eAAe,EACnC,MAAOA,EAAc,gBAAgB,CACvC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ThemeConfig } from "../types/theme.mjs";
|
|
2
|
+
//#region src/theme/parse.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Validates a theme config read from JSON. Returns null rather than throwing
|
|
5
|
+
* because a bad theme file must never take the cockpit down; the caller falls
|
|
6
|
+
* back to the shipped default and says so.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseThemeConfig(input: unknown): ThemeConfig | null;
|
|
9
|
+
//#endregion
|
|
10
|
+
//# sourceMappingURL=parse.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.mts","names":[],"sources":["../../../../../../src/theme/parse.ts"],"mappings":";;;;;;;wBAgBgB,iBAAiB,iBAAiB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{DERIVED_TOKENS as e,PALETTE_TOKENS as t}from"../types/theme.mjs";const n=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,r=/^(?:#[0-9a-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\((?:[^()]|\([^()]*\))*\)|[a-z]+)$/i;function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(a){if(!i(a))return null;let{name:o,label:s,scheme:c,tokens:l}=a;if(typeof o!=`string`||!n.test(o)||typeof s!=`string`||s.trim()===``||c!==`dark`&&c!==`light`||!i(l))return null;let u={};for(let e of t){let t=l[e];if(typeof t!=`string`||!r.test(t.trim()))return null;u[e]=t.trim()}for(let t of e){let e=l[t];if(e!==void 0){if(typeof e!=`string`||e.trim()===``)return null;u[t]=e.trim()}}return{name:o,label:s,scheme:c,tokens:u}}export{a as parseThemeConfig};
|
|
2
|
+
//# sourceMappingURL=parse.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.mjs","names":["THEME_NAME","CSS_COLOR","isRecord","value","parseThemeConfig","input","name","label","scheme","tokens","accepted","token","PALETTE_TOKENS","DERIVED_TOKENS"],"sources":["../../../../../../src/theme/parse.ts"],"sourcesContent":["import { DERIVED_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme } from '../types/theme';\n\nconst THEME_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n/** A CSS colour as a theme may spell it: hex, a colour function, or a named colour; never a url or an image. */\nconst CSS_COLOR =\n /^(?:#[0-9a-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\\((?:[^()]|\\([^()]*\\))*\\)|[a-z]+)$/i;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Validates a theme config read from JSON. Returns null rather than throwing\n * because a bad theme file must never take the cockpit down; the caller falls\n * back to the shipped default and says so.\n */\nexport function parseThemeConfig(input: unknown): ThemeConfig | null {\n if (!isRecord(input)) return null;\n const { name, label, scheme, tokens } = input;\n if (typeof name !== 'string' || !THEME_NAME.test(name)) return null;\n if (typeof label !== 'string' || label.trim() === '') return null;\n if (scheme !== 'dark' && scheme !== 'light') return null;\n if (!isRecord(tokens)) return null;\n\n const accepted: Record<string, string> = {};\n for (const token of PALETTE_TOKENS) {\n const value = tokens[token];\n if (typeof value !== 'string' || !CSS_COLOR.test(value.trim())) return null;\n accepted[token] = value.trim();\n }\n for (const token of DERIVED_TOKENS) {\n const value = tokens[token];\n if (value === undefined) continue;\n if (typeof value !== 'string' || value.trim() === '') return null;\n accepted[token] = value.trim();\n }\n return { name, label, scheme: scheme as ThemeScheme, tokens: accepted as ThemeConfig['tokens'] };\n}\n"],"mappings":"wEAEA,MAAMA,EAAa,6BAEbC,EACJ,iIAEF,SAASC,EAAS,EAAkD,CAClE,OAAO,OAAOC,GAAU,YAAYA,GAAkB,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAOA,SAAgBC,EAAiB,EAAoC,CACnE,GAAI,CAACF,EAASG,CAAK,EAAG,OAAO,KAC7B,GAAM,CAAE,OAAM,QAAO,SAAQ,UAAWA,EAIxC,GAHI,OAAOC,GAAS,UAAY,CAACN,EAAW,KAAKM,CAAI,GACjD,OAAOC,GAAU,UAAYA,EAAM,KAAK,IAAM,IAC9CC,IAAW,QAAUA,IAAW,SAChC,CAACN,EAASO,CAAM,EAAG,OAAO,KAE9B,IAAMC,EAAmC,CAAC,EAC1C,IAAK,IAAMC,KAASC,EAAgB,CAClC,IAAMT,EAAQM,EAAOE,GACrB,GAAI,OAAOR,GAAU,UAAY,CAACF,EAAU,KAAKE,EAAM,KAAK,CAAC,EAAG,OAAO,KACvE,EAASQ,GAASR,EAAM,KAAK,CAC/B,CACA,IAAK,IAAMQ,KAASE,EAAgB,CAClC,IAAMV,EAAQM,EAAOE,GACrB,GAAIR,IAAU,IAAA,GACd,IAAI,OAAOA,GAAU,UAAYA,EAAM,KAAK,IAAM,GAAI,OAAO,KAC7D,EAASQ,GAASR,EAAM,KAAK,CADgC,CAE/D,CACA,MAAO,CAAE,OAAM,QAAe,SAAuB,OAAQO,CAAkC,CACjG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ThemeConfig, ThemeScheme } from "../types/theme.mjs";
|
|
2
|
+
//#region src/theme/piTheme.d.ts
|
|
3
|
+
export interface PiThemeBridgeOptions {
|
|
4
|
+
/** The web theme's id; defaults to the Pi theme's name. */
|
|
5
|
+
name?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Forced scheme; otherwise inferred from the background luminance. */
|
|
8
|
+
scheme?: ThemeScheme;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Builds a web theme from a Pi TUI theme, so the palette Po ships for
|
|
12
|
+
* the terminal (po-ui/themes/po-dark.json) drives the browser too.
|
|
13
|
+
* The mapping is by role, not by name: Pi has no cockpit "deep" surface or
|
|
14
|
+
* "border-soft" line, so those are mixed from the nearest vars. Returns null
|
|
15
|
+
* when the input is not a Pi theme with a complete palette.
|
|
16
|
+
*/
|
|
17
|
+
export declare function themeFromPiTheme(input: unknown, options?: PiThemeBridgeOptions): ThemeConfig | null;
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=piTheme.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"piTheme.d.mts","names":[],"sources":["../../../../../../src/theme/piTheme.ts"],"mappings":";;iBAiCiB;;EAEf;EACA;;EAEA,SAAS;;;;;;;;;wBAUK,iBAAiB,gBAAgB,UAAS,uBAA4B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{parseThemeConfig as e}from"./parse.mjs";function t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function n(e){let t=/^#([0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=Number.parseInt(t[1],16),r=n>>16&255,i=n>>8&255,a=n&255;return(.2126*r+.7152*i+.0722*a)/255}function r(e,t){if(t!==void 0)return e[t]??t}function i(i,a={}){if(!t(i))return null;let{name:o,vars:s,colors:c}=i;if(!t(s))return null;let l={};for(let[e,t]of Object.entries(s))typeof t==`string`&&(l[e]=t);let u={};if(t(c))for(let[e,t]of Object.entries(c))typeof t==`string`&&(u[e]=t);let d=l.bg,f=l.bgAlt??d,p=l.fg;if(d===void 0||p===void 0)return null;let m=n(d),h=a.scheme??(m!==null&&m>.5?`light`:`dark`),g=`color-mix(in srgb, ${f} 84%, ${h===`dark`?`black`:`white`})`,_=r(l,u.borderMuted)??l.grey??`color-mix(in srgb, ${p} 25%, ${d})`,v=a.name??(typeof o==`string`?o:`pi-theme`);return e({name:v,label:a.label??v,scheme:h,tokens:{bg:d,rail:f,panel:`color-mix(in srgb, ${f} 70%, ${d})`,deep:g,border:_,"border-soft":`color-mix(in srgb, ${_} 55%, ${d})`,hi:`color-mix(in srgb, ${p} 65%, ${h===`dark`?`white`:`black`})`,text:p,dim:r(l,u.muted)??l.fgAlt??p,faint:r(l,u.dim)??l.comment??l.greyAlt??p,blue:l.blue??r(l,u.accent)??p,green:l.green??r(l,u.success)??p,yellow:l.yellow??r(l,u.warning)??p,red:l.red??r(l,u.error)??p,magenta:l.magenta??l.violet??p,violet:l.violet??l.magenta??p,cyan:l.cyan??l.blue??p,orange:l.orange??l.yellow??p,teal:l.teal??l.cyan??p,selected:l.darkBlue??l.blue??p}})}export{i as themeFromPiTheme};
|
|
2
|
+
//# sourceMappingURL=piTheme.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"piTheme.mjs","names":["isRecord","value","hexLuminance","match","hex","g","b","resolve","reference","vars","themeFromPiTheme","input","palette","key","semantic","colors","bg","bgAlt","fg","luminance","scheme","options","deep","border","themeName","name","parseThemeConfig"],"sources":["../../../../../../src/theme/piTheme.ts"],"sourcesContent":["import type { ThemeConfig, ThemeScheme } from '../types/theme';\nimport { parseThemeConfig } from './parse';\n\n/**\n * The Pi TUI theme shape (theme-schema.json): a palette of named vars and\n * semantic colours that name a var or spell a colour.\n */\ninterface PiThemeLike {\n name?: unknown;\n vars?: unknown;\n colors?: unknown;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction hexLuminance(hex: string): number | null {\n const match = /^#([0-9a-f]{6})$/i.exec(hex.trim());\n if (!match) return null;\n const value = Number.parseInt(match[1], 16);\n const r = (value >> 16) & 0xff;\n const g = (value >> 8) & 0xff;\n const b = value & 0xff;\n return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;\n}\n\n/** Resolves a Pi colour reference: a var name, or a literal colour. */\nfunction resolve(vars: Record<string, string>, reference: string | undefined): string | undefined {\n if (reference === undefined) return undefined;\n return vars[reference] ?? reference;\n}\n\nexport interface PiThemeBridgeOptions {\n /** The web theme's id; defaults to the Pi theme's name. */\n name?: string;\n label?: string;\n /** Forced scheme; otherwise inferred from the background luminance. */\n scheme?: ThemeScheme;\n}\n\n/**\n * Builds a web theme from a Pi TUI theme, so the palette Po ships for\n * the terminal (po-ui/themes/po-dark.json) drives the browser too.\n * The mapping is by role, not by name: Pi has no cockpit \"deep\" surface or\n * \"border-soft\" line, so those are mixed from the nearest vars. Returns null\n * when the input is not a Pi theme with a complete palette.\n */\nexport function themeFromPiTheme(input: unknown, options: PiThemeBridgeOptions = {}): ThemeConfig | null {\n if (!isRecord(input)) return null;\n const { name, vars, colors } = input as PiThemeLike;\n if (!isRecord(vars)) return null;\n const palette: Record<string, string> = {};\n for (const [key, value] of Object.entries(vars)) if (typeof value === 'string') palette[key] = value;\n const semantic: Record<string, string> = {};\n if (isRecord(colors))\n for (const [key, value] of Object.entries(colors)) if (typeof value === 'string') semantic[key] = value;\n\n const bg = palette.bg;\n const bgAlt = palette.bgAlt ?? bg;\n const fg = palette.fg;\n if (bg === undefined || fg === undefined) return null;\n\n const luminance = hexLuminance(bg);\n const scheme: ThemeScheme = options.scheme ?? (luminance !== null && luminance > 0.5 ? 'light' : 'dark');\n const towards = scheme === 'dark' ? 'black' : 'white';\n const deep = `color-mix(in srgb, ${bgAlt} 84%, ${towards})`;\n const border = resolve(palette, semantic.borderMuted) ?? palette.grey ?? `color-mix(in srgb, ${fg} 25%, ${bg})`;\n const themeName = options.name ?? (typeof name === 'string' ? name : 'pi-theme');\n\n return parseThemeConfig({\n name: themeName,\n label: options.label ?? themeName,\n scheme,\n tokens: {\n bg,\n rail: bgAlt,\n panel: `color-mix(in srgb, ${bgAlt} 70%, ${bg})`,\n deep,\n border,\n 'border-soft': `color-mix(in srgb, ${border} 55%, ${bg})`,\n hi: `color-mix(in srgb, ${fg} 65%, ${scheme === 'dark' ? 'white' : 'black'})`,\n text: fg,\n dim: resolve(palette, semantic.muted) ?? palette.fgAlt ?? fg,\n faint: resolve(palette, semantic.dim) ?? palette.comment ?? palette.greyAlt ?? fg,\n blue: palette.blue ?? resolve(palette, semantic.accent) ?? fg,\n green: palette.green ?? resolve(palette, semantic.success) ?? fg,\n yellow: palette.yellow ?? resolve(palette, semantic.warning) ?? fg,\n red: palette.red ?? resolve(palette, semantic.error) ?? fg,\n magenta: palette.magenta ?? palette.violet ?? fg,\n violet: palette.violet ?? palette.magenta ?? fg,\n cyan: palette.cyan ?? palette.blue ?? fg,\n orange: palette.orange ?? palette.yellow ?? fg,\n teal: palette.teal ?? palette.cyan ?? fg,\n selected: palette.darkBlue ?? palette.blue ?? fg,\n },\n });\n}\n"],"mappings":"+CAaA,SAASA,EAAS,EAAkD,CAClE,OAAO,OAAOC,GAAU,YAAYA,GAAkB,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAEA,SAASC,EAAa,EAA4B,CAChD,IAAMC,EAAQ,oBAAoB,KAAKC,EAAI,KAAK,CAAC,EACjD,GAAI,CAACD,EAAO,OAAO,KACnB,IAAMF,EAAQ,OAAO,SAASE,EAAM,GAAI,EAAE,EACpC,EAAKF,GAAS,GAAM,IACpBI,EAAKJ,GAAS,EAAK,IACnBK,EAAIL,EAAQ,IAClB,OAAQ,MAAS,EAAI,MAASI,EAAI,MAASC,GAAK,GAClD,CAGA,SAASC,EAAQ,EAA8B,EAAmD,CAChG,GAAIC,IAAc,IAAA,GAClB,OAAOC,EAAKD,IAAcA,CAC5B,CAiBA,SAAgBE,EAAiB,EAAgB,EAAgC,CAAC,EAAuB,CACvG,GAAI,CAACV,EAASW,CAAK,EAAG,OAAO,KAC7B,GAAM,CAAE,OAAM,OAAM,UAAWA,EAC/B,GAAI,CAACX,EAASS,CAAI,EAAG,OAAO,KAC5B,IAAMG,EAAkC,CAAC,EACzC,IAAK,GAAM,CAACC,EAAKZ,KAAU,OAAO,QAAQQ,CAAI,EAAO,OAAOR,GAAU,WAAU,EAAQY,GAAOZ,GAC/F,IAAMa,EAAmC,CAAC,EAC1C,GAAId,EAASe,CAAM,EACZ,IAAA,GAAM,CAACF,EAAKZ,KAAU,OAAO,QAAQc,CAAM,EAAO,OAAOd,GAAU,WAAU,EAASY,GAAOZ,GAEpG,IAAMe,EAAKJ,EAAQ,GACbK,EAAQL,EAAQ,OAASI,EACzBE,EAAKN,EAAQ,GACnB,GAAII,IAAO,IAAA,IAAaE,IAAO,IAAA,GAAW,OAAO,KAEjD,IAAMC,EAAYjB,EAAac,CAAE,EAC3BI,EAAsBC,EAAQ,SAAWF,IAAc,MAAQA,EAAY,GAAM,QAAU,QAE3FG,EAAO,sBAAsBL,EAAM,QADzBG,IAAW,OAAS,QAAU,QACW,GACnDG,EAAShB,EAAQK,EAASE,EAAS,WAAW,GAAKF,EAAQ,MAAQ,sBAAsBM,EAAG,QAAQF,EAAG,GACvGQ,EAAYH,EAAQ,OAAS,OAAOI,GAAS,SAAWA,EAAO,YAErE,OAAOC,EAAiB,CACtB,KAAMF,EACN,MAAOH,EAAQ,OAASG,EACxB,SACA,OAAQ,CACN,KACA,KAAMP,EACN,MAAO,sBAAsBA,EAAM,QAAQD,EAAG,GAC9C,OACA,SACA,cAAe,sBAAsBO,EAAO,QAAQP,EAAG,GACvD,GAAI,sBAAsBE,EAAG,QAAQE,IAAW,OAAS,QAAU,QAAQ,GAC3E,KAAMF,EACN,IAAKX,EAAQK,EAASE,EAAS,KAAK,GAAKF,EAAQ,OAASM,EAC1D,MAAOX,EAAQK,EAASE,EAAS,GAAG,GAAKF,EAAQ,SAAWA,EAAQ,SAAWM,EAC/E,KAAMN,EAAQ,MAAQL,EAAQK,EAASE,EAAS,MAAM,GAAKI,EAC3D,MAAON,EAAQ,OAASL,EAAQK,EAASE,EAAS,OAAO,GAAKI,EAC9D,OAAQN,EAAQ,QAAUL,EAAQK,EAASE,EAAS,OAAO,GAAKI,EAChE,IAAKN,EAAQ,KAAOL,EAAQK,EAASE,EAAS,KAAK,GAAKI,EACxD,QAASN,EAAQ,SAAWA,EAAQ,QAAUM,EAC9C,OAAQN,EAAQ,QAAUA,EAAQ,SAAWM,EAC7C,KAAMN,EAAQ,MAAQA,EAAQ,MAAQM,EACtC,OAAQN,EAAQ,QAAUA,EAAQ,QAAUM,EAC5C,KAAMN,EAAQ,MAAQA,EAAQ,MAAQM,EACtC,SAAUN,EAAQ,UAAYA,EAAQ,MAAQM,CAChD,CACF,CAAC,CACH"}
|