zss-engine 2.2.3 → 2.2.4

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/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyCssValue = exports.camelToKebabCase = exports.build = exports.overrideLonghand = exports.processAtomicProps = exports.splitAtomicAndNested = exports.transpileAtomic = exports.transpile = exports.genBase36Hash = exports.isTestingDevelopment = exports.isDevelopment = exports.isServer = void 0;
3
+ exports.applyCssValue = exports.camelToKebabCase = exports.overrideLonghand = exports.processAtomicProps = exports.splitAtomicAndNested = exports.transpileAtomic = exports.transpile = exports.genBase36Hash = exports.isTestingDevelopment = exports.isDevelopment = exports.isServer = void 0;
4
4
  var helper_js_1 = require("./utils/helper.js");
5
5
  Object.defineProperty(exports, "isServer", { enumerable: true, get: function () { return helper_js_1.isServer; } });
6
6
  Object.defineProperty(exports, "isDevelopment", { enumerable: true, get: function () { return helper_js_1.isDevelopment; } });
@@ -16,8 +16,6 @@ Object.defineProperty(exports, "splitAtomicAndNested", { enumerable: true, get:
16
16
  Object.defineProperty(exports, "processAtomicProps", { enumerable: true, get: function () { return processor_atomic_js_1.processAtomicProps; } });
17
17
  var override_longhand_js_1 = require("./utils/override-longhand.js");
18
18
  Object.defineProperty(exports, "overrideLonghand", { enumerable: true, get: function () { return override_longhand_js_1.overrideLonghand; } });
19
- var build_js_1 = require("./utils/build.js");
20
- Object.defineProperty(exports, "build", { enumerable: true, get: function () { return build_js_1.build; } });
21
19
  var helper_js_2 = require("./utils/helper.js");
22
20
  Object.defineProperty(exports, "camelToKebabCase", { enumerable: true, get: function () { return helper_js_2.camelToKebabCase; } });
23
21
  Object.defineProperty(exports, "applyCssValue", { enumerable: true, get: function () { return helper_js_2.applyCssValue; } });
package/dist/esm/index.js CHANGED
@@ -4,5 +4,4 @@ export { transpile } from './utils/transpile.js';
4
4
  export { transpileAtomic } from './utils/transpile-atomic.js';
5
5
  export { splitAtomicAndNested, processAtomicProps } from './utils/processor-atomic.js';
6
6
  export { overrideLonghand } from './utils/override-longhand.js';
7
- export { build } from './utils/build.js';
8
7
  export { camelToKebabCase, applyCssValue } from './utils/helper.js';
@@ -1,7 +1,6 @@
1
1
  export type { CSSProperties } from './types/common/css-properties';
2
- export type { CreateStyleType, ReturnType, CreateStyle } from './types/main/create';
3
- export type { CSSHTML, Keyframes } from './types/main/global';
4
- export type { CreateStatic, CreateTheme, ReturnVariableType, Styles } from './types/main/variableTypes';
2
+ export type { CreateStyle } from './types/main/create';
3
+ export type { CreateTheme } from './types/main/variableTypes';
5
4
  export type { ViewTransition } from './types/main/viewTransition';
6
5
  export { isServer, isDevelopment, isTestingDevelopment } from './utils/helper.js';
7
6
  export { genBase36Hash } from './utils/hash.js';
@@ -9,5 +8,4 @@ export { transpile } from './utils/transpile.js';
9
8
  export { transpileAtomic } from './utils/transpile-atomic.js';
10
9
  export { splitAtomicAndNested, processAtomicProps } from './utils/processor-atomic.js';
11
10
  export { overrideLonghand } from './utils/override-longhand.js';
12
- export { build } from './utils/build.js';
13
11
  export { camelToKebabCase, applyCssValue } from './utils/helper.js';
@@ -1,16 +1,4 @@
1
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
2
  export type CreateStyle = {
6
3
  [key: string]: CSSProperties;
7
4
  };
8
- type Selector<Properties> = {
9
- readonly properties: Properties;
10
- };
11
- export type ReturnType<T> = {
12
- [K in keyof T]: Readonly<{
13
- [P in keyof T[K]]: P extends `@media ${string}` | `@container ${string}` | `:${string}` | `&${string}` ? Selector<keyof T[K][P]> : T[K][P];
14
- }>;
15
- };
16
- export {};
@@ -3,12 +3,5 @@ export type CSSVariableValue = `var(${CSSVariableKey})`;
3
3
  export type CSSVariableProperty = {
4
4
  [key: CSSVariableKey]: string | number;
5
5
  };
6
- export type CreateStatic = Record<string, string | number>;
7
6
  export type CreateTheme = Record<string, Record<string, string | number>>;
8
- export type ReturnVariableType<T> = {
9
- [K in keyof T]: CSSVariableValue;
10
- };
11
- export type Styles = {
12
- [key: CSSVariableKey]: string;
13
- };
14
7
  export {};
@@ -1,4 +1,4 @@
1
- import type { CSSHTML } from '../index.js';
1
+ import type { CSSHTML } from '../types/main/global.js';
2
2
  export declare function transpile(object: CSSHTML, base36Hash?: string, core?: string): {
3
3
  styleSheet: string;
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zss-engine",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "Zero-runtime StyleSheet Engine",
5
5
  "funding": "https://github.com/sponsors/refirst11",
6
6
  "author": "Refirst 11",
@@ -1,28 +0,0 @@
1
- 'use server';
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.build = void 0;
5
- const helper_js_1 = require("./helper.js");
6
- const build = async (styleSheet, filePath) => {
7
- if (!helper_js_1.isServer)
8
- return;
9
- const fs = await import('fs');
10
- try {
11
- if (fs.existsSync(filePath)) {
12
- const css = fs.readFileSync(filePath, 'utf-8');
13
- if (!css.includes(styleSheet)) {
14
- fs.appendFileSync(filePath, styleSheet, 'utf-8');
15
- if (process.argv.includes('--view')) {
16
- const { styleText } = await import('util');
17
- const line = styleText('gray', '─'.repeat(60));
18
- console.log('\n' + styleText(['green', 'bold'], '✓ extract...') + '\n\n' + styleText('cyan', styleSheet) + '\n' + line);
19
- }
20
- }
21
- }
22
- return;
23
- }
24
- catch (error) {
25
- console.error('Error writing to file:', error);
26
- }
27
- };
28
- exports.build = build;
@@ -1,24 +0,0 @@
1
- 'use server';
2
- import { isServer } from './helper.js';
3
- export const build = async (styleSheet, filePath) => {
4
- if (!isServer)
5
- return;
6
- const fs = await import('fs');
7
- try {
8
- if (fs.existsSync(filePath)) {
9
- const css = fs.readFileSync(filePath, 'utf-8');
10
- if (!css.includes(styleSheet)) {
11
- fs.appendFileSync(filePath, styleSheet, 'utf-8');
12
- if (process.argv.includes('--view')) {
13
- const { styleText } = await import('util');
14
- const line = styleText('gray', '─'.repeat(60));
15
- console.log('\n' + styleText(['green', 'bold'], '✓ extract...') + '\n\n' + styleText('cyan', styleSheet) + '\n' + line);
16
- }
17
- }
18
- }
19
- return;
20
- }
21
- catch (error) {
22
- console.error('Error writing to file:', error);
23
- }
24
- };
@@ -1 +0,0 @@
1
- export declare const build: (styleSheet: string, filePath: string) => Promise<void>;