@neko-os/ui 0.6.0 → 0.6.1
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.
|
@@ -30,6 +30,8 @@ export function useGetResponsiveValue() {
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
|
|
34
|
+
|
|
33
35
|
var bpNames = breakpoints.map(function (b) {return b.name;});
|
|
34
36
|
var isResponsiveKey = function isResponsiveKey(k) {return (
|
|
35
37
|
k === 'df' ||
|
|
@@ -39,7 +41,8 @@ export function useGetResponsiveValue() {
|
|
|
39
41
|
k === 'android' ||
|
|
40
42
|
bpNames.includes(k) ||
|
|
41
43
|
/^(\w+)[du]$/.test(k) && bpNames.includes(k.slice(0, -1)));};
|
|
42
|
-
|
|
44
|
+
var objKeys = Object.keys(value);
|
|
45
|
+
if (objKeys.length > 0 && !objKeys.some(isResponsiveKey)) return value;
|
|
43
46
|
|
|
44
47
|
if (value[screen]) return value[screen];
|
|
45
48
|
|
package/package.json
CHANGED
|
@@ -28,8 +28,10 @@ export function useGetResponsiveValue() {
|
|
|
28
28
|
if (!isObj) return value
|
|
29
29
|
|
|
30
30
|
// Only treat the object as a responsive descriptor when it actually
|
|
31
|
-
// carries breakpoint / platform / df keys.
|
|
32
|
-
//
|
|
31
|
+
// carries breakpoint / platform / df keys. A non-empty plain object
|
|
32
|
+
// (e.g. titleProps) passes through untouched. An empty object carries
|
|
33
|
+
// no info either way, so it falls through to the df (undefined) result
|
|
34
|
+
// instead of returning itself truthy.
|
|
33
35
|
const bpNames = breakpoints.map((b) => b.name)
|
|
34
36
|
const isResponsiveKey = (k) =>
|
|
35
37
|
k === 'df' ||
|
|
@@ -39,7 +41,8 @@ export function useGetResponsiveValue() {
|
|
|
39
41
|
k === 'android' ||
|
|
40
42
|
bpNames.includes(k) ||
|
|
41
43
|
(/^(\w+)[du]$/.test(k) && bpNames.includes(k.slice(0, -1)))
|
|
42
|
-
|
|
44
|
+
const objKeys = Object.keys(value)
|
|
45
|
+
if (objKeys.length > 0 && !objKeys.some(isResponsiveKey)) return value
|
|
43
46
|
|
|
44
47
|
if (value[screen]) return value[screen]
|
|
45
48
|
|