@kaze-style/core
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -1,1 +0,1 @@ | ||
const e=()=>{};export{e as __globalStyle}; | ||
var e=()=>{};export{e as __globalStyle}; |
import type { CssRuleObject } from './styleOrder'; | ||
import type { KazeGlobalStyle } from './types/style'; | ||
import type { KazeGlobalStyle } from './types/globalStyle'; | ||
export declare type ForBuildGlobalStyle = { | ||
@@ -7,5 +7,5 @@ cssRuleObjects: CssRuleObject[]; | ||
}; | ||
export declare const __preGlobalStyle: (globalStyles: KazeGlobalStyle, forBuild: { | ||
export declare const __preGlobalStyle: <T extends string>(globalStyles: KazeGlobalStyle<T>, forBuild: { | ||
fileName: string; | ||
globalStyles: ForBuildGlobalStyle[]; | ||
}, fileName: string, index: number) => void; |
@@ -1,1 +0,1 @@ | ||
import{createGlobalStyle as r}from"./createGlobalStyle";const y=(l,e,t,o)=>{const{cssRuleObjects:s}=r(l);e.fileName===t&&e.globalStyles.push({cssRuleObjects:s,index:o})};export{y as __preGlobalStyle}; | ||
import{createGlobalStyle as r}from"./createGlobalStyle.js";var a=(l,e,t,o)=>{let{cssRuleObjects:s}=r(l);e.fileName===t&&e.globalStyles.push({cssRuleObjects:s,index:o})};export{a as __preGlobalStyle}; |
import type { CssRuleObject } from './styleOrder'; | ||
import type { Classes, ClassesObject, KazeStyle } from './types/style'; | ||
import type { ClassesObject, Classes } from './types/common'; | ||
import type { KazeStyle } from './types/style'; | ||
export declare type ForBuildStyle<K extends string> = { | ||
@@ -4,0 +5,0 @@ classesObject: ClassesObject<K>; |
@@ -1,1 +0,1 @@ | ||
import{createStyle as a}from"./createStyle";const n=(s,e,t,l)=>{const{classes:r,classesObject:c,cssRuleObjects:y}=a(s);return e.fileName===t&&e.styles.push({classesObject:c,cssRuleObjects:y,index:l}),r};export{n as __preStyle}; | ||
import{createStyle as o}from"./createStyle.js";var p=(s,e,t,l)=>{let{classes:r,classesObject:c,cssRuleObjects:y}=o(s);return e.fileName===t&&e.styles.push({classesObject:c,cssRuleObjects:y,index:l}),r};export{p as __preStyle}; |
@@ -1,2 +0,2 @@ | ||
import type { Classes } from './types/style'; | ||
import type { Classes } from './types/common'; | ||
export declare const __style: <K extends string>(classes: Classes<K>) => Classes<K>; |
@@ -1,1 +0,1 @@ | ||
const e=s=>s;export{e as __style}; | ||
var e=s=>s;export{e as __style}; |
@@ -1,1 +0,1 @@ | ||
class r extends String{object;others;constructor(s,t=[]){super([...Object.values(s),...t].join(" ")),this.others=t,this.object=s}}export{r as ClassName}; | ||
var e=class extends String{object;others;constructor(s,t=[]){super([...Object.values(s),...t].join(" ")),this.others=t,this.object=s}};export{e as ClassName}; |
import type { CssRuleObject } from './styleOrder'; | ||
import type { KazeGlobalStyle } from './types/style'; | ||
import type { KazeGlobalStyle } from './types/globalStyle'; | ||
declare type Result = { | ||
cssRuleObjects: CssRuleObject[]; | ||
}; | ||
export declare const createGlobalStyle: (globalStyles: KazeGlobalStyle) => Result; | ||
export declare const createGlobalStyle: <T extends string>(_styles: KazeGlobalStyle<T>) => Result; | ||
export {}; |
@@ -1,1 +0,1 @@ | ||
import{compileObjectCss as o}from"./utils/compileObjectCss";const y=e=>{const s=[];for(const t in e){const l=e[t];o({style:l||{},selector:t}).forEach(r=>{s.push({rule:r,order:"global"})})}return{cssRuleObjects:Array.from(new Set(s))}};export{y as createGlobalStyle}; | ||
import{compileObjectCss as y}from"./utils/compileObjectCss.js";import{cssRuleObjectsUniquify as p}from"./utils/cssRuleObjectsUniquify.js";var m=l=>{let e=[],s=l;for(let t in s){let o=s[t],r=y({style:o,selector:t});e.push(...r.map(c=>({rule:c,order:"global"})))}return{cssRuleObjects:p(e)}};export{m as createGlobalStyle}; |
import type { CssRuleObject } from './styleOrder'; | ||
import type { Classes, ClassesObject, KazeStyle } from './types/style'; | ||
import type { Classes, ClassesObject } from './types/common'; | ||
import type { KazeStyle } from './types/style'; | ||
declare type Result<K extends string> = { | ||
@@ -4,0 +5,0 @@ cssRuleObjects: CssRuleObject[]; |
@@ -1,1 +0,1 @@ | ||
import{ClassName as o}from"./ClassName";import{resolveStyle as n}from"./resolveStyle";const b=e=>{const t={},l={},c=[];for(const s in e){const{classNameObject:a,cssRuleObjects:r}=n({style:e[s]});c.push(...r),t[s]=new o(a),l[s]=a}return{classes:t,classesObject:l,cssRuleObjects:Array.from(new Map(c.map(s=>[s.rule,s])).values())}};export{b as createStyle}; | ||
import{ClassName as a}from"./ClassName.js";import{resolveStyle as n}from"./resolveStyle.js";import{cssRuleObjectsUniquify as m}from"./utils/cssRuleObjectsUniquify.js";var p=e=>{let t={},c={},l=[];for(let s in e){let{classNameObject:o,cssRuleObjects:r}=n({style:e[s]});l.push(...r),t[s]=new a(o),c[s]=o}return{classes:t,classesObject:c,cssRuleObjects:m(l)}};export{p as createStyle}; |
@@ -1,1 +0,1 @@ | ||
const t=(x,h=0)=>{let a=x.length,f=h^a,d=0,e;for(;a>=4;)e=x.charCodeAt(d)&255|(x.charCodeAt(++d)&255)<<8|(x.charCodeAt(++d)&255)<<16|(x.charCodeAt(++d)&255)<<24,e=(e&65535)*1540483477+(((e>>>16)*1540483477&65535)<<16),e^=e>>>24,e=(e&65535)*1540483477+(((e>>>16)*1540483477&65535)<<16),f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16)^e,a-=4,++d;switch(a){case 3:f^=(x.charCodeAt(d+2)&255)<<16;break;case 2:f^=(x.charCodeAt(d+1)&255)<<8;break;case 1:f^=x.charCodeAt(d)&255,f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16)}return f^=f>>>13,f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16),f^=f>>>15,(f>>>0).toString(36)};export{t as hash}; | ||
var t=(x,h=0)=>{let a=x.length,f=h^a,d=0,e;for(;a>=4;)e=x.charCodeAt(d)&255|(x.charCodeAt(++d)&255)<<8|(x.charCodeAt(++d)&255)<<16|(x.charCodeAt(++d)&255)<<24,e=(e&65535)*1540483477+(((e>>>16)*1540483477&65535)<<16),e^=e>>>24,e=(e&65535)*1540483477+(((e>>>16)*1540483477&65535)<<16),f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16)^e,a-=4,++d;switch(a){case 3:f^=(x.charCodeAt(d+2)&255)<<16;break;case 2:f^=(x.charCodeAt(d+1)&255)<<8;break;case 1:f^=x.charCodeAt(d)&255,f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16)}return f^=f>>>13,f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16),f^=f>>>15,(f>>>0).toString(36)};export{t as hash}; |
@@ -10,4 +10,6 @@ export * from './mergeStyle'; | ||
export * from './styleOrder'; | ||
export type { KazeStyle, KazeGlobalStyle, SupportStyle, SupportGlobalStyle, Classes, } from './types/style'; | ||
export type { Classes } from './types/common'; | ||
export type { KazeStyle, SupportStyle } from './types/style'; | ||
export type { KazeGlobalStyle, SupportGlobalStyle } from './types/globalStyle'; | ||
export type { ForBuildStyle } from './__preStyle'; | ||
export type { ForBuildGlobalStyle } from './__preGlobalStyle'; |
@@ -1,1 +0,1 @@ | ||
export*from"./mergeStyle";export*from"./createStyle";export*from"./createGlobalStyle";export*from"./__style";export*from"./__globalStyle";export*from"./__preStyle";export*from"./__preGlobalStyle";export*from"./ClassName";export*from"./styleOrder"; | ||
export*from"./mergeStyle.js";export*from"./createStyle.js";export*from"./createGlobalStyle.js";export*from"./__style.js";export*from"./__globalStyle.js";export*from"./__preStyle.js";export*from"./__preGlobalStyle.js";export*from"./ClassName.js";export*from"./styleOrder.js"; |
@@ -1,1 +0,1 @@ | ||
import{ClassName as n}from"./ClassName";const i=(...r)=>{const e=[],t={};return r.forEach(s=>{typeof s=="string"?e.push(s):s instanceof n&&(e.push(...s.others),Object.assign(t,s.object))}),new n(t,e)};export{i as mergeStyle}; | ||
import{ClassName as n}from"./ClassName.js";var i=(...r)=>{let e=[],t={};return r.forEach(s=>{typeof s=="string"?e.push(s):s instanceof n&&(e.push(...s.others),Object.assign(t,s.object))}),new n(t,e)};export{i as mergeStyle}; |
import type { ClassName } from './ClassName'; | ||
import type { CssRuleObject } from './styleOrder'; | ||
import type { Selectors } from './types/common'; | ||
import type { SupportStyle } from './types/style'; | ||
@@ -8,6 +9,2 @@ declare type ResolvedStyle = { | ||
}; | ||
export declare type Selectors = { | ||
nested: string; | ||
atRules: string[]; | ||
}; | ||
declare type Args = { | ||
@@ -14,0 +11,0 @@ style: SupportStyle; |
@@ -1,1 +0,1 @@ | ||
import{checkStyleOrder as n}from"./utils/checkStyleOrder";import{compileCss as y}from"./utils/compileCss";import{compileKeyFrameCss as f}from"./utils/compileKeyFrameCss";import{hashClassName as u}from"./utils/hashClassName";import{hashSelector as O}from"./utils/hashSelector";import{isCssValue as b}from"./utils/isCssValue";import{isObject as j}from"./utils/isObject";import{resolveSelectors as R}from"./utils/resolveSelectors";import{styleDeclarationStringify as N}from"./utils/styleDeclarationStringify";const c=({style:l,selectors:s={nested:"",atRules:[]},resolvedStyle:e={classNameObject:{},cssRuleObjects:[]}})=>{for(const p in l){const t=p,r=l[t];if(b(r)){const a=u({selectors:s,property:t,styleValue:r}),m=O({selectors:s,property:t}),o=y({selector:`.${a}`,selectors:s,declaration:N({property:t,styleValue:r})}),i=n({selectors:s});e.cssRuleObjects.push({rule:o,order:i}),Object.assign(e.classNameObject,{[m]:a})}else if(j(r))if(t==="animationName"){const a=r,{keyframesRule:m,keyframeName:o}=f(a);e.cssRuleObjects.push({rule:m,order:"keyframes"}),Object.assign(e.classNameObject,{[o]:o}),c({style:{animationName:o},selectors:s,resolvedStyle:e})}else c({style:r,selectors:R({property:t,selectors:s}),resolvedStyle:e})}return e};export{c as resolveStyle}; | ||
import{checkStyleOrder as y}from"./utils/checkStyleOrder.js";import{compileCss as n}from"./utils/compileCss.js";import{compileKeyFrameCss as f}from"./utils/compileKeyFrameCss.js";import{hashClassName as u}from"./utils/hashClassName.js";import{hashSelector as O}from"./utils/hashSelector.js";import{isCssValue as b}from"./utils/isCssValue.js";import{isObject as j}from"./utils/isObject.js";import{resolveSelectors as N}from"./utils/resolveSelectors.js";import{styleDeclarationStringify as R}from"./utils/styleDeclarationStringify.js";var l=({style:c,selectors:s={nested:"",atRules:[]},resolvedStyle:e={classNameObject:{},cssRuleObjects:[]}})=>{for(let p in c){let t=p,o=c[t];if(b(o)){let m=u({selectors:s,property:t,styleValue:o}),a=O({selectors:s,property:t}),r=n({selector:`.${m}`,selectors:s,declaration:R({property:t,styleValue:o})}),i=y({selectors:s});e.cssRuleObjects.push({rule:r,order:i}),Object.assign(e.classNameObject,{[a]:m})}else if(j(o))if(t==="animationName"){let m=o,{keyframesRule:a,keyframeName:r}=f(m);e.cssRuleObjects.push({rule:a,order:"keyframes"}),Object.assign(e.classNameObject,{[r]:r}),l({style:{animationName:r},selectors:s,resolvedStyle:e})}else l({style:o,selectors:N({property:t,selectors:s}),resolvedStyle:e})}return e};export{l as resolveStyle}; |
@@ -1,1 +0,1 @@ | ||
export*from"./runtime/setCssRuleObjects"; | ||
export*from"./runtime/setCssRuleObjects.js"; |
@@ -1,1 +0,1 @@ | ||
import{styleOrder as r}from"../styleOrder";const t={},s=()=>(t[r[0]]===void 0&&r.forEach(l=>{const e=document.createElement("style");e.rules=[],e.id=`kaze-${l}`,document.head.appendChild(e),Object.assign(t,{[l]:e})}),t);export{s as getStyleElements}; | ||
import{styleOrder as r}from"../styleOrder.js";var t={},s=()=>(t[r[0]]===void 0&&r.forEach(l=>{let e=document.createElement("style");e.rules=[],e.id=`kaze-${l}`,document.head.appendChild(e),Object.assign(t,{[l]:e})}),t);export{s as getStyleElements}; |
@@ -1,1 +0,1 @@ | ||
import{getStyleElements as l}from"./getStyleElements";const n=r=>{const s=l();r.forEach(t=>{const e=s[t.order];e.rules=Array.from(new Set([...e.rules,t.rule])),e.innerText=e.rules.join("")})};export{n as setCssRuleObjects}; | ||
import{getStyleElements as l}from"./getStyleElements.js";var n=r=>{let s=l();r.forEach(t=>{let e=s[t.order];e.rules=Array.from(new Set([...e.rules,t.rule])),e.innerText=e.rules.join("")})};export{n as setCssRuleObjects}; |
@@ -1,1 +0,1 @@ | ||
const e=["global","normal","link","visited","focusWithin","focus","focusVisible","hover","active","keyframes","atRules","media"];export{e as styleOrder}; | ||
var e=["global","normal","link","visited","focusWithin","focus","focusVisible","hover","active","keyframes","atRules","media"];export{e as styleOrder}; |
@@ -1,6 +0,5 @@ | ||
import type { Pseudos, PropertiesFallback, AtRule } from 'csstype'; | ||
import type { ClassName } from '../ClassName'; | ||
import type { AndArray, IncludeChar } from './utils'; | ||
export declare type CssValue = string | number | undefined; | ||
declare type NestedChar = ':' | '&' | ' ' | '@' | ',' | '>' | '~' | '+' | '[' | '.' | '#'; | ||
import type { Pseudos, PropertiesFallback } from 'csstype'; | ||
import type { CssValue, NestedChar } from './common'; | ||
import type { IncludeChar } from './utils'; | ||
declare type SupportProperties = Omit<PropertiesFallback<CssValue>, 'animationName'>; | ||
declare type PredictType = '@media (max-width: 0)' | '@media (min-width: 0)' | '@media (prefers-color-scheme: dark)' | '@media (prefers-color-scheme: light)' | '@layer utilities' | '@layer base' | '@supports ()' | '@supports not ()'; | ||
@@ -16,2 +15,5 @@ declare type PredictTypeRules = { | ||
}; | ||
declare type CssAnimationNameProperty = { | ||
animationName?: KeyframesCssRules | string; | ||
}; | ||
export declare type KeyframesCssRules = { | ||
@@ -22,26 +24,4 @@ [_ in 'from' | 'to']?: SupportProperties; | ||
}; | ||
declare type CssAnimationNameProperty = { | ||
animationName?: KeyframesCssRules | string; | ||
}; | ||
export declare type SupportProperties = Omit<PropertiesFallback<CssValue>, 'animationName'>; | ||
export declare type SupportStyle = SupportProperties & PseudosCssRules & PredictTypeRules & StringCssRules & CssAnimationNameProperty; | ||
export declare type KazeStyle<T extends string> = Record<T, SupportStyle>; | ||
declare type SupportGlobalProperties = PropertiesFallback<AndArray<CssValue>>; | ||
declare type GlobalPseudosCssRules = { | ||
[_ in Pseudos]?: SupportGlobalStyle; | ||
}; | ||
declare type GlobalStringCssRules = { | ||
[P in IncludeChar<NestedChar>]?: P extends '@font-face' ? FontFaceStyle : SupportGlobalStyle; | ||
}; | ||
export declare type SupportGlobalStyle = SupportGlobalProperties & GlobalPseudosCssRules & GlobalStringCssRules; | ||
declare type FontFaceStyle = AtRule.FontFaceFallback<CssValue> & AtRule.FontFaceHyphenFallback<CssValue>; | ||
declare type GlobalSelector = keyof HTMLElementTagNameMap | '*'; | ||
declare type PredictGlobalSelector = Pseudos | GlobalSelector | `${GlobalSelector}${Pseudos}`; | ||
export declare type KazeGlobalStyle = { | ||
'@font-face'?: FontFaceStyle; | ||
} & { | ||
[_ in PredictGlobalSelector]?: SupportGlobalStyle; | ||
} & Record<string, Record<string, AndArray<CssValue>> | SupportGlobalStyle>; | ||
export declare type Classes<K extends string> = Record<K, string>; | ||
export declare type ClassesObject<K extends string> = Record<K, ClassName['object']>; | ||
export {}; |
export declare type ValueOf<T> = T[keyof T]; | ||
export declare type AndArray<T> = T | T[]; | ||
export declare type IncludeChar<T extends string> = `${string}${T}${string}`; | ||
export declare type NestedObj<T> = Obj<T>; | ||
declare type Obj<T = string> = { | ||
[_ in string]?: NestedObj<T> | T; | ||
export declare type ObjKey = string | number | symbol; | ||
export declare type NestedObj<T> = { | ||
[_ in ObjKey]?: NestedObj<T> | T; | ||
}; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import type { Selectors } from '../resolveStyle'; | ||
import type { Selectors } from '../types/common'; | ||
declare type Args = { | ||
@@ -3,0 +3,0 @@ selectors: Selectors; |
@@ -1,1 +0,1 @@ | ||
const r=({selectors:{nested:i,atRules:l}})=>{let e="normal";return l.length!==0?l.some(s=>s.includes("media"))?e="media":e="atRules":i.includes(":active")?e="active":i.includes(":hover")?e="hover":i.includes(":focus-visible")?e="focusVisible":i.includes(":focus")?e="focus":i.includes(":focus-within")?e="focusWithin":i.includes(":visited")?e="visited":i.includes(":link")&&(e="link"),e};export{r as checkStyleOrder}; | ||
var r=({selectors:{nested:i,atRules:s}})=>{let e="normal";return s.length!==0?s.some(l=>l.includes("media"))?e="media":e="atRules":i.includes(":active")?e="active":i.includes(":hover")?e="hover":i.includes(":focus-visible")?e="focusVisible":i.includes(":focus")?e="focus":i.includes(":focus-within")?e="focusWithin":i.includes(":visited")?e="visited":i.includes(":link")&&(e="link"),e};export{r as checkStyleOrder}; |
@@ -1,3 +0,3 @@ | ||
import type { Selectors } from '../resolveStyle'; | ||
declare type CompileCss = { | ||
import type { Selectors } from '../types/common'; | ||
declare type Args = { | ||
selector: string; | ||
@@ -7,3 +7,3 @@ selectors: Selectors; | ||
}; | ||
export declare const compileCss: ({ selector, selectors: { nested, atRules }, declaration, }: CompileCss) => string; | ||
export declare const compileCss: ({ selector, selectors: { nested, atRules }, declaration, }: Args) => string; | ||
export {}; |
@@ -1,1 +0,1 @@ | ||
const i=({selector:l,selectors:{nested:s,atRules:t},declaration:o})=>{let r="",e="";return s?r=`${s.replace(/&/g,`${l}`)}`:r=`${l}`,e=`${r}{${o}}`,t.length!==0&&t.forEach(c=>e=`${c}{${e}}`),e};export{i as compileCss}; | ||
var i=({selector:t,selectors:{nested:o,atRules:s},declaration:l})=>{let r="",e="";return o?r=`${o.replace(/&/g,`${t}`)}`:r=`${t}`,e=`${r}{${l}}`,s.length!==0&&s.forEach(c=>e=`${c}{${e}}`),e};export{i as compileCss}; |
@@ -1,1 +0,1 @@ | ||
import{hash as a}from"../hash";import{compileObjectCss as c}from"./compileObjectCss";const f=e=>{const s=[];for(const t in e){const m=e[t];s.push(`${c({selector:t,style:m||{}})}`)}const r=s.join(""),o=`_${a(r)}`;return{keyframesRule:`@keyframes ${o} {${r}}`,keyframeName:o}};export{f as compileKeyFrameCss}; | ||
import{hash as n}from"../hash.js";import{compileObjectCss as a}from"./compileObjectCss.js";var f=e=>{let s=[];for(let t in e){let m=e[t];s.push(`${a({selector:t,style:m||{}}).join("")}`)}let o=s.join(""),r=`_${n(o)}`;return{keyframesRule:`@keyframes ${r}{${o}}`,keyframeName:r}};export{f as compileKeyFrameCss}; |
@@ -1,2 +0,2 @@ | ||
import type { CssValue } from '../types/style'; | ||
import type { CssValue, Selectors } from '../types/common'; | ||
import type { AndArray, NestedObj } from '../types/utils'; | ||
@@ -6,6 +6,3 @@ declare type Args = { | ||
selector: string; | ||
selectors?: { | ||
nested: string; | ||
atRules: string[]; | ||
}; | ||
selectors?: Selectors; | ||
resolvedStyle?: { | ||
@@ -12,0 +9,0 @@ cssRules: string[]; |
@@ -1,1 +0,1 @@ | ||
import{compileCss as n}from"./compileCss";import{isCssValue as c}from"./isCssValue";import{isObject as p}from"./isObject";import{resolveSelectors as m}from"./resolveSelectors";import{styleDeclarationStringify as u}from"./styleDeclarationStringify";const a=({style:o,selector:i,selectors:l={atRules:[],nested:""},resolvedStyle:t={cssRules:[]}})=>{const r=[];for(const s in o){const e=o[s];c(e)?r.push(u({property:s,styleValue:e})):p(e)&&a({style:e,selector:i,selectors:m({property:s,selectors:l}),resolvedStyle:t})}if(r.length!==0){const s=n({selector:i,declaration:r.join(""),selectors:l});t.cssRules.push(s)}return t.cssRules};export{a as compileObjectCss}; | ||
import{compileCss as c}from"./compileCss.js";import{isCssValue as n}from"./isCssValue.js";import{isObject as p}from"./isObject.js";import{resolveSelectors as m}from"./resolveSelectors.js";import{styleDeclarationStringify as u}from"./styleDeclarationStringify.js";var a=({style:o,selector:l,selectors:i={atRules:[],nested:""},resolvedStyle:t={cssRules:[]}})=>{let r=[];for(let s in o){let e=o[s];n(e)?r.push(u({property:s,styleValue:e})):p(e)&&a({style:e,selector:l,selectors:m({property:s,selectors:i}),resolvedStyle:t})}if(r.length!==0){let s=c({selector:l,declaration:r.join(""),selectors:i});t.cssRules.push(s)}return t.cssRules};export{a as compileObjectCss}; |
@@ -1,3 +0,2 @@ | ||
import type { Selectors } from '../resolveStyle'; | ||
import type { CssValue } from '../types/style'; | ||
import type { CssValue, Selectors } from '../types/common'; | ||
import type { AndArray } from '../types/utils'; | ||
@@ -4,0 +3,0 @@ declare type Args = { |
@@ -1,1 +0,1 @@ | ||
import{hash as o}from"../hash";import{styleValueStringify as l}from"./styleValueStringify";const i=({selectors:{nested:r,atRules:e},property:t,styleValue:s})=>`_${o(`${t}${r}${e.join("")}${l(s)}`)}`;export{i as hashClassName}; | ||
import{hash as o}from"../hash.js";import{styleValueStringify as l}from"./styleValueStringify.js";var y=({selectors:{nested:r,atRules:s},property:e,styleValue:t})=>`_${o(`${e}${r}${s.join("")}${l(t)}`)}`;export{y as hashClassName}; |
@@ -1,2 +0,2 @@ | ||
import type { Selectors } from '../resolveStyle'; | ||
import type { Selectors } from '../types/common'; | ||
declare type Args = { | ||
@@ -3,0 +3,0 @@ selectors: Selectors; |
@@ -1,1 +0,1 @@ | ||
import{hash as o}from"../hash";const l=({selectors:{nested:r,atRules:e},property:t})=>`_${o(`${t}${r}${e.join("")}`)}`;export{l as hashSelector}; | ||
import{hash as o}from"../hash.js";var p=({selectors:{nested:r,atRules:e},property:t})=>`_${o(`${t}${r}${e.join("")}`)}`;export{p as hashSelector}; |
@@ -1,1 +0,1 @@ | ||
const n=e=>e.includes("-")?e:e.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());export{n as hyphenateProperty}; | ||
var n=e=>e.includes("-")?e:e.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());export{n as hyphenateProperty}; |
@@ -1,3 +0,3 @@ | ||
import type { CssValue } from '../types/style'; | ||
import type { CssValue } from '../types/common'; | ||
import type { AndArray, NestedObj } from '../types/utils'; | ||
export declare const isCssValue: (styleValue: NestedObj<AndArray<CssValue>> | AndArray<CssValue>) => styleValue is AndArray<CssValue>; |
@@ -1,1 +0,1 @@ | ||
const s=r=>typeof r=="string"||typeof r=="number"||Array.isArray(r);export{s as isCssValue}; | ||
var s=r=>typeof r=="string"||typeof r=="number"||Array.isArray(r);export{s as isCssValue}; |
@@ -1,1 +0,1 @@ | ||
const t=e=>/(:|&| |,|>|~|\+|\[|\.|#|)/.test(e);export{t as isNestedSelector}; | ||
var t=e=>/(:|&| |,|>|~|\+|\[|\.|#|)/.test(e);export{t as isNestedSelector}; |
@@ -1,2 +0,2 @@ | ||
import type { Selectors } from '../resolveStyle'; | ||
import type { Selectors } from '../types/common'; | ||
declare type Args = { | ||
@@ -3,0 +3,0 @@ property: string; |
@@ -1,1 +0,1 @@ | ||
import{isNestedSelector as r}from"./isNestedSelector";import{normalizeNestedProperty as s}from"./normalizeNestedProperty";const o=({property:t,selectors:e})=>t.substring(0,1)==="@"?Object.assign({},e,{atRules:[t].concat(e.atRules)}):r(t)?Object.assign({},e,{nested:s(t,e.nested)}):e;export{o as resolveSelectors}; | ||
import{isNestedSelector as s}from"./isNestedSelector.js";import{normalizeNestedSelector as r}from"./normalizeNestedSelector.js";var i=({property:t,selectors:e})=>t.substring(0,1)==="@"?Object.assign({},e,{atRules:[t].concat(e.atRules)}):s(t)?Object.assign({},e,{nested:r({current:e.nested,nested:t})}):e;export{i as resolveSelectors}; |
@@ -1,2 +0,2 @@ | ||
import type { CssValue } from '../types/style'; | ||
import type { CssValue } from '../types/common'; | ||
import type { AndArray } from '../types/utils'; | ||
@@ -3,0 +3,0 @@ declare type Args = { |
@@ -1,1 +0,1 @@ | ||
import{hyphenateProperty as e}from"./hyphenateProperty";import{styleValueStringify as y}from"./styleValueStringify";const o=({property:r,styleValue:t})=>`${e(r)}:${y(t)};`;export{o as styleDeclarationStringify}; | ||
import{hyphenateProperty as e}from"./hyphenateProperty.js";import{styleValueStringify as o}from"./styleValueStringify.js";var s=({property:r,styleValue:t})=>`${e(r)}:${o(t)};`;export{s as styleDeclarationStringify}; |
@@ -1,3 +0,3 @@ | ||
import type { CssValue } from '../types/style'; | ||
import type { CssValue } from '../types/common'; | ||
import type { AndArray } from '../types/utils'; | ||
export declare const styleValueStringify: (styleValue: AndArray<CssValue>) => CssValue; |
@@ -1,1 +0,1 @@ | ||
const s=r=>Array.isArray(r)?r.join(" "):r;export{s as styleValueStringify}; | ||
var s=r=>Array.isArray(r)?r.join(" "):r;export{s as styleValueStringify}; |
{ | ||
"name": "@kaze-style/core", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"license": "MIT", | ||
@@ -12,4 +12,5 @@ "author": "Taishi Naritomi", | ||
}, | ||
"type": "module", | ||
"sideEffects": false, | ||
"main": "dist/index.cjs", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/index.js", | ||
@@ -20,11 +21,16 @@ "typings": "dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts" | ||
"require": "./dist/cjs/index.js" | ||
}, | ||
"./runtime": { | ||
"import": "./dist/runtime.js", | ||
"require": "./dist/runtime.cjs", | ||
"types": "./dist/runtime.d.ts" | ||
"require": "./dist/cjs/runtime.js" | ||
} | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"runtime": [ | ||
"./dist/runtime" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
@@ -36,4 +42,5 @@ "dist", | ||
"scripts": { | ||
"dev": "tsx ./../../scripts/build.ts --watch --entry ./src/runtime.ts", | ||
"build": "tsx ./../../scripts/build.ts --entry ./src/runtime.ts" | ||
"type-check": "tsc --noEmit", | ||
"dev": "tsx ./../../scripts/build.ts --watch", | ||
"build": "tsx ./../../scripts/build.ts --size --sizeEntry src/runtime.ts" | ||
}, | ||
@@ -40,0 +47,0 @@ "dependencies": { |
{ | ||
"main": "../dist/runtime.cjs", | ||
"main": "../dist/cjs/runtime.js", | ||
"module": "../dist/runtime.js", | ||
@@ -4,0 +4,0 @@ "typings": "../dist/runtime.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 3 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110
397
Yes
47208
18
1