@uniweb/runtime 0.8.21 → 0.8.23

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.
@@ -1,2 +1,2 @@
1
- import{B as h,D as g,E as p,F as _,O as f,P as d,U as m,W as v,c as b,d as S,e as x,g as C,i as y,l as V,m as T,r as O,s as k}from"../assets/index-Bxvdtdsc.js";const n=[50,100,200,300,400,500,600,700,800,900,950],r=["light","medium","dark"],a={light:{bg:"var(--neutral-50)",text:"var(--neutral-950)",heading:"var(--neutral-900)",link:"var(--primary-600)"},medium:{bg:"var(--neutral-100)",text:"var(--neutral-950)",heading:"var(--neutral-900)",link:"var(--primary-600)"},dark:{bg:"var(--neutral-900)",text:"var(--neutral-50)",heading:"white",link:"var(--primary-400)"}};class i{constructor(t={}){this._data=t,this._palettes=t.palettes||t.colors||{},this._rawColors=t.colors||{},this._contexts=t.contexts||{},this._fonts=t.fonts||{},this._appearance=t.appearance||{default:"light"},this._foundationVars=t.foundationVars||{},this._css=t.css||null,Object.seal(this)}get css(){return this._css}get data(){return this._data}getColor(t,e=500){const s=this._palettes[t];return s&&s[e]||null}getPalette(t){return this._palettes[t]||null}getPaletteNames(){return Object.keys(this._palettes)}hasPalette(t){return t in this._palettes}getColorVar(t,e=500){return`var(--${t}-${e})`}getContextToken(t,e){const s=this._contexts[t];return s&&s[e]?s[e]:a[t]?.[e]||null}getContextTokens(t){const e=a[t]||{},s=this._contexts[t]||{};return{...e,...s}}getContextClass(t){return r.includes(t)?`context-${t}`:(console.warn(`Invalid context: ${t}. Using 'light'.`),"context-light")}isValidContext(t){return r.includes(t)}getValidContexts(){return[...r]}getAppearance(){return{default:this._appearance.default||"light",allowToggle:this._appearance.allowToggle||!1,respectSystemPreference:this._appearance.respectSystemPreference??!0,schemes:this._appearance.schemes||["light"]}}getDefaultScheme(){return this._appearance.default||"light"}supportsScheme(t){return(this._appearance.schemes||["light"]).includes(t)}hasSchemeToggle(){return this._appearance.allowToggle===!0}getSchemeClass(t){return`scheme-${t}`}getFonts(){return{...this._fonts}}getFont(t){return this._fonts[t]||null}getFontVar(t){return`var(--font-${t})`}getFoundationVar(t){const e=this._foundationVars[t];return e?typeof e=="object"?e.default:e:null}getFoundationVars(){const t={};for(const[e,s]of Object.entries(this._foundationVars))t[e]=typeof s=="object"?s.default:s;return t}getFoundationVarRef(t){return`var(--${t})`}getShadeLevels(){return[...n]}hasCustomization(){return Object.keys(this._palettes).length>0||Object.keys(this._contexts).length>0||Object.keys(this._fonts).length>0}toJSON(){return{palettes:this._palettes,colors:this._rawColors,contexts:this._contexts,fonts:this._fonts,appearance:this._appearance,foundationVars:this._foundationVars}}}export{h as Block,g as DataStore,p as EntityStore,_ as FetcherDispatcher,f as ObservableState,d as Page,i as Theme,m as Uniweb,v as Website,b as createUniweb,S as deriveCacheKey,x as evaluateWhere,C as getUniweb,y as isRichSchema,V as listRequestStyleNames,T as matchWhere,O as resolveRequestStyle,k as substitutePlaceholders};
1
+ import{B as h,D as g,E as p,F as _,O as f,P as d,U as m,W as v,c as b,d as S,e as x,g as C,i as y,l as V,m as T,r as O,s as k}from"../assets/index-DesPD4M1.js";const n=[50,100,200,300,400,500,600,700,800,900,950],r=["light","medium","dark"],a={light:{bg:"var(--neutral-50)",text:"var(--neutral-950)",heading:"var(--neutral-900)",link:"var(--primary-600)"},medium:{bg:"var(--neutral-100)",text:"var(--neutral-950)",heading:"var(--neutral-900)",link:"var(--primary-600)"},dark:{bg:"var(--neutral-900)",text:"var(--neutral-50)",heading:"white",link:"var(--primary-400)"}};class i{constructor(t={}){this._data=t,this._palettes=t.palettes||t.colors||{},this._rawColors=t.colors||{},this._contexts=t.contexts||{},this._fonts=t.fonts||{},this._appearance=t.appearance||{default:"light"},this._foundationVars=t.foundationVars||{},this._css=t.css||null,Object.seal(this)}get css(){return this._css}get data(){return this._data}getColor(t,e=500){const s=this._palettes[t];return s&&s[e]||null}getPalette(t){return this._palettes[t]||null}getPaletteNames(){return Object.keys(this._palettes)}hasPalette(t){return t in this._palettes}getColorVar(t,e=500){return`var(--${t}-${e})`}getContextToken(t,e){const s=this._contexts[t];return s&&s[e]?s[e]:a[t]?.[e]||null}getContextTokens(t){const e=a[t]||{},s=this._contexts[t]||{};return{...e,...s}}getContextClass(t){return r.includes(t)?`context-${t}`:(console.warn(`Invalid context: ${t}. Using 'light'.`),"context-light")}isValidContext(t){return r.includes(t)}getValidContexts(){return[...r]}getAppearance(){return{default:this._appearance.default||"light",allowToggle:this._appearance.allowToggle||!1,respectSystemPreference:this._appearance.respectSystemPreference??!0,schemes:this._appearance.schemes||["light"]}}getDefaultScheme(){return this._appearance.default||"light"}supportsScheme(t){return(this._appearance.schemes||["light"]).includes(t)}hasSchemeToggle(){return this._appearance.allowToggle===!0}getSchemeClass(t){return`scheme-${t}`}getFonts(){return{...this._fonts}}getFont(t){return this._fonts[t]||null}getFontVar(t){return`var(--font-${t})`}getFoundationVar(t){const e=this._foundationVars[t];return e?typeof e=="object"?e.default:e:null}getFoundationVars(){const t={};for(const[e,s]of Object.entries(this._foundationVars))t[e]=typeof s=="object"?s.default:s;return t}getFoundationVarRef(t){return`var(--${t})`}getShadeLevels(){return[...n]}hasCustomization(){return Object.keys(this._palettes).length>0||Object.keys(this._contexts).length>0||Object.keys(this._fonts).length>0}toJSON(){return{palettes:this._palettes,colors:this._rawColors,contexts:this._contexts,fonts:this._fonts,appearance:this._appearance,foundationVars:this._foundationVars}}}export{h as Block,g as DataStore,p as EntityStore,_ as FetcherDispatcher,f as ObservableState,d as Page,i as Theme,m as Uniweb,v as Website,b as createUniweb,S as deriveCacheKey,x as evaluateWhere,C as getUniweb,y as isRichSchema,V as listRequestStyleNames,T as matchWhere,O as resolveRequestStyle,k as substitutePlaceholders};
2
2
  //# sourceMappingURL=@uniweb-core.js.map