@sanity/ui 2.8.24-canary.0 → 2.8.24-canary.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.
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.esm.js +9 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/hooks/useArrayProp.ts +4 -5
- package/src/core/styles/helpers.ts +2 -2
- package/src/core/utils/portal/portalProvider.tsx +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -983,7 +983,7 @@ export declare interface FontWeightStyleProps {
|
|
|
983
983
|
/**
|
|
984
984
|
* @internal
|
|
985
985
|
*/
|
|
986
|
-
export declare function _getArrayProp<T = number>(val: T | T[] | undefined
|
|
986
|
+
export declare function _getArrayProp<T = number>(val: T | T[] | undefined): T[]
|
|
987
987
|
|
|
988
988
|
/**
|
|
989
989
|
* @internal
|
|
@@ -2706,7 +2706,6 @@ export declare interface TreeState {
|
|
|
2706
2706
|
*/
|
|
2707
2707
|
export declare function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>(
|
|
2708
2708
|
val: T | T[] | undefined,
|
|
2709
|
-
defaultVal?: T[],
|
|
2710
2709
|
): T[]
|
|
2711
2710
|
|
|
2712
2711
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -983,7 +983,7 @@ export declare interface FontWeightStyleProps {
|
|
|
983
983
|
/**
|
|
984
984
|
* @internal
|
|
985
985
|
*/
|
|
986
|
-
export declare function _getArrayProp<T = number>(val: T | T[] | undefined
|
|
986
|
+
export declare function _getArrayProp<T = number>(val: T | T[] | undefined): T[]
|
|
987
987
|
|
|
988
988
|
/**
|
|
989
989
|
* @internal
|
|
@@ -2706,7 +2706,6 @@ export declare interface TreeState {
|
|
|
2706
2706
|
*/
|
|
2707
2707
|
export declare function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>(
|
|
2708
2708
|
val: T | T[] | undefined,
|
|
2709
|
-
defaultVal?: T[],
|
|
2710
2709
|
): T[]
|
|
2711
2710
|
|
|
2712
2711
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -45,8 +45,8 @@ function _responsive(media, values, callback) {
|
|
|
45
45
|
[`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
function _getArrayProp(val
|
|
49
|
-
return val === void 0 ?
|
|
48
|
+
function _getArrayProp(val) {
|
|
49
|
+
return val === void 0 ? EMPTY_ARRAY : Array.isArray(val) ? val : [val];
|
|
50
50
|
}
|
|
51
51
|
function _getResponsiveSpace(theme, props, spaceIndexes = EMPTY_ARRAY) {
|
|
52
52
|
if (!Array.isArray(spaceIndexes))
|
|
@@ -153,17 +153,17 @@ function responsiveTextAlignStyle(props) {
|
|
|
153
153
|
function responsiveTextFont(props) {
|
|
154
154
|
return responsiveFont("text", props);
|
|
155
155
|
}
|
|
156
|
-
function useArrayProp(val
|
|
157
|
-
const $ = c(
|
|
156
|
+
function useArrayProp(val) {
|
|
157
|
+
const $ = c(6);
|
|
158
158
|
let t0;
|
|
159
|
-
$[0] !==
|
|
159
|
+
$[0] !== val ? (t0 = () => [_getArrayProp(val), JSON.stringify(val)], $[0] = val, $[1] = t0) : t0 = $[1];
|
|
160
160
|
const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1;
|
|
161
161
|
let result = cachedVal, t2;
|
|
162
|
-
$[
|
|
162
|
+
$[2] !== val ? (t2 = JSON.stringify(val), $[2] = val, $[3] = t2) : t2 = $[3];
|
|
163
163
|
const hash = t2;
|
|
164
164
|
if (hash !== cachedHash) {
|
|
165
165
|
let t3;
|
|
166
|
-
$[
|
|
166
|
+
$[4] !== val ? (t3 = _getArrayProp(val), $[4] = val, $[5] = t3) : t3 = $[5];
|
|
167
167
|
const current = t3;
|
|
168
168
|
setCache([current, hash]), result = current;
|
|
169
169
|
}
|
|
@@ -3518,9 +3518,8 @@ function PortalProvider(props) {
|
|
|
3518
3518
|
const $ = c(7), {
|
|
3519
3519
|
boundaryElement,
|
|
3520
3520
|
children,
|
|
3521
|
-
element
|
|
3522
|
-
|
|
3523
|
-
} = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$3, _temp2$1);
|
|
3521
|
+
element
|
|
3522
|
+
} = props, elements = useUnique(props.__unstable_elements), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$3, _temp2$1);
|
|
3524
3523
|
let t0;
|
|
3525
3524
|
const t1 = boundaryElement || null, t2 = element || fallbackElement;
|
|
3526
3525
|
let t3;
|