@oxy.so/bloom 7.24.0 → 7.24.2
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/docs/adoption-matrix.mdx +5 -5
- package/docs/file-upload.mdx +2 -0
- package/docs/rating.mdx +2 -0
- package/docs/screen.mdx +7 -2
- package/lib/commonjs/file-upload/FileUpload.js +4 -0
- package/lib/commonjs/file-upload/FileUpload.js.map +1 -1
- package/lib/commonjs/page-header/PageHeader.js +3 -1
- package/lib/commonjs/page-header/PageHeader.js.map +1 -1
- package/lib/commonjs/rating/RatingInput.js +10 -4
- package/lib/commonjs/rating/RatingInput.js.map +1 -1
- package/lib/commonjs/screen/Screen.js +18 -13
- package/lib/commonjs/screen/Screen.js.map +1 -1
- package/lib/commonjs/screen/context.js +4 -1
- package/lib/commonjs/screen/context.js.map +1 -1
- package/lib/module/file-upload/FileUpload.js +4 -0
- package/lib/module/file-upload/FileUpload.js.map +1 -1
- package/lib/module/page-header/PageHeader.js +4 -2
- package/lib/module/page-header/PageHeader.js.map +1 -1
- package/lib/module/rating/RatingInput.js +10 -4
- package/lib/module/rating/RatingInput.js.map +1 -1
- package/lib/module/screen/Screen.js +20 -15
- package/lib/module/screen/Screen.js.map +1 -1
- package/lib/module/screen/context.js +3 -0
- package/lib/module/screen/context.js.map +1 -1
- package/lib/typescript/commonjs/file-upload/FileUpload.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/rating/RatingInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/Screen.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/context.d.ts +2 -0
- package/lib/typescript/commonjs/screen/context.d.ts.map +1 -1
- package/lib/typescript/module/file-upload/FileUpload.d.ts.map +1 -1
- package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/module/rating/RatingInput.d.ts.map +1 -1
- package/lib/typescript/module/screen/Screen.d.ts.map +1 -1
- package/lib/typescript/module/screen/context.d.ts +2 -0
- package/lib/typescript/module/screen/context.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/file-upload/FileUpload.tsx +8 -1
- package/src/page-header/PageHeader.tsx +4 -2
- package/src/rating/RatingInput.tsx +9 -5
- package/src/screen/Screen.tsx +7 -6
- package/src/screen/context.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../../../src/screen/Screen.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,6FAA6F;AAC7F,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,eAAsB,EAAE,eAA2B,EAAE,cAAsB,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAqB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../../../src/screen/Screen.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,6FAA6F;AAC7F,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,eAAsB,EAAE,eAA2B,EAAE,cAAsB,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAqB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAgDrP"}
|
|
@@ -14,6 +14,8 @@ export type ScreenNavigationState = Pick<ScreenContextValue, 'collapseProgress'
|
|
|
14
14
|
bottomInset?: number;
|
|
15
15
|
};
|
|
16
16
|
export declare const ScreenNavigationContext: import("react").Context<ScreenNavigationState | null>;
|
|
17
|
+
/** Only the Screen header slot owns chrome positioning; content headers remain independent. */
|
|
18
|
+
export declare const ScreenHeaderContext: import("react").Context<ScreenContextValue | null>;
|
|
17
19
|
export declare const ScreenContext: import("react").Context<ScreenContextValue | null>;
|
|
18
20
|
export declare function useScreenContext(): ScreenContextValue | null;
|
|
19
21
|
export declare function useScreen(): ScreenContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/screen/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,gBAAgB,EAAE,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7C,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACpJ,eAAO,MAAM,uBAAuB,uDAAoD,CAAC;AAEzF,eAAO,MAAM,aAAa,oDAAiD,CAAC;AAC5E,wBAAgB,gBAAgB,8BAAwC;AACxE,wBAAgB,SAAS,IAAI,kBAAkB,CAI9C"}
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/screen/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,gBAAgB,EAAE,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7C,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACpJ,eAAO,MAAM,uBAAuB,uDAAoD,CAAC;AAEzF,+FAA+F;AAC/F,eAAO,MAAM,mBAAmB,oDAAiD,CAAC;AAElF,eAAO,MAAM,aAAa,oDAAiD,CAAC;AAC5E,wBAAgB,gBAAgB,8BAAwC;AACxE,wBAAgB,SAAS,IAAI,kBAAkB,CAI9C"}
|
package/package.json
CHANGED
|
@@ -381,6 +381,7 @@ function StaggerLine({
|
|
|
381
381
|
: { bloomFileUploadSub: state },
|
|
382
382
|
)}
|
|
383
383
|
pointerEvents="none"
|
|
384
|
+
aria-hidden={state !== 'shown'}
|
|
384
385
|
style={style}
|
|
385
386
|
>
|
|
386
387
|
{children}
|
|
@@ -388,7 +389,13 @@ function StaggerLine({
|
|
|
388
389
|
);
|
|
389
390
|
}
|
|
390
391
|
return (
|
|
391
|
-
<Animated.View
|
|
392
|
+
<Animated.View
|
|
393
|
+
pointerEvents="none"
|
|
394
|
+
aria-hidden={state !== 'shown'}
|
|
395
|
+
accessibilityElementsHidden={state !== 'shown'}
|
|
396
|
+
importantForAccessibility={state !== 'shown' ? 'no-hide-descendants' : 'auto'}
|
|
397
|
+
style={[style, { opacity, transform: [{ translateY }] }]}
|
|
398
|
+
>
|
|
392
399
|
{children}
|
|
393
400
|
</Animated.View>
|
|
394
401
|
);
|
|
@@ -18,7 +18,7 @@ import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
|
|
18
18
|
|
|
19
19
|
import { useHeaderDockContext } from '../layout/header-dock';
|
|
20
20
|
import { useSurfaceFill } from '../styles/surface-levels';
|
|
21
|
-
import { useScreenContext } from '../screen/context';
|
|
21
|
+
import { ScreenHeaderContext, useScreenContext } from '../screen/context';
|
|
22
22
|
import { Button } from '../button';
|
|
23
23
|
import { BUTTON_SHADOW } from '../button/shared';
|
|
24
24
|
import { BloomScope } from "../appearance";
|
|
@@ -192,6 +192,8 @@ function PageHeaderComponent({
|
|
|
192
192
|
// it a header inside a scrolling panel followed `window.scrollY`, which on a
|
|
193
193
|
// desktop shell never moves, so the header looked deliberately inert.
|
|
194
194
|
const screen = useScreenContext();
|
|
195
|
+
const headerScreen = useContext(ScreenHeaderContext);
|
|
196
|
+
const positionedByScreen = screen != null && headerScreen === screen;
|
|
195
197
|
const contextScrollY = useScrollOffset();
|
|
196
198
|
const metrics = useScrollMetricsValue();
|
|
197
199
|
const internalScrollY = useSharedValue(0);
|
|
@@ -353,7 +355,7 @@ function PageHeaderComponent({
|
|
|
353
355
|
) : null;
|
|
354
356
|
|
|
355
357
|
const containerWeb: WebCssStyle | null =
|
|
356
|
-
isWeb && sticky && !overlay
|
|
358
|
+
isWeb && sticky && !overlay && !positionedByScreen
|
|
357
359
|
? { position: WEB_POSITION_STICKY, top: WEB_SURFACE_STICKY_TOP, zIndex: Z_INDEX.floating,
|
|
358
360
|
transitionProperty: 'top', transitionDuration: 'var(--bloom-panel-inset-duration, 0ms)', transitionTimingFunction: 'ease-in-out' }
|
|
359
361
|
: null;
|
|
@@ -213,11 +213,15 @@ function RatingInputComponent({
|
|
|
213
213
|
testID={testID ? `${testID}-star-${star}` : undefined}
|
|
214
214
|
style={starStyle}
|
|
215
215
|
>
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
{/* Hover swaps the glyph. Keep the press target on the radio so
|
|
217
|
+
replacing a decorative SVG between down/up cannot lose a click. */}
|
|
218
|
+
<View pointerEvents="none" aria-hidden accessibilityElementsHidden importantForAccessibility="no-hide-descendants">
|
|
219
|
+
<Glyph
|
|
220
|
+
width={config.star}
|
|
221
|
+
height={config.star}
|
|
222
|
+
fill={filled ? theme.colors.primary : emptyColor}
|
|
223
|
+
/>
|
|
224
|
+
</View>
|
|
221
225
|
</Pressable>
|
|
222
226
|
);
|
|
223
227
|
})}
|
package/src/screen/Screen.tsx
CHANGED
|
@@ -3,16 +3,16 @@ import { Keyboard, Platform, View } from 'react-native';
|
|
|
3
3
|
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
|
4
4
|
import { windowEdgeGap } from '../layout/edge';
|
|
5
5
|
import { useSharedValue } from 'react-native-reanimated';
|
|
6
|
-
import {
|
|
7
|
-
import { WEB_POSITION_STICKY, WEB_VIEWPORT_HEIGHT } from '../styles/web-view-style';
|
|
6
|
+
import { useSurfaceFill } from '../styles/surface-levels';
|
|
7
|
+
import { WEB_POSITION_STICKY, WEB_SURFACE_STICKY_TOP, WEB_VIEWPORT_HEIGHT, type WebCssStyle } from '../styles/web-view-style';
|
|
8
8
|
import { Z_INDEX } from '../styles/z-index';
|
|
9
|
-
import { ScreenContext, ScreenNavigationContext } from './context';
|
|
9
|
+
import { ScreenContext, ScreenHeaderContext, ScreenNavigationContext } from './context';
|
|
10
10
|
import { useScreenWindowBinding } from './use-screen-window-scroll';
|
|
11
11
|
import type { ScreenProps } from './types';
|
|
12
12
|
|
|
13
13
|
/** One continuous canvas; chrome overlays it and content reserves its measured footprint. */
|
|
14
14
|
export function Screen({ header, bottomBar, primaryAction, active: requestedActive = true, navigationScope = 'inherit', documentScroll = false, headerHeight, bottomBarHeight, contentClearance = 16, children, style, testID, ...props }: ScreenProps) {
|
|
15
|
-
const
|
|
15
|
+
const surfaceFill = useSurfaceFill();
|
|
16
16
|
const parentScreen = useContext(ScreenContext);
|
|
17
17
|
const active = requestedActive && (navigationScope === 'isolated' ? true : parentScreen?.active ?? true);
|
|
18
18
|
const scrollY = useSharedValue(0);
|
|
@@ -40,12 +40,13 @@ export function Screen({ header, bottomBar, primaryAction, active: requestedActi
|
|
|
40
40
|
contentInsetsHandled: document, topInset: header ? top : 0, bottomInset: keyboardVisible ? contentClearance : hasBottom ? bottom + contentClearance : navigationScope === 'inherit' ? inheritedNavigation?.bottomInset ?? contentClearance : contentClearance,
|
|
41
41
|
}), [active, scrollY, collapseProgress, collapseTarget, activeScrollerId, header, hasBottom, top, bottom, contentClearance, navigationScope, inheritedNavigation?.bottomInset, document, keyboardVisible]);
|
|
42
42
|
useScreenWindowBinding(value, { active: document });
|
|
43
|
-
const
|
|
43
|
+
const documentHeaderStyle: WebCssStyle = { position: WEB_POSITION_STICKY, top: WEB_SURFACE_STICKY_TOP, zIndex: Z_INDEX.floating, marginBottom: -top, transitionProperty: 'top', transitionDuration: 'var(--bloom-panel-inset-duration, 0ms)', transitionTimingFunction: 'ease-in-out' };
|
|
44
|
+
const headerNode = header ? <View testID={testID ? `${testID}-header` : undefined} pointerEvents="box-none" onLayout={event => setTop(event.nativeEvent.layout.height)} style={document ? documentHeaderStyle : { position: 'absolute', top: 0, left: 0, right: 0 }}><ScreenHeaderContext.Provider value={value}>{header}</ScreenHeaderContext.Provider></View> : null;
|
|
44
45
|
const bottomNode = hasBottom ? <View testID={testID ? `${testID}-bottom` : undefined} pointerEvents="box-none" onLayout={event => setBottom(event.nativeEvent.layout.height)} style={document ? { position: WEB_POSITION_STICKY, bottom: 0, zIndex: Z_INDEX.floating, marginTop: -bottom } : { position: 'absolute', bottom: 0, left: 0, right: 0 }}>{bottomBar ?? <View pointerEvents="box-none" style={{ alignItems: 'flex-end', paddingHorizontal: 16, paddingBottom: windowEdgeGap(insets?.bottom ?? 0), minHeight: bottom }}>{primaryAction}</View>}</View> : null;
|
|
45
46
|
return (
|
|
46
47
|
<ScreenNavigationContext.Provider value={navigationScope === 'inherit' ? inheritedNavigation : { ...navigation, bottomInset: value.bottomInset }}>
|
|
47
48
|
<ScreenContext.Provider value={value}>
|
|
48
|
-
<View {...props} testID={testID} style={[document ? { minHeight: WEB_VIEWPORT_HEIGHT, width: '100%', position: 'relative', backgroundColor:
|
|
49
|
+
<View {...props} testID={testID} style={[document ? { minHeight: WEB_VIEWPORT_HEIGHT, width: '100%', position: 'relative', backgroundColor: surfaceFill } : { flex: 1, minHeight: 0, position: 'relative', backgroundColor: surfaceFill }, style]}>
|
|
49
50
|
{document ? headerNode : null}
|
|
50
51
|
{document ? <View testID={testID ? `${testID}-content` : undefined} style={{
|
|
51
52
|
flexGrow: 1, flexShrink: 0,
|
package/src/screen/context.ts
CHANGED
|
@@ -16,6 +16,9 @@ export interface ScreenContextValue {
|
|
|
16
16
|
export type ScreenNavigationState = Pick<ScreenContextValue, 'collapseProgress' | 'collapseTarget' | 'activeScrollerId'> & { bottomInset?: number };
|
|
17
17
|
export const ScreenNavigationContext = createContext<ScreenNavigationState | null>(null);
|
|
18
18
|
|
|
19
|
+
/** Only the Screen header slot owns chrome positioning; content headers remain independent. */
|
|
20
|
+
export const ScreenHeaderContext = createContext<ScreenContextValue | null>(null);
|
|
21
|
+
|
|
19
22
|
export const ScreenContext = createContext<ScreenContextValue | null>(null);
|
|
20
23
|
export function useScreenContext() { return useContext(ScreenContext); }
|
|
21
24
|
export function useScreen(): ScreenContextValue {
|