Files
webstudio/@types/css-tree.d.ts
T
Ivan Starkov ffae4bd403 Make CSSValueInput controllable, (#551)
CSSValueInput used useEffect and executed onChange etc events on its
own. What in case of any small changes caused loops and strange
behavior. Now should execute everything only as a result of user input.

`parseCssValue` - now stupid parse CSS value and someday will be used
only inside text-control.
setProperty - now accepts StyleValue, the string param is deprecated,
warning set.

CSSValueInput now not update styles during editing.

unit menu now not hiding during formulas etc

fixed bug with updating style on newly created items

fixed scrub bugs with unsubscribing

css-tree Adds 52101 gzip bytes. 
A lot of size is coming from here 

https://github.com/csstree/csstree/blob/97d7f3b95a3efd8f431af39986acc149dceefa59/lib/data.js
more than 1/3 of `esm` size (20+kb gz), and most huge are properties
json we need and use.

Doesn't look tree-shakeable, anyway can be loaded lazily as until
editing we don't need to validate CSS vars.

Investigating: 
- [x] - Changing any style Combobox with mouse cause multiple value
updates to previous and current value (was a blur event issue)
2022-12-07 14:32:34 +04:00

36 lines
762 B
TypeScript

declare module "css-tree" {
export function parse(
text: string,
options?: import("@types/css-tree").ParseOptions
): import("@types/css-tree").CssNode;
type Match =
| {
syntax: { type: "Property"; name: string };
match: Match[];
}
| {
syntax: { type: "Keyword"; name: string };
token: string;
}
| { syntax: null };
type MatchProperty =
| {
matched: null;
error: { message: string };
}
// eslint-disable-next-line @typescript-eslint/ban-types
| {
matched: Match;
error: null;
};
export declare const lexer: {
matchProperty: (
property: string,
ast: import("@types/css-tree").CssNode
) => MatchProperty;
};
}