@master/css 2.0.0-rc.68 → 2.0.0-rc.69
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/common.cjs +0 -2
- package/dist/common.d.ts +0 -1
- package/dist/common.mjs +1 -2
- package/dist/config/functions.cjs +9 -243
- package/dist/config/functions.d.ts +137 -2
- package/dist/config/functions.mjs +9 -243
- package/dist/config/index.cjs +2 -2
- package/dist/config/index.mjs +2 -2
- package/dist/config/modes.cjs +307 -3
- package/dist/config/modes.d.ts +306 -2
- package/dist/config/modes.mjs +307 -3
- package/dist/config/rules.cjs +740 -782
- package/dist/config/rules.d.ts +692 -683
- package/dist/config/rules.mjs +741 -783
- package/dist/config/utilities.cjs +328 -97
- package/dist/config/utilities.d.ts +247 -16
- package/dist/config/utilities.mjs +328 -97
- package/dist/config/variables.cjs +88 -460
- package/dist/config/variables.d.ts +358 -369
- package/dist/config/variables.mjs +88 -460
- package/dist/core.cjs +234 -234
- package/dist/core.d.ts +5 -3
- package/dist/core.mjs +234 -234
- package/dist/create.cjs +10 -0
- package/dist/create.d.ts +3 -0
- package/dist/create.mjs +8 -0
- package/dist/declarers/core.group.cjs +99 -0
- package/dist/declarers/core.group.d.ts +2 -0
- package/dist/declarers/core.group.mjs +97 -0
- package/dist/declarers/core.variable.cjs +9 -0
- package/dist/declarers/core.variable.d.ts +4 -0
- package/dist/declarers/core.variable.mjs +7 -0
- package/dist/declarers/index.cjs +13 -0
- package/dist/declarers/index.d.ts +10 -0
- package/dist/declarers/index.mjs +11 -0
- package/dist/declarers/pair.cjs +12 -0
- package/dist/declarers/pair.d.ts +4 -0
- package/dist/declarers/pair.mjs +10 -0
- package/dist/factories/with-syntax-layer.cjs +0 -2
- package/dist/factories/with-syntax-layer.mjs +0 -2
- package/dist/function-transformers/core.calc.cjs +225 -0
- package/dist/function-transformers/core.calc.d.ts +2 -0
- package/dist/function-transformers/core.calc.mjs +223 -0
- package/dist/function-transformers/core.variable.cjs +23 -0
- package/dist/function-transformers/core.variable.d.ts +7 -0
- package/dist/function-transformers/core.variable.mjs +21 -0
- package/dist/function-transformers/index.cjs +11 -0
- package/dist/function-transformers/index.d.ts +8 -0
- package/dist/function-transformers/index.mjs +9 -0
- package/dist/index.cjs +10 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.mjs +6 -1
- package/dist/layer.cjs +2 -4
- package/dist/layer.mjs +2 -4
- package/dist/non-layer.cjs +2 -4
- package/dist/non-layer.mjs +2 -4
- package/dist/syntax-rule-type.cjs +8 -7
- package/dist/syntax-rule-type.d.ts +7 -7
- package/dist/syntax-rule-type.mjs +8 -7
- package/dist/syntax-rule.cjs +305 -258
- package/dist/syntax-rule.d.ts +2 -2
- package/dist/syntax-rule.mjs +306 -259
- package/dist/{utils/autofill-solid-style.cjs → transformers/auto-fill-solid.cjs} +3 -3
- package/dist/transformers/auto-fill-solid.d.ts +2 -0
- package/dist/{utils/autofill-solid-style.mjs → transformers/auto-fill-solid.mjs} +3 -3
- package/dist/transformers/index.cjs +9 -0
- package/dist/transformers/index.d.ts +6 -0
- package/dist/transformers/index.mjs +7 -0
- package/dist/types/common.d.ts +0 -2
- package/dist/types/config.d.ts +24 -20
- package/dist/types/syntax.d.ts +10 -8
- package/dist/utils/equal-selectors.cjs +1 -2
- package/dist/utils/equal-selectors.mjs +1 -2
- package/dist/utils/extend-config.cjs +83 -44
- package/dist/utils/extend-config.d.ts +10 -1
- package/dist/utils/extend-config.mjs +83 -44
- package/dist/utils/flatten-meta-object.cjs +38 -0
- package/dist/utils/flatten-meta-object.d.ts +13 -0
- package/dist/utils/flatten-meta-object.mjs +36 -0
- package/dist/utils/flatten-object.cjs +13 -9
- package/dist/utils/flatten-object.d.ts +1 -1
- package/dist/utils/flatten-object.mjs +13 -9
- package/dist/utils/generate-css.cjs +2 -2
- package/dist/utils/generate-css.d.ts +1 -2
- package/dist/utils/generate-css.mjs +2 -2
- package/dist/utils/minify-extended-config.cjs +64 -0
- package/dist/utils/minify-extended-config.d.ts +9 -0
- package/dist/utils/minify-extended-config.mjs +62 -0
- package/dist/utils/nest-meta-object.cjs +25 -0
- package/dist/utils/nest-meta-object.d.ts +7 -0
- package/dist/utils/nest-meta-object.mjs +23 -0
- package/dist/utils/parse-at.cjs +1 -2
- package/dist/utils/parse-at.d.ts +2 -2
- package/dist/utils/parse-at.mjs +1 -2
- package/dist/utils/parse-pair.cjs +3 -6
- package/dist/utils/parse-pair.mjs +3 -6
- package/dist/utils/parse-selector.cjs +2 -4
- package/dist/utils/parse-selector.d.ts +2 -2
- package/dist/utils/parse-selector.mjs +2 -4
- package/dist/utils/sort-readable-classes.cjs +2 -2
- package/dist/utils/sort-readable-classes.d.ts +1 -2
- package/dist/utils/sort-readable-classes.mjs +2 -2
- package/dist/variable-rule.cjs +35 -29
- package/dist/variable-rule.d.ts +16 -6
- package/dist/variable-rule.mjs +35 -29
- package/package.json +1 -1
- package/dist/utils/autofill-solid-style.d.ts +0 -3
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import functions from '../config/functions.mjs';
|
|
2
|
+
import { BASE_UNIT_REGEX } from '../common.mjs';
|
|
3
|
+
|
|
4
|
+
function coreCalc(value, bypassVariableNames) {
|
|
5
|
+
const valueComponents = [];
|
|
6
|
+
let i = 0;
|
|
7
|
+
const anaylzeDeeply = (currentValueComponents, bypassHandlingSeparator, parentBypassParsing, parentUnitChecking, isVarFunction)=>{
|
|
8
|
+
const isChildHandler = valueComponents !== currentValueComponents;
|
|
9
|
+
const unparsedValueComponents = [];
|
|
10
|
+
let bypassParsing = false;
|
|
11
|
+
let hasUnit = false;
|
|
12
|
+
let currentHasUnit = false;
|
|
13
|
+
let unitChecking = false;
|
|
14
|
+
let childHasUnit = undefined;
|
|
15
|
+
let current = '';
|
|
16
|
+
const clear = (separator, prefix = '', suffix = '')=>{
|
|
17
|
+
if (childHasUnit === false && separator !== ' ' && this.definition.unit) {
|
|
18
|
+
childHasUnit = undefined;
|
|
19
|
+
if (!unitChecking) {
|
|
20
|
+
pushUnitValueComponents();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (current) {
|
|
24
|
+
if (!isVarFunction) {
|
|
25
|
+
const result = BASE_UNIT_REGEX.exec(current);
|
|
26
|
+
if (result) {
|
|
27
|
+
current = (+result[1] * (this.css.config.baseUnit ?? 1)).toString();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (!bypassParsing && !parentBypassParsing) {
|
|
31
|
+
const valueComponent = {
|
|
32
|
+
...this.parseValue(current),
|
|
33
|
+
token: current
|
|
34
|
+
};
|
|
35
|
+
if (!hasUnit && isNaN(+current) && valueComponent.type === 'number') {
|
|
36
|
+
hasUnit = true;
|
|
37
|
+
}
|
|
38
|
+
if (unitChecking) {
|
|
39
|
+
if (isNaN(+current)) {
|
|
40
|
+
if (valueComponent.type === 'number') {
|
|
41
|
+
currentValueComponents.push(valueComponent);
|
|
42
|
+
currentHasUnit = true;
|
|
43
|
+
} else {
|
|
44
|
+
currentValueComponents.push(valueComponent);
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
currentValueComponents.push({
|
|
48
|
+
type: 'number',
|
|
49
|
+
value: +current,
|
|
50
|
+
token: current
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
if (isChildHandler) {
|
|
55
|
+
const newValueComponent = {
|
|
56
|
+
type: 'string',
|
|
57
|
+
value: current,
|
|
58
|
+
token: current
|
|
59
|
+
};
|
|
60
|
+
unparsedValueComponents.push(newValueComponent);
|
|
61
|
+
currentValueComponents.push(newValueComponent);
|
|
62
|
+
} else {
|
|
63
|
+
currentValueComponents.push(valueComponent);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
currentValueComponents.push({
|
|
68
|
+
type: 'string',
|
|
69
|
+
value: current,
|
|
70
|
+
token: current
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
current = '';
|
|
74
|
+
}
|
|
75
|
+
if (separator) {
|
|
76
|
+
if (separator === '+' || separator === '-') {
|
|
77
|
+
handleUnitChecking();
|
|
78
|
+
}
|
|
79
|
+
if (prefix && value[i - 1] === ' ') {
|
|
80
|
+
prefix = '';
|
|
81
|
+
}
|
|
82
|
+
if (suffix && value[i + 1] === ' ') {
|
|
83
|
+
suffix = '';
|
|
84
|
+
}
|
|
85
|
+
if (bypassHandlingSeparator) {
|
|
86
|
+
currentValueComponents.push({
|
|
87
|
+
type: 'separator',
|
|
88
|
+
value: separator,
|
|
89
|
+
text: separator,
|
|
90
|
+
token: separator
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
currentValueComponents.push({
|
|
94
|
+
type: 'separator',
|
|
95
|
+
value: separator,
|
|
96
|
+
text: prefix + separator + suffix,
|
|
97
|
+
token: separator
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
bypassParsing = false;
|
|
102
|
+
};
|
|
103
|
+
const pushUnitValueComponents = ()=>{
|
|
104
|
+
if (this.definition.unit === 'rem' || this.definition.unit === 'em') {
|
|
105
|
+
currentValueComponents.push({
|
|
106
|
+
type: 'separator',
|
|
107
|
+
value: '/',
|
|
108
|
+
text: ' / ',
|
|
109
|
+
token: '/'
|
|
110
|
+
}, {
|
|
111
|
+
type: 'number',
|
|
112
|
+
value: this.css.config.rootSize,
|
|
113
|
+
token: String(this.css.config.rootSize)
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
currentValueComponents.push({
|
|
117
|
+
type: 'separator',
|
|
118
|
+
value: '*',
|
|
119
|
+
text: ' * ',
|
|
120
|
+
token: '*'
|
|
121
|
+
}, {
|
|
122
|
+
type: 'number',
|
|
123
|
+
value: 1,
|
|
124
|
+
unit: this.definition.unit,
|
|
125
|
+
token: this.definition.unit
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const handleUnitChecking = ()=>{
|
|
129
|
+
if (unitChecking && !currentHasUnit && !parentUnitChecking && (!isChildHandler || hasUnit)) {
|
|
130
|
+
pushUnitValueComponents();
|
|
131
|
+
}
|
|
132
|
+
unitChecking = false;
|
|
133
|
+
currentHasUnit = false;
|
|
134
|
+
};
|
|
135
|
+
for(; i < value.length; i++){
|
|
136
|
+
const char = value[i];
|
|
137
|
+
if (char === '(') {
|
|
138
|
+
const symbolResult = /^([+-])/.exec(current);
|
|
139
|
+
if (symbolResult) {
|
|
140
|
+
currentValueComponents.push({
|
|
141
|
+
type: 'string',
|
|
142
|
+
value: symbolResult[1],
|
|
143
|
+
token: symbolResult[1]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const functionName = symbolResult ? current.slice(1) : current;
|
|
147
|
+
const newValueComponent = {
|
|
148
|
+
type: 'function',
|
|
149
|
+
name: functionName,
|
|
150
|
+
symbol: char,
|
|
151
|
+
children: [],
|
|
152
|
+
bypassTransform: functionName === 'calc',
|
|
153
|
+
token: current
|
|
154
|
+
};
|
|
155
|
+
currentValueComponents.push(newValueComponent);
|
|
156
|
+
current = '';
|
|
157
|
+
i++;
|
|
158
|
+
const isVarFunction = functionName === '$' || functionName === 'var';
|
|
159
|
+
childHasUnit = anaylzeDeeply(newValueComponent.children, functionName !== '' && functionName !== 'calc' && (isVarFunction || Object.prototype.hasOwnProperty.call(functions, functionName)), bypassParsing || isVarFunction || unitChecking && currentHasUnit, unitChecking, isVarFunction) || functionName === 'var';
|
|
160
|
+
if (!childHasUnit && functionName === '$') {
|
|
161
|
+
const variableType = this.css.variables.get(newValueComponent.children[0].value)?.type;
|
|
162
|
+
childHasUnit = !variableType || variableType === 'string';
|
|
163
|
+
}
|
|
164
|
+
if (childHasUnit) {
|
|
165
|
+
hasUnit = true;
|
|
166
|
+
currentHasUnit = true;
|
|
167
|
+
}
|
|
168
|
+
} else if (char === ')') {
|
|
169
|
+
clear('');
|
|
170
|
+
if (hasUnit) {
|
|
171
|
+
for (const eachUnparsedValueComponent of unparsedValueComponents){
|
|
172
|
+
Object.assign(eachUnparsedValueComponent, this.parseValue(eachUnparsedValueComponent.value));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return hasUnit;
|
|
176
|
+
} else if (char === ',') {
|
|
177
|
+
clear(char, '', ' ');
|
|
178
|
+
} else if (char === ' ') {
|
|
179
|
+
clear(char);
|
|
180
|
+
} else {
|
|
181
|
+
const previousChar = value[i - 1];
|
|
182
|
+
switch(char){
|
|
183
|
+
case '+':
|
|
184
|
+
if (!current && previousChar !== ')') {
|
|
185
|
+
current += char;
|
|
186
|
+
} else {
|
|
187
|
+
clear(char, ' ', ' ');
|
|
188
|
+
}
|
|
189
|
+
break;
|
|
190
|
+
case '-':
|
|
191
|
+
if (!current && previousChar !== ')') {
|
|
192
|
+
current += char;
|
|
193
|
+
} else {
|
|
194
|
+
clear(char, ' ', ' ');
|
|
195
|
+
}
|
|
196
|
+
break;
|
|
197
|
+
case '*':
|
|
198
|
+
if (this.definition.unit) {
|
|
199
|
+
unitChecking = true;
|
|
200
|
+
}
|
|
201
|
+
clear(char, ' ', ' ');
|
|
202
|
+
break;
|
|
203
|
+
case '/':
|
|
204
|
+
if (this.definition.unit) {
|
|
205
|
+
unitChecking = true;
|
|
206
|
+
}
|
|
207
|
+
clear(char, ' ', ' ');
|
|
208
|
+
bypassParsing = true;
|
|
209
|
+
break;
|
|
210
|
+
default:
|
|
211
|
+
current += char;
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
clear('');
|
|
217
|
+
handleUnitChecking();
|
|
218
|
+
};
|
|
219
|
+
anaylzeDeeply(valueComponents, false, false, false, false);
|
|
220
|
+
return 'calc(' + this.resolveValue(valueComponents, this.definition.unit, bypassVariableNames, true) + ')';
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export { coreCalc as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function coreVariable(value) {
|
|
4
|
+
let name;
|
|
5
|
+
let fallback;
|
|
6
|
+
const firstCommaIndex = value.indexOf(',');
|
|
7
|
+
if (firstCommaIndex !== -1) {
|
|
8
|
+
name = value.slice(0, firstCommaIndex);
|
|
9
|
+
fallback = value.slice(firstCommaIndex + 1);
|
|
10
|
+
} else {
|
|
11
|
+
name = value;
|
|
12
|
+
}
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
type: 'variable',
|
|
16
|
+
name,
|
|
17
|
+
fallback,
|
|
18
|
+
token: value
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = coreVariable;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function coreVariable(value) {
|
|
2
|
+
let name;
|
|
3
|
+
let fallback;
|
|
4
|
+
const firstCommaIndex = value.indexOf(',');
|
|
5
|
+
if (firstCommaIndex !== -1) {
|
|
6
|
+
name = value.slice(0, firstCommaIndex);
|
|
7
|
+
fallback = value.slice(firstCommaIndex + 1);
|
|
8
|
+
} else {
|
|
9
|
+
name = value;
|
|
10
|
+
}
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
type: 'variable',
|
|
14
|
+
name,
|
|
15
|
+
fallback,
|
|
16
|
+
token: value
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { coreVariable as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core_calc = require('./core.calc.cjs');
|
|
4
|
+
var core_variable = require('./core.variable.cjs');
|
|
5
|
+
|
|
6
|
+
const functionTransformers = {
|
|
7
|
+
'core.calc': core_calc,
|
|
8
|
+
'core.variable': core_variable
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
module.exports = functionTransformers;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import coreCalc from './core.calc';
|
|
2
|
+
import coreVariable from './core.variable';
|
|
3
|
+
declare const functionTransformers: {
|
|
4
|
+
'core.calc': typeof coreCalc;
|
|
5
|
+
'core.variable': typeof coreVariable;
|
|
6
|
+
};
|
|
7
|
+
export default functionTransformers;
|
|
8
|
+
export type FunctionTransformerNames = keyof typeof functionTransformers;
|
package/dist/index.cjs
CHANGED
|
@@ -13,6 +13,7 @@ var nonLayer = require('./non-layer.cjs');
|
|
|
13
13
|
var syntaxRuleType = require('./syntax-rule-type.cjs');
|
|
14
14
|
var variableRule = require('./variable-rule.cjs');
|
|
15
15
|
var animationRule = require('./animation-rule.cjs');
|
|
16
|
+
var create = require('./create.cjs');
|
|
16
17
|
var withSyntaxLayer = require('./factories/with-syntax-layer.cjs');
|
|
17
18
|
var extendConfig = require('./utils/extend-config.cjs');
|
|
18
19
|
var sortReadableClasses = require('./utils/sort-readable-classes.cjs');
|
|
@@ -30,6 +31,10 @@ var parseSelector = require('./utils/parse-selector.cjs');
|
|
|
30
31
|
var generateSelector = require('./utils/generate-selector.cjs');
|
|
31
32
|
var getSingleAtNumberRuleNode = require('./utils/get-single-at-number-rule-node.cjs');
|
|
32
33
|
var compareRulePriority = require('./utils/compare-rule-priority.cjs');
|
|
34
|
+
var flattenObject = require('./utils/flatten-object.cjs');
|
|
35
|
+
var flattenMetaObject = require('./utils/flatten-meta-object.cjs');
|
|
36
|
+
var nestMetaObject = require('./utils/nest-meta-object.cjs');
|
|
37
|
+
var minifyExtendedConfig = require('./utils/minify-extended-config.cjs');
|
|
33
38
|
var at = require('./config/at.cjs');
|
|
34
39
|
var selectors = require('./config/selectors.cjs');
|
|
35
40
|
var utilities = require('./config/utilities.cjs');
|
|
@@ -59,7 +64,6 @@ exports.COMPARISION_OPERATORS = common.COMPARISION_OPERATORS;
|
|
|
59
64
|
exports.DELIMITER_SIGN = common.DELIMITER_SIGN;
|
|
60
65
|
exports.IMAGE_VALUE_REGEX = common.IMAGE_VALUE_REGEX;
|
|
61
66
|
exports.NUMBER_VALUE_REGEX = common.NUMBER_VALUE_REGEX;
|
|
62
|
-
exports.OFFICIAL_URL = common.OFFICIAL_URL;
|
|
63
67
|
exports.QUERY_COMPARISON_OPERATORS = common.QUERY_COMPARISON_OPERATORS;
|
|
64
68
|
exports.QUERY_LOGICAL_OPERATORS = common.QUERY_LOGICAL_OPERATORS;
|
|
65
69
|
exports.SELECTOR_COMBINATORS = common.SELECTOR_COMBINATORS;
|
|
@@ -81,6 +85,7 @@ exports.NonLayer = nonLayer;
|
|
|
81
85
|
exports.SyntaxRuleType = syntaxRuleType;
|
|
82
86
|
exports.VariableRule = variableRule.default;
|
|
83
87
|
exports.AnimationRule = animationRule;
|
|
88
|
+
exports.createCSS = create;
|
|
84
89
|
exports.withSyntaxLayer = withSyntaxLayer;
|
|
85
90
|
exports.extendConfig = extendConfig;
|
|
86
91
|
exports.sortReadableClasses = sortReadableClasses;
|
|
@@ -98,6 +103,10 @@ exports.parseSelector = parseSelector;
|
|
|
98
103
|
exports.generateSelector = generateSelector;
|
|
99
104
|
exports.getSingleAtNumberRuleNode = getSingleAtNumberRuleNode;
|
|
100
105
|
exports.compareRulePriority = compareRulePriority.default;
|
|
106
|
+
exports.flattenObject = flattenObject;
|
|
107
|
+
exports.flattenMetaObject = flattenMetaObject;
|
|
108
|
+
exports.nestMetaObject = nestMetaObject;
|
|
109
|
+
exports.minifyExtendedConfig = minifyExtendedConfig;
|
|
101
110
|
exports.at = at;
|
|
102
111
|
exports.selectors = selectors;
|
|
103
112
|
exports.utilities = utilities;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { default as NonLayer } from './non-layer';
|
|
|
9
9
|
export { default as SyntaxRuleType } from './syntax-rule-type';
|
|
10
10
|
export { default as VariableRule } from './variable-rule';
|
|
11
11
|
export { default as AnimationRule } from './animation-rule';
|
|
12
|
+
export { default as createCSS } from './create';
|
|
12
13
|
export * from './types/config';
|
|
13
14
|
export * from './types/syntax';
|
|
14
15
|
export * from './types/common';
|
|
@@ -24,11 +25,16 @@ export { default as isCoreRule } from './utils/is-core-rule';
|
|
|
24
25
|
export { default as parsePair } from './utils/parse-pair';
|
|
25
26
|
export { default as parseValue } from './utils/parse-value';
|
|
26
27
|
export { default as parseAt } from './utils/parse-at';
|
|
27
|
-
export type * from './utils/parse-at';
|
|
28
28
|
export { default as generateAt } from './utils/generate-at';
|
|
29
29
|
export { default as parseSelector } from './utils/parse-selector';
|
|
30
|
-
export type * from './utils/parse-selector';
|
|
31
30
|
export { default as generateSelector } from './utils/generate-selector';
|
|
32
31
|
export { default as getSingleAtNumberRuleNode } from './utils/get-single-at-number-rule-node';
|
|
33
32
|
export { default as compareRulePriority } from './utils/compare-rule-priority';
|
|
33
|
+
export { default as flattenObject } from './utils/flatten-object';
|
|
34
|
+
export { default as flattenMetaObject } from './utils/flatten-meta-object';
|
|
35
|
+
export { default as nestMetaObject } from './utils/nest-meta-object';
|
|
36
|
+
export { default as minifyExtendedConfig } from './utils/minify-extended-config';
|
|
37
|
+
export type * from './utils/parse-at';
|
|
38
|
+
export type * from './utils/parse-selector';
|
|
39
|
+
export type * from './utils/extend-config';
|
|
34
40
|
export { default as MasterCSS, default } from './core';
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { config } from './config/index.mjs';
|
|
2
|
-
export { ANIMATION_SIGN, AT_COMPARABLE_FEATURES, AT_COMPARISON_OPERATORS, AT_IDENTIFIERS, AT_LOGICAL_OPERATORS, AT_SIGN, BASE_UNIT_REGEX, BORDER_STYLE_VALUES, CLASS_ATTRIBUTES, CLASS_DECLARATIONS, CLASS_FUNCTIONS, COLOR_VALUE_REGEX, COMPARISION_OPERATORS, DELIMITER_SIGN, IMAGE_VALUE_REGEX, NUMBER_VALUE_REGEX,
|
|
2
|
+
export { ANIMATION_SIGN, AT_COMPARABLE_FEATURES, AT_COMPARISON_OPERATORS, AT_IDENTIFIERS, AT_LOGICAL_OPERATORS, AT_SIGN, BASE_UNIT_REGEX, BORDER_STYLE_VALUES, CLASS_ATTRIBUTES, CLASS_DECLARATIONS, CLASS_FUNCTIONS, COLOR_VALUE_REGEX, COMPARISION_OPERATORS, DELIMITER_SIGN, IMAGE_VALUE_REGEX, NUMBER_VALUE_REGEX, QUERY_COMPARISON_OPERATORS, QUERY_LOGICAL_OPERATORS, SELECTOR_COMBINATORS, SELECTOR_SIGNS, SEPARATOR_SIGN, SEPARATOR_SIGNS, TRANSITION_SIGN, UNIT_REGEX, VALUE_DELIMITERS, VALUE_UNITS, __UNSORTED__ } from './common.mjs';
|
|
3
3
|
export { default as MasterCSS, default } from './core.mjs';
|
|
4
4
|
export { SyntaxRule } from './syntax-rule.mjs';
|
|
5
5
|
export { Rule } from './rule.mjs';
|
|
@@ -9,6 +9,7 @@ export { default as NonLayer } from './non-layer.mjs';
|
|
|
9
9
|
export { default as SyntaxRuleType } from './syntax-rule-type.mjs';
|
|
10
10
|
export { default as VariableRule } from './variable-rule.mjs';
|
|
11
11
|
export { default as AnimationRule } from './animation-rule.mjs';
|
|
12
|
+
export { default as createCSS } from './create.mjs';
|
|
12
13
|
export { default as withSyntaxLayer } from './factories/with-syntax-layer.mjs';
|
|
13
14
|
export { default as extendConfig } from './utils/extend-config.mjs';
|
|
14
15
|
export { default as sortReadableClasses } from './utils/sort-readable-classes.mjs';
|
|
@@ -26,6 +27,10 @@ export { default as parseSelector } from './utils/parse-selector.mjs';
|
|
|
26
27
|
export { default as generateSelector } from './utils/generate-selector.mjs';
|
|
27
28
|
export { default as getSingleAtNumberRuleNode } from './utils/get-single-at-number-rule-node.mjs';
|
|
28
29
|
export { default as compareRulePriority } from './utils/compare-rule-priority.mjs';
|
|
30
|
+
export { default as flattenObject } from './utils/flatten-object.mjs';
|
|
31
|
+
export { default as flattenMetaObject } from './utils/flatten-meta-object.mjs';
|
|
32
|
+
export { default as nestMetaObject } from './utils/nest-meta-object.mjs';
|
|
33
|
+
export { default as minifyExtendedConfig } from './utils/minify-extended-config.mjs';
|
|
29
34
|
export { default as at } from './config/at.mjs';
|
|
30
35
|
export { default as selectors } from './config/selectors.mjs';
|
|
31
36
|
export { default as utilities } from './config/utilities.mjs';
|
package/dist/layer.cjs
CHANGED
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
class Layer {
|
|
4
4
|
name;
|
|
5
5
|
css;
|
|
6
|
-
rules;
|
|
7
|
-
tokenCounts;
|
|
6
|
+
rules = [];
|
|
7
|
+
tokenCounts = new Map();
|
|
8
8
|
constructor(name, css){
|
|
9
9
|
this.name = name;
|
|
10
10
|
this.css = css;
|
|
11
|
-
this.rules = [];
|
|
12
|
-
this.tokenCounts = new Map();
|
|
13
11
|
}
|
|
14
12
|
attach() {
|
|
15
13
|
this.css.rules.push(this);
|
package/dist/layer.mjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
class Layer {
|
|
2
2
|
name;
|
|
3
3
|
css;
|
|
4
|
-
rules;
|
|
5
|
-
tokenCounts;
|
|
4
|
+
rules = [];
|
|
5
|
+
tokenCounts = new Map();
|
|
6
6
|
constructor(name, css){
|
|
7
7
|
this.name = name;
|
|
8
8
|
this.css = css;
|
|
9
|
-
this.rules = [];
|
|
10
|
-
this.tokenCounts = new Map();
|
|
11
9
|
}
|
|
12
10
|
attach() {
|
|
13
11
|
this.css.rules.push(this);
|
package/dist/non-layer.cjs
CHANGED
|
@@ -4,12 +4,10 @@ var findNativeCssRuleIndex = require('./shared/utils/find-native-css-rule-index.
|
|
|
4
4
|
|
|
5
5
|
class NonLayer {
|
|
6
6
|
css;
|
|
7
|
-
rules;
|
|
8
|
-
tokenCounts;
|
|
7
|
+
rules = [];
|
|
8
|
+
tokenCounts = new Map();
|
|
9
9
|
constructor(css){
|
|
10
10
|
this.css = css;
|
|
11
|
-
this.rules = [];
|
|
12
|
-
this.tokenCounts = new Map();
|
|
13
11
|
}
|
|
14
12
|
insert(rule) {
|
|
15
13
|
if (this.rules.includes(rule)) return;
|
package/dist/non-layer.mjs
CHANGED
|
@@ -2,12 +2,10 @@ import findNativeCSSRuleIndex from './shared/utils/find-native-css-rule-index.mj
|
|
|
2
2
|
|
|
3
3
|
class NonLayer {
|
|
4
4
|
css;
|
|
5
|
-
rules;
|
|
6
|
-
tokenCounts;
|
|
5
|
+
rules = [];
|
|
6
|
+
tokenCounts = new Map();
|
|
7
7
|
constructor(css){
|
|
8
8
|
this.css = css;
|
|
9
|
-
this.rules = [];
|
|
10
|
-
this.tokenCounts = new Map();
|
|
11
9
|
}
|
|
12
10
|
insert(rule) {
|
|
13
11
|
if (this.rules.includes(rule)) return;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var SyntaxRuleType = /*#__PURE__*/ function(SyntaxRuleType) {
|
|
4
4
|
/**
|
|
5
5
|
* utility classes
|
|
6
6
|
* @example block, inline
|
|
7
|
-
*/ Utility
|
|
7
|
+
*/ SyntaxRuleType[SyntaxRuleType["Utility"] = -4] = "Utility";
|
|
8
8
|
/**
|
|
9
9
|
* native shorthand
|
|
10
10
|
* @example border, padding, margin
|
|
11
|
-
*/ NativeShorthand
|
|
11
|
+
*/ SyntaxRuleType[SyntaxRuleType["NativeShorthand"] = -3] = "NativeShorthand";
|
|
12
12
|
/**
|
|
13
13
|
* shorthand
|
|
14
14
|
* @example px, py, mx, my
|
|
15
|
-
*/ Shorthand
|
|
15
|
+
*/ SyntaxRuleType[SyntaxRuleType["Shorthand"] = -2] = "Shorthand";
|
|
16
16
|
/**
|
|
17
17
|
* native properties
|
|
18
18
|
* @example color, background-color, font-size
|
|
19
|
-
*/ Native
|
|
19
|
+
*/ SyntaxRuleType[SyntaxRuleType["Native"] = -1] = "Native";
|
|
20
20
|
/**
|
|
21
21
|
* normal
|
|
22
22
|
* @example grid-cols
|
|
23
|
-
*/ Normal
|
|
24
|
-
|
|
23
|
+
*/ SyntaxRuleType[SyntaxRuleType["Normal"] = 0] = "Normal";
|
|
24
|
+
return SyntaxRuleType;
|
|
25
|
+
}(SyntaxRuleType || {});
|
|
25
26
|
|
|
26
27
|
module.exports = SyntaxRuleType;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare enum SyntaxRuleType {
|
|
2
2
|
/**
|
|
3
3
|
* utility classes
|
|
4
4
|
* @example block, inline
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
Utility = -4,
|
|
7
7
|
/**
|
|
8
8
|
* native shorthand
|
|
9
9
|
* @example border, padding, margin
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
NativeShorthand = -3,
|
|
12
12
|
/**
|
|
13
13
|
* shorthand
|
|
14
14
|
* @example px, py, mx, my
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
Shorthand = -2,
|
|
17
17
|
/**
|
|
18
18
|
* native properties
|
|
19
19
|
* @example color, background-color, font-size
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
Native = -1,
|
|
22
22
|
/**
|
|
23
23
|
* normal
|
|
24
24
|
* @example grid-cols
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
}
|
|
26
|
+
Normal = 0
|
|
27
|
+
}
|
|
28
28
|
export default SyntaxRuleType;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
var SyntaxRuleType = /*#__PURE__*/ function(SyntaxRuleType) {
|
|
2
2
|
/**
|
|
3
3
|
* utility classes
|
|
4
4
|
* @example block, inline
|
|
5
|
-
*/ Utility
|
|
5
|
+
*/ SyntaxRuleType[SyntaxRuleType["Utility"] = -4] = "Utility";
|
|
6
6
|
/**
|
|
7
7
|
* native shorthand
|
|
8
8
|
* @example border, padding, margin
|
|
9
|
-
*/ NativeShorthand
|
|
9
|
+
*/ SyntaxRuleType[SyntaxRuleType["NativeShorthand"] = -3] = "NativeShorthand";
|
|
10
10
|
/**
|
|
11
11
|
* shorthand
|
|
12
12
|
* @example px, py, mx, my
|
|
13
|
-
*/ Shorthand
|
|
13
|
+
*/ SyntaxRuleType[SyntaxRuleType["Shorthand"] = -2] = "Shorthand";
|
|
14
14
|
/**
|
|
15
15
|
* native properties
|
|
16
16
|
* @example color, background-color, font-size
|
|
17
|
-
*/ Native
|
|
17
|
+
*/ SyntaxRuleType[SyntaxRuleType["Native"] = -1] = "Native";
|
|
18
18
|
/**
|
|
19
19
|
* normal
|
|
20
20
|
* @example grid-cols
|
|
21
|
-
*/ Normal
|
|
22
|
-
|
|
21
|
+
*/ SyntaxRuleType[SyntaxRuleType["Normal"] = 0] = "Normal";
|
|
22
|
+
return SyntaxRuleType;
|
|
23
|
+
}(SyntaxRuleType || {});
|
|
23
24
|
|
|
24
25
|
export { SyntaxRuleType as default };
|