zss-engine 2.2.6 → 2.2.7

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.
@@ -32,15 +32,16 @@ const overrideLonghand = (style) => {
32
32
  }
33
33
  }
34
34
  const finalStyle = {};
35
+ const queryStyle = style;
35
36
  for (const prop of props) {
36
37
  if (propsToRemove.has(prop)) {
37
38
  continue;
38
39
  }
39
40
  if (prop.startsWith('@')) {
40
- finalStyle[prop] = (0, exports.overrideLonghand)(style[prop]);
41
+ finalStyle[prop] = (0, exports.overrideLonghand)(queryStyle[prop]);
41
42
  }
42
43
  else {
43
- finalStyle[prop] = style[prop];
44
+ finalStyle[prop] = queryStyle[prop];
44
45
  }
45
46
  }
46
47
  return finalStyle;
@@ -5,21 +5,23 @@ exports.processAtomicProps = processAtomicProps;
5
5
  const index_js_1 = require("../index.js");
6
6
  const shorthand_js_1 = require("./shorthand.js");
7
7
  function splitAtomicAndNested(obj, flat, nonFlat) {
8
+ const queryFlat = flat;
9
+ const queryNonFlat = nonFlat;
8
10
  Object.entries(obj).forEach(([property, value]) => {
9
11
  if (property.startsWith(':') || property.startsWith('[')) {
10
- nonFlat[property] = value;
12
+ queryNonFlat[property] = value;
11
13
  }
12
14
  else if (property.startsWith('@media') || property.startsWith('@container')) {
13
15
  const innerFlat = {};
14
16
  const innerNonFlat = {};
15
17
  splitAtomicAndNested(value, innerFlat, innerNonFlat);
16
18
  if (Object.keys(innerFlat).length)
17
- flat[property] = innerFlat;
19
+ queryFlat[property] = innerFlat;
18
20
  if (Object.keys(innerNonFlat).length)
19
- nonFlat[property] = innerNonFlat;
21
+ queryNonFlat[property] = innerNonFlat;
20
22
  }
21
23
  else {
22
- flat[property] = value;
24
+ queryFlat[property] = value;
23
25
  }
24
26
  });
25
27
  }
@@ -31,12 +33,12 @@ Object.entries(shorthand_js_1.SHORTHAND_PROPERTIES).forEach(([shorthand, longhan
31
33
  });
32
34
  function processAtomicProps(flatProps, atomicMap, parentAtRule) {
33
35
  const resultQueue = [];
34
- for (const [property, value] of Object.entries(flatProps)) {
35
- if (property.startsWith('@media') || property.startsWith('@container')) {
36
- processAtomicProps(value, atomicMap, property);
36
+ for (const [key, style] of Object.entries(flatProps)) {
37
+ if (key.startsWith('@media') || key.startsWith('@container')) {
38
+ processAtomicProps(style, atomicMap, key);
37
39
  continue;
38
40
  }
39
- resultQueue.push([property, value]);
41
+ resultQueue.push([key, style]);
40
42
  }
41
43
  for (const [property, value] of resultQueue) {
42
44
  const CSSProp = (0, index_js_1.camelToKebabCase)(property);
@@ -29,15 +29,16 @@ export const overrideLonghand = (style) => {
29
29
  }
30
30
  }
31
31
  const finalStyle = {};
32
+ const queryStyle = style;
32
33
  for (const prop of props) {
33
34
  if (propsToRemove.has(prop)) {
34
35
  continue;
35
36
  }
36
37
  if (prop.startsWith('@')) {
37
- finalStyle[prop] = overrideLonghand(style[prop]);
38
+ finalStyle[prop] = overrideLonghand(queryStyle[prop]);
38
39
  }
39
40
  else {
40
- finalStyle[prop] = style[prop];
41
+ finalStyle[prop] = queryStyle[prop];
41
42
  }
42
43
  }
43
44
  return finalStyle;
@@ -1,21 +1,23 @@
1
1
  import { camelToKebabCase, genBase36Hash, applyCssValue, transpileAtomic } from '../index.js';
2
2
  import { SHORTHAND_PROPERTIES } from './shorthand.js';
3
3
  function splitAtomicAndNested(obj, flat, nonFlat) {
4
+ const queryFlat = flat;
5
+ const queryNonFlat = nonFlat;
4
6
  Object.entries(obj).forEach(([property, value]) => {
5
7
  if (property.startsWith(':') || property.startsWith('[')) {
6
- nonFlat[property] = value;
8
+ queryNonFlat[property] = value;
7
9
  }
8
10
  else if (property.startsWith('@media') || property.startsWith('@container')) {
9
11
  const innerFlat = {};
10
12
  const innerNonFlat = {};
11
13
  splitAtomicAndNested(value, innerFlat, innerNonFlat);
12
14
  if (Object.keys(innerFlat).length)
13
- flat[property] = innerFlat;
15
+ queryFlat[property] = innerFlat;
14
16
  if (Object.keys(innerNonFlat).length)
15
- nonFlat[property] = innerNonFlat;
17
+ queryNonFlat[property] = innerNonFlat;
16
18
  }
17
19
  else {
18
- flat[property] = value;
20
+ queryFlat[property] = value;
19
21
  }
20
22
  });
21
23
  }
@@ -27,12 +29,12 @@ Object.entries(SHORTHAND_PROPERTIES).forEach(([shorthand, longhands]) => {
27
29
  });
28
30
  function processAtomicProps(flatProps, atomicMap, parentAtRule) {
29
31
  const resultQueue = [];
30
- for (const [property, value] of Object.entries(flatProps)) {
31
- if (property.startsWith('@media') || property.startsWith('@container')) {
32
- processAtomicProps(value, atomicMap, property);
32
+ for (const [key, style] of Object.entries(flatProps)) {
33
+ if (key.startsWith('@media') || key.startsWith('@container')) {
34
+ processAtomicProps(style, atomicMap, key);
33
35
  continue;
34
36
  }
35
- resultQueue.push([property, value]);
37
+ resultQueue.push([key, style]);
36
38
  }
37
39
  for (const [property, value] of resultQueue) {
38
40
  const CSSProp = camelToKebabCase(property);
@@ -1,5 +1,4 @@
1
1
  export type { CSSProperties } from './types/common/css-properties';
2
- export type { CreateStyle } from './types/main/create';
3
2
  export type { CreateTheme } from './types/main/variableTypes';
4
3
  export type { ViewTransition } from './types/main/viewTransition';
5
4
  export { isServer, isDevelopment, isTestingDevelopment } from './utils/helper.js';
@@ -1,2 +1,2 @@
1
- import type { CreateStyle } from '../types/main/create.js';
2
- export declare const overrideLonghand: (style: CreateStyle) => CreateStyle;
1
+ import { CSSProperties } from '../types/common/css-properties.js';
2
+ export declare const overrideLonghand: (style: CSSProperties) => CSSProperties;
@@ -1,4 +1,4 @@
1
- import type { CSSProperties, CreateStyle } from '../index.js';
2
- declare function splitAtomicAndNested(obj: CSSProperties, flat: CreateStyle, nonFlat: CreateStyle): void;
1
+ import type { CSSProperties } from '../index.js';
2
+ declare function splitAtomicAndNested(obj: CSSProperties, flat: CSSProperties, nonFlat: CSSProperties): void;
3
3
  declare function processAtomicProps(flatProps: CSSProperties, atomicMap: Map<string, string>, parentAtRule?: string): void;
4
4
  export { splitAtomicAndNested, processAtomicProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zss-engine",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "description": "A CSS-in-JS transpiler engine for building zero-runtime stylesheets at build time.",
5
5
  "funding": "https://github.com/sponsors/refirst11",
6
6
  "author": "Refirst 11",
@@ -51,13 +51,13 @@
51
51
  "csstype": "3.2.3"
52
52
  },
53
53
  "devDependencies": {
54
- "@types/jest": "^29.5.14",
55
- "@types/node": "^22.18.10",
56
- "jest": "^29.7.0",
57
- "jest-environment-jsdom": "^29.7.0",
54
+ "@types/jest": "^30.0.0",
55
+ "@types/node": "^25.6.0",
56
+ "jest": "^30.3.0",
57
+ "jest-environment-jsdom": "^30.3.0",
58
58
  "rimraf": "^6.1.2",
59
- "ts-jest": "^29.4.5",
60
- "typescript": "^5.9.3"
59
+ "ts-jest": "^29.4.9",
60
+ "typescript": "^6.0.2"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public",
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import type { CSSProperties } from '../common/css-properties';
2
- export type CreateStyle = {
3
- [key: string]: CSSProperties;
4
- };