@master/css
Advanced tools
Comparing version 2.0.0-beta.192 to 2.0.0-beta.193
@@ -0,31 +1,10 @@ | ||
import type { ConfigFunction } from './'; | ||
declare const functions: { | ||
$: { | ||
transform(opening: any, value: any, closing: any): any; | ||
transform(value: any): { | ||
type: string; | ||
name: any; | ||
}[]; | ||
}; | ||
calc: { | ||
transform(opening: any, value: any, closing: any): (string | number | { | ||
type: "function"; | ||
name: string; | ||
symbol: string; | ||
childrens: (string | number | any | { | ||
type: "variable"; | ||
name: string; | ||
alpha?: string; | ||
} | { | ||
type: "separator"; | ||
value: string; | ||
prefixWhite?: boolean; | ||
suffixWhite?: boolean; | ||
})[]; | ||
} | { | ||
type: "variable"; | ||
name: string; | ||
alpha?: string; | ||
} | { | ||
type: "separator"; | ||
value: string; | ||
prefixWhite?: boolean; | ||
suffixWhite?: boolean; | ||
})[]; | ||
}; | ||
calc: ConfigFunction; | ||
translate: { | ||
@@ -32,0 +11,0 @@ unit: string; |
@@ -9,3 +9,3 @@ import mediaQueries from './media-queries'; | ||
import { CSSDeclarations } from '../types/css-declarations'; | ||
import type { Rule } from '../rule'; | ||
import type { Rule, RuleOptions, ValueComponent } from '../rule'; | ||
declare const config: Config; | ||
@@ -19,2 +19,12 @@ export { config, mediaQueries, selectors, semantics, rules, functions, animations, variables }; | ||
}; | ||
export type ConfigFunction = { | ||
unit?: string; | ||
colored?: boolean; | ||
transform?(this: Rule, value: string): string | ValueComponent[]; | ||
}; | ||
export type ConfigAnimation = { | ||
[key in 'from' | 'to']?: CSSDeclarations; | ||
} & { | ||
[key: string]: CSSDeclarations; | ||
}; | ||
export interface Config { | ||
@@ -44,3 +54,3 @@ extends?: (Config | { | ||
rules?: { | ||
[key in keyof typeof rules | string]?: Rule['options']; | ||
[key in keyof typeof rules | string]?: RuleOptions; | ||
}; | ||
@@ -51,13 +61,5 @@ rootSize?: number; | ||
override?: boolean; | ||
functions?: Record<string, { | ||
unit?: string; | ||
colored?: boolean; | ||
transform?(this: Rule, opening: string, value: string, closing: string): string | Rule['valueNodes']; | ||
}>; | ||
animations?: Record<string, { | ||
[key in 'from' | 'to']?: CSSDeclarations; | ||
} & { | ||
[key: string]: CSSDeclarations; | ||
}>; | ||
functions?: Record<string, ConfigFunction>; | ||
animations?: Record<string, ConfigAnimation>; | ||
themeDriver?: 'class' | 'media' | 'host'; | ||
} |
@@ -134,3 +134,2 @@ declare const variables: { | ||
current: string; | ||
transparent: string; | ||
slate: any; | ||
@@ -137,0 +136,0 @@ gray: any; |
@@ -1,3 +0,3 @@ | ||
import { Rule, NativeRule } from './rule'; | ||
import type { Config } from './config'; | ||
import { Rule, NativeRule, RuleOptions } from './rule'; | ||
import type { Config, ConfigAnimation } from './config'; | ||
type VariableValue = { | ||
@@ -14,7 +14,2 @@ type: 'string'; | ||
}; | ||
type VariableValues = { | ||
[key: string]: VariableValue | { | ||
[theme in '' | `@${string}`]?: VariableValue; | ||
}; | ||
}; | ||
export interface MasterCSS { | ||
@@ -27,14 +22,18 @@ readonly style: HTMLStyleElement; | ||
selectors: Record<string, [RegExp, string[]][]>; | ||
generalVariables: VariableValues; | ||
colorVariables: VariableValues; | ||
mediaQueries: Record<string, string>; | ||
keyframesMap: Record<string, { | ||
nativeRule: NativeRule; | ||
count: number; | ||
variables: Record<string, Omit<VariableValue, 'value' | 'space'> & { | ||
value?: any; | ||
space?: any; | ||
usage?: number; | ||
natives?: NativeRule[]; | ||
themes?: { | ||
[theme: string]: VariableValue; | ||
}; | ||
}>; | ||
variablesMap: Record<string, { | ||
nativeRules: NativeRule[]; | ||
count: number; | ||
mediaQueries: Record<string, string | number>; | ||
hasVariablesRule: boolean; | ||
hasKeyframesRule: boolean; | ||
animations: Record<string, ConfigAnimation & { | ||
usage?: number; | ||
native?: NativeRule; | ||
}>; | ||
animations: Config['animations']; | ||
} | ||
@@ -70,3 +69,3 @@ export declare class MasterCSS { | ||
*/ | ||
match(syntax: string): Rule['options']; | ||
match(syntax: string): RuleOptions; | ||
/** | ||
@@ -73,0 +72,0 @@ * Create rules from class syntax |
export { MasterCSS, MasterCSS as default } from './core'; | ||
export { Rule, NativeRule, MediaFeatureRule, MediaQuery } from './rule'; | ||
export { Rule, NativeRule, MediaFeatureComponent, MediaQuery } from './rule'; | ||
export { CONFIG_TEXT } from './constants/config-text'; | ||
@@ -4,0 +4,0 @@ export { CONFIG_ESM_TEXT } from './constants/config-esm-text'; |
@@ -6,26 +6,3 @@ import type { MasterCSS } from './core'; | ||
readonly className: string; | ||
readonly options: { | ||
id?: string; | ||
match?: RegExp | [string, string[]?]; | ||
resolvedMatch?: RegExp; | ||
resolvedNormalVariables?: any; | ||
resolvedColorVariables?: any; | ||
variableGroups?: string[]; | ||
order?: number; | ||
separators?: string[]; | ||
shorthand?: string; | ||
colored?: boolean; | ||
numeric?: boolean; | ||
unit?: any; | ||
native?: boolean; | ||
declarations?: CSSDeclarations; | ||
resolvedPropName?: string; | ||
layer?: Layer | CoreLayer; | ||
analyze?: (this: Rule, className: string) => [valueToken: string, prefixToken?: string]; | ||
transform?(this: Rule, value: string): string; | ||
declare?(this: Rule, value: string, unit: string): CSSDeclarations; | ||
delete?(this: Rule, className: string): void; | ||
create?(this: Rule, className: string): void; | ||
insert?(this: Rule): void; | ||
}; | ||
readonly options: RuleOptions; | ||
css: MasterCSS; | ||
@@ -41,33 +18,40 @@ readonly at: Record<string, string>; | ||
variableNames: string[]; | ||
constructor(className: string, options: { | ||
id?: string; | ||
match?: RegExp | [string, string[]?]; | ||
resolvedMatch?: RegExp; | ||
resolvedNormalVariables?: any; | ||
resolvedColorVariables?: any; | ||
variableGroups?: string[]; | ||
order?: number; | ||
separators?: string[]; | ||
shorthand?: string; | ||
colored?: boolean; | ||
numeric?: boolean; | ||
unit?: any; | ||
native?: boolean; | ||
declarations?: CSSDeclarations; | ||
resolvedPropName?: string; | ||
layer?: Layer | CoreLayer; | ||
analyze?: (this: Rule, className: string) => [valueToken: string, prefixToken?: string]; | ||
transform?(this: Rule, value: string): string; | ||
declare?(this: Rule, value: string, unit: string): CSSDeclarations; | ||
delete?(this: Rule, className: string): void; | ||
create?(this: Rule, className: string): void; | ||
insert?(this: Rule): void; | ||
}, css: MasterCSS); | ||
constructor(className: string, options: RuleOptions, css: MasterCSS); | ||
transformValueComponents: (valueComponents: ValueComponent[], unit: string, bypassVariableNames: string[]) => string; | ||
get text(): string; | ||
parseValue: (currentValueComponents: ValueComponent[], i: number, value: string, unit: string, endSymbol?: string, parentFunctionName?: any, bypassVariableNames?: string[]) => number; | ||
resolveValue(value: any, unit: any): any; | ||
resolveUnitValue(token: string | number, unit?: string): { | ||
value: string; | ||
unit: string; | ||
}; | ||
parseValueComponent(token: string | number, unit?: any): StringValueComponent | NumericValueComponent; | ||
} | ||
export type ValueComponent = StringValueComponent | NumericValueComponent | FunctionValueComponent | VariableValueComponent | SeparatorValueComponent; | ||
export interface StringValueComponent { | ||
token?: string; | ||
type: 'string'; | ||
value: string; | ||
} | ||
export interface NumericValueComponent { | ||
token?: string; | ||
type: 'number'; | ||
value: number; | ||
unit?: string; | ||
} | ||
export interface FunctionValueComponent { | ||
token?: string; | ||
type: 'function'; | ||
name: string; | ||
symbol: string; | ||
childrens: ValueComponent[]; | ||
} | ||
export interface VariableValueComponent { | ||
token?: string; | ||
type: 'variable'; | ||
name: string; | ||
alpha?: string; | ||
} | ||
export interface SeparatorValueComponent { | ||
type: 'separator'; | ||
value: string; | ||
prefix?: string; | ||
suffix?: string; | ||
} | ||
export interface Rule { | ||
@@ -84,17 +68,3 @@ prefix?: string; | ||
hasWhere?: boolean; | ||
valueNodes?: Array<string | number | { | ||
type: 'function'; | ||
name: string; | ||
symbol: string; | ||
childrens: Rule['valueNodes']; | ||
} | { | ||
type: 'variable'; | ||
name: string; | ||
alpha?: string; | ||
} | { | ||
type: 'separator'; | ||
value: string; | ||
prefixWhite?: boolean; | ||
suffixWhite?: boolean; | ||
}>; | ||
valueComponents?: Array<ValueComponent>; | ||
constructor: { | ||
@@ -104,2 +74,26 @@ match?(name: string, matches: RegExp, colors: Record<string, Record<string, string>>, colorNames: string[]): RuleMeta; | ||
} | ||
export interface RuleOptions { | ||
id?: string; | ||
match?: RegExp | [string, string[]?]; | ||
resolvedMatch?: RegExp; | ||
resolvedVariables?: any; | ||
variableGroups?: string[]; | ||
order?: number; | ||
separators?: string[]; | ||
shorthand?: string; | ||
colored?: boolean; | ||
numeric?: boolean; | ||
unit?: any; | ||
native?: boolean; | ||
declarations?: CSSDeclarations; | ||
resolvedPropName?: string; | ||
layer?: Layer | CoreLayer; | ||
analyze?: (this: Rule, className: string) => [valueToken: string, prefixToken?: string]; | ||
transform?(this: Rule, value: string): string; | ||
transformValueComponents?(this: Rule, valueComponents: ValueComponent[]): ValueComponent[]; | ||
declare?(this: Rule, value: string, unit: string): CSSDeclarations; | ||
delete?(this: Rule, className: string): void; | ||
create?(this: Rule, className: string): void; | ||
insert?(this: Rule): void; | ||
} | ||
export interface NativeRule { | ||
@@ -109,13 +103,13 @@ text: string; | ||
} | ||
export interface MediaFeatureRule { | ||
token: string; | ||
export type MediaFeatureComponent = { | ||
type: string; | ||
tokenType?: string; | ||
operator?: string; | ||
value?: number; | ||
unit?: string; | ||
} | ||
value: number; | ||
unit: string; | ||
}; | ||
export interface MediaQuery { | ||
token: string; | ||
features?: { | ||
[key: string]: MediaFeatureRule; | ||
[key: string]: MediaFeatureComponent; | ||
}; | ||
@@ -126,3 +120,3 @@ type?: string; | ||
value?: [string, string | Record<string, string>]; | ||
config?: Rule['options']; | ||
config?: RuleOptions; | ||
} |
@@ -1,1 +0,1 @@ | ||
{"name":"@master/css","scripts":{"build":"techor pack --external @master/css-renderer @master/css-extractor","dev":"pnpm run build --watch --no-declare","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"A markup-driven CSS language with enhanced syntax","author":"Aoyue Design LLC.","funding":"https://css.master.co/docs/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/css"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.bundle.js","jsnext:main":"./dist/index.bundle.mjs","esnext":"./dist/index.bundle.mjs","module":"./dist/index.bundle.mjs","browser":"./dist/index.browser.bundle.js","types":"./dist/index.d.ts","exports":{".":{"browser":{"import":"./dist/index.bundle.mjs","types":"./dist/index.browser.d.ts"},"require":"./dist/index.bundle.js","import":"./dist/index.bundle.mjs","types":"./dist/index.d.ts"}},"files":["dist"],"bin":{"mcss":"./dist/bin/index.bundle.js","mastercss":"./dist/bin/index.bundle.js"},"publishConfig":{"access":"public"},"dependencies":{"@master/normal.css":"^2.0.0-beta.192","@techor/fs":"^2.5.4","@techor/log":"^2.5.4","commander":"^11.0.0"},"devDependencies":{"@techor/extend":"^2.5.4","@techor/pack":"^2.5.4","css-shared":"^2.0.0-beta.192","csstype":"^3.1.2","puppeteer":"^21.0.1","vite":"^4.2.1"},"version":"2.0.0-beta.192"} | ||
{"name":"@master/css","scripts":{"build":"techor pack --external @master/css-renderer @master/css-extractor","dev":"pnpm run build --watch --no-declare","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"A markup-driven CSS language with enhanced syntax","author":"Aoyue Design LLC.","funding":"https://css.master.co/docs/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/css"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.bundle.js","jsnext:main":"./dist/index.bundle.mjs","esnext":"./dist/index.bundle.mjs","module":"./dist/index.bundle.mjs","browser":"./dist/index.browser.bundle.js","types":"./dist/index.d.ts","exports":{".":{"browser":{"import":"./dist/index.bundle.mjs","types":"./dist/index.browser.d.ts"},"require":"./dist/index.bundle.js","import":"./dist/index.bundle.mjs","types":"./dist/index.d.ts"}},"files":["dist"],"bin":{"mcss":"./dist/bin/index.bundle.js","mastercss":"./dist/bin/index.bundle.js"},"publishConfig":{"access":"public"},"dependencies":{"@master/normal.css":"^2.0.0-beta.193","@techor/fs":"^2.5.4","@techor/log":"^2.5.4","commander":"^11.0.0"},"devDependencies":{"@techor/extend":"^2.5.4","@techor/pack":"^2.5.4","css-shared":"^2.0.0-beta.193","csstype":"^3.1.2","puppeteer":"^21.0.1","vite":"^4.2.1"},"version":"2.0.0-beta.193"} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
239270
2126
1