1- export function $ ( sel , root = document ) { return root . querySelector ( sel ) }
2- export function $$ ( sel , root = document ) { return root . querySelectorAll ( sel ) }
3- export function $H ( ss , ...values ) {
1+ function _ $( sel , root = document ) { return root . querySelector ( sel ) }
2+ function _ $$( sel , root = document ) { return root . querySelectorAll ( sel ) }
3+ function $H ( ss , ...values ) {
44const r = document . createElement ( 'div' ) ;
55r . innerHTML = ss . reduce ( ( r , s , i ) => r + s + ( values [ i ] || '' ) , '' ) . trim ( ) ;
66return r . firstElementChild ;
77}
88
9- export function $E ( t , attrs = { } , children = [ ] ) {
9+ function $E ( t , attrs = { } , children = [ ] ) {
1010if ( typeof t === 'string' ) {
1111const { style, dataset, className, cls, ...rest } = attrs ;
1212const e = document . createElement ( t ) ;
@@ -31,22 +31,28 @@ export function $E(t, attrs = {}, children = []) {
3131} else return t ;
3232}
3333
34- export function proc_htmx ( sel , func ) {
34+ function proc_htmx ( sel , func ) {
3535htmx . onLoad ( elt => {
3636const elements = Array . from ( htmx . findAll ( elt , sel ) ) ;
3737if ( elt . matches ( sel ) ) elements . unshift ( elt )
3838elements . forEach ( func ) ;
3939} ) ;
4040}
4141
42- export function domReadyExecute ( cb ) {
42+ function domReadyExecute ( cb ) {
4343if ( document . readyState === "loading" ) document . addEventListener ( "DOMContentLoaded" , cb )
4444else cb ( ) ;
4545}
4646
47- if ( typeof window !== 'undefined' ) {
48- window . $E = $E ;
49- window . $H = $H ;
50- window . proc_htmx = proc_htmx ;
51- window . domReadyExecute = domReadyExecute ;
47+ console . log ( exports ) ;
48+ console . log ( 'hi' ) ;
49+
50+ if ( typeof exports !== 'undefined' ) {
51+ console . log ( 'exports' ) ;
52+ exports . $ = _$ ;
53+ exports . $$ = _$$ ;
54+ exports . $E = $E ;
55+ exports . $H = $H ;
56+ exports . proc_htmx = proc_htmx ;
57+ exports . domReadyExecute = domReadyExecute ;
5258}