@master/css-engine 2.0.0-rc.70
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/README.md +57 -0
- package/dist/animation-rule.d.ts +12 -0
- package/dist/animation-rule.mjs +38 -0
- package/dist/common.d.ts +40 -0
- package/dist/common.mjs +114 -0
- package/dist/compile-manifest.d.ts +54 -0
- package/dist/compile-manifest.mjs +451 -0
- package/dist/compiler.d.ts +32 -0
- package/dist/compiler.mjs +38 -0
- package/dist/core.d.ts +141 -0
- package/dist/core.mjs +848 -0
- package/dist/emitted-globals.d.ts +4 -0
- package/dist/emitted-globals.mjs +1 -0
- package/dist/hydration-manifest.d.ts +4 -0
- package/dist/hydration-manifest.mjs +61 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.mjs +15 -0
- package/dist/key-aliases.d.ts +4 -0
- package/dist/key-aliases.mjs +95 -0
- package/dist/layer.d.ts +17 -0
- package/dist/layer.mjs +78 -0
- package/dist/namespaces.d.ts +5 -0
- package/dist/namespaces.mjs +28 -0
- package/dist/native-value-namespaces.d.ts +9 -0
- package/dist/native-value-namespaces.mjs +346 -0
- package/dist/non-layer.d.ts +12 -0
- package/dist/non-layer.mjs +53 -0
- package/dist/rule.d.ts +7 -0
- package/dist/rule.mjs +14 -0
- package/dist/theme-layer.d.ts +21 -0
- package/dist/theme-layer.mjs +52 -0
- package/dist/utility-layer.d.ts +10 -0
- package/dist/utility-layer.mjs +118 -0
- package/dist/utility.d.ts +102 -0
- package/dist/utility.mjs +1263 -0
- package/dist/utils/collect-animation-names.d.ts +10 -0
- package/dist/utils/collect-animation-names.mjs +61 -0
- package/dist/utils/collect-variable-names.d.ts +3 -0
- package/dist/utils/collect-variable-names.mjs +18 -0
- package/dist/utils/compare-rule-priority.d.ts +14 -0
- package/dist/utils/compare-rule-priority.mjs +136 -0
- package/dist/utils/css-variables.d.ts +12 -0
- package/dist/utils/css-variables.mjs +197 -0
- package/dist/utils/find-native-css-rule-index.d.ts +1 -0
- package/dist/utils/find-native-css-rule-index.mjs +10 -0
- package/dist/utils/generate-at.d.ts +2 -0
- package/dist/utils/generate-at.mjs +32 -0
- package/dist/utils/generate-selector.d.ts +2 -0
- package/dist/utils/generate-selector.mjs +48 -0
- package/dist/utils/natural-compare.d.ts +2 -0
- package/dist/utils/natural-compare.mjs +6 -0
- package/dist/utils/parse-at.d.ts +44 -0
- package/dist/utils/parse-at.mjs +179 -0
- package/dist/utils/parse-pair.d.ts +8 -0
- package/dist/utils/parse-pair.mjs +46 -0
- package/dist/utils/parse-selector.d.ts +19 -0
- package/dist/utils/parse-selector.mjs +124 -0
- package/dist/utils/parse-value.d.ts +2 -0
- package/dist/utils/parse-value.mjs +37 -0
- package/dist/utils/replace-char-outside-quotes.d.ts +1 -0
- package/dist/utils/replace-char-outside-quotes.mjs +19 -0
- package/dist/utils/split-char-outside-quotes.d.ts +1 -0
- package/dist/utils/split-char-outside-quotes.mjs +27 -0
- package/dist/utils/wrap-at-rules.d.ts +1 -0
- package/dist/utils/wrap-at-rules.mjs +10 -0
- package/dist/variable-rule.d.ts +26 -0
- package/dist/variable-rule.mjs +105 -0
- package/package.json +1 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import MasterCSS from './core';
|
|
2
|
+
import { type UtilityType as UtilityTypeValue } from '@master/css-schema/utility-type';
|
|
3
|
+
import { type PropertiesHyphen } from 'csstype';
|
|
4
|
+
import Layer from './layer';
|
|
5
|
+
import type { ValueComponent, Variable, StringValueComponent } from '@master/css-schema/css-syntax';
|
|
6
|
+
import { AtRuleNode } from './utils/parse-at';
|
|
7
|
+
import type { MasterCSSManifestAtIdentifier, MasterCSSManifestUtilityLayerName } from '@master/css-schema/manifest';
|
|
8
|
+
import type { CompiledUtility } from './core';
|
|
9
|
+
import { SelectorNode } from './utils/parse-selector';
|
|
10
|
+
import { RulePriority } from './utils/compare-rule-priority';
|
|
11
|
+
type UtilityStateBranch = {
|
|
12
|
+
selectorTemplate?: string;
|
|
13
|
+
selectorNodes?: SelectorNode[];
|
|
14
|
+
atRules?: Partial<Record<MasterCSSManifestAtIdentifier, AtRuleNode[]>>;
|
|
15
|
+
layer?: MasterCSSManifestUtilityLayerName;
|
|
16
|
+
mode?: string;
|
|
17
|
+
key: string;
|
|
18
|
+
valid?: boolean;
|
|
19
|
+
};
|
|
20
|
+
type ResolvedVariableAlias = {
|
|
21
|
+
name: string;
|
|
22
|
+
variable: Variable;
|
|
23
|
+
negative?: boolean;
|
|
24
|
+
};
|
|
25
|
+
interface CoreMathData {
|
|
26
|
+
name?: string;
|
|
27
|
+
wrapArguments?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare class Utility {
|
|
30
|
+
readonly name: string;
|
|
31
|
+
css: MasterCSS;
|
|
32
|
+
readonly registeredUtility: CompiledUtility;
|
|
33
|
+
fixedClass?: string | undefined;
|
|
34
|
+
native?: CSSRule;
|
|
35
|
+
nodes?: UtilityRuleNode[];
|
|
36
|
+
readonly atRules?: Partial<Record<MasterCSSManifestAtIdentifier, AtRuleNode[]>>;
|
|
37
|
+
readonly priority: RulePriority;
|
|
38
|
+
readonly type: UtilityTypeValue;
|
|
39
|
+
readonly declarations?: PropertiesHyphen;
|
|
40
|
+
readonly declarationRules?: {
|
|
41
|
+
declarations: PropertiesHyphen;
|
|
42
|
+
atRules?: string[];
|
|
43
|
+
selector?: string;
|
|
44
|
+
}[];
|
|
45
|
+
readonly layer: Layer;
|
|
46
|
+
readonly layerName: MasterCSSManifestUtilityLayerName;
|
|
47
|
+
explicitLayerName?: MasterCSSManifestUtilityLayerName;
|
|
48
|
+
readonly valid: boolean;
|
|
49
|
+
animationNames?: Set<string>;
|
|
50
|
+
variableNames?: Set<string>;
|
|
51
|
+
readonly branchIndex?: number;
|
|
52
|
+
readonly branchCount: number;
|
|
53
|
+
readonly selectorTemplate?: string;
|
|
54
|
+
variantBranchKey?: string;
|
|
55
|
+
private invalidValueSyntax;
|
|
56
|
+
constructor(name: string, css: MasterCSS, registeredUtility: CompiledUtility, fixedClass?: string | undefined, mode?: string, branchIndex?: number);
|
|
57
|
+
resolveVariableAlias(variableName: string): ResolvedVariableAlias | undefined;
|
|
58
|
+
resolveDynamicDeclarationValue(value: string | number | null | (string | number | null)[], newValue: string): string | number;
|
|
59
|
+
resolveDynamicDeclarations(declarations: PropertiesHyphen, newValue: string): PropertiesHyphen;
|
|
60
|
+
emitDynamicDeclarationRules(newValue: string): {
|
|
61
|
+
declarations: PropertiesHyphen<0 | (string & {}), string & {}>;
|
|
62
|
+
atRules: string[] | undefined;
|
|
63
|
+
selector: string | undefined;
|
|
64
|
+
}[] | undefined;
|
|
65
|
+
emitDynamicDeclarations(newValue: string): PropertiesHyphen | undefined;
|
|
66
|
+
emitGroupDeclarations(value: string): PropertiesHyphen;
|
|
67
|
+
resolveStateBranches(stateToken: string): UtilityStateBranch[];
|
|
68
|
+
applySelectorTokenBranches(branches: UtilityStateBranch[], selectorToken: string): UtilityStateBranch[];
|
|
69
|
+
get text(): string;
|
|
70
|
+
createRuleText(declarations: PropertiesHyphen, atRules?: string[], selector?: string): string;
|
|
71
|
+
get selectorText(): string;
|
|
72
|
+
createSelectorText(selector?: string): string;
|
|
73
|
+
resolveValue: (valueComponents: ValueComponent[], unit: string, bypassVariableNames: string[], bypassParsing: boolean) => string;
|
|
74
|
+
stringifyValueComponents(valueComponents: ValueComponent[]): string;
|
|
75
|
+
resolveMathFunction(value: string, bypassVariableNames: string[], data?: CoreMathData): string;
|
|
76
|
+
parseValues: (currentValueComponents: ValueComponent[], i: number, value: string, unit: string, endSymbol: string, parentFunctionName?: string, bypassParsing?: boolean, bypassVariableNames?: string[]) => number;
|
|
77
|
+
parseValue(token: string | number, unit?: string): StringValueComponent | import("@master/css-schema/css-syntax").NumberValueComponent;
|
|
78
|
+
get key(): string;
|
|
79
|
+
}
|
|
80
|
+
export declare class UtilityRuleNode {
|
|
81
|
+
readonly rule: Utility;
|
|
82
|
+
readonly declarations: PropertiesHyphen;
|
|
83
|
+
readonly atRules?: string[] | undefined;
|
|
84
|
+
readonly selector?: string | undefined;
|
|
85
|
+
native?: CSSRule;
|
|
86
|
+
constructor(rule: Utility, declarations: PropertiesHyphen, atRules?: string[] | undefined, selector?: string | undefined);
|
|
87
|
+
get text(): string;
|
|
88
|
+
}
|
|
89
|
+
export interface Utility extends Omit<CompiledUtility, 'name' | 'layer' | 'atRules'> {
|
|
90
|
+
token: string;
|
|
91
|
+
selectorNodes?: SelectorNode[];
|
|
92
|
+
important: boolean;
|
|
93
|
+
direction: string;
|
|
94
|
+
mode: string;
|
|
95
|
+
unitToken: string;
|
|
96
|
+
keyToken: string;
|
|
97
|
+
valueToken: string;
|
|
98
|
+
stateToken: string;
|
|
99
|
+
atToken: string;
|
|
100
|
+
valueComponents: ValueComponent[];
|
|
101
|
+
}
|
|
102
|
+
export {};
|