@kbach/react 0.3.8 → 0.3.10
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/{chunk-H5232HHF.mjs → chunk-3AMSZMOL.mjs} +1 -1
- package/dist/{chunk-WYY3PRRC.mjs → chunk-LZYPVC5K.mjs} +39 -9
- package/dist/index.js +39 -9
- package/dist/index.mjs +1 -1
- package/dist/jsx-dev-runtime.js +34 -8
- package/dist/jsx-dev-runtime.mjs +2 -2
- package/dist/jsx-runtime.js +34 -8
- package/dist/jsx-runtime.mjs +2 -2
- package/package.json +1 -1
|
@@ -2040,12 +2040,10 @@ function resolve(classString, theme, darkMode = "attribute") {
|
|
|
2040
2040
|
}
|
|
2041
2041
|
}
|
|
2042
2042
|
styleCache.set(cacheKey, result);
|
|
2043
|
-
if (isWeb
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
}
|
|
2048
|
-
});
|
|
2043
|
+
if (isWeb) {
|
|
2044
|
+
for (const { cls, bucketKey, styles } of injectQueue) {
|
|
2045
|
+
injectClassRule(cls, bucketKey, styles, darkMode);
|
|
2046
|
+
}
|
|
2049
2047
|
}
|
|
2050
2048
|
return result;
|
|
2051
2049
|
}
|
|
@@ -2319,13 +2317,45 @@ var NOOP_SUB = (_) => () => {
|
|
|
2319
2317
|
};
|
|
2320
2318
|
var ZERO_SNAP = () => 0;
|
|
2321
2319
|
var EMPTY_BREAKPOINTS = /* @__PURE__ */ new Set();
|
|
2320
|
+
var _webListeners = null;
|
|
2321
|
+
var _webRaf = 0;
|
|
2322
|
+
function _webResizeHandler() {
|
|
2323
|
+
cancelAnimationFrame(_webRaf);
|
|
2324
|
+
_webRaf = requestAnimationFrame(() => {
|
|
2325
|
+
if (_webListeners) for (const cb of _webListeners) cb();
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
function subscribeWebWidth(cb) {
|
|
2329
|
+
if (typeof window === "undefined") return () => {
|
|
2330
|
+
};
|
|
2331
|
+
if (!_webListeners) {
|
|
2332
|
+
_webListeners = /* @__PURE__ */ new Set();
|
|
2333
|
+
window.addEventListener("resize", _webResizeHandler);
|
|
2334
|
+
}
|
|
2335
|
+
_webListeners.add(cb);
|
|
2336
|
+
return () => {
|
|
2337
|
+
_webListeners.delete(cb);
|
|
2338
|
+
if (_webListeners.size === 0) {
|
|
2339
|
+
window.removeEventListener("resize", _webResizeHandler);
|
|
2340
|
+
cancelAnimationFrame(_webRaf);
|
|
2341
|
+
_webListeners = null;
|
|
2342
|
+
}
|
|
2343
|
+
};
|
|
2344
|
+
}
|
|
2345
|
+
function getWebWidth() {
|
|
2346
|
+
return typeof window !== "undefined" ? window.innerWidth : 0;
|
|
2347
|
+
}
|
|
2322
2348
|
function useGlobalWidth() {
|
|
2323
|
-
return useSyncExternalStore2(
|
|
2349
|
+
return useSyncExternalStore2(
|
|
2350
|
+
isWeb ? subscribeWebWidth : subscribeGlobalWidth,
|
|
2351
|
+
isWeb ? getWebWidth : getGlobalWidth,
|
|
2352
|
+
ZERO_SNAP
|
|
2353
|
+
);
|
|
2324
2354
|
}
|
|
2325
2355
|
function useConditionalWidth(active) {
|
|
2326
2356
|
return useSyncExternalStore2(
|
|
2327
|
-
active ? subscribeGlobalWidth : NOOP_SUB,
|
|
2328
|
-
active ? getGlobalWidth : ZERO_SNAP,
|
|
2357
|
+
active ? isWeb ? subscribeWebWidth : subscribeGlobalWidth : NOOP_SUB,
|
|
2358
|
+
active ? isWeb ? getWebWidth : getGlobalWidth : ZERO_SNAP,
|
|
2329
2359
|
ZERO_SNAP
|
|
2330
2360
|
);
|
|
2331
2361
|
}
|
package/dist/index.js
CHANGED
|
@@ -2170,12 +2170,10 @@ function resolve(classString, theme, darkMode = "attribute") {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
}
|
|
2172
2172
|
styleCache.set(cacheKey, result);
|
|
2173
|
-
if (isWeb
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
}
|
|
2178
|
-
});
|
|
2173
|
+
if (isWeb) {
|
|
2174
|
+
for (const { cls, bucketKey, styles } of injectQueue) {
|
|
2175
|
+
injectClassRule(cls, bucketKey, styles, darkMode);
|
|
2176
|
+
}
|
|
2179
2177
|
}
|
|
2180
2178
|
return result;
|
|
2181
2179
|
}
|
|
@@ -2764,13 +2762,45 @@ var NOOP_SUB = (_) => () => {
|
|
|
2764
2762
|
};
|
|
2765
2763
|
var ZERO_SNAP = () => 0;
|
|
2766
2764
|
var EMPTY_BREAKPOINTS = /* @__PURE__ */ new Set();
|
|
2765
|
+
var _webListeners = null;
|
|
2766
|
+
var _webRaf = 0;
|
|
2767
|
+
function _webResizeHandler() {
|
|
2768
|
+
cancelAnimationFrame(_webRaf);
|
|
2769
|
+
_webRaf = requestAnimationFrame(() => {
|
|
2770
|
+
if (_webListeners) for (const cb of _webListeners) cb();
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
function subscribeWebWidth(cb) {
|
|
2774
|
+
if (typeof window === "undefined") return () => {
|
|
2775
|
+
};
|
|
2776
|
+
if (!_webListeners) {
|
|
2777
|
+
_webListeners = /* @__PURE__ */ new Set();
|
|
2778
|
+
window.addEventListener("resize", _webResizeHandler);
|
|
2779
|
+
}
|
|
2780
|
+
_webListeners.add(cb);
|
|
2781
|
+
return () => {
|
|
2782
|
+
_webListeners.delete(cb);
|
|
2783
|
+
if (_webListeners.size === 0) {
|
|
2784
|
+
window.removeEventListener("resize", _webResizeHandler);
|
|
2785
|
+
cancelAnimationFrame(_webRaf);
|
|
2786
|
+
_webListeners = null;
|
|
2787
|
+
}
|
|
2788
|
+
};
|
|
2789
|
+
}
|
|
2790
|
+
function getWebWidth() {
|
|
2791
|
+
return typeof window !== "undefined" ? window.innerWidth : 0;
|
|
2792
|
+
}
|
|
2767
2793
|
function useGlobalWidth() {
|
|
2768
|
-
return useSyncExternalStore(
|
|
2794
|
+
return useSyncExternalStore(
|
|
2795
|
+
isWeb ? subscribeWebWidth : subscribeGlobalWidth,
|
|
2796
|
+
isWeb ? getWebWidth : getGlobalWidth,
|
|
2797
|
+
ZERO_SNAP
|
|
2798
|
+
);
|
|
2769
2799
|
}
|
|
2770
2800
|
function useConditionalWidth(active) {
|
|
2771
2801
|
return useSyncExternalStore(
|
|
2772
|
-
active ? subscribeGlobalWidth : NOOP_SUB,
|
|
2773
|
-
active ? getGlobalWidth : ZERO_SNAP,
|
|
2802
|
+
active ? isWeb ? subscribeWebWidth : subscribeGlobalWidth : NOOP_SUB,
|
|
2803
|
+
active ? isWeb ? getWebWidth : getGlobalWidth : ZERO_SNAP,
|
|
2774
2804
|
ZERO_SNAP
|
|
2775
2805
|
);
|
|
2776
2806
|
}
|
package/dist/index.mjs
CHANGED
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -2061,12 +2061,10 @@ function resolve(classString, theme, darkMode = "attribute") {
|
|
|
2061
2061
|
}
|
|
2062
2062
|
}
|
|
2063
2063
|
styleCache.set(cacheKey, result);
|
|
2064
|
-
if (isWeb
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
}
|
|
2069
|
-
});
|
|
2064
|
+
if (isWeb) {
|
|
2065
|
+
for (const { cls, bucketKey, styles } of injectQueue) {
|
|
2066
|
+
injectClassRule(cls, bucketKey, styles, darkMode);
|
|
2067
|
+
}
|
|
2070
2068
|
}
|
|
2071
2069
|
return result;
|
|
2072
2070
|
}
|
|
@@ -2309,10 +2307,38 @@ var NOOP_SUB = (_) => () => {
|
|
|
2309
2307
|
};
|
|
2310
2308
|
var ZERO_SNAP = () => 0;
|
|
2311
2309
|
var EMPTY_BREAKPOINTS = /* @__PURE__ */ new Set();
|
|
2310
|
+
var _webListeners = null;
|
|
2311
|
+
var _webRaf = 0;
|
|
2312
|
+
function _webResizeHandler() {
|
|
2313
|
+
cancelAnimationFrame(_webRaf);
|
|
2314
|
+
_webRaf = requestAnimationFrame(() => {
|
|
2315
|
+
if (_webListeners) for (const cb of _webListeners) cb();
|
|
2316
|
+
});
|
|
2317
|
+
}
|
|
2318
|
+
function subscribeWebWidth(cb) {
|
|
2319
|
+
if (typeof window === "undefined") return () => {
|
|
2320
|
+
};
|
|
2321
|
+
if (!_webListeners) {
|
|
2322
|
+
_webListeners = /* @__PURE__ */ new Set();
|
|
2323
|
+
window.addEventListener("resize", _webResizeHandler);
|
|
2324
|
+
}
|
|
2325
|
+
_webListeners.add(cb);
|
|
2326
|
+
return () => {
|
|
2327
|
+
_webListeners.delete(cb);
|
|
2328
|
+
if (_webListeners.size === 0) {
|
|
2329
|
+
window.removeEventListener("resize", _webResizeHandler);
|
|
2330
|
+
cancelAnimationFrame(_webRaf);
|
|
2331
|
+
_webListeners = null;
|
|
2332
|
+
}
|
|
2333
|
+
};
|
|
2334
|
+
}
|
|
2335
|
+
function getWebWidth() {
|
|
2336
|
+
return typeof window !== "undefined" ? window.innerWidth : 0;
|
|
2337
|
+
}
|
|
2312
2338
|
function useConditionalWidth(active) {
|
|
2313
2339
|
return useSyncExternalStore2(
|
|
2314
|
-
active ? subscribeGlobalWidth : NOOP_SUB,
|
|
2315
|
-
active ? getGlobalWidth : ZERO_SNAP,
|
|
2340
|
+
active ? isWeb ? subscribeWebWidth : subscribeGlobalWidth : NOOP_SUB,
|
|
2341
|
+
active ? isWeb ? getWebWidth : getGlobalWidth : ZERO_SNAP,
|
|
2316
2342
|
ZERO_SNAP
|
|
2317
2343
|
);
|
|
2318
2344
|
}
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
Fragment,
|
|
3
3
|
jsx,
|
|
4
4
|
jsxs
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-3AMSZMOL.mjs";
|
|
6
|
+
import "./chunk-LZYPVC5K.mjs";
|
|
7
7
|
|
|
8
8
|
// src/jsx-dev-runtime.tsx
|
|
9
9
|
function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -2060,12 +2060,10 @@ function resolve(classString, theme, darkMode = "attribute") {
|
|
|
2060
2060
|
}
|
|
2061
2061
|
}
|
|
2062
2062
|
styleCache.set(cacheKey, result);
|
|
2063
|
-
if (isWeb
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
}
|
|
2068
|
-
});
|
|
2063
|
+
if (isWeb) {
|
|
2064
|
+
for (const { cls, bucketKey, styles } of injectQueue) {
|
|
2065
|
+
injectClassRule(cls, bucketKey, styles, darkMode);
|
|
2066
|
+
}
|
|
2069
2067
|
}
|
|
2070
2068
|
return result;
|
|
2071
2069
|
}
|
|
@@ -2308,10 +2306,38 @@ var NOOP_SUB = (_) => () => {
|
|
|
2308
2306
|
};
|
|
2309
2307
|
var ZERO_SNAP = () => 0;
|
|
2310
2308
|
var EMPTY_BREAKPOINTS = /* @__PURE__ */ new Set();
|
|
2309
|
+
var _webListeners = null;
|
|
2310
|
+
var _webRaf = 0;
|
|
2311
|
+
function _webResizeHandler() {
|
|
2312
|
+
cancelAnimationFrame(_webRaf);
|
|
2313
|
+
_webRaf = requestAnimationFrame(() => {
|
|
2314
|
+
if (_webListeners) for (const cb of _webListeners) cb();
|
|
2315
|
+
});
|
|
2316
|
+
}
|
|
2317
|
+
function subscribeWebWidth(cb) {
|
|
2318
|
+
if (typeof window === "undefined") return () => {
|
|
2319
|
+
};
|
|
2320
|
+
if (!_webListeners) {
|
|
2321
|
+
_webListeners = /* @__PURE__ */ new Set();
|
|
2322
|
+
window.addEventListener("resize", _webResizeHandler);
|
|
2323
|
+
}
|
|
2324
|
+
_webListeners.add(cb);
|
|
2325
|
+
return () => {
|
|
2326
|
+
_webListeners.delete(cb);
|
|
2327
|
+
if (_webListeners.size === 0) {
|
|
2328
|
+
window.removeEventListener("resize", _webResizeHandler);
|
|
2329
|
+
cancelAnimationFrame(_webRaf);
|
|
2330
|
+
_webListeners = null;
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
}
|
|
2334
|
+
function getWebWidth() {
|
|
2335
|
+
return typeof window !== "undefined" ? window.innerWidth : 0;
|
|
2336
|
+
}
|
|
2311
2337
|
function useConditionalWidth(active) {
|
|
2312
2338
|
return useSyncExternalStore2(
|
|
2313
|
-
active ? subscribeGlobalWidth : NOOP_SUB,
|
|
2314
|
-
active ? getGlobalWidth : ZERO_SNAP,
|
|
2339
|
+
active ? isWeb ? subscribeWebWidth : subscribeGlobalWidth : NOOP_SUB,
|
|
2340
|
+
active ? isWeb ? getWebWidth : getGlobalWidth : ZERO_SNAP,
|
|
2315
2341
|
ZERO_SNAP
|
|
2316
2342
|
);
|
|
2317
2343
|
}
|
package/dist/jsx-runtime.mjs
CHANGED