zss-engine 0.2.95 → 0.2.96
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.isHashInStyleSheets = exports.injectClientGlobalCSS = exports.injectClientQuery = exports.injectClientCSS = exports.applyCssValue = exports.camelToKebabCase = exports.build = exports.overrideLonghand = exports.
|
|
3
|
+
exports.isHashInStyleSheets = exports.injectClientGlobalCSS = exports.injectClientQuery = exports.injectClientCSS = 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;
|
|
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; } });
|
|
@@ -14,9 +14,6 @@ Object.defineProperty(exports, "transpileAtomic", { enumerable: true, get: funct
|
|
|
14
14
|
var processor_atomic_js_1 = require("./utils/processor-atomic.js");
|
|
15
15
|
Object.defineProperty(exports, "splitAtomicAndNested", { enumerable: true, get: function () { return processor_atomic_js_1.splitAtomicAndNested; } });
|
|
16
16
|
Object.defineProperty(exports, "processAtomicProps", { enumerable: true, get: function () { return processor_atomic_js_1.processAtomicProps; } });
|
|
17
|
-
var shorthand_js_1 = require("./utils/shorthand.js");
|
|
18
|
-
Object.defineProperty(exports, "SHORTHAND_PROPERTIES", { enumerable: true, get: function () { return shorthand_js_1.SHORTHAND_PROPERTIES; } });
|
|
19
|
-
Object.defineProperty(exports, "LONG_TO_SHORT", { enumerable: true, get: function () { return shorthand_js_1.LONG_TO_SHORT; } });
|
|
20
17
|
var override_longhand_1 = require("./utils/override-longhand");
|
|
21
18
|
Object.defineProperty(exports, "overrideLonghand", { enumerable: true, get: function () { return override_longhand_1.overrideLonghand; } });
|
|
22
19
|
var build_js_1 = require("./utils/build.js");
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.overrideLonghand = void 0;
|
|
4
|
-
const
|
|
4
|
+
const helper_js_1 = require("./helper.js");
|
|
5
|
+
const shorthand_js_1 = require("./shorthand.js");
|
|
5
6
|
const overrideLonghand = (style) => {
|
|
6
7
|
const props = Object.keys(style);
|
|
7
8
|
const propsToRemove = new Set();
|
|
@@ -13,15 +14,15 @@ const overrideLonghand = (style) => {
|
|
|
13
14
|
}
|
|
14
15
|
const shorthandsInStyle = {};
|
|
15
16
|
for (const { key, index } of plainProps) {
|
|
16
|
-
const kebab = (0,
|
|
17
|
-
if (
|
|
17
|
+
const kebab = (0, helper_js_1.camelToKebabCase)(key);
|
|
18
|
+
if (shorthand_js_1.SHORTHAND_PROPERTIES[kebab]) {
|
|
18
19
|
shorthandsInStyle[kebab] = index;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
for (const { key, index } of plainProps) {
|
|
22
|
-
const kebab = (0,
|
|
23
|
-
if (!
|
|
24
|
-
const longhands =
|
|
23
|
+
const kebab = (0, helper_js_1.camelToKebabCase)(key);
|
|
24
|
+
if (!shorthand_js_1.SHORTHAND_PROPERTIES[kebab]) {
|
|
25
|
+
const longhands = shorthand_js_1.LONG_TO_SHORT[kebab] || [];
|
|
25
26
|
for (const shorthand of longhands) {
|
|
26
27
|
if (shorthandsInStyle[shorthand] > index) {
|
|
27
28
|
propsToRemove.add(key);
|
package/dist/esm/index.js
CHANGED
|
@@ -3,7 +3,6 @@ export { genBase36Hash } from './utils/hash.js';
|
|
|
3
3
|
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
|
-
export { SHORTHAND_PROPERTIES, LONG_TO_SHORT } from './utils/shorthand.js';
|
|
7
6
|
export { overrideLonghand } from './utils/override-longhand';
|
|
8
7
|
export { build } from './utils/build.js';
|
|
9
8
|
export { camelToKebabCase, applyCssValue } from './utils/helper.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { camelToKebabCase
|
|
1
|
+
import { camelToKebabCase } from './helper.js';
|
|
2
|
+
import { LONG_TO_SHORT, SHORTHAND_PROPERTIES } from './shorthand.js';
|
|
2
3
|
export const overrideLonghand = (style) => {
|
|
3
4
|
const props = Object.keys(style);
|
|
4
5
|
const propsToRemove = new Set();
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export { genBase36Hash } from './utils/hash.js';
|
|
|
8
8
|
export { transpile } from './utils/transpile.js';
|
|
9
9
|
export { transpileAtomic } from './utils/transpile-atomic.js';
|
|
10
10
|
export { splitAtomicAndNested, processAtomicProps } from './utils/processor-atomic.js';
|
|
11
|
-
export { SHORTHAND_PROPERTIES, LONG_TO_SHORT } from './utils/shorthand.js';
|
|
12
11
|
export { overrideLonghand } from './utils/override-longhand';
|
|
13
12
|
export { build } from './utils/build.js';
|
|
14
13
|
export { camelToKebabCase, applyCssValue } from './utils/helper.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CreateStyle } from '
|
|
1
|
+
import type { CreateStyle } from '../types/main/create.js';
|
|
2
2
|
export declare const overrideLonghand: (style: CreateStyle) => CreateStyle;
|