@oxyhq/bloom 1.13.0 → 1.14.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/README.md +1 -1
- package/docs/avatar.mdx +46 -5
- package/docs/index.mdx +1 -1
- package/docs/media-flight.mdx +15 -6
- package/docs/tab-bar.mdx +35 -0
- package/lib/commonjs/avatar/Avatar.js +24 -8
- package/lib/commonjs/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/avatar/AvatarRing.js +13 -12
- package/lib/commonjs/avatar/AvatarRing.js.map +1 -1
- package/lib/commonjs/avatar/index.js +19 -0
- package/lib/commonjs/avatar/index.js.map +1 -1
- package/lib/commonjs/avatar/resolve-shape.js +43 -0
- package/lib/commonjs/avatar/resolve-shape.js.map +1 -0
- package/lib/commonjs/avatar/shape-paths.js +174 -0
- package/lib/commonjs/avatar/shape-paths.js.map +1 -0
- package/lib/commonjs/media-flight/MediaSurface.js +51 -10
- package/lib/commonjs/media-flight/MediaSurface.js.map +1 -1
- package/lib/commonjs/media-flight/constants.js +32 -7
- package/lib/commonjs/media-flight/constants.js.map +1 -1
- package/lib/commonjs/tab-bar/TabBarBase.js +87 -13
- package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -1
- package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js +5 -0
- package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js.map +1 -1
- package/lib/commonjs/theme/color-scope/ColorScope.js +42 -12
- package/lib/commonjs/theme/color-scope/ColorScope.js.map +1 -1
- package/lib/commonjs/theme/color-scope/ColorScope.web.js +2 -8
- package/lib/commonjs/theme/color-scope/ColorScope.web.js.map +1 -1
- package/lib/module/avatar/Avatar.js +24 -8
- package/lib/module/avatar/Avatar.js.map +1 -1
- package/lib/module/avatar/AvatarRing.js +13 -12
- package/lib/module/avatar/AvatarRing.js.map +1 -1
- package/lib/module/avatar/index.js +1 -0
- package/lib/module/avatar/index.js.map +1 -1
- package/lib/module/avatar/resolve-shape.js +40 -0
- package/lib/module/avatar/resolve-shape.js.map +1 -0
- package/lib/module/avatar/shape-paths.js +170 -0
- package/lib/module/avatar/shape-paths.js.map +1 -0
- package/lib/module/media-flight/MediaSurface.js +52 -11
- package/lib/module/media-flight/MediaSurface.js.map +1 -1
- package/lib/module/media-flight/constants.js +31 -6
- package/lib/module/media-flight/constants.js.map +1 -1
- package/lib/module/tab-bar/TabBarBase.js +89 -15
- package/lib/module/tab-bar/TabBarBase.js.map +1 -1
- package/lib/module/tab-bar/expo-router/RouterTabBar.js +5 -0
- package/lib/module/tab-bar/expo-router/RouterTabBar.js.map +1 -1
- package/lib/module/theme/color-scope/ColorScope.js +45 -13
- package/lib/module/theme/color-scope/ColorScope.js.map +1 -1
- package/lib/module/theme/color-scope/ColorScope.web.js +3 -9
- package/lib/module/theme/color-scope/ColorScope.web.js.map +1 -1
- package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/AvatarRing.d.ts +4 -3
- package/lib/typescript/commonjs/avatar/AvatarRing.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/index.d.ts +3 -1
- package/lib/typescript/commonjs/avatar/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/resolve-shape.d.ts +17 -0
- package/lib/typescript/commonjs/avatar/resolve-shape.d.ts.map +1 -0
- package/lib/typescript/commonjs/avatar/shape-paths.d.ts +27 -0
- package/lib/typescript/commonjs/avatar/shape-paths.d.ts.map +1 -0
- package/lib/typescript/commonjs/avatar/types.d.ts +30 -3
- package/lib/typescript/commonjs/avatar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/constants.d.ts +30 -6
- package/lib/typescript/commonjs/media-flight/constants.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/types.d.ts +7 -2
- package/lib/typescript/commonjs/media-flight/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts +5 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/types.d.ts +36 -5
- package/lib/typescript/commonjs/tab-bar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/ColorScope.d.ts +36 -2
- package/lib/typescript/commonjs/theme/color-scope/ColorScope.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/ColorScope.web.d.ts +6 -2
- package/lib/typescript/commonjs/theme/color-scope/ColorScope.web.d.ts.map +1 -1
- package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/module/avatar/AvatarRing.d.ts +4 -3
- package/lib/typescript/module/avatar/AvatarRing.d.ts.map +1 -1
- package/lib/typescript/module/avatar/index.d.ts +3 -1
- package/lib/typescript/module/avatar/index.d.ts.map +1 -1
- package/lib/typescript/module/avatar/resolve-shape.d.ts +17 -0
- package/lib/typescript/module/avatar/resolve-shape.d.ts.map +1 -0
- package/lib/typescript/module/avatar/shape-paths.d.ts +27 -0
- package/lib/typescript/module/avatar/shape-paths.d.ts.map +1 -0
- package/lib/typescript/module/avatar/types.d.ts +30 -3
- package/lib/typescript/module/avatar/types.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/MediaSurface.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/constants.d.ts +30 -6
- package/lib/typescript/module/media-flight/constants.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/types.d.ts +7 -2
- package/lib/typescript/module/media-flight/types.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts +5 -0
- package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/types.d.ts +36 -5
- package/lib/typescript/module/tab-bar/types.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/ColorScope.d.ts +36 -2
- package/lib/typescript/module/theme/color-scope/ColorScope.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/ColorScope.web.d.ts +6 -2
- package/lib/typescript/module/theme/color-scope/ColorScope.web.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/avatar/Avatar.tsx +27 -10
- package/src/avatar/AvatarRing.tsx +21 -14
- package/src/avatar/index.ts +7 -0
- package/src/avatar/resolve-shape.ts +33 -0
- package/src/avatar/shape-paths.ts +150 -0
- package/src/avatar/types.ts +32 -3
- package/src/media-flight/MediaSurface.tsx +60 -14
- package/src/media-flight/constants.ts +31 -6
- package/src/media-flight/types.ts +7 -2
- package/src/tab-bar/TabBarBase.tsx +110 -17
- package/src/tab-bar/expo-router/RouterTabBar.tsx +5 -0
- package/src/tab-bar/types.ts +36 -5
- package/src/theme/color-scope/ColorScope.tsx +53 -12
- package/src/theme/color-scope/ColorScope.web.tsx +10 -8
|
@@ -4,14 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Public API types for `@oxyhq/bloom/tab-bar`.
|
|
6
6
|
*
|
|
7
|
-
* This module
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* three at once. Platform behaviour lives in `surface.native.tsx` /
|
|
11
|
-
* `glyph.native.tsx` / `surface.web.tsx` and the `expo-router/` adapter
|
|
7
|
+
* This module names no PLATFORM package. It is resolved by a consumer's `tsc`,
|
|
8
|
+
* by Metro, and by every web bundler alike, so an import here of
|
|
9
|
+
* expo-glass-effect / expo-symbols / expo-router / react-native-screens would
|
|
10
|
+
* break all three at once. Platform behaviour lives in `surface.native.tsx` /
|
|
11
|
+
* `glyph.native.tsx` / `surface.web.tsx` and the `expo-router/` adapter; the
|
|
12
|
+
* gate is `src/__tests__/TabBarWebFork.test.ts`.
|
|
13
|
+
*
|
|
14
|
+
* `react-native-reanimated` is exempt and always was: it is a REQUIRED peer that
|
|
15
|
+
* every neutral module in this family already imports at runtime
|
|
16
|
+
* (`TabBarBase.tsx`), and the one reference below is `import type`, erased
|
|
17
|
+
* before any bundler sees it.
|
|
12
18
|
*/
|
|
13
19
|
import type { ReactNode } from 'react';
|
|
14
20
|
import type { PressableProps, ViewProps } from 'react-native';
|
|
21
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
15
22
|
export type TabBarItem = {
|
|
16
23
|
/** Stable identity for the tab (a route name in router-driven usage). */
|
|
17
24
|
name: string;
|
|
@@ -89,6 +96,30 @@ export type TabBarProps = ViewProps & {
|
|
|
89
96
|
* highlight from its own `isFocused`.
|
|
90
97
|
*/
|
|
91
98
|
activeIndex?: number;
|
|
99
|
+
/**
|
|
100
|
+
* DRIVEN path — the highlight's live position, in TAB UNITS, on the UI thread.
|
|
101
|
+
* A pager writes its own page position here (`1.4` is 40% of the way from the
|
|
102
|
+
* second tab to the third) and the highlight tracks the finger 1:1 instead of
|
|
103
|
+
* springing to a settled index after the navigation commits.
|
|
104
|
+
*
|
|
105
|
+
* It says WHERE the highlight is, never WHETHER there is one. Selection stays
|
|
106
|
+
* with the path already in play: `activeIndex` when the bar is controlled (an
|
|
107
|
+
* index naming no tab still fades the highlight out — see above), each
|
|
108
|
+
* button's `isFocused` when it is not. Passing this alone, with neither, is a
|
|
109
|
+
* bar that is always selected, which is what the focus-driven path already
|
|
110
|
+
* means.
|
|
111
|
+
*
|
|
112
|
+
* PRECEDENCE, because a shared value with two writers is a race: the SCRUB
|
|
113
|
+
* always wins — a finger on the bar is a direct manipulation of the bar, and
|
|
114
|
+
* releasing it reports through `onIndexChange` like any other selection. Below
|
|
115
|
+
* that, this value wins over every discrete writer: while it is supplied, the
|
|
116
|
+
* controlled effect, the focus effect and a `TabBarButton`'s own press all
|
|
117
|
+
* stop writing the position and leave it to the driver. So a consumer that
|
|
118
|
+
* passes this must keep it truthful — spring it to the settled index after a
|
|
119
|
+
* commit, and after any navigation it did not cause (a deep link, a back
|
|
120
|
+
* gesture), or the highlight stays where the last gesture left it.
|
|
121
|
+
*/
|
|
122
|
+
activeProgress?: SharedValue<number>;
|
|
92
123
|
/**
|
|
93
124
|
* Called with the chosen index when a tab is picked by tap, by scrub release,
|
|
94
125
|
* or by keyboard/assistive-technology activation of a `TabBarButton`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,UAAU,GAAG;IACvB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG;IAC/C,IAAI,EAAE,UAAU,CAAC;IACjB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
|
@@ -3,8 +3,13 @@ import { type StyleProp, type ViewStyle } from 'react-native';
|
|
|
3
3
|
import type { AppColorName } from '../color-presets';
|
|
4
4
|
export interface BloomColorScopeProps {
|
|
5
5
|
/**
|
|
6
|
-
* Preset to apply within this subtree. When `undefined`, the scope
|
|
7
|
-
*
|
|
6
|
+
* Preset to apply within this subtree. When `undefined`, the scope publishes
|
|
7
|
+
* nothing of its own and children inherit the parent scope's preset unchanged.
|
|
8
|
+
*
|
|
9
|
+
* It is a no-op in what it PUBLISHES, never in what it RENDERS — see the
|
|
10
|
+
* component's own comment: the element tree this returns is identical whether
|
|
11
|
+
* or not a preset is set, because a preset that arrives late must not remount
|
|
12
|
+
* the subtree.
|
|
8
13
|
*/
|
|
9
14
|
colorPreset: AppColorName | undefined;
|
|
10
15
|
/**
|
|
@@ -16,6 +21,35 @@ export interface BloomColorScopeProps {
|
|
|
16
21
|
style?: StyleProp<ViewStyle>;
|
|
17
22
|
children: React.ReactNode;
|
|
18
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A subtree themed by one color preset.
|
|
26
|
+
*
|
|
27
|
+
* THE SHAPE OF WHAT THIS RETURNS DOES NOT DEPEND ON `colorPreset`. Both
|
|
28
|
+
* providers are mounted unconditionally, and an absent preset is expressed as
|
|
29
|
+
* pass-through VALUES ({@link NO_VARS}, the parent's own theme) rather than as a
|
|
30
|
+
* shorter tree. That is a correctness requirement, not a tidiness one, and it
|
|
31
|
+
* cost a real bug to learn:
|
|
32
|
+
*
|
|
33
|
+
* The no-preset path used to be `return <>{children}</>` — two provider levels
|
|
34
|
+
* shallower than the preset path. React reconciles by POSITION, so the first
|
|
35
|
+
* render after a preset arrives finds different element types at that position
|
|
36
|
+
* and unmounts the whole subtree to mount a new one. Every consumer that resolves
|
|
37
|
+
* its preset asynchronously — a profile screen learning the account's color a
|
|
38
|
+
* few hundred milliseconds after it opens — therefore remounted everything below
|
|
39
|
+
* the scope, including its own navigator.
|
|
40
|
+
*
|
|
41
|
+
* In Mention that scope sits above the app's route stack: the remount rebuilt
|
|
42
|
+
* the `[username]` navigator from scratch, which dropped the pushed child route
|
|
43
|
+
* AND its `username` param, and the profile a reader had just tapped rendered
|
|
44
|
+
* itself as "Profile not found" (mention#…, reproduced from the reel on a Pixel
|
|
45
|
+
* 10 Pro; the A/B was pinning `colorPreset` and watching the collapse stop).
|
|
46
|
+
* Remounting also throws away scroll positions, video players and in-flight
|
|
47
|
+
* state, so the same bug was costing far more than the one visible symptom.
|
|
48
|
+
*
|
|
49
|
+
* If a future change wants the no-preset case to render less, it has to keep the
|
|
50
|
+
* element types at this position identical across a preset change, or the
|
|
51
|
+
* remount comes back.
|
|
52
|
+
*/
|
|
19
53
|
export declare function BloomColorScope({ colorPreset, asChild, style, children, }: BloomColorScopeProps): import("react/jsx-runtime").JSX.Element;
|
|
20
54
|
/**
|
|
21
55
|
* Escape hatch for advanced cases where the wrapping element is owned by the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorScope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorScope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAarD,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAyDtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAYlF"}
|
|
@@ -2,8 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import type { AppColorName } from '../color-presets';
|
|
3
3
|
export interface BloomColorScopeProps {
|
|
4
4
|
/**
|
|
5
|
-
* Preset to apply within this subtree. When `undefined`, the scope
|
|
6
|
-
*
|
|
5
|
+
* Preset to apply within this subtree. When `undefined`, the scope publishes
|
|
6
|
+
* nothing of its own and children inherit the parent scope's preset unchanged.
|
|
7
|
+
*
|
|
8
|
+
* It is a no-op in what it PUBLISHES, never in what it RENDERS — the element
|
|
9
|
+
* tree is identical either way, so a preset that arrives late cannot remount
|
|
10
|
+
* the subtree. `ColorScope.tsx` carries the full account.
|
|
7
11
|
*/
|
|
8
12
|
colorPreset: AppColorName | undefined;
|
|
9
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAI3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgBrD,MAAM,WAAW,oBAAoB;IACnC
|
|
1
|
+
{"version":3,"file":"ColorScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAI3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgBrD,MAAM,WAAW,oBAAoB;IACnC;;;;;;;OAOG;IACH,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yGAAyG;IACzG,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AA+BD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAoDtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,KAAK,CAAC,aAAa,CAYjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAa/D,OAAO,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAa/D,OAAO,KAAK,EAAE,WAAW,EAAqC,MAAM,SAAS,CAAC;AAuZ9E,eAAO,MAAM,MAAM,yCAAwB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ResolvedAvatarShape } from './resolve-shape';
|
|
3
|
+
import type { AvatarRingGradientDirection } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* Size of the box the ring occupies. With `gap === 0` the ring overlays the
|
|
5
6
|
* avatar edge and the box equals the avatar size (footprint unchanged). With
|
|
@@ -11,8 +12,8 @@ export declare function getRingOuterSize(size: number, width: number, gap: numbe
|
|
|
11
12
|
interface AvatarRingProps {
|
|
12
13
|
/** Avatar diameter in px (the inner content size, before any gap). */
|
|
13
14
|
size: number;
|
|
14
|
-
/**
|
|
15
|
-
shape:
|
|
15
|
+
/** The avatar's resolved outline, or `null` for a circle. */
|
|
16
|
+
shape: ResolvedAvatarShape;
|
|
16
17
|
/** Solid ring: one color. Gradient ring: 2+ colors. */
|
|
17
18
|
colors: string | string[];
|
|
18
19
|
/** Ring stroke width in px. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarRing.d.ts","sourceRoot":"","sources":["../../../../src/avatar/AvatarRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AvatarRing.d.ts","sourceRoot":"","sources":["../../../../src/avatar/AvatarRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAK7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAO3D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,UAAU,eAAe;IACvB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,KAAK,EAAE,mBAAmB,CAAC;IAC3B,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,iBAAiB,EAAE,2BAA2B,CAAC;CAChD;AAkID,eAAO,MAAM,UAAU,6CAA4B,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { Avatar } from './Avatar';
|
|
2
2
|
export { AvatarPlaceholderProvider } from './context';
|
|
3
3
|
export type { AvatarPlaceholderConfig } from './context';
|
|
4
|
-
export type { AvatarProps, AvatarShape, AvatarRingConfig, AvatarRingGradientDirection, } from './types';
|
|
4
|
+
export type { AvatarProps, AvatarShape, AvatarShapePath, AvatarRingConfig, AvatarRingGradientDirection, } from './types';
|
|
5
5
|
export { defaultAvatarSource } from './default-avatar';
|
|
6
|
+
export { AVATAR_SHAPE_PATHS, AVATAR_SHAPE_LABELS, NAMED_SHAPE_VIEW_BOX, } from './shape-paths';
|
|
7
|
+
export type { AvatarShapeName } from './shape-paths';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EACV,WAAW,EACX,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AvatarShape, AvatarShapePath } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A shape reduced to what the renderers need: either nothing (a circle, drawn
|
|
4
|
+
* with `borderRadius` and no SVG at all) or one outline plus the size of the
|
|
5
|
+
* square space it is drawn in.
|
|
6
|
+
*/
|
|
7
|
+
export type ResolvedAvatarShape = AvatarShapePath | null;
|
|
8
|
+
/**
|
|
9
|
+
* Turns the public `shape` prop into an outline.
|
|
10
|
+
*
|
|
11
|
+
* Returns `null` for a circle so callers can keep the cheap `borderRadius`
|
|
12
|
+
* path — the common case never touches `react-native-svg`. An unknown string
|
|
13
|
+
* also returns `null`: a shape name that does not resolve should degrade to a
|
|
14
|
+
* plain circular avatar, never to a blank hole where a face should be.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveAvatarShape(shape: AvatarShape | AvatarShapePath | undefined): ResolvedAvatarShape;
|
|
17
|
+
//# sourceMappingURL=resolve-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-shape.d.ts","sourceRoot":"","sources":["../../../../src/avatar/resolve-shape.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,IAAI,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,eAAe,GAAG,SAAS,GAAG,mBAAmB,CAaxG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named avatar outlines.
|
|
3
|
+
*
|
|
4
|
+
* Each entry is an SVG path drawn in a 100×100 square coordinate space, scaled
|
|
5
|
+
* at render time to the avatar's pixel size. That space is declared once in
|
|
6
|
+
* {@link NAMED_SHAPE_VIEW_BOX} rather than baked into the numbers, so the paths
|
|
7
|
+
* can be read and edited at human-friendly magnitudes. The built-in squircle
|
|
8
|
+
* lives in `squircle-path.ts` and uses a 0–1 space; both are supported because
|
|
9
|
+
* {@link AvatarShapePath} carries its own `viewBox`.
|
|
10
|
+
*
|
|
11
|
+
* `circle` is deliberately absent: a circular avatar is rendered with
|
|
12
|
+
* `borderRadius` and never reaches the SVG renderer.
|
|
13
|
+
*/
|
|
14
|
+
/** Side length of the coordinate space every path below is drawn in. */
|
|
15
|
+
export declare const NAMED_SHAPE_VIEW_BOX = 100;
|
|
16
|
+
export type AvatarShapeName = 'square' | 'slanted' | 'arch' | 'semicircle' | 'oval' | 'pill' | 'triangle' | 'arrow' | 'fan' | 'diamond' | 'clamshell' | 'pentagon' | 'gem' | 'very-sunny' | 'sunny' | '4-sided-cookie' | '6-sided-cookie' | '7-sided-cookie' | '9-sided-cookie' | '12-sided-cookie' | '4-leaf-clover' | '8-leaf-clover' | 'burst' | 'soft-burst' | 'boom' | 'soft-boom' | 'flower' | 'puffy' | 'puffy-diamond' | 'ghost-ish' | 'pixel-circle' | 'pixel-triangle' | 'bun' | 'heart';
|
|
17
|
+
export declare const AVATAR_SHAPE_PATHS: Record<AvatarShapeName, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Display labels for the named shapes, in the order a picker should show them.
|
|
20
|
+
* Exported so consumers building a shape picker do not re-derive the order (or
|
|
21
|
+
* the capitalisation) themselves.
|
|
22
|
+
*/
|
|
23
|
+
export declare const AVATAR_SHAPE_LABELS: {
|
|
24
|
+
name: AvatarShapeName;
|
|
25
|
+
label: string;
|
|
26
|
+
}[];
|
|
27
|
+
//# sourceMappingURL=shape-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape-paths.d.ts","sourceRoot":"","sources":["../../../../src/avatar/shape-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,wEAAwE;AACxE,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,MAAM,MAAM,eAAe,GACvB,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,GAC5C,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK,GAC9C,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,YAAY,GAC3D,OAAO,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB,GAChE,gBAAgB,GAAG,iBAAiB,GAAG,eAAe,GACtD,eAAe,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,GAAG,WAAW,GAC/D,QAAQ,GAAG,OAAO,GAAG,eAAe,GAAG,WAAW,GAClD,cAAc,GAAG,gBAAgB,GAAG,KAAK,GAAG,OAAO,CAAC;AAExD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAgF9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAmCzE,CAAC"}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ImageSourcePropType, StyleProp, ViewStyle, ImageStyle } from 'react-native';
|
|
3
|
-
|
|
3
|
+
import type { AvatarShapeName } from './shape-paths';
|
|
4
|
+
/**
|
|
5
|
+
* Built-in avatar outlines: the two originals plus the named registry in
|
|
6
|
+
* `shape-paths.ts`. Any of these can be passed as a plain string.
|
|
7
|
+
*/
|
|
8
|
+
export type AvatarShape = 'circle' | 'squircle' | AvatarShapeName;
|
|
9
|
+
/**
|
|
10
|
+
* A caller-supplied outline, for shapes that are not in the built-in registry.
|
|
11
|
+
*
|
|
12
|
+
* The path is clipped against the avatar box, so it should fill its coordinate
|
|
13
|
+
* space edge to edge; anything outside is cut off rather than scaled to fit.
|
|
14
|
+
*/
|
|
15
|
+
export interface AvatarShapePath {
|
|
16
|
+
/** SVG path data (the `d` attribute) describing a closed outline. */
|
|
17
|
+
d: string;
|
|
18
|
+
/**
|
|
19
|
+
* Side length of the square coordinate space `d` is drawn in — 100 for a
|
|
20
|
+
* path written over a 0–100 grid, 1 for one written over a 0–1 grid.
|
|
21
|
+
* Defaults to 1.
|
|
22
|
+
*/
|
|
23
|
+
viewBox?: number;
|
|
24
|
+
}
|
|
4
25
|
/** Gradient sweep direction for a multi-color {@link AvatarRingConfig}. */
|
|
5
26
|
export type AvatarRingGradientDirection = 'diagonal' | 'horizontal' | 'vertical';
|
|
6
27
|
export interface AvatarRingConfig {
|
|
@@ -39,8 +60,14 @@ export interface AvatarProps {
|
|
|
39
60
|
verified?: boolean;
|
|
40
61
|
/** Custom verified badge icon (rendered at bottom-right) */
|
|
41
62
|
verifiedIcon?: ReactNode;
|
|
42
|
-
/**
|
|
43
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Shape of the avatar (defaults to `'circle'`). Accepts a built-in name —
|
|
65
|
+
* `'squircle'`, `'heart'`, `'pentagon'`, … see {@link AvatarShapeName} — or an
|
|
66
|
+
* {@link AvatarShapePath} with your own outline. Everything except `'circle'`
|
|
67
|
+
* clips through `react-native-svg`; a name that does not resolve falls back to
|
|
68
|
+
* a circle.
|
|
69
|
+
*/
|
|
70
|
+
shape?: AvatarShape | AvatarShapePath;
|
|
44
71
|
/** Container style */
|
|
45
72
|
style?: StyleProp<ViewStyle>;
|
|
46
73
|
/** Image style (circle shape only) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1F,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,eAAe,CAAC;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K,CAAC,EAAE,iBAAiB,CAAC;IAC1B,4DAA4D;IAC5D,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1D;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,yDAqJvB,CAAC;AAwBH;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,UAAoB,EACpB,kBAAkB,GACnB,EAAE;IACD,OAAO,EAAE,mBAAmB,CAAC;IAC7B,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,2CAaA;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;CAAE,2CAExE"}
|
|
@@ -16,15 +16,39 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const SURFACE_MOUNT_TIMEOUT_MS = 250;
|
|
18
18
|
/**
|
|
19
|
-
* How many
|
|
19
|
+
* How many CONSECUTIVE renders a video slot may arrive new on before Bloom says
|
|
20
|
+
* so.
|
|
20
21
|
*
|
|
21
|
-
* `renderVideo` is
|
|
22
|
-
*
|
|
23
|
-
* lives in
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* `renderVideo` is compared by identity — and on web it is part of what a host
|
|
23
|
+
* publishes to the layer — so an unmemoised slot re-renders the surface on
|
|
24
|
+
* every render of the row it lives in, silently and only under load.
|
|
25
|
+
*
|
|
26
|
+
* Consecutive, never a lifetime total. A correctly memoised slot changes
|
|
27
|
+
* identity whenever the state it reads changes (`isWatched` on a reel slide,
|
|
28
|
+
* say), so ANY fixed lifetime total is reached eventually by a consumer with
|
|
29
|
+
* nothing to fix — and the warning's own advice, `useCallback` over the props
|
|
30
|
+
* the slot reads, is what such a consumer already wrote. Five in a row is
|
|
31
|
+
* unreachable that way: it takes five commits where nothing the slot reads
|
|
32
|
+
* changed and the slot was rebuilt anyway.
|
|
26
33
|
*/
|
|
27
34
|
export declare const SLOT_IDENTITY_CHURN_LIMIT = 5;
|
|
35
|
+
/**
|
|
36
|
+
* How long a run of {@link SLOT_IDENTITY_CHURN_LIMIT} new slots may take and
|
|
37
|
+
* still be reported (ms).
|
|
38
|
+
*
|
|
39
|
+
* "Consecutive" alone is not enough for the consumer who memoised the surface's
|
|
40
|
+
* other props as well: `memo` then skips every render where only the parent
|
|
41
|
+
* changed, so the surface commits ONLY when the slot changes and the run never
|
|
42
|
+
* breaks — with nothing to fix and, because the renders were skipped, no cost
|
|
43
|
+
* paid either.
|
|
44
|
+
*
|
|
45
|
+
* Rate is what separates them, and it is what the warning was always about. A
|
|
46
|
+
* slot rebuilt per render changes as fast as its row renders, which in a
|
|
47
|
+
* scrolling feed is five times in a fraction of a frame budget. A slot rebuilt
|
|
48
|
+
* when the state it reads changes moves at the speed of a finger, and half a
|
|
49
|
+
* second is far too short for five activations of ONE surface.
|
|
50
|
+
*/
|
|
51
|
+
export declare const SLOT_IDENTITY_CHURN_WINDOW_MS = 500;
|
|
28
52
|
/**
|
|
29
53
|
* How far a media element may sit from the box it is supposed to fill, in px,
|
|
30
54
|
* before Bloom says so.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAiB5C
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAiB5C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC"}
|
|
@@ -257,9 +257,14 @@ export interface MediaVideoSlotProps<P extends VideoPlayerLike = VideoPlayerLike
|
|
|
257
257
|
* So the consumer may build the element instead, with Bloom deciding only what
|
|
258
258
|
* it has to: which player, and a style that fills the box.
|
|
259
259
|
*
|
|
260
|
-
* MEMOISE IT (`useCallback`)
|
|
261
|
-
*
|
|
260
|
+
* MEMOISE IT (`useCallback`), over the state the element actually reads. The
|
|
261
|
+
* slot is compared by identity — and on web it is part of what a host publishes
|
|
262
|
+
* to the layer — so a new function every render re-renders the surface every
|
|
262
263
|
* render. Correct either way, wasteful if you skip it.
|
|
264
|
+
*
|
|
265
|
+
* It is expected to change when that state does; only a slot rebuilt on renders
|
|
266
|
+
* where nothing it reads changed is the mistake, and that is the only one Bloom
|
|
267
|
+
* warns about.
|
|
263
268
|
*/
|
|
264
269
|
export type MediaVideoSlot<P extends VideoPlayerLike = VideoPlayerLike> = (props: MediaVideoSlotProps<P>) => ReactNode;
|
|
265
270
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/types.ts"],"names":[],"mappings":"AAAA,OAAO,K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B,CAAC,CAAC,CAAC,CAAC;IACpD,mFAAmF;IACnF,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAChC,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1D;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AA2Bf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAiBL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAe,MAAM,SAAS,CAAC;AA4oB3E;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAC1C,IAAI,EAAE,aAAa,CAAC,oBAAoB,CAAC;YAElB,WAAW;;EAGnC;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC;YAC1C,iBAAiB;;EAG/C"}
|
|
@@ -16,6 +16,11 @@ import type { TabBarItem, TabBarProps } from '../types';
|
|
|
16
16
|
* by each trigger's own focus (see `RouterTabBarButton`), which is what keeps it
|
|
17
17
|
* correct through deep links, back gestures and any other programmatic
|
|
18
18
|
* navigation. Setting both would put two writers on one shared value.
|
|
19
|
+
*
|
|
20
|
+
* `activeProgress` is NOT omitted, and that is not an oversight. It answers a
|
|
21
|
+
* different question — where the highlight is, not whether there is one — so a
|
|
22
|
+
* router-focused bar whose screens are PAGED can pass it and keep the focus
|
|
23
|
+
* path for selection. See `TabBarProps.activeProgress`.
|
|
19
24
|
*/
|
|
20
25
|
export type RouterTabBarProps = TabListProps & Omit<TabBarProps, 'activeIndex'>;
|
|
21
26
|
export type RouterTabBarButtonProps = TabTriggerSlotProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouterTabBar.d.ts","sourceRoot":"","sources":["../../../../../src/tab-bar/expo-router/RouterTabBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"RouterTabBar.d.ts","sourceRoot":"","sources":["../../../../../src/tab-bar/expo-router/RouterTabBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAEhF,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,GAAG;IAC1D,IAAI,EAAE,UAAU,CAAC;IACjB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,EAI3B,OAAO,EAAE,QAAQ,EACjB,GAAG,KAAK,EACT,EAAE,iBAAiB,2CAEnB;yBARe,YAAY;;;AAY5B;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,EAIL,IAAI,EAAE,KAAK,EACX,GAAG,KAAK,EACT,EAAE,uBAAuB,2CAEzB;yBAVe,kBAAkB"}
|
|
@@ -4,14 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Public API types for `@oxyhq/bloom/tab-bar`.
|
|
6
6
|
*
|
|
7
|
-
* This module
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* three at once. Platform behaviour lives in `surface.native.tsx` /
|
|
11
|
-
* `glyph.native.tsx` / `surface.web.tsx` and the `expo-router/` adapter
|
|
7
|
+
* This module names no PLATFORM package. It is resolved by a consumer's `tsc`,
|
|
8
|
+
* by Metro, and by every web bundler alike, so an import here of
|
|
9
|
+
* expo-glass-effect / expo-symbols / expo-router / react-native-screens would
|
|
10
|
+
* break all three at once. Platform behaviour lives in `surface.native.tsx` /
|
|
11
|
+
* `glyph.native.tsx` / `surface.web.tsx` and the `expo-router/` adapter; the
|
|
12
|
+
* gate is `src/__tests__/TabBarWebFork.test.ts`.
|
|
13
|
+
*
|
|
14
|
+
* `react-native-reanimated` is exempt and always was: it is a REQUIRED peer that
|
|
15
|
+
* every neutral module in this family already imports at runtime
|
|
16
|
+
* (`TabBarBase.tsx`), and the one reference below is `import type`, erased
|
|
17
|
+
* before any bundler sees it.
|
|
12
18
|
*/
|
|
13
19
|
import type { ReactNode } from 'react';
|
|
14
20
|
import type { PressableProps, ViewProps } from 'react-native';
|
|
21
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
15
22
|
export type TabBarItem = {
|
|
16
23
|
/** Stable identity for the tab (a route name in router-driven usage). */
|
|
17
24
|
name: string;
|
|
@@ -89,6 +96,30 @@ export type TabBarProps = ViewProps & {
|
|
|
89
96
|
* highlight from its own `isFocused`.
|
|
90
97
|
*/
|
|
91
98
|
activeIndex?: number;
|
|
99
|
+
/**
|
|
100
|
+
* DRIVEN path — the highlight's live position, in TAB UNITS, on the UI thread.
|
|
101
|
+
* A pager writes its own page position here (`1.4` is 40% of the way from the
|
|
102
|
+
* second tab to the third) and the highlight tracks the finger 1:1 instead of
|
|
103
|
+
* springing to a settled index after the navigation commits.
|
|
104
|
+
*
|
|
105
|
+
* It says WHERE the highlight is, never WHETHER there is one. Selection stays
|
|
106
|
+
* with the path already in play: `activeIndex` when the bar is controlled (an
|
|
107
|
+
* index naming no tab still fades the highlight out — see above), each
|
|
108
|
+
* button's `isFocused` when it is not. Passing this alone, with neither, is a
|
|
109
|
+
* bar that is always selected, which is what the focus-driven path already
|
|
110
|
+
* means.
|
|
111
|
+
*
|
|
112
|
+
* PRECEDENCE, because a shared value with two writers is a race: the SCRUB
|
|
113
|
+
* always wins — a finger on the bar is a direct manipulation of the bar, and
|
|
114
|
+
* releasing it reports through `onIndexChange` like any other selection. Below
|
|
115
|
+
* that, this value wins over every discrete writer: while it is supplied, the
|
|
116
|
+
* controlled effect, the focus effect and a `TabBarButton`'s own press all
|
|
117
|
+
* stop writing the position and leave it to the driver. So a consumer that
|
|
118
|
+
* passes this must keep it truthful — spring it to the settled index after a
|
|
119
|
+
* commit, and after any navigation it did not cause (a deep link, a back
|
|
120
|
+
* gesture), or the highlight stays where the last gesture left it.
|
|
121
|
+
*/
|
|
122
|
+
activeProgress?: SharedValue<number>;
|
|
92
123
|
/**
|
|
93
124
|
* Called with the chosen index when a tab is picked by tap, by scrub release,
|
|
94
125
|
* or by keyboard/assistive-technology activation of a `TabBarButton`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,UAAU,GAAG;IACvB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG;IAC/C,IAAI,EAAE,UAAU,CAAC;IACjB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
|
@@ -3,8 +3,13 @@ import { type StyleProp, type ViewStyle } from 'react-native';
|
|
|
3
3
|
import type { AppColorName } from '../color-presets';
|
|
4
4
|
export interface BloomColorScopeProps {
|
|
5
5
|
/**
|
|
6
|
-
* Preset to apply within this subtree. When `undefined`, the scope
|
|
7
|
-
*
|
|
6
|
+
* Preset to apply within this subtree. When `undefined`, the scope publishes
|
|
7
|
+
* nothing of its own and children inherit the parent scope's preset unchanged.
|
|
8
|
+
*
|
|
9
|
+
* It is a no-op in what it PUBLISHES, never in what it RENDERS — see the
|
|
10
|
+
* component's own comment: the element tree this returns is identical whether
|
|
11
|
+
* or not a preset is set, because a preset that arrives late must not remount
|
|
12
|
+
* the subtree.
|
|
8
13
|
*/
|
|
9
14
|
colorPreset: AppColorName | undefined;
|
|
10
15
|
/**
|
|
@@ -16,6 +21,35 @@ export interface BloomColorScopeProps {
|
|
|
16
21
|
style?: StyleProp<ViewStyle>;
|
|
17
22
|
children: React.ReactNode;
|
|
18
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A subtree themed by one color preset.
|
|
26
|
+
*
|
|
27
|
+
* THE SHAPE OF WHAT THIS RETURNS DOES NOT DEPEND ON `colorPreset`. Both
|
|
28
|
+
* providers are mounted unconditionally, and an absent preset is expressed as
|
|
29
|
+
* pass-through VALUES ({@link NO_VARS}, the parent's own theme) rather than as a
|
|
30
|
+
* shorter tree. That is a correctness requirement, not a tidiness one, and it
|
|
31
|
+
* cost a real bug to learn:
|
|
32
|
+
*
|
|
33
|
+
* The no-preset path used to be `return <>{children}</>` — two provider levels
|
|
34
|
+
* shallower than the preset path. React reconciles by POSITION, so the first
|
|
35
|
+
* render after a preset arrives finds different element types at that position
|
|
36
|
+
* and unmounts the whole subtree to mount a new one. Every consumer that resolves
|
|
37
|
+
* its preset asynchronously — a profile screen learning the account's color a
|
|
38
|
+
* few hundred milliseconds after it opens — therefore remounted everything below
|
|
39
|
+
* the scope, including its own navigator.
|
|
40
|
+
*
|
|
41
|
+
* In Mention that scope sits above the app's route stack: the remount rebuilt
|
|
42
|
+
* the `[username]` navigator from scratch, which dropped the pushed child route
|
|
43
|
+
* AND its `username` param, and the profile a reader had just tapped rendered
|
|
44
|
+
* itself as "Profile not found" (mention#…, reproduced from the reel on a Pixel
|
|
45
|
+
* 10 Pro; the A/B was pinning `colorPreset` and watching the collapse stop).
|
|
46
|
+
* Remounting also throws away scroll positions, video players and in-flight
|
|
47
|
+
* state, so the same bug was costing far more than the one visible symptom.
|
|
48
|
+
*
|
|
49
|
+
* If a future change wants the no-preset case to render less, it has to keep the
|
|
50
|
+
* element types at this position identical across a preset change, or the
|
|
51
|
+
* remount comes back.
|
|
52
|
+
*/
|
|
19
53
|
export declare function BloomColorScope({ colorPreset, asChild, style, children, }: BloomColorScopeProps): import("react/jsx-runtime").JSX.Element;
|
|
20
54
|
/**
|
|
21
55
|
* Escape hatch for advanced cases where the wrapping element is owned by the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorScope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorScope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAarD,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAyDtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAYlF"}
|
|
@@ -2,8 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import type { AppColorName } from '../color-presets';
|
|
3
3
|
export interface BloomColorScopeProps {
|
|
4
4
|
/**
|
|
5
|
-
* Preset to apply within this subtree. When `undefined`, the scope
|
|
6
|
-
*
|
|
5
|
+
* Preset to apply within this subtree. When `undefined`, the scope publishes
|
|
6
|
+
* nothing of its own and children inherit the parent scope's preset unchanged.
|
|
7
|
+
*
|
|
8
|
+
* It is a no-op in what it PUBLISHES, never in what it RENDERS — the element
|
|
9
|
+
* tree is identical either way, so a preset that arrives late cannot remount
|
|
10
|
+
* the subtree. `ColorScope.tsx` carries the full account.
|
|
7
11
|
*/
|
|
8
12
|
colorPreset: AppColorName | undefined;
|
|
9
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAI3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgBrD,MAAM,WAAW,oBAAoB;IACnC
|
|
1
|
+
{"version":3,"file":"ColorScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAI3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgBrD,MAAM,WAAW,oBAAoB;IACnC;;;;;;;OAOG;IACH,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yGAAyG;IACzG,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AA+BD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAoDtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,KAAK,CAAC,aAAa,CAYjF"}
|