Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@master/css

Package Overview
Dependencies
Maintainers
2
Versions
429
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@master/css - npm Package Compare versions

Comparing version 2.0.0-beta.206 to 2.0.0-beta.207

dist/types/global.d.ts

8

dist/bin/index.bundle.js
#!/usr/bin/env node
var h=Object.create;var d=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var O=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of _(o))!E.call(e,s)&&s!==t&&d(e,s,{get:()=>o[s],enumerable:!(r=C(o,s))||r.enumerable});return e};var p=(e,o,t)=>(t=e!=null?h(x(e)):{},O(o||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e));var T=require("commander"),m=p(require("path")),a=p(require("fs"));var S=`/** @type {import('@master/css').Config} */
"use strict";var h=Object.create;var d=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var O=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of _(o))!E.call(e,s)&&s!==t&&d(e,s,{get:()=>o[s],enumerable:!(r=C(o,s))||r.enumerable});return e};var p=(e,o,t)=>(t=e!=null?h(x(e)):{},O(o||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e));var T=require("commander"),m=p(require("path")),a=p(require("fs"));var S=`/** @type {import('@master/css').Config} */
export default {

@@ -13,3 +13,3 @@ styles: {},

}
`;var g=`/** @type {import('@master/css').Config} */
`;var y=`/** @type {import('@master/css').Config} */
module.exports = {

@@ -25,3 +25,3 @@ styles: {},

}
`;var y=`import type { Config } from '@master/css'
`;var g=`import type { Config } from '@master/css'

@@ -38,2 +38,2 @@ export default {

} as Config
`;var n=p(require("@techor/log")),l=require("@techor/fs"),{version:v,name:j,description:F}=(0,l.readJSONFileSync)(m.default.resolve(__dirname,"../../package.json")),c=new T.Command;c.name(j).description(F).version(v||"0.0.0");c.command("init").description("Initialize definition files for Master CSS").option("-o, --override","Override existing definition file").option("--esm","ES Module .mjs").option("--ts","TypeScript .ts").option("--cjs","CommonJS .js").action(async function(e){let{esm:o,ts:t,cjs:r}=e;if(!o&&!t&&!r)if(a.default.existsSync("tsconfig.json"))t=!0;else{let{type:i}=(0,l.readJSONFileSync)("./package.json")||{};i==="module"?o=!0:r=!0}let s=(i,f)=>{let u=a.default.existsSync(m.default.join(process.cwd(),i));u?u&&e.override?(a.default.writeFileSync(i,f),n.default.ok`**${i}** file is overridden`):n.default.x`**${i}** file already exists`:(a.default.writeFileSync(i,f),n.default.ok`**${i}** file is created`)};o&&s("master.css.mjs",S),t&&s("master.css.ts",y),r&&s("master.css.js",g)});c.command("render").description("Scans HTML and injects generated CSS rules").argument("<source paths>","The path in glob patterns of the source of the HTML file").option("-c --config <path>","The source path of the Master CSS configuration","master.css.*").option("-a --analyze","Analyze injected CSS and HTML size ( brotli ) without writing to file").action(async function(e,o){try{await require("@master/css-renderer/actions/main")(e,o)}catch(t){t.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-renderer** first`:console.error(t)}});c.command("extract").argument("[source paths]","The glob pattern path to extract sources").option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your CSS file output path").option("-v, --verbose","Verbose logging 0~N","1").option("--options <path>","Specify your extractor options sources","master.css-extractor.*").action(async function(e,o){try{await require("@master/css-extractor/actions/main")(e,o)}catch(t){t.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-extractor** first`:console.error(t)}});c.parse();
`;var n=p(require("@techor/log")),l=require("@techor/fs"),{version:v,name:j,description:F}=(0,l.readJSONFileSync)(m.default.resolve(__dirname,"../../package.json")),c=new T.Command;c.name(j).description(F).version(v||"0.0.0");c.command("init").description("Initialize definition files for Master CSS").option("-o, --override","Override existing definition file").option("--esm","ES Module .mjs").option("--ts","TypeScript .ts").option("--cjs","CommonJS .js").action(async function(e){let{esm:o,ts:t,cjs:r}=e;if(!o&&!t&&!r)if(a.default.existsSync("tsconfig.json"))t=!0;else{let{type:i}=(0,l.readJSONFileSync)("./package.json")||{};i==="module"?o=!0:r=!0}let s=(i,f)=>{let u=a.default.existsSync(m.default.join(process.cwd(),i));u?u&&e.override?(a.default.writeFileSync(i,f),n.default.ok`**${i}** file is overridden`):n.default.x`**${i}** file already exists`:(a.default.writeFileSync(i,f),n.default.ok`**${i}** file is created`)};o&&s("master.css.mjs",S),t&&s("master.css.ts",g),r&&s("master.css.js",y)});c.command("render").description("Scans HTML and injects generated CSS rules").argument("<source paths>","The path in glob patterns of the source of the HTML file").option("-c --config <path>","The source path of the Master CSS configuration","master.css.*").option("-a --analyze","Analyze injected CSS and HTML size ( brotli ) without writing to file").action(async function(e,o){try{await require("@master/css-renderer/actions/main")(e,o)}catch(t){t.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-renderer** first`:console.error(t)}});c.command("extract").argument("[source paths]","The glob pattern path to extract sources").option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your CSS file output path").option("-v, --verbose","Verbose logging 0~N","1").option("--options <path>","Specify your extractor options sources","master.css-extractor.*").action(async function(e,o){try{await require("@master/css-extractor/actions/main")(e,o)}catch(t){t.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-extractor** first`:console.error(t)}});c.parse();

@@ -1,130 +0,3 @@

import type { FunctionDefinition } from './';
declare const functions: {
$: {
colored: boolean;
transform(value: any): {
type: string;
name: string;
fallback: string;
}[];
};
calc: FunctionDefinition;
translate: {
unit: string;
};
translateX: {
unit: string;
};
translateY: {
unit: string;
};
translateZ: {
unit: string;
};
translate3d: {
unit: string;
};
skew: {
unit: string;
};
skewX: {
unit: string;
};
skewY: {
unit: string;
};
skewZ: {
unit: string;
};
skew3d: {
unit: string;
};
rotate: {
unit: string;
};
rotateX: {
unit: string;
};
rotateY: {
unit: string;
};
rotateZ: {
unit: string;
};
rotate3d: {
unit: string;
};
blur: {
unit: string;
};
'drop-shadow': {
unit: string;
};
'hue-rotate': {
unit: string;
};
rgb: {
unit: string;
};
rgba: {
unit: string;
};
hsl: {
unit: string;
};
hsla: {
unit: string;
};
color: {
unit: string;
colored: boolean;
};
'color-contrast': {
unit: string;
colored: boolean;
};
'color-mix': {
unit: string;
colored: boolean;
};
hwb: {
unit: string;
};
lab: {
unit: string;
};
lch: {
unit: string;
};
oklab: {
unit: string;
};
oklch: {
unit: string;
};
clamp: {
unit: string;
};
repeat: {
unit: string;
};
'linear-gradient': {
colored: boolean;
};
'radial-gradient': {
colored: boolean;
};
'conic-gradient': {
colored: boolean;
};
'repeating-linear-gradient': {
colored: boolean;
};
'repeating-radial-gradient': {
colored: boolean;
};
'repeating-conic-gradient': {
colored: boolean;
};
};
import type { FunctionDefinitions } from './';
declare const functions: FunctionDefinitions;
export default functions;

@@ -51,3 +51,3 @@ import mediaQueries from './media-queries';

colored?: boolean;
transform?(this: Rule, value: string): string | ValueComponent[];
transform?(this: Rule, value: string, bypassVariableNames: string[]): string | ValueComponent[];
}

@@ -58,5 +58,3 @@ export type FunctionDefinitions = {

export interface Config {
extends?: (Config | {
config: Config;
})[];
extends?: (Config | any)[];
styles?: StyleDefinitions;

@@ -63,0 +61,0 @@ mediaQueries?: MediaQueryDefinitions;

@@ -1,3 +0,4 @@

import { Rule, NativeRule, RuleDefinition } from './rule';
import { Rule, NativeRule, RegisteredRule } from './rule';
import type { Config, AnimationDefinitions } from './config';
import './types/global';
type VariableValue = {

@@ -41,6 +42,6 @@ type: 'string';

readonly ruleBy: Record<string, Rule>;
readonly classesUsage: {};
readonly classesUsage: Record<string, number>;
readonly config: Config;
private readonly semanticRuleOptions;
private readonly ruleDefinitions;
readonly RegisteredSemanticRules: RegisteredRule[];
readonly RegisteredRules: RegisteredRule[];
constructor(customConfig?: Config);

@@ -53,3 +54,3 @@ resolve(): void;

*/
match(syntax: string): RuleDefinition;
match(syntax: string): RegisteredRule | undefined;
/**

@@ -90,14 +91,3 @@ * Create rules from class syntax

}
declare global {
interface Window {
MasterCSS: typeof MasterCSS;
masterCSSs: MasterCSS[];
}
namespace NodeJS {
interface Global {
MasterCSS: typeof MasterCSS;
masterCSSs: MasterCSS[];
}
}
}
export declare const masterCSSs: MasterCSS[];
export {};
export { MasterCSS, MasterCSS as default } from './core';
export { RuntimeCSS } from './runtime';
export { Rule, NativeRule, MediaFeatureComponent, MediaQuery } from './rule';
export { Rule } from './rule';
export type { NativeRule, MediaFeatureComponent, MediaQuery } from './rule';
export { CONFIG_TEXT } from './constants/config-text';

@@ -5,0 +6,0 @@ export { CONFIG_ESM_TEXT } from './constants/config-esm-text';

@@ -6,3 +6,2 @@ import type { MasterCSS, Variable } from './core';

readonly className: string;
readonly definition: RuleDefinition;
css: MasterCSS;

@@ -15,10 +14,9 @@ readonly at: Record<string, string>;

readonly stateToken: string;
readonly declarations: CSSDeclarations;
readonly colored: boolean;
animationNames: string[];
variableNames: string[];
constructor(className: string, definition: RuleDefinition, css: MasterCSS);
resolveValue: (valueComponents: ValueComponent[], unit: string, bypassVariableNames: string[]) => string;
readonly declarations?: CSSDeclarations;
animationNames?: string[];
variableNames?: string[];
constructor(className: string, RegisteredRule: RegisteredRule, css: MasterCSS);
resolveValue: (valueComponents: ValueComponent[], unit: string, bypassVariableNames: string[], bypassParsing: boolean) => string;
get text(): string;
parseValue: (currentValueComponents: ValueComponent[], i: number, value: string, unit: string, endSymbol?: string, parentFunctionName?: any, bypassVariableNames?: string[]) => number;
parseValue: (currentValueComponents: ValueComponent[], i: number, value: string, unit: string, endSymbol: string, parentFunctionName?: string, bypassParsing?: boolean, bypassVariableNames?: string[]) => number;
parseValueComponent(token: string | number, unit?: any): StringValueComponent | NumericValueComponent;

@@ -47,2 +45,3 @@ }

children: ValueComponent[];
bypassTransform?: boolean;
}

@@ -63,25 +62,27 @@ export interface VariableValueComponent {

}
export interface Rule {
prefix?: string;
token?: string;
vendorPrefixSelectors?: Record<string, string[]>;
vendorSuffixSelectors?: Record<string, string[]>;
important?: boolean;
media?: MediaQuery;
direction?: string;
theme?: string;
unitToken?: string;
hasWhere?: boolean;
valueComponents?: Array<ValueComponent>;
constructor: {
match?(name: string, matches: RegExp, colors: Record<string, Record<string, string>>, colorNames: string[]): RuleMeta;
};
export interface Rule extends RegisteredRule {
colored: boolean;
prefix: string;
token: string;
vendorPrefixSelectors: Record<string, string[]>;
vendorSuffixSelectors: Record<string, string[]>;
important: boolean;
media: MediaQuery;
direction: string;
theme: string;
unitToken: string;
hasWhere: boolean;
valueComponents: Array<ValueComponent>;
}
export interface RegisteredRule {
id: string;
match?: RegExp;
variables?: any;
order: number;
definition: RuleDefinition;
}
export interface RuleDefinition {
id?: string;
layer?: Layer;
match?: RegExp | [string, string[]?];
resolvedMatch?: RegExp;
resolvedVariables?: any;
variables?: string[];
order?: number;
separators?: string[];

@@ -94,7 +95,6 @@ shorthand?: string;

declarations?: CSSDeclarations;
layer?: Layer;
analyze?: (this: Rule, className: string) => [valueToken: string, prefixToken?: string];
transformValue?(this: Rule, value: string): string;
transformValueComponents?(this: Rule, valueComponents: ValueComponent[]): ValueComponent[];
declare?(this: Rule, value: string, unit: string): CSSDeclarations;
declare?(this: Rule, value: string): CSSDeclarations;
delete?(this: Rule, className: string): void;

@@ -117,3 +117,3 @@ create?(this: Rule, className: string): void;

token: string;
features?: {
features: {
[key: string]: MediaFeatureComponent;

@@ -123,5 +123,1 @@ };

}
export interface RuleMeta {
value?: [string, string | Record<string, string>];
config?: RuleDefinition;
}
import type { Config } from './config';
declare global {
interface Window {
masterCSSConfig: Config;
}
var masterCSSConfig: Config;
}
import { Config } from './config';
import { MasterCSS } from './core';
import './types/global';
export declare class RuntimeCSS extends MasterCSS {

@@ -9,4 +10,3 @@ root: Document | ShadowRoot | undefined | null;

readonly container: HTMLElement | ShadowRoot;
readonly styleSheets: StyleSheetList;
observer: MutationObserver;
observer?: MutationObserver | null;
constructor(root?: Document | ShadowRoot | undefined | null, customConfig?: Config);

@@ -24,9 +24,2 @@ /**

}
declare global {
interface Window {
RuntimeCSS: typeof RuntimeCSS;
masterCSSConfig: Config;
runtimeCSSs: RuntimeCSS[];
runtimeCSS: RuntimeCSS;
}
}
export declare const runtimeCSSs: RuntimeCSS[];
import { PropertiesHyphen } from 'csstype';
export type CSSDeclarations = {
[key in keyof PropertiesHyphen]?: PropertiesHyphen[key];
[key in keyof PropertiesHyphen]: PropertiesHyphen[key];
} & {
[key: string]: string;
};

@@ -1,1 +0,1 @@

export declare function hexToRgb(hex: string): number[];
export declare function hexToRgb(hex: string): (number | undefined)[];

@@ -1,1 +0,1 @@

export declare function rgbToHex(r: any, g: any, b: any): any;
export declare function rgbToHex(r: number, g: number, b: number): string;

@@ -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/runtime.browser.bundle.js","types":"./dist/index.d.ts","exports":{".":{"browser":{"import":"./dist/index.bundle.mjs","types":"./dist/runtime.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.206","@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.206","csstype":"^3.1.2","puppeteer":"^21.0.1","vite":"^4.2.1"},"version":"2.0.0-beta.206"}
{"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/runtime.browser.bundle.js","types":"./dist/index.d.ts","exports":{".":{"browser":{"import":"./dist/index.bundle.mjs","types":"./dist/runtime.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.207","@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.207","csstype":"^3.1.2","puppeteer":"^21.0.1","vite":"^4.2.1"},"version":"2.0.0-beta.207"}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc