zss-engine 0.2.75 → 0.2.77
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 +3 -1
- package/dist/cjs/utils/is-hash-in-style-sheets.js +14 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/utils/is-hash-in-style-sheets.js +11 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/is-hash-in-style-sheets.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.injectClientGlobalCSS = exports.injectClientCSS = exports.applyCssValue = exports.camelToKebabCase = exports.build = exports.processAtomicProps = exports.splitAtomicAndNested = exports.transpileAtomic = exports.transpile = exports.genBase36Hash = exports.isTestingDevelopment = exports.isDevelopment = exports.isServer = void 0;
|
|
3
|
+
exports.isHashInStyleSheets = exports.injectClientGlobalCSS = exports.injectClientCSS = exports.applyCssValue = exports.camelToKebabCase = exports.build = 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; } });
|
|
@@ -23,3 +23,5 @@ var inject_client_css_js_1 = require("./utils/inject-client-css.js");
|
|
|
23
23
|
Object.defineProperty(exports, "injectClientCSS", { enumerable: true, get: function () { return inject_client_css_js_1.injectClientCSS; } });
|
|
24
24
|
var inject_client_global_css_js_1 = require("./utils/inject-client-global-css.js");
|
|
25
25
|
Object.defineProperty(exports, "injectClientGlobalCSS", { enumerable: true, get: function () { return inject_client_global_css_js_1.injectClientGlobalCSS; } });
|
|
26
|
+
var is_hash_in_style_sheets_js_1 = require("./utils/is-hash-in-style-sheets.js");
|
|
27
|
+
Object.defineProperty(exports, "isHashInStyleSheets", { enumerable: true, get: function () { return is_hash_in_style_sheets_js_1.isHashInStyleSheets; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isHashInStyleSheets = isHashInStyleSheets;
|
|
4
|
+
function isHashInStyleSheets(hash) {
|
|
5
|
+
const sheets = Array.from(document.styleSheets);
|
|
6
|
+
return sheets.some(sheet => {
|
|
7
|
+
try {
|
|
8
|
+
return Array.from(sheet.cssRules).some(rule => rule.selectorText === `.${hash}`);
|
|
9
|
+
}
|
|
10
|
+
catch (_err) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -7,3 +7,4 @@ export { build } from './utils/build.js';
|
|
|
7
7
|
export { camelToKebabCase, applyCssValue } from './utils/helper.js';
|
|
8
8
|
export { injectClientCSS } from './utils/inject-client-css.js';
|
|
9
9
|
export { injectClientGlobalCSS } from './utils/inject-client-global-css.js';
|
|
10
|
+
export { isHashInStyleSheets } from './utils/is-hash-in-style-sheets.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function isHashInStyleSheets(hash) {
|
|
2
|
+
const sheets = Array.from(document.styleSheets);
|
|
3
|
+
return sheets.some(sheet => {
|
|
4
|
+
try {
|
|
5
|
+
return Array.from(sheet.cssRules).some(rule => rule.selectorText === `.${hash}`);
|
|
6
|
+
}
|
|
7
|
+
catch (_err) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export { build } from './utils/build.js';
|
|
|
11
11
|
export { camelToKebabCase, applyCssValue } from './utils/helper.js';
|
|
12
12
|
export { injectClientCSS } from './utils/inject-client-css.js';
|
|
13
13
|
export { injectClientGlobalCSS } from './utils/inject-client-global-css.js';
|
|
14
|
+
export { isHashInStyleSheets } from './utils/is-hash-in-style-sheets.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isHashInStyleSheets(hash: string): boolean;
|