@master/css 2.0.0-beta.165 → 2.0.0-beta.166

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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var T=Object.create;var d=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var O=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _(t))!E.call(e,o)&&o!==s&&d(e,o,{get:()=>t[o],enumerable:!(i=C(t,o))||i.enumerable});return e};var p=(e,t,s)=>(s=e!=null?T(x(e)):{},O(t||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var h=require("commander"),m=p(require("path")),c=p(require("fs"));var S=`/** @type {import('@master/css').Config} */
2
+ var y=Object.create;var d=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var E=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _(t))!x.call(e,o)&&o!==s&&d(e,o,{get:()=>t[o],enumerable:!(i=C(t,o))||i.enumerable});return e};var p=(e,t,s)=>(s=e!=null?y(v(e)):{},E(t||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var T=require("commander"),m=p(require("path")),c=p(require("fs"));var S=`/** @type {import('@master/css').Config} */
3
3
  export default {
4
4
  classes: {},
5
5
  colors: {},
@@ -7,9 +7,9 @@ export default {
7
7
  rules: {},
8
8
  values: {},
9
9
  semantics: {},
10
- breakpoints: {},
10
+ viewports: {},
11
11
  mediaQueries: {},
12
- keyframes: {},
12
+ animations: {},
13
13
  selectors: {},
14
14
  functions: {}
15
15
  }
@@ -21,13 +21,13 @@ module.exports = {
21
21
  rules: {},
22
22
  values: {},
23
23
  semantics: {},
24
- breakpoints: {},
24
+ viewports: {},
25
25
  mediaQueries: {},
26
- keyframes: {},
26
+ animations: {},
27
27
  selectors: {},
28
28
  functions: {}
29
29
  }
30
- `;var y=`import type { Config } from '@master/css'
30
+ `;var h=`import type { Config } from '@master/css'
31
31
 
32
32
  export default {
33
33
  classes: {},
@@ -36,10 +36,10 @@ export default {
36
36
  rules: {},
37
37
  values: {},
38
38
  semantics: {},
39
- breakpoints: {},
39
+ viewports: {},
40
40
  mediaQueries: {},
41
- keyframes: {},
41
+ animations: {},
42
42
  selectors: {},
43
43
  functions: {}
44
44
  } as Config
45
- `;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")),a=new h.Command;a.name(j).description(F).version(v||"0.0.0");a.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:t,ts:s,cjs:i}=e;if(!t&&!s&&!i)if(c.default.existsSync("tsconfig.json"))s=!0;else{let{type:r}=(0,l.readJSONFileSync)("./package.json")||{};r==="module"?t=!0:i=!0}let o=(r,f)=>{let u=c.default.existsSync(m.default.join(process.cwd(),r));u?u&&e.override?(c.default.writeFileSync(r,f),n.default.ok`**${r}** file is overridden`):n.default.x`**${r}** file already exists`:(c.default.writeFileSync(r,f),n.default.ok`**${r}** file is created`)};t&&o("master.css.mjs",S),s&&o("master.css.ts",y),i&&o("master.css.js",g)});a.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","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,t){try{await require("@master/css-renderer/actions/main")(e,t)}catch(s){s.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-renderer** first`:console.error(s)}});a.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,t){try{await require("@master/css-extractor/actions/main")(e,t)}catch(s){s.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-extractor** first`:console.error(s)}});a.parse();
45
+ `;var n=p(require("@techor/log")),l=require("@techor/fs"),{version:O,name:w,description:j}=(0,l.readJSONFileSync)(m.default.resolve(__dirname,"../../package.json")),a=new T.Command;a.name(w).description(j).version(O||"0.0.0");a.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:t,ts:s,cjs:i}=e;if(!t&&!s&&!i)if(c.default.existsSync("tsconfig.json"))s=!0;else{let{type:r}=(0,l.readJSONFileSync)("./package.json")||{};r==="module"?t=!0:i=!0}let o=(r,f)=>{let u=c.default.existsSync(m.default.join(process.cwd(),r));u?u&&e.override?(c.default.writeFileSync(r,f),n.default.ok`**${r}** file is overridden`):n.default.x`**${r}** file already exists`:(c.default.writeFileSync(r,f),n.default.ok`**${r}** file is created`)};t&&o("master.css.mjs",S),s&&o("master.css.ts",h),i&&o("master.css.js",g)});a.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","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,t){try{await require("@master/css-renderer/actions/main")(e,t)}catch(s){s.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-renderer** first`:console.error(s)}});a.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,t){try{await require("@master/css-extractor/actions/main")(e,t)}catch(s){s.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-extractor** first`:console.error(s)}});a.parse();
@@ -0,0 +1,8 @@
1
+ import type { CSSProperties } from '../types/css-properties';
2
+ declare const animations: Animations;
3
+ export default animations;
4
+ export type Animations = Record<string, {
5
+ [key in 'from' | 'to']?: CSSProperties;
6
+ } & {
7
+ [key: string]: CSSProperties;
8
+ }>;
@@ -0,0 +1,3 @@
1
+ export type Classes = {
2
+ [key: string]: string | Classes;
3
+ };
@@ -1,24 +1,5 @@
1
- export declare const colors: {
2
- black: string;
3
- white: string;
4
- slate: any;
5
- gray: any;
6
- brown: any;
7
- orange: any;
8
- gold: any;
9
- yellow: any;
10
- grass: any;
11
- green: any;
12
- beryl: any;
13
- teal: any;
14
- cyan: any;
15
- sky: any;
16
- blue: any;
17
- indigo: any;
18
- violet: any;
19
- purple: any;
20
- fuchsia: any;
21
- pink: any;
22
- crimson: any;
23
- red: any;
1
+ declare const colors: Colors;
2
+ export default colors;
3
+ export type Colors = {
4
+ [key: string]: string | Colors;
24
5
  };
@@ -1,7 +1,9 @@
1
1
  import { Rule } from '../rule';
2
- export declare const functions: Record<string, FunctionConfig>;
2
+ declare const functions: Functions;
3
+ export default functions;
3
4
  export interface FunctionConfig {
4
5
  unit?: string;
5
6
  name?: string;
6
7
  transform?(this: Rule, value: string): string;
7
8
  }
9
+ export type Functions = Record<string, FunctionConfig>;
@@ -1 +1,2 @@
1
- export declare const important = false;
1
+ declare const important = false;
2
+ export default important;
@@ -1,68 +1,37 @@
1
- import { breakpoints } from './breakpoints';
2
- import { colors } from './colors';
3
- import { rootSize } from './root-size';
4
- import { scope } from './scope';
5
- import { selectors } from './selectors';
6
- import { semantics } from './semantics';
7
- import { rules } from './rules';
8
- import { override } from './override';
9
- import { important } from './important';
10
- import { keyframes } from './keyframes';
11
- import { functions, FunctionConfig } from './functions';
12
- import { themeDriver } from './themeDriver';
13
- import type { Properties } from 'csstype';
1
+ import viewports, { type Viewports } from './viewports';
2
+ import colors, { type Colors } from './colors';
3
+ import selectors, { type Selectors } from './selectors';
4
+ import semantics, { type Semantics } from './semantics';
5
+ import animations, { type Animations } from './animations';
6
+ import rules, { type Rules } from './rules';
7
+ import functions, { type Functions } from './functions';
8
+ import rootSize from './root-size';
9
+ import scope from './scope';
10
+ import override from './override';
11
+ import important from './important';
12
+ import themeDriver, { type ThemeDriver } from './theme-driver';
13
+ import type { MediaQueries } from './media-queries';
14
+ import type { Values } from './values';
15
+ import type { Classes } from './classes';
14
16
  declare const config: Config;
15
- export { config, breakpoints, colors, rootSize, scope, selectors, semantics, rules, override, important, functions, keyframes, themeDriver };
16
- import type { RuleConfig } from '../rule';
17
- type CSS = {
18
- [key in keyof Properties]?: Properties[key];
19
- };
20
- type Classes = {
21
- [key: string]: string | Classes;
22
- };
23
- export type Colors = {
24
- [key: string]: string | Colors;
25
- };
26
- type Breakpoints = {
27
- [key: string]: number | Breakpoints;
28
- };
29
- type MediaQueries = {
30
- [key: string]: string | MediaQueries;
31
- };
32
- type Selectors = {
33
- [key: string]: string | string[] | Selectors;
34
- };
35
- type SemanticsBase = CSS | {
36
- [key: string]: SemanticsBase;
37
- };
38
- export type Semantics = {
39
- [key: string]: SemanticsBase;
40
- };
41
- export type Values = {
42
- [key: string]: string | number | Values;
43
- };
44
- export type Keyframes = Record<string, {
45
- [key in 'from' | 'to']?: CSS;
46
- } & {
47
- [key: string]: CSS;
48
- }>;
17
+ export { config, viewports, colors, rootSize, scope, selectors, semantics, rules, override, important, functions, animations, themeDriver, Viewports, Colors, MediaQueries, Values, Classes, Selectors, Semantics, Rules, Functions, Animations, ThemeDriver };
49
18
  export interface Config {
50
19
  extends?: (Config | {
51
20
  config: Config;
52
21
  })[];
53
22
  classes?: Classes;
54
23
  colors?: Colors;
55
- breakpoints?: Breakpoints;
24
+ viewports?: Viewports;
56
25
  mediaQueries?: MediaQueries;
57
26
  selectors?: Selectors;
58
27
  semantics?: Semantics;
59
28
  values?: Values;
60
- rules?: Record<string, RuleConfig>;
29
+ rules?: Rules;
61
30
  rootSize?: number;
62
31
  scope?: string;
63
32
  important?: boolean;
64
33
  override?: boolean;
65
- functions?: Record<string, FunctionConfig>;
66
- keyframes?: Keyframes;
67
- themeDriver?: 'class' | 'media' | 'host';
34
+ functions?: Functions;
35
+ animations?: Animations;
36
+ themeDriver?: ThemeDriver;
68
37
  }
@@ -0,0 +1,3 @@
1
+ export type MediaQueries = {
2
+ [key: string]: string | MediaQueries;
3
+ };
@@ -1 +1,2 @@
1
- export declare const override = false;
1
+ declare const override = false;
2
+ export default override;
@@ -1 +1,2 @@
1
- export declare const rootSize = 16;
1
+ declare const rootSize = 16;
2
+ export default rootSize;