zss-engine 0.2.14 → 0.2.15

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/index.js CHANGED
@@ -14,11 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.transpiler = exports.build = exports.getServerCSS = exports.injectServerCSS = exports.injectClientGlobalCSS = exports.injectClientCSS = exports.genBase36Hash = void 0;
17
+ exports.getServerCSS = exports.injectServerCSS = exports.injectClientGlobalCSS = exports.injectClientCSS = exports.build = exports.transpiler = exports.genBase36Hash = void 0;
18
18
  __exportStar(require("./types"), exports);
19
19
  __exportStar(require("./utils/helper"), exports);
20
20
  var hash_1 = require("./utils/hash");
21
21
  Object.defineProperty(exports, "genBase36Hash", { enumerable: true, get: function () { return hash_1.genBase36Hash; } });
22
+ var transpiler_1 = require("./utils/transpiler");
23
+ Object.defineProperty(exports, "transpiler", { enumerable: true, get: function () { return transpiler_1.transpiler; } });
24
+ var build_1 = require("./utils/build");
25
+ Object.defineProperty(exports, "build", { enumerable: true, get: function () { return build_1.build; } });
22
26
  var inject_client_css_1 = require("./utils/inject-client-css");
23
27
  Object.defineProperty(exports, "injectClientCSS", { enumerable: true, get: function () { return inject_client_css_1.injectClientCSS; } });
24
28
  var inject_client_global_css_1 = require("./utils/inject-client-global-css");
@@ -26,7 +30,3 @@ Object.defineProperty(exports, "injectClientGlobalCSS", { enumerable: true, get:
26
30
  var inject_server_css_1 = require("./utils/inject-server-css");
27
31
  Object.defineProperty(exports, "injectServerCSS", { enumerable: true, get: function () { return inject_server_css_1.injectServerCSS; } });
28
32
  Object.defineProperty(exports, "getServerCSS", { enumerable: true, get: function () { return inject_server_css_1.getServerCSS; } });
29
- var build_1 = require("./utils/build");
30
- Object.defineProperty(exports, "build", { enumerable: true, get: function () { return build_1.build; } });
31
- var transpiler_1 = require("./utils/transpiler");
32
- Object.defineProperty(exports, "transpiler", { enumerable: true, get: function () { return transpiler_1.transpiler; } });
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  export * from './types';
2
2
  export * from './utils/helper';
3
3
  export { genBase36Hash } from './utils/hash';
4
+ export { transpiler } from './utils/transpiler';
5
+ export { build } from './utils/build';
4
6
  export { injectClientCSS } from './utils/inject-client-css';
5
7
  export { injectClientGlobalCSS } from './utils/inject-client-global-css';
6
8
  export { injectServerCSS, getServerCSS } from './utils/inject-server-css';
7
- export { build } from './utils/build';
8
- export { transpiler } from './utils/transpiler';
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.camelToKebabCase = exports.applyCssValue = exports.isDevServer = exports.isDevAndTest = exports.isDevelopment = exports.isServer = void 0;
3
+ exports.camelToKebabCase = exports.applyCssValue = exports.isDevAndTest = exports.isDevelopment = exports.isServer = void 0;
4
4
  const isWindowDefined = typeof window !== 'undefined';
5
5
  const isDocumentDefined = typeof document !== 'undefined';
6
6
  exports.isServer = !isWindowDefined || !isDocumentDefined;
7
7
  exports.isDevelopment = process.env.NODE_ENV === 'development';
8
8
  exports.isDevAndTest = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
9
- exports.isDevServer = exports.isDevelopment && exports.isServer;
10
9
  const exception = ['line-height', 'font-weight', 'opacity', 'scale', 'z-index', 'column-count', 'order', 'orphans', 'widows'];
11
10
  const applyCssValue = (value, cssProp) => {
12
11
  if (typeof value === 'number') {
@@ -3,7 +3,6 @@ const isDocumentDefined = typeof document !== 'undefined';
3
3
  export const isServer = !isWindowDefined || !isDocumentDefined;
4
4
  export const isDevelopment = process.env.NODE_ENV === 'development';
5
5
  export const isDevAndTest = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
6
- export const isDevServer = isDevelopment && isServer;
7
6
  const exception = ['line-height', 'font-weight', 'opacity', 'scale', 'z-index', 'column-count', 'order', 'orphans', 'widows'];
8
7
  export const applyCssValue = (value, cssProp) => {
9
8
  if (typeof value === 'number') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zss-engine",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Zero-runtime Style Sheet Engine",
5
5
  "keywords": [
6
6
  "zero-runtime",
package/types/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export * from './types';
2
2
  export * from './utils/helper';
3
3
  export { genBase36Hash } from './utils/hash';
4
+ export { transpiler } from './utils/transpiler';
5
+ export { build } from './utils/build';
4
6
  export { injectClientCSS } from './utils/inject-client-css';
5
7
  export { injectClientGlobalCSS } from './utils/inject-client-global-css';
6
8
  export { injectServerCSS, getServerCSS } from './utils/inject-server-css';
7
- export { build } from './utils/build';
8
- export { transpiler } from './utils/transpiler';
@@ -1,4 +1,4 @@
1
- import type { CSSVariableValue } from '../main/vars';
1
+ import type { CSSVariableValue, CSSVariableProperty } from '../main/vars';
2
2
  import type { Properties, Property } from 'csstype';
3
3
  type ColorValue = Exclude<Property.Color, '-moz-initial'> | (string & {});
4
4
  type CSSColorProperty = Exclude<ColorValue, SystemColorKeyword>;
@@ -42,5 +42,5 @@ export type MediaQuery = `@media ${string}`;
42
42
  type MediaQueryType = {
43
43
  [K in MediaQuery]: CommonProperties | ColonType | AndStringType;
44
44
  };
45
- export type CustomProperties = CommonProperties | ColonType | AndStringType | MediaQueryType;
45
+ export type CustomProperties = CommonProperties | ColonType | CSSVariableProperty | AndStringType | MediaQueryType;
46
46
  export {};
@@ -1,10 +1,10 @@
1
1
  export type VarsDefinition = Record<string, string | number | Record<string, string | number>>;
2
2
  type CSSVariableKey = `--${string}`;
3
3
  export type CSSVariableValue = `var(${CSSVariableKey})`;
4
- type CSSVariableProperties = {
4
+ export type CSSVariableProperty = {
5
5
  [key: CSSVariableKey]: string | number;
6
6
  };
7
7
  export type VarsTransformed = {
8
- [key: string]: CSSVariableProperties;
8
+ [key: string]: CSSVariableProperty;
9
9
  };
10
10
  export {};
@@ -1,6 +1,5 @@
1
1
  export declare const isServer: boolean;
2
2
  export declare const isDevelopment: boolean;
3
3
  export declare const isDevAndTest: boolean;
4
- export declare const isDevServer: boolean;
5
4
  export declare const applyCssValue: (value: string | number, cssProp: string) => string;
6
5
  export declare const camelToKebabCase: (property: string) => string;