@master/css 2.0.0-beta.206 → 2.0.0-beta.207
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 +4 -4
- package/dist/config/functions.d.ts +2 -129
- package/dist/config/index.d.ts +2 -4
- package/dist/core.d.ts +7 -17
- package/dist/index.bundle.js +4 -4
- package/dist/index.bundle.mjs +4 -4
- package/dist/index.d.ts +2 -1
- package/dist/rule.d.ts +30 -34
- package/dist/runtime.browser.bundle.js +1 -1
- package/dist/runtime.browser.d.ts +1 -3
- package/dist/runtime.d.ts +3 -10
- package/dist/types/css-declarations.d.ts +3 -1
- package/dist/types/global.d.ts +11 -0
- package/dist/utils/hex-to-rgb.d.ts +1 -1
- package/dist/utils/rgb-to-hex.d.ts +1 -1
- package/package.json +1 -1
- package/dist/variables.d.ts +0 -113
package/dist/bin/index.bundle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
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} */
|
|
2
|
+
"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} */
|
|
3
3
|
export default {
|
|
4
4
|
styles: {},
|
|
5
5
|
rules: {},
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
selectors: {},
|
|
11
11
|
functions: {}
|
|
12
12
|
}
|
|
13
|
-
`;var
|
|
13
|
+
`;var y=`/** @type {import('@master/css').Config} */
|
|
14
14
|
module.exports = {
|
|
15
15
|
styles: {},
|
|
16
16
|
rules: {},
|
|
@@ -21,7 +21,7 @@ module.exports = {
|
|
|
21
21
|
selectors: {},
|
|
22
22
|
functions: {}
|
|
23
23
|
}
|
|
24
|
-
`;var
|
|
24
|
+
`;var g=`import type { Config } from '@master/css'
|
|
25
25
|
|
|
26
26
|
export default {
|
|
27
27
|
styles: {},
|
|
@@ -33,4 +33,4 @@ export default {
|
|
|
33
33
|
selectors: {},
|
|
34
34
|
functions: {}
|
|
35
35
|
} as Config
|
|
36
|
-
`;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",
|
|
36
|
+
`;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 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const functions:
|
|
3
|
-
$: {
|
|
4
|
-
colored: boolean;
|
|
5
|
-
transform(value: any): {
|
|
6
|
-
type: string;
|
|
7
|
-
name: string;
|
|
8
|
-
fallback: string;
|
|
9
|
-
}[];
|
|
10
|
-
};
|
|
11
|
-
calc: FunctionDefinition;
|
|
12
|
-
translate: {
|
|
13
|
-
unit: string;
|
|
14
|
-
};
|
|
15
|
-
translateX: {
|
|
16
|
-
unit: string;
|
|
17
|
-
};
|
|
18
|
-
translateY: {
|
|
19
|
-
unit: string;
|
|
20
|
-
};
|
|
21
|
-
translateZ: {
|
|
22
|
-
unit: string;
|
|
23
|
-
};
|
|
24
|
-
translate3d: {
|
|
25
|
-
unit: string;
|
|
26
|
-
};
|
|
27
|
-
skew: {
|
|
28
|
-
unit: string;
|
|
29
|
-
};
|
|
30
|
-
skewX: {
|
|
31
|
-
unit: string;
|
|
32
|
-
};
|
|
33
|
-
skewY: {
|
|
34
|
-
unit: string;
|
|
35
|
-
};
|
|
36
|
-
skewZ: {
|
|
37
|
-
unit: string;
|
|
38
|
-
};
|
|
39
|
-
skew3d: {
|
|
40
|
-
unit: string;
|
|
41
|
-
};
|
|
42
|
-
rotate: {
|
|
43
|
-
unit: string;
|
|
44
|
-
};
|
|
45
|
-
rotateX: {
|
|
46
|
-
unit: string;
|
|
47
|
-
};
|
|
48
|
-
rotateY: {
|
|
49
|
-
unit: string;
|
|
50
|
-
};
|
|
51
|
-
rotateZ: {
|
|
52
|
-
unit: string;
|
|
53
|
-
};
|
|
54
|
-
rotate3d: {
|
|
55
|
-
unit: string;
|
|
56
|
-
};
|
|
57
|
-
blur: {
|
|
58
|
-
unit: string;
|
|
59
|
-
};
|
|
60
|
-
'drop-shadow': {
|
|
61
|
-
unit: string;
|
|
62
|
-
};
|
|
63
|
-
'hue-rotate': {
|
|
64
|
-
unit: string;
|
|
65
|
-
};
|
|
66
|
-
rgb: {
|
|
67
|
-
unit: string;
|
|
68
|
-
};
|
|
69
|
-
rgba: {
|
|
70
|
-
unit: string;
|
|
71
|
-
};
|
|
72
|
-
hsl: {
|
|
73
|
-
unit: string;
|
|
74
|
-
};
|
|
75
|
-
hsla: {
|
|
76
|
-
unit: string;
|
|
77
|
-
};
|
|
78
|
-
color: {
|
|
79
|
-
unit: string;
|
|
80
|
-
colored: boolean;
|
|
81
|
-
};
|
|
82
|
-
'color-contrast': {
|
|
83
|
-
unit: string;
|
|
84
|
-
colored: boolean;
|
|
85
|
-
};
|
|
86
|
-
'color-mix': {
|
|
87
|
-
unit: string;
|
|
88
|
-
colored: boolean;
|
|
89
|
-
};
|
|
90
|
-
hwb: {
|
|
91
|
-
unit: string;
|
|
92
|
-
};
|
|
93
|
-
lab: {
|
|
94
|
-
unit: string;
|
|
95
|
-
};
|
|
96
|
-
lch: {
|
|
97
|
-
unit: string;
|
|
98
|
-
};
|
|
99
|
-
oklab: {
|
|
100
|
-
unit: string;
|
|
101
|
-
};
|
|
102
|
-
oklch: {
|
|
103
|
-
unit: string;
|
|
104
|
-
};
|
|
105
|
-
clamp: {
|
|
106
|
-
unit: string;
|
|
107
|
-
};
|
|
108
|
-
repeat: {
|
|
109
|
-
unit: string;
|
|
110
|
-
};
|
|
111
|
-
'linear-gradient': {
|
|
112
|
-
colored: boolean;
|
|
113
|
-
};
|
|
114
|
-
'radial-gradient': {
|
|
115
|
-
colored: boolean;
|
|
116
|
-
};
|
|
117
|
-
'conic-gradient': {
|
|
118
|
-
colored: boolean;
|
|
119
|
-
};
|
|
120
|
-
'repeating-linear-gradient': {
|
|
121
|
-
colored: boolean;
|
|
122
|
-
};
|
|
123
|
-
'repeating-radial-gradient': {
|
|
124
|
-
colored: boolean;
|
|
125
|
-
};
|
|
126
|
-
'repeating-conic-gradient': {
|
|
127
|
-
colored: boolean;
|
|
128
|
-
};
|
|
129
|
-
};
|
|
1
|
+
import type { FunctionDefinitions } from './';
|
|
2
|
+
declare const functions: FunctionDefinitions;
|
|
130
3
|
export default functions;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -48,15 +48,13 @@ export type SemanticDefinitions = {
|
|
|
48
48
|
export interface FunctionDefinition {
|
|
49
49
|
unit?: string;
|
|
50
50
|
colored?: boolean;
|
|
51
|
-
transform?(this: Rule, value: string): string | ValueComponent[];
|
|
51
|
+
transform?(this: Rule, value: string, bypassVariableNames: string[]): string | ValueComponent[];
|
|
52
52
|
}
|
|
53
53
|
export type FunctionDefinitions = {
|
|
54
54
|
[key: string]: FunctionDefinition;
|
|
55
55
|
};
|
|
56
56
|
export interface Config {
|
|
57
|
-
extends?: (Config |
|
|
58
|
-
config: Config;
|
|
59
|
-
})[];
|
|
57
|
+
extends?: (Config | any)[];
|
|
60
58
|
styles?: StyleDefinitions;
|
|
61
59
|
mediaQueries?: MediaQueryDefinitions;
|
|
62
60
|
selectors?: SelectorDefinitions;
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Rule, NativeRule,
|
|
1
|
+
import { Rule, NativeRule, RegisteredRule } from './rule';
|
|
2
2
|
import type { Config, AnimationDefinitions } from './config';
|
|
3
|
+
import './types/global';
|
|
3
4
|
type VariableValue = {
|
|
4
5
|
type: 'string';
|
|
5
6
|
value: string;
|
|
@@ -38,10 +39,10 @@ export declare class MasterCSS {
|
|
|
38
39
|
static config: Config;
|
|
39
40
|
readonly rules: Rule[];
|
|
40
41
|
readonly ruleBy: Record<string, Rule>;
|
|
41
|
-
readonly classesUsage:
|
|
42
|
+
readonly classesUsage: Record<string, number>;
|
|
42
43
|
readonly config: Config;
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
readonly RegisteredSemanticRules: RegisteredRule[];
|
|
45
|
+
readonly RegisteredRules: RegisteredRule[];
|
|
45
46
|
constructor(customConfig?: Config);
|
|
46
47
|
resolve(): void;
|
|
47
48
|
/**
|
|
@@ -49,7 +50,7 @@ export declare class MasterCSS {
|
|
|
49
50
|
* @param syntax class syntax
|
|
50
51
|
* @returns css text
|
|
51
52
|
*/
|
|
52
|
-
match(syntax: string):
|
|
53
|
+
match(syntax: string): RegisteredRule | undefined;
|
|
53
54
|
/**
|
|
54
55
|
* Create rules from class syntax
|
|
55
56
|
* @param syntax class syntax
|
|
@@ -85,16 +86,5 @@ export declare class MasterCSS {
|
|
|
85
86
|
handleRuleWithVariableNames(rule: Rule, initializing?: boolean): void;
|
|
86
87
|
pushVariableNativeRule(theme: string, variableCSSRule: CSSStyleRule): NativeRule;
|
|
87
88
|
}
|
|
88
|
-
declare
|
|
89
|
-
interface Window {
|
|
90
|
-
MasterCSS: typeof MasterCSS;
|
|
91
|
-
masterCSSs: MasterCSS[];
|
|
92
|
-
}
|
|
93
|
-
namespace NodeJS {
|
|
94
|
-
interface Global {
|
|
95
|
-
MasterCSS: typeof MasterCSS;
|
|
96
|
-
masterCSSs: MasterCSS[];
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
89
|
+
export declare const masterCSSs: MasterCSS[];
|
|
100
90
|
export {};
|