import * as T from "@phijs/shared" ; import { layerTreeToArray , layerToCss , jsonToRefs } from "@phijs/shared" ; function componentToCss ( component , refs ) { return layerTreeToArray ( component . layout ) . map ( ( layer ) => layerToCss ( T . kebabToPascal ( component . name ) , layer , refs ) ) . join ( "\n\n" ) ; } export function phiToCss ( data ) { const refs = jsonToRefs ( data ) ; return Array . from ( refs . components . values ( ) ) . map ( ( component ) => componentToCss ( component , refs ) ) . join ( "\n\n" ) ; } export default function cssLoader ( source ) { return phiToCss ( JSON . parse ( source ) ) ; }