zss-engine 0.2.35 → 0.2.37

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 (43) hide show
  1. package/dist/index.d.ts +111 -0
  2. package/dist/index.js +258 -0
  3. package/dist/index.mjs +247 -0
  4. package/package.json +9 -12
  5. package/dist/cjs/index.js +0 -22
  6. package/dist/cjs/types/common/css-properties.js +0 -2
  7. package/dist/cjs/types/common/css-property.js +0 -2
  8. package/dist/cjs/types/main/create.js +0 -2
  9. package/dist/cjs/types/main/global.js +0 -2
  10. package/dist/cjs/types/main/vars.js +0 -2
  11. package/dist/cjs/utils/build.js +0 -27
  12. package/dist/cjs/utils/hash.js +0 -34
  13. package/dist/cjs/utils/helper.js +0 -22
  14. package/dist/cjs/utils/inject-client-css.js +0 -51
  15. package/dist/cjs/utils/inject-client-global-css.js +0 -18
  16. package/dist/cjs/utils/inject-server-css.js +0 -11
  17. package/dist/cjs/utils/transpiler.js +0 -125
  18. package/dist/esm/index.js +0 -8
  19. package/dist/esm/types/common/css-properties.js +0 -1
  20. package/dist/esm/types/common/css-property.js +0 -1
  21. package/dist/esm/types/main/create.js +0 -1
  22. package/dist/esm/types/main/global.js +0 -1
  23. package/dist/esm/types/main/vars.js +0 -1
  24. package/dist/esm/utils/build.js +0 -23
  25. package/dist/esm/utils/hash.js +0 -31
  26. package/dist/esm/utils/helper.js +0 -17
  27. package/dist/esm/utils/inject-client-css.js +0 -47
  28. package/dist/esm/utils/inject-client-global-css.js +0 -15
  29. package/dist/esm/utils/inject-server-css.js +0 -7
  30. package/dist/esm/utils/transpiler.js +0 -122
  31. package/types/index.d.ts +0 -12
  32. package/types/types/common/css-properties.d.ts +0 -46
  33. package/types/types/common/css-property.d.ts +0 -5
  34. package/types/types/main/create.d.ts +0 -10
  35. package/types/types/main/global.d.ts +0 -37
  36. package/types/types/main/vars.d.ts +0 -8
  37. package/types/utils/build.d.ts +0 -1
  38. package/types/utils/hash.d.ts +0 -2
  39. package/types/utils/helper.d.ts +0 -5
  40. package/types/utils/inject-client-css.d.ts +0 -2
  41. package/types/utils/inject-client-global-css.d.ts +0 -1
  42. package/types/utils/inject-server-css.d.ts +0 -2
  43. package/types/utils/transpiler.d.ts +0 -4
@@ -1,46 +0,0 @@
1
- import type { CSSVariableValue, CSSVariableProperty } from '../main/vars';
2
- import type { Properties, Property } from 'csstype';
3
- type ColorValue = Exclude<Property.Color, '-moz-initial'> | (string & {});
4
- type CSSColorProperty = Exclude<ColorValue, SystemColorKeyword>;
5
- type SystemColorKeyword = 'ActiveBorder' | 'ActiveCaption' | 'AppWorkspace' | 'Background' | 'ButtonFace' | 'ButtonHighlight' | 'ButtonShadow' | 'ButtonText' | 'CaptionText' | 'GrayText' | 'Highlight' | 'HighlightText' | 'InactiveBorder' | 'InactiveCaption' | 'InactiveCaptionText' | 'InfoBackground' | 'InfoText' | 'Menu' | 'MenuText' | 'Scrollbar' | 'ThreeDDarkShadow' | 'ThreeDFace' | 'ThreeDHighlight' | 'ThreeDLightShadow' | 'ThreeDShadow' | 'Window' | 'WindowFrame' | 'WindowText';
6
- type ExcludeMozInitial<T> = Exclude<T, '-moz-initial'>;
7
- type CSSTypeProperties = Properties<number | (string & {})>;
8
- type CustomProperties = {
9
- [K in keyof CSSTypeProperties]: ExcludeMozInitial<CSSTypeProperties[K]>;
10
- };
11
- type BaseCSSProperties = {
12
- [K in keyof CustomProperties]: CustomProperties[K] | CSSVariableValue;
13
- };
14
- interface CommonProperties extends BaseCSSProperties {
15
- accentColor?: CSSColorProperty;
16
- color?: CSSColorProperty;
17
- borderLeftColor?: CSSColorProperty;
18
- borderRightColor?: CSSColorProperty;
19
- borderTopColor?: CSSColorProperty;
20
- borderBottomColor?: CSSColorProperty;
21
- borderBlockColor?: CSSColorProperty;
22
- borderBlockStartColor?: CSSColorProperty;
23
- borderBlockEndColor?: CSSColorProperty;
24
- borderInlineColor?: CSSColorProperty;
25
- borderInlineStartColor?: CSSColorProperty;
26
- borderInlineEndColor?: CSSColorProperty;
27
- backgroundColor?: CSSColorProperty;
28
- outlineColor?: CSSColorProperty;
29
- textDecorationColor?: CSSColorProperty;
30
- caretColor?: CSSColorProperty;
31
- columnRuleColor?: CSSColorProperty;
32
- }
33
- type AndString = `&${string}`;
34
- type AndStringType = {
35
- [key in AndString]: CommonProperties;
36
- };
37
- type Colon = `:${string}`;
38
- type ColonType = {
39
- [key in Colon]: CommonProperties;
40
- };
41
- export type MediaQuery = `@media ${string}`;
42
- type MediaQueryType = {
43
- [K in MediaQuery]: CommonProperties | ColonType | AndStringType;
44
- };
45
- export type CSSProperties = CommonProperties | ColonType | CSSVariableProperty | AndStringType | MediaQueryType;
46
- export {};
@@ -1,5 +0,0 @@
1
- type PropertyValue = string | number | PropertyType;
2
- export type PropertyType = {
3
- [key: string]: PropertyValue;
4
- };
5
- export {};
@@ -1,10 +0,0 @@
1
- import type { CSSProperties } from '../common/css-properties';
2
- export type CreateStyleType<T> = {
3
- readonly [K in keyof T]: T[K] extends CSSProperties ? CSSProperties : T[K];
4
- };
5
- export type CreateStyle = {
6
- [key: string]: CSSProperties;
7
- };
8
- export type ReturnType<T> = {
9
- [key in keyof T]: string;
10
- };
@@ -1,37 +0,0 @@
1
- import type { CSSProperties, MediaQuery } from '../common/css-properties';
2
- type JSXType = keyof HTMLElementTagNameMap | '*' | ':root';
3
- type HTMLType = {
4
- [K in JSXType]: CSSProperties;
5
- };
6
- type ClassName = `.${string}`;
7
- type ClassNameType = {
8
- [K in ClassName]: CSSProperties;
9
- };
10
- type Attribute = `${string}[${string}]${string}`;
11
- type AttributeType = {
12
- [K in Attribute]: CSSProperties;
13
- };
14
- type Consecutive = `${JSXType} ${string}`;
15
- type ConsecutiveType = {
16
- [K in Consecutive]: CSSProperties;
17
- };
18
- type PseudoClass = `${JSXType}:${string}`;
19
- type PseudoClassType = {
20
- [K in PseudoClass]: CSSProperties;
21
- };
22
- type PseudoElement = `::${string}`;
23
- type PseudoElementType = {
24
- [K in PseudoElement]: CSSProperties;
25
- };
26
- type KeyframeSelector = 'from' | 'to' | `${number}%`;
27
- export type CreateKeyframes = {
28
- [K in KeyframeSelector]?: CSSProperties;
29
- };
30
- type KeyframesType = {
31
- [K in `@keyframes ${string}`]: CreateKeyframes;
32
- };
33
- type MediaQueryHTMLType = {
34
- [K in MediaQuery]: CSSHTML;
35
- };
36
- export type CSSHTML = HTMLType | ClassNameType | AttributeType | ConsecutiveType | PseudoClassType | PseudoElementType | KeyframesType | MediaQueryHTMLType;
37
- export {};
@@ -1,8 +0,0 @@
1
- type CSSVariableKey = `--${string}`;
2
- export type CSSVariableValue = `var(${CSSVariableKey})`;
3
- export type CSSVariableProperty = {
4
- [key: CSSVariableKey]: string | number;
5
- };
6
- export type CreateVars = Record<string, string | number>;
7
- export type CreateTheme = Record<string, Record<string, string | number>>;
8
- export {};
@@ -1 +0,0 @@
1
- export declare const build: (styleSheet: string, filePath: string, global?: string) => Promise<void>;
@@ -1,2 +0,0 @@
1
- import { CreateStyle, CreateKeyframes } from '../index.js';
2
- export declare function genBase36Hash(object: CreateStyle | CreateKeyframes, n: number): string;
@@ -1,5 +0,0 @@
1
- export declare const isServer: boolean;
2
- export declare const isDevelopment: boolean;
3
- export declare const isDevAndTest: boolean;
4
- export declare const applyCssValue: (value: string | number, cssProp: string) => string;
5
- export declare const camelToKebabCase: (property: string) => string;
@@ -1,2 +0,0 @@
1
- export declare function createStyleElement(hash: string): HTMLStyleElement | null;
2
- export declare function injectClientCSS(hash: string, sheet: string): void;
@@ -1 +0,0 @@
1
- export declare function injectClientGlobalCSS(sheet: string): void;
@@ -1,2 +0,0 @@
1
- export declare function injectServerCSS(hash: string, sheet: string): void;
2
- export declare function getServerCSS(): string;
@@ -1,4 +0,0 @@
1
- import type { CSSHTML } from '../index.js';
2
- export declare function transpiler(object: CSSHTML, base36Hash?: string, core?: string): {
3
- styleSheet: string;
4
- };