@css-hooks/core 4.0.0-next.2 → 4.0.0-next.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/README.md +5 -5
- package/cjs/index.js +5 -4
- package/esm/index.js +5 -4
- package/package.json +1 -1
- package/types/index.d.ts +3 -1
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.
|
|
2
|
+
<a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.4/.github/logomark.svg" height="128" /></a><br/><br/>
|
|
3
3
|
<div id="wordmark">
|
|
4
|
-
<a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.
|
|
4
|
+
<a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.4/.github/wordmark-dark.svg" width="256"></a>
|
|
5
5
|
</div>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
<br/>
|
|
9
9
|
|
|
10
10
|
<div align="center" id="badges">
|
|
11
|
-
<a href="https://github.com/css-hooks/css-hooks/tree/v4.0.0-next.
|
|
12
|
-
<a href="https://www.npmjs.com/package/@css-hooks/core/v/4.0.0-next.
|
|
13
|
-
<a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.
|
|
11
|
+
<a href="https://github.com/css-hooks/css-hooks/tree/v4.0.0-next.4"><img src="https://img.shields.io/badge/tag-v4.0.0--next.4-ffd700" alt="tag v4.0.0-next.4"></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@css-hooks/core/v/4.0.0-next.4"><img src="https://img.shields.io/badge/npm-v4.0.0--next.4-ffd700" alt="npm version"></a>
|
|
13
|
+
<a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.4/LICENSE"><img src="https://img.shields.io/badge/license-MIT-ffd700" alt="license"></a>
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
16
|
---
|
package/cjs/index.js
CHANGED
|
@@ -135,7 +135,8 @@ function buildHooksSystem(stringify = String) {
|
|
|
135
135
|
};
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
const hashAlphabet = "
|
|
138
|
+
const hashAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
139
|
+
const hashAlphabetLength = hashAlphabet.length;
|
|
139
140
|
function createHash(value) {
|
|
140
141
|
let h1 = 0xdeadbeef;
|
|
141
142
|
let h2 = 0x41c6ce57;
|
|
@@ -152,9 +153,9 @@ function createHash(value) {
|
|
|
152
153
|
Math.imul(h1 ^ (h1 >>> 13), 0xc2b2ae35);
|
|
153
154
|
let hash = (h1 >>> 0) + 0x100000000 * (h2 & 0xf);
|
|
154
155
|
let encoded = "";
|
|
155
|
-
for (let i = 0; i <
|
|
156
|
-
encoded = hashAlphabet.charAt(hash %
|
|
157
|
-
hash = Math.floor(hash /
|
|
156
|
+
for (let i = 0; i < 7; i++) {
|
|
157
|
+
encoded = hashAlphabet.charAt(hash % hashAlphabetLength) + encoded;
|
|
158
|
+
hash = Math.floor(hash / hashAlphabetLength);
|
|
158
159
|
}
|
|
159
160
|
return encoded;
|
|
160
161
|
}
|
package/esm/index.js
CHANGED
|
@@ -132,7 +132,8 @@ export function buildHooksSystem(stringify = String) {
|
|
|
132
132
|
};
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
const hashAlphabet = "
|
|
135
|
+
const hashAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
136
|
+
const hashAlphabetLength = hashAlphabet.length;
|
|
136
137
|
function createHash(value) {
|
|
137
138
|
let h1 = 0xdeadbeef;
|
|
138
139
|
let h2 = 0x41c6ce57;
|
|
@@ -149,9 +150,9 @@ function createHash(value) {
|
|
|
149
150
|
Math.imul(h1 ^ (h1 >>> 13), 0xc2b2ae35);
|
|
150
151
|
let hash = (h1 >>> 0) + 0x100000000 * (h2 & 0xf);
|
|
151
152
|
let encoded = "";
|
|
152
|
-
for (let i = 0; i <
|
|
153
|
-
encoded = hashAlphabet.charAt(hash %
|
|
154
|
-
hash = Math.floor(hash /
|
|
153
|
+
for (let i = 0; i < 7; i++) {
|
|
154
|
+
encoded = hashAlphabet.charAt(hash % hashAlphabetLength) + encoded;
|
|
155
|
+
hash = Math.floor(hash / hashAlphabetLength);
|
|
155
156
|
}
|
|
156
157
|
return encoded;
|
|
157
158
|
}
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -77,8 +77,10 @@ type ForbidCSSPropertyConflicts<CSSPropertyConflicts extends object, OverrideCSS
|
|
|
77
77
|
* an app framework (e.g., React's `CSSProperties` type)
|
|
78
78
|
* @typeParam CSSPropertyConflicts - A map from CSS properties to the properties
|
|
79
79
|
* with which they conflict
|
|
80
|
+
*
|
|
81
|
+
* @public
|
|
80
82
|
*/
|
|
81
|
-
interface CreateHooksResult<S, CSSProperties, CSSPropertyConflicts extends object> {
|
|
83
|
+
export interface CreateHooksResult<S, CSSProperties, CSSPropertyConflicts extends object> {
|
|
82
84
|
/**
|
|
83
85
|
* Creates a function that enhances a style object with conditional override
|
|
84
86
|
* styles.
|