@webstudio-is/css-engine 0.0.0-017f1bd

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.
Files changed (36) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +6 -0
  3. package/lib/index.js +988 -0
  4. package/lib/runtime.js +114 -0
  5. package/lib/types/__generated__/types.d.ts +3 -0
  6. package/lib/types/core/atomic.d.ts +14 -0
  7. package/lib/types/core/atomic.test.d.ts +1 -0
  8. package/lib/types/core/compare-media.d.ts +6 -0
  9. package/lib/types/core/compare-media.test.d.ts +1 -0
  10. package/lib/types/core/create-style-sheet.d.ts +4 -0
  11. package/lib/types/core/css-engine.stories.d.ts +5 -0
  12. package/lib/types/core/equal-media.d.ts +2 -0
  13. package/lib/types/core/equal-media.test.d.ts +1 -0
  14. package/lib/types/core/find-applicable-media.d.ts +2 -0
  15. package/lib/types/core/find-applicable-media.test.d.ts +1 -0
  16. package/lib/types/core/index.d.ts +13 -0
  17. package/lib/types/core/match-media.d.ts +2 -0
  18. package/lib/types/core/match-media.test.d.ts +1 -0
  19. package/lib/types/core/merger.d.ts +604 -0
  20. package/lib/types/core/merger.test.d.ts +1 -0
  21. package/lib/types/core/prefixer.d.ts +2 -0
  22. package/lib/types/core/prefixer.test.d.ts +1 -0
  23. package/lib/types/core/rules.d.ts +107 -0
  24. package/lib/types/core/style-element.d.ts +10 -0
  25. package/lib/types/core/style-sheet-regular.d.ts +3 -0
  26. package/lib/types/core/style-sheet-regular.test.d.ts +1 -0
  27. package/lib/types/core/style-sheet.d.ts +24 -0
  28. package/lib/types/core/to-property.d.ts +5 -0
  29. package/lib/types/core/to-property.test.d.ts +1 -0
  30. package/lib/types/core/to-value.d.ts +3 -0
  31. package/lib/types/core/to-value.test.d.ts +1 -0
  32. package/lib/types/css.d.ts +1 -0
  33. package/lib/types/index.d.ts +5 -0
  34. package/lib/types/runtime.d.ts +1 -0
  35. package/lib/types/schema.d.ts +9623 -0
  36. package/package.json +46 -0
@@ -0,0 +1,10 @@
1
+ export declare class StyleElement {
2
+ #private;
3
+ constructor(name?: string);
4
+ get isMounted(): boolean;
5
+ mount(): void;
6
+ unmount(): void;
7
+ render(cssText: string): void;
8
+ setAttribute(name: string, value: string): void;
9
+ getAttribute(name: string): string | null | undefined;
10
+ }
@@ -0,0 +1,3 @@
1
+ import { StyleSheet } from "./style-sheet";
2
+ export declare class StyleSheetRegular extends StyleSheet {
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ import { MediaRule, MixinRule, NestingRule, PlaintextRule, type FontFaceOptions, type MediaRuleOptions } from "./rules";
2
+ import { StyleElement } from "./style-element";
3
+ import type { TransformValue } from "./to-value";
4
+ export declare class StyleSheet {
5
+ #private;
6
+ nestingRules: Map<string, NestingRule>;
7
+ constructor(element: StyleElement);
8
+ setTransformer(transformValue: TransformValue): void;
9
+ addMediaRule(id: string, options?: MediaRuleOptions): MediaRule;
10
+ addPlaintextRule(cssText: string): PlaintextRule | Map<string, PlaintextRule>;
11
+ addMixinRule(name: string): MixinRule;
12
+ addNestingRule(selector: string, descendantSuffix?: string): NestingRule;
13
+ addFontFaceRule(options: FontFaceOptions): number;
14
+ generateWith({ nestingRules, transformValue, }: {
15
+ nestingRules: NestingRule[];
16
+ transformValue?: TransformValue;
17
+ }): string;
18
+ get cssText(): string;
19
+ clear(): void;
20
+ render(): void;
21
+ unmount(): void;
22
+ setAttribute(name: string, value: string): void;
23
+ getAttribute(name: string): string | null | undefined;
24
+ }
@@ -0,0 +1,5 @@
1
+ import type { CssProperty } from "../schema";
2
+ /**
3
+ * Hyphenates a camelcased CSS property name
4
+ */
5
+ export declare const hyphenateProperty: (property: string) => CssProperty;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { StyleValue } from "../schema";
2
+ export type TransformValue = (styleValue: StyleValue) => undefined | StyleValue;
3
+ export declare const toValue: (styleValue: undefined | StyleValue, transformValue?: TransformValue) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const cssWideKeywords: Set<string>;
@@ -0,0 +1,5 @@
1
+ export * from "./core/index";
2
+ export * from "./schema";
3
+ export * from "./css";
4
+ export type { Unit as __Unit } from "./__generated__/types";
5
+ export type { HyphenatedProperty as __HyphenatedProperty } from "./__generated__/types";
@@ -0,0 +1 @@
1
+ export { toValue } from "./core/to-value";