@master/css 2.0.0-beta.164 → 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.
- package/dist/bin/index.bundle.js +9 -9
- package/dist/config/animations.d.ts +8 -0
- package/dist/config/classes.d.ts +3 -0
- package/dist/config/colors.d.ts +4 -23
- package/dist/config/functions.d.ts +3 -1
- package/dist/config/important.d.ts +2 -1
- package/dist/config/index.d.ts +21 -43
- package/dist/config/media-queries.d.ts +3 -0
- package/dist/config/override.d.ts +2 -1
- package/dist/config/root-size.d.ts +2 -1
- package/dist/config/rules.d.ts +274 -263
- package/dist/config/scope.d.ts +2 -1
- package/dist/config/selectors.d.ts +4 -18
- package/dist/config/semantics.d.ts +8 -189
- package/dist/config/theme-driver.d.ts +3 -0
- package/dist/config/values.d.ts +3 -0
- package/dist/config/viewports.d.ts +5 -0
- package/dist/constants/config-esm-text.d.ts +1 -1
- package/dist/constants/config-text.d.ts +1 -1
- package/dist/constants/config-ts-text.d.ts +1 -1
- package/dist/core.d.ts +4 -3
- package/dist/index.browser.bundle.js +1 -1
- package/dist/index.bundle.js +10 -10
- package/dist/index.bundle.mjs +10 -10
- package/dist/rule.d.ts +1 -1
- package/dist/types/css-properties.d.ts +4 -0
- package/dist/utils/camel-2-kebab.d.ts +1 -0
- package/package.json +1 -1
- package/dist/config/breakpoints.d.ts +0 -12
- package/dist/config/keyframes.d.ts +0 -109
- package/dist/config/themeDriver.d.ts +0 -1
package/dist/bin/index.bundle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
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
|
-
|
|
10
|
+
viewports: {},
|
|
11
11
|
mediaQueries: {},
|
|
12
|
-
|
|
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
|
-
|
|
24
|
+
viewports: {},
|
|
25
25
|
mediaQueries: {},
|
|
26
|
-
|
|
26
|
+
animations: {},
|
|
27
27
|
selectors: {},
|
|
28
28
|
functions: {}
|
|
29
29
|
}
|
|
30
|
-
`;var
|
|
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
|
-
|
|
39
|
+
viewports: {},
|
|
40
40
|
mediaQueries: {},
|
|
41
|
-
|
|
41
|
+
animations: {},
|
|
42
42
|
selectors: {},
|
|
43
43
|
functions: {}
|
|
44
44
|
} as Config
|
|
45
|
-
`;var n=p(require("@techor/log")),l=require("@techor/fs"),{version:
|
|
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();
|
package/dist/config/colors.d.ts
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
declare const important = false;
|
|
2
|
+
export default important;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,59 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
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';
|
|
13
16
|
declare const config: Config;
|
|
14
|
-
export { config,
|
|
15
|
-
import type { RuleConfig } from '../rule';
|
|
16
|
-
type Classes = {
|
|
17
|
-
[key: string]: string | Classes;
|
|
18
|
-
};
|
|
19
|
-
export type Colors = {
|
|
20
|
-
[key: string]: string | Colors;
|
|
21
|
-
};
|
|
22
|
-
type Breakpoints = {
|
|
23
|
-
[key: string]: number | Breakpoints;
|
|
24
|
-
};
|
|
25
|
-
type MediaQueries = {
|
|
26
|
-
[key: string]: string | MediaQueries;
|
|
27
|
-
};
|
|
28
|
-
type Selectors = {
|
|
29
|
-
[key: string]: string | string[] | Selectors;
|
|
30
|
-
};
|
|
31
|
-
type SemanticsBase = {
|
|
32
|
-
[key: string]: string | number | SemanticsBase;
|
|
33
|
-
};
|
|
34
|
-
type Semantics = {
|
|
35
|
-
[key: string]: SemanticsBase;
|
|
36
|
-
};
|
|
37
|
-
export type Values = {
|
|
38
|
-
[key: string]: string | number | Values;
|
|
39
|
-
};
|
|
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 };
|
|
40
18
|
export interface Config {
|
|
41
19
|
extends?: (Config | {
|
|
42
20
|
config: Config;
|
|
43
21
|
})[];
|
|
44
22
|
classes?: Classes;
|
|
45
23
|
colors?: Colors;
|
|
46
|
-
|
|
24
|
+
viewports?: Viewports;
|
|
47
25
|
mediaQueries?: MediaQueries;
|
|
48
26
|
selectors?: Selectors;
|
|
49
27
|
semantics?: Semantics;
|
|
50
28
|
values?: Values;
|
|
51
|
-
rules?:
|
|
29
|
+
rules?: Rules;
|
|
52
30
|
rootSize?: number;
|
|
53
31
|
scope?: string;
|
|
54
32
|
important?: boolean;
|
|
55
33
|
override?: boolean;
|
|
56
|
-
functions?:
|
|
57
|
-
|
|
58
|
-
themeDriver?:
|
|
34
|
+
functions?: Functions;
|
|
35
|
+
animations?: Animations;
|
|
36
|
+
themeDriver?: ThemeDriver;
|
|
59
37
|
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const override = false;
|
|
2
|
+
export default override;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const rootSize = 16;
|
|
2
|
+
export default rootSize;
|