@oxy.so/bloom 4.2.0 → 4.3.0
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/ai-chat.mdx +8 -0
- package/docs/settings-modal.mdx +7 -1
- package/docs/sidebar.mdx +11 -0
- package/lib/commonjs/ai-chat/AiChatContainer.js +8 -8
- package/lib/commonjs/ai-chat/AiChatContainer.js.map +1 -1
- package/lib/commonjs/settings-modal/SettingsModal.js +120 -112
- package/lib/commonjs/settings-modal/SettingsModal.js.map +1 -1
- package/lib/commonjs/sidebar/Sidebar.js +34 -4
- package/lib/commonjs/sidebar/Sidebar.js.map +1 -1
- package/lib/module/ai-chat/AiChatContainer.js +8 -8
- package/lib/module/ai-chat/AiChatContainer.js.map +1 -1
- package/lib/module/settings-modal/SettingsModal.js +123 -115
- package/lib/module/settings-modal/SettingsModal.js.map +1 -1
- package/lib/module/sidebar/Sidebar.js +34 -4
- package/lib/module/sidebar/Sidebar.js.map +1 -1
- package/lib/typescript/commonjs/ai-chat/types.d.ts +2 -2
- package/lib/typescript/commonjs/ai-chat/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/settings-modal/SettingsModal.d.ts +1 -1
- package/lib/typescript/commonjs/settings-modal/SettingsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/settings-modal/types.d.ts +3 -0
- package/lib/typescript/commonjs/settings-modal/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/types.d.ts +12 -1
- package/lib/typescript/commonjs/sidebar/types.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/types.d.ts +2 -2
- package/lib/typescript/module/ai-chat/types.d.ts.map +1 -1
- package/lib/typescript/module/settings-modal/SettingsModal.d.ts +1 -1
- package/lib/typescript/module/settings-modal/SettingsModal.d.ts.map +1 -1
- package/lib/typescript/module/settings-modal/types.d.ts +3 -0
- package/lib/typescript/module/settings-modal/types.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/types.d.ts +12 -1
- package/lib/typescript/module/sidebar/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/support/adoption-matrix.ts +703 -0
- package/src/__tests__/support/collision-fixture-barrel.ts +20 -0
- package/src/__tests__/support/commerce-harness.tsx +97 -0
- package/src/__tests__/support/composite.ts +68 -0
- package/src/__tests__/support/constructed-style-sheets.ts +68 -0
- package/src/__tests__/support/press-host.ts +30 -0
- package/src/__tests__/support/rendered-style.ts +99 -0
- package/src/__tests__/support/unread-hook-fixture.ts +33 -0
- package/src/ai-chat/AiChatContainer.tsx +7 -7
- package/src/ai-chat/types.ts +2 -2
- package/src/settings-modal/SettingsModal.tsx +150 -132
- package/src/settings-modal/types.ts +3 -0
- package/src/sidebar/Sidebar.tsx +25 -4
- package/src/sidebar/types.ts +12 -1
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +9346 -0
- package/src/theme/__tests__/__fixtures__/tonal-glass-primary-failures.json +69 -0
- package/src/theme/__tests__/fixtures/color-engine-golden.json +1 -0
package/docs/adoption-matrix.mdx
CHANGED
|
@@ -173,7 +173,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
173
173
|
| `date-picker` | `@oxy.so/bloom/date-picker` + barrel | universal | `date-picker.mdx` | yes | 4 | reads | reads | | reads |
|
|
174
174
|
| `delivery-slot` | `@oxy.so/bloom/delivery-slot` + barrel | universal | `delivery-slot.mdx` | yes | 2 | reads | | | |
|
|
175
175
|
| `design-tokens` | `@oxy.so/bloom/design-tokens` + barrel | universal | `design-tokens.mdx` | yes | 3 | | | | |
|
|
176
|
-
| `dialog` | `@oxy.so/bloom/dialog` + barrel | web fork | `dialog.mdx` | yes |
|
|
176
|
+
| `dialog` | `@oxy.so/bloom/dialog` + barrel | web fork | `dialog.mdx` | yes | 14 | | | | |
|
|
177
177
|
| `directions` | `@oxy.so/bloom/directions` + barrel | universal | `directions.mdx` | yes | 2 | | | | |
|
|
178
178
|
| `divider` | `@oxy.so/bloom/divider` + barrel | universal | `divider.mdx` | yes | 1 | | | | |
|
|
179
179
|
| `dot-grid-meter` | `@oxy.so/bloom/dot-grid-meter` + barrel | universal | `dot-grid-meter.mdx` | yes | 2 | | | | |
|
|
@@ -195,7 +195,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
195
195
|
| `hooks` | `@oxy.so/bloom/hooks` + barrel | universal | `hooks.mdx` | yes | 9 | | | | reads |
|
|
196
196
|
| `hover-card` | `@oxy.so/bloom/hover-card` + barrel | web fork | `hover-card.mdx` | yes | 2 | | | reads | reads |
|
|
197
197
|
| `icon-circle` | `@oxy.so/bloom/icon-circle` + barrel | universal | `icon-circle.mdx` | yes | 1 | | | | |
|
|
198
|
-
| `icons` | `@oxy.so/bloom/icons` + barrel | universal | `icons.mdx` | yes |
|
|
198
|
+
| `icons` | `@oxy.so/bloom/icons` + barrel | universal | `icons.mdx` | yes | 48 | | | | |
|
|
199
199
|
| `image-aspect-ratio-cache` | `@oxy.so/bloom/image-aspect-ratio-cache` + barrel | universal | `image-aspect-ratio-cache.mdx` | yes | 1 | | | | |
|
|
200
200
|
| `image-resolver` | `@oxy.so/bloom/image-resolver` + barrel | universal | `image-resolver.mdx` | yes | 7 | | | | |
|
|
201
201
|
| `important-alerts-card` | `@oxy.so/bloom/important-alerts-card` + barrel | universal | `important-alerts-card.mdx` | yes | 1 | | | | |
|
|
@@ -278,9 +278,9 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
278
278
|
| `segmented-control` | `@oxy.so/bloom/segmented-control` + barrel | universal | `segmented-control.mdx` | yes | 3 | reads | | | |
|
|
279
279
|
| `select` | `@oxy.so/bloom/select` + barrel | web fork | `select.mdx` | yes | 6 | reads | | reads | |
|
|
280
280
|
| `settings-list` | `@oxy.so/bloom/settings-list` + barrel | universal | `settings-list.mdx` | yes | 5 | | | | |
|
|
281
|
-
| `settings-modal` | `@oxy.so/bloom/settings-modal` + barrel | universal | `settings-modal.mdx` | yes |
|
|
281
|
+
| `settings-modal` | `@oxy.so/bloom/settings-modal` + barrel | universal | `settings-modal.mdx` | yes | 2 | | | | reads |
|
|
282
282
|
| `shipment-request` | `@oxy.so/bloom/shipment-request` + barrel | universal | `shipment-request.mdx` | yes | 1 | **adaptation** | | | |
|
|
283
|
-
| `sidebar` | `@oxy.so/bloom/sidebar` + barrel | universal | `sidebar.mdx` | yes |
|
|
283
|
+
| `sidebar` | `@oxy.so/bloom/sidebar` + barrel | universal | `sidebar.mdx` | yes | 6 | n/a¹ | | | reads |
|
|
284
284
|
| `skeleton` | `@oxy.so/bloom/skeleton` + barrel | universal | `skeleton.mdx` | yes | 1 | | | | |
|
|
285
285
|
| `slider` | `@oxy.so/bloom/slider` + barrel | universal | `slider.mdx` | yes | 4 | reads | | | |
|
|
286
286
|
| `social-button` | `@oxy.so/bloom/social-button` + barrel | universal | `social-button.mdx` | yes | 1 | | | | |
|
|
@@ -304,7 +304,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
304
304
|
| `tenancy` | `@oxy.so/bloom/tenancy` + barrel | universal | `tenancy.mdx` | yes | 3 | | n/a¹ | | |
|
|
305
305
|
| `text-field` | `@oxy.so/bloom/text-field` + barrel | universal | `text-field.mdx` | yes | 13 | reads | reads | | |
|
|
306
306
|
| `textarea` | `@oxy.so/bloom/textarea` + barrel | universal | `textarea.mdx` | yes | 4 | reads | reads | | n/a¹ |
|
|
307
|
-
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes |
|
|
307
|
+
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes | 289 | | | n/a¹ | reads |
|
|
308
308
|
| `theme-toggle` | `@oxy.so/bloom/theme-toggle` + barrel | universal | `theme-toggle.mdx` | yes | 1 | n/a¹ | | | |
|
|
309
309
|
| `toast` | `@oxy.so/bloom/toast` + barrel | universal | `toast.mdx` | yes | 17 | | | | |
|
|
310
310
|
| `tooltip` | `@oxy.so/bloom/tooltip` + barrel | web fork | `tooltip.mdx` | yes | 1 | | | | |
|
package/docs/ai-chat.mdx
CHANGED
|
@@ -130,3 +130,11 @@ Semantic tokens resolved onto Bloom's ramps (`ai-chat/shared.ts`): background-fu
|
|
|
130
130
|
- **The glass chips** are frost + tint + sheen + rim; the SVG refraction layer of the reference material is not reproduced.
|
|
131
131
|
- **Effort at Max** has no flame / starfield flourish (see `composer-panel`).
|
|
132
132
|
- The gallery re-baselines rather than animating when the panel's own width changes during a resize drag.
|
|
133
|
+
|
|
134
|
+
### Custom chat header
|
|
135
|
+
|
|
136
|
+
`AiChatContainer` can receive a `header` such as Bloom's `PageHeader` with the
|
|
137
|
+
application's real actions. Omit `title` and `project` to omit its breadcrumb;
|
|
138
|
+
without breadcrumb or action handlers no extra header row is reserved. Share
|
|
139
|
+
and more controls render only when `onShare` and `onMore` are supplied. This
|
|
140
|
+
keeps applications without public sharing from presenting a dead share action.
|
package/docs/settings-modal.mdx
CHANGED
|
@@ -77,7 +77,7 @@ In `compact`, `SettingsRow` lets its control wrap under the label when both do n
|
|
|
77
77
|
|
|
78
78
|
## Shared header
|
|
79
79
|
|
|
80
|
-
Every layout uses `PageHeader` with its floating islands. A `ButtonGroupItem` supplies the close action; compact pages use its native back action to return to sections. The modal owns safe-area padding once, so the header uses `safeArea={false}`.
|
|
80
|
+
Every layout uses `PageHeader` with its floating islands. A `ButtonGroupItem` supplies the close action; compact pages use its native back action to return to sections. The modal owns safe-area padding once, so the header uses `safeArea={false}`. The page viewport fills the entire content panel: its first child is the sticky header, followed by the padded page body. Native uses `stickyHeaderIndices`; web uses the header’s CSS sticky positioning. The viewport’s own Reanimated scroll offset drives `PageHeader`’s automatic scrim in the modal surface color, independently of the document beneath it. There is no second body viewport or separate fade. Compact section navigation uses the same structure in its rail viewport. Changing pages remounts the page viewport and resets its scroll offset. `PageHeader` owns header metrics; only the page body owns content padding.
|
|
81
81
|
|
|
82
82
|
## Why it is not a `Dialog`
|
|
83
83
|
|
|
@@ -119,3 +119,9 @@ All surfaces come from the theme ramps (`button/shared`): background/secondary i
|
|
|
119
119
|
- Bespoke file-type illustrations aren't included; the default is the Remix document / spreadsheet / video glyph. Pass `renderFileIcon` for artwork.
|
|
120
120
|
- The Storage search uses `TextField`'s own tertiary fill — `TextField` owns its shell paint.
|
|
121
121
|
- The panel's 4px blur during open/close is web-only; native fades and scales.
|
|
122
|
+
|
|
123
|
+
### Preventing unfinished work from being discarded
|
|
124
|
+
|
|
125
|
+
`onBeforeLeave(reason)` synchronously returns `false` to keep the current content mounted, with no exit animation. Reasons are `close` (close action, backdrop, Escape, Android back from navigation, or `control.close()`), `navigation` (compact back to sections, including Android back), and `page` (selecting a different page). It runs once per intention with the latest callback; selecting the same page does not invoke it. An imperative close callback runs only if the close was accepted.
|
|
126
|
+
|
|
127
|
+
Use the imperative control for guarded flows. External changes to controlled `open` or `page`, and parent unmounts, remain the caller's authority and are not vetoed. Preserve the application's router leave guard as well when navigation can unmount the modal. The guard should read the application's completion state; the modal never stores recovery phrases or other sensitive content.
|
package/docs/sidebar.mdx
CHANGED
|
@@ -232,3 +232,14 @@ The panel scroll viewport extends behind the bottom half of the last fixed heade
|
|
|
232
232
|
`ProfileButton` above is an application component: the app retains authentication, account selection and menu behavior. The slot adds no account behavior and does not replace `account`, theme, secondary navigation, team or plan controls. Omit `account` if your footer replaces the built-in account switcher. Footer content should fit the compact rail width and provide an accessible name when it hides its label.
|
|
233
233
|
|
|
234
234
|
Navigation items accept `onLongPress` for secondary touch actions, in both panel and rail. Keep the same action available in a keyboard-accessible menu; long press alone is not discoverable or keyboard accessible.
|
|
235
|
+
|
|
236
|
+
## App-owned history
|
|
237
|
+
|
|
238
|
+
Use `content` for conversation history or other application-owned rows. It follows
|
|
239
|
+
items/tree inside Sidebar's existing scroll viewport; `onScroll` observes that
|
|
240
|
+
viewport after its edge fades update. Compose `SidebarItem`/`SidebarFolder` here,
|
|
241
|
+
not another scroller. Header, primary action and footer stay fixed. Content remains
|
|
242
|
+
mounted while collapsed, but is hidden from focus, pointers and accessibility and
|
|
243
|
+
contracts with the panel's animation. `variant="rail"` omits this expanded content.
|
|
244
|
+
Quick search only filters built-in rows/tree; use `showSearch={false}` when the
|
|
245
|
+
application supplies its own search destination.
|
|
@@ -85,7 +85,7 @@ function AiChatContainer({
|
|
|
85
85
|
bottom: 0
|
|
86
86
|
},
|
|
87
87
|
children: background
|
|
88
|
-
}) : null, header, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
88
|
+
}) : null, header, title != null || project != null || onShare || onMore ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
89
89
|
style: {
|
|
90
90
|
width: '100%',
|
|
91
91
|
flexDirection: 'row',
|
|
@@ -101,17 +101,17 @@ function AiChatContainer({
|
|
|
101
101
|
minWidth: 0,
|
|
102
102
|
flex: 1
|
|
103
103
|
},
|
|
104
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.Breadcrumb, {
|
|
104
|
+
children: title != null || project != null ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index2.Breadcrumb, {
|
|
105
105
|
accessibilityLabel: l.breadcrumb,
|
|
106
106
|
children: [project === undefined ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.BreadcrumbItem, {
|
|
107
107
|
icon: projectIcon,
|
|
108
108
|
onPress: onProjectPress,
|
|
109
109
|
children: project
|
|
110
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.BreadcrumbItem, {
|
|
110
|
+
}), title == null ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.BreadcrumbItem, {
|
|
111
111
|
current: true,
|
|
112
112
|
children: title
|
|
113
113
|
})]
|
|
114
|
-
})
|
|
114
|
+
}) : null
|
|
115
115
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
116
116
|
style: {
|
|
117
117
|
flexShrink: 0,
|
|
@@ -119,19 +119,19 @@ function AiChatContainer({
|
|
|
119
119
|
alignItems: 'center',
|
|
120
120
|
gap: 8
|
|
121
121
|
},
|
|
122
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AiChatControls.GlyphAction, {
|
|
122
|
+
children: [onShare ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_AiChatControls.GlyphAction, {
|
|
123
123
|
icon: _RiShare2Line.RiShare2Line,
|
|
124
124
|
label: l.share,
|
|
125
125
|
onPress: onShare,
|
|
126
126
|
palette: palette
|
|
127
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AiChatControls.GlyphAction, {
|
|
127
|
+
}) : null, onMore ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_AiChatControls.GlyphAction, {
|
|
128
128
|
icon: _RiMoreFill.RiMoreFill,
|
|
129
129
|
label: l.more,
|
|
130
130
|
onPress: onMore,
|
|
131
131
|
palette: palette
|
|
132
|
-
})]
|
|
132
|
+
}) : null]
|
|
133
133
|
})]
|
|
134
|
-
}), children, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
134
|
+
}) : null, children, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
135
135
|
style: {
|
|
136
136
|
width: '100%',
|
|
137
137
|
flexDirection: 'column',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_index","_index2","_RiFolderLine","_RiMoreFill","_RiShare2Line","_AiChatControls","_shared","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_LABELS","breadcrumb","share","more","AiChatContainer","project","title","projectIcon","RiFolderLine","onProjectPress","onShare","onMore","header","children","composer","working","workingLabel","background","surface","labels","style","testID","useAiChatWebCss","palette","useAiChatPalette","l","useMemo","jsxs","View","height","minWidth","flex","flexDirection","overflow","borderRadius","CONTAINER_RADIUS","backgroundColor","secondary","jsx","pointerEvents","position","top","left","right","bottom","width","alignItems","justifyContent","gap","paddingLeft","paddingRight","paddingTop","Breadcrumb","accessibilityLabel","undefined","BreadcrumbItem","icon","onPress","current","flexShrink","GlyphAction","RiShare2Line","label","RiMoreFill","paddingBottom","AgentThinking","variant","AiChatThread","exports","forwardRef","autoFollow","followAnimated","followThreshold","onStartReached","onStartReachedThreshold","maintainStartPosition","onScroll","scrollEventThrottle","ref","scrollRef","useRef","lastHeight","offset","viewport","pageOut","startArmed","useImperativeHandle","scrollToEnd","options","animated","scrollToOffset","y","scrollTo","getScrollView","listening","handleScroll","useCallback","event","contentOffset","layoutMeasurement","nativeEvent","onLayout","layout","onContentSizeChange","_width","previous","grew","first","fromBottom","ScrollView","dataHook","minHeight","contentContainerStyle","IS_WEB","flexGrow"],"sourceRoot":"../../../src","sources":["ai-chat/AiChatContainer.tsx"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAiG,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAD,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAW,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAA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C,CAAC;EACjB,MAAMC,OAAO,GAAG,IAAAC,wBAAgB,EAAC,CAAC;EAClC,MAAMC,CAAC,GAAG,IAAAC,cAAO,EAAC,OAAO;IAAE,GAAG1B,cAAc;IAAE,GAAGmB;EAAO,CAAC,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EACrE,oBACE,IAAAvC,WAAA,CAAA+C,IAAA,EAACvD,YAAA,CAAAwD,IAAI;IACHP,MAAM,EAAEA,MAAO;IACfD,KAAK,EAAE,CACL;MACES,MAAM,EAAE,MAAM;MACdC,QAAQ,EAAE,CAAC;MACXC,IAAI,EAAE,CAAC;MACPC,aAAa,EAAE,QAAQ;MACvBC,QAAQ,EAAE,QAAQ;MAClBC,YAAY,EAAEC,wBAAgB;MAC9BC,eAAe,EAAElB,OAAO,GAAGK,OAAO,CAACc,SAAS,GAAG;IACjD,CAAC,EACDjB,KAAK,CACL;IAAAP,QAAA,GACDI,UAAU,gBACT,IAAArC,WAAA,CAAA0D,GAAA,EAAClE,YAAA,CAAAwD,IAAI;MAACW,aAAa,EAAC,MAAM;MAACnB,KAAK,EAAE;QAAEoB,QAAQ,EAAE,UAAU;QAAEC,GAAG,EAAE,CAAC;QAAEC,IAAI,EAAE,CAAC;QAAEC,KAAK,EAAE,CAAC;QAAEC,MAAM,EAAE;MAAE,CAAE;MAAA/B,QAAA,EAC9FI;IAAU,CACP,CAAC,GACL,IAAI,EACPL,MAAM,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_index","_index2","_RiFolderLine","_RiMoreFill","_RiShare2Line","_AiChatControls","_shared","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_LABELS","breadcrumb","share","more","AiChatContainer","project","title","projectIcon","RiFolderLine","onProjectPress","onShare","onMore","header","children","composer","working","workingLabel","background","surface","labels","style","testID","useAiChatWebCss","palette","useAiChatPalette","l","useMemo","jsxs","View","height","minWidth","flex","flexDirection","overflow","borderRadius","CONTAINER_RADIUS","backgroundColor","secondary","jsx","pointerEvents","position","top","left","right","bottom","width","alignItems","justifyContent","gap","paddingLeft","paddingRight","paddingTop","Breadcrumb","accessibilityLabel","undefined","BreadcrumbItem","icon","onPress","current","flexShrink","GlyphAction","RiShare2Line","label","RiMoreFill","paddingBottom","AgentThinking","variant","AiChatThread","exports","forwardRef","autoFollow","followAnimated","followThreshold","onStartReached","onStartReachedThreshold","maintainStartPosition","onScroll","scrollEventThrottle","ref","scrollRef","useRef","lastHeight","offset","viewport","pageOut","startArmed","useImperativeHandle","scrollToEnd","options","animated","scrollToOffset","y","scrollTo","getScrollView","listening","handleScroll","useCallback","event","contentOffset","layoutMeasurement","nativeEvent","onLayout","layout","onContentSizeChange","_width","previous","grew","first","fromBottom","ScrollView","dataHook","minHeight","contentContainerStyle","IS_WEB","flexGrow"],"sourceRoot":"../../../src","sources":["ai-chat/AiChatContainer.tsx"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAiG,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAD,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAW,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA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yB,QAAQ,CAACzB,OAAO;MAC/D,IAAIkD,UAAU,GAAGpC,eAAe,EAAE;IACpC;IACAO,SAAS,CAACrB,OAAO,EAAE6B,WAAW,CAAC;MAAEE,QAAQ,EAAElB;IAAe,CAAC,CAAC;EAC9D,CAAC,EACD,CAACD,UAAU,EAAEC,cAAc,EAAEC,eAAe,EAAEG,qBAAqB,CACrE,CAAC;EAED,oBACE,IAAA/F,WAAA,CAAA0D,GAAA,EAAClE,YAAA,CAAAyI,UAAU;IACT/B,GAAG,EAAEC,SAAU;IACf1D,MAAM,EAAEA,MAAO;IAAA,GACX,IAAAyF,gBAAQ,EAAC,mBAAmB,EAAE,MAAM,CAAC;IACzCP,mBAAmB,EAAEA,mBAAoB;IACzCF,QAAQ,EAAEA,QAAS;IACnBzB,QAAQ,EAAEkB,SAAS,GAAGC,YAAY,GAAGzC,SAAU;IAC/CuB,mBAAmB,EAAEiB,SAAS,GAAGjB,mBAAmB,GAAGvB,SAAU;IACjElC,KAAK,EAAE,CAAC;MAAE2F,SAAS,EAAE,CAAC;MAAElE,KAAK,EAAE,MAAM;MAAEd,IAAI,EAAE;IAAE,CAAC,EAAEX,KAAK,CAAE;IACzD4F,qBAAqB,EAAE;MACrB;MACA;MACA;MACA,IAAIC,cAAM,GAAG;QAAEF,SAAS,EAAE,MAAM;QAAEpD,UAAU,EAAE;MAAE,CAAC,GAAG;QAAEuD,QAAQ,EAAE;MAAE,CAAC,CAAC;MACpElF,aAAa,EAAE,QAAQ;MACvBe,cAAc,EAAE,UAAU;MAC1BC,GAAG,EAAE,EAAE;MACPC,WAAW,EAAE,EAAE;MACfC,YAAY,EAAE,EAAE;MAChBC,UAAU,EAAE;IACd,CAAE;IAAAtC,QAAA,EACDA;EAAQ,CACC,CAAC;AAEjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -13,7 +13,6 @@ var _RiCheckboxCircleFill = require("../icons/remix/RiCheckboxCircleFill.js");
|
|
|
13
13
|
var _index = require("../page-header/index.js");
|
|
14
14
|
var _index2 = require("../button-group/index.js");
|
|
15
15
|
var _RiCloseLine = require("../icons/remix/RiCloseLine.js");
|
|
16
|
-
var _SettingsArt = require("./SettingsArt.js");
|
|
17
16
|
var _index3 = require("../overlay/index.js");
|
|
18
17
|
var _webData = require("../styles/web-data.js");
|
|
19
18
|
var _index4 = require("../typography/index.js");
|
|
@@ -34,8 +33,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
34
33
|
* 20px icon (icon/secondary) + 8 + body-medium label
|
|
35
34
|
* (selected: background/secondary/hover + text/primary;
|
|
36
35
|
* hover: background/secondary/hover @ 60%)
|
|
37
|
-
* content
|
|
38
|
-
*
|
|
36
|
+
* content one viewport with a sticky PageHeader and its scroll-linked edge;
|
|
37
|
+
* content insets belong to the page body, never the viewport
|
|
39
38
|
* toast "Saved" pill straddling the panel's bottom edge: 1px
|
|
40
39
|
* border/button, background/primary, py 4 pr 10 pl 6, gap 4,
|
|
41
40
|
* 16px lime check + body-2-medium, shadow-dropdown. Rises 12px in,
|
|
@@ -99,6 +98,7 @@ function SettingsModal({
|
|
|
99
98
|
control,
|
|
100
99
|
open: controlledOpen,
|
|
101
100
|
onClose,
|
|
101
|
+
onBeforeLeave,
|
|
102
102
|
groups,
|
|
103
103
|
pages,
|
|
104
104
|
page: controlledPage,
|
|
@@ -131,6 +131,9 @@ function SettingsModal({
|
|
|
131
131
|
const [compactPageOpen, setCompactPageOpen] = (0, _react.useState)(initialView === 'page');
|
|
132
132
|
const initialViewRef = (0, _react.useRef)(initialView);
|
|
133
133
|
initialViewRef.current = initialView;
|
|
134
|
+
const beforeLeaveRef = (0, _react.useRef)(onBeforeLeave);
|
|
135
|
+
beforeLeaveRef.current = onBeforeLeave;
|
|
136
|
+
const mayLeave = (0, _react.useCallback)(reason => beforeLeaveRef.current?.(reason) !== false, []);
|
|
134
137
|
const onCloseRef = (0, _react.useRef)(onClose);
|
|
135
138
|
onCloseRef.current = onClose;
|
|
136
139
|
const isControlledRef = (0, _react.useRef)(isControlled);
|
|
@@ -176,20 +179,25 @@ function SettingsModal({
|
|
|
176
179
|
if (controlledOpen) show();else hide();
|
|
177
180
|
}, [isControlled, controlledOpen, show, hide]);
|
|
178
181
|
const requestClose = (0, _react.useCallback)(() => {
|
|
182
|
+
if (!mayLeave('close')) return false;
|
|
179
183
|
if (isControlledRef.current) onCloseRef.current?.();else hide();
|
|
180
|
-
|
|
184
|
+
return true;
|
|
185
|
+
}, [hide, mayLeave]);
|
|
181
186
|
(0, _react.useImperativeHandle)(control?.ref, () => ({
|
|
182
187
|
open: show,
|
|
183
188
|
close: cb => {
|
|
184
|
-
|
|
185
|
-
if (cb) setTimeout(cb, UNMOUNT_MS);
|
|
189
|
+
if (requestClose() && cb) setTimeout(cb, UNMOUNT_MS);
|
|
186
190
|
}
|
|
187
|
-
}), [show,
|
|
191
|
+
}), [show, requestClose]);
|
|
188
192
|
const selectPage = (0, _react.useCallback)(next => {
|
|
193
|
+
if (next !== currentPage && !mayLeave('page')) return;
|
|
189
194
|
if (controlledPage === undefined) setInternalPage(next);
|
|
190
195
|
setCompactPageOpen(true);
|
|
191
196
|
onPageChange?.(next);
|
|
192
|
-
}, [controlledPage, onPageChange]);
|
|
197
|
+
}, [controlledPage, currentPage, onPageChange, mayLeave]);
|
|
198
|
+
const requestNavigation = (0, _react.useCallback)(() => {
|
|
199
|
+
if (mayLeave('navigation')) setCompactPageOpen(false);
|
|
200
|
+
}, [mayLeave]);
|
|
193
201
|
|
|
194
202
|
// Escape closes (web). On `window`, not `document`: a menu or popover opened
|
|
195
203
|
// inside the modal handles Escape on `document` and stops propagation there,
|
|
@@ -214,11 +222,11 @@ function SettingsModal({
|
|
|
214
222
|
if (!mounted || _webCss.IS_WEB || typeof _reactNative.BackHandler?.addEventListener !== 'function') return;
|
|
215
223
|
const sub = _reactNative.BackHandler.addEventListener('hardwareBackPress', () => {
|
|
216
224
|
// On a pushed page (compact), back returns to the section list first.
|
|
217
|
-
if (compactPageOpenRef.current)
|
|
225
|
+
if (compactPageOpenRef.current) requestNavigation();else requestClose();
|
|
218
226
|
return true;
|
|
219
227
|
});
|
|
220
228
|
return () => sub.remove();
|
|
221
|
-
}, [mounted, requestClose]);
|
|
229
|
+
}, [mounted, requestClose, requestNavigation]);
|
|
222
230
|
|
|
223
231
|
// ----- saved toast -------------------------------------------------------
|
|
224
232
|
const [savedPhase, setSavedPhase] = (0, _react.useState)('hidden');
|
|
@@ -328,32 +336,30 @@ function SettingsModal({
|
|
|
328
336
|
backgroundColor: palette.full,
|
|
329
337
|
boxShadow: palette.shadowXs
|
|
330
338
|
}, ringVars(palette)],
|
|
331
|
-
children: layout === 'compact' ? compactPageOpen && pageConfig ? /*#__PURE__*/(0, _jsxRuntime.
|
|
339
|
+
children: layout === 'compact' ? compactPageOpen && pageConfig ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
332
340
|
style: styles.content,
|
|
333
|
-
children:
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(PageScroller, {
|
|
341
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PageScroller, {
|
|
342
|
+
header: {
|
|
343
|
+
title: pageConfig.title,
|
|
344
|
+
onBack: requestNavigation,
|
|
345
|
+
backLabel: labels?.back ?? 'Back',
|
|
346
|
+
closeLabel,
|
|
347
|
+
onClose: requestClose
|
|
348
|
+
},
|
|
342
349
|
palette: palette,
|
|
343
350
|
inset: CONTENT_INSET.compact,
|
|
344
351
|
insetTop: CONTENT_INSET.compact,
|
|
345
352
|
testID: testID,
|
|
346
353
|
children: pageConfig.content
|
|
347
|
-
}, currentPage)
|
|
348
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.
|
|
354
|
+
}, currentPage)
|
|
355
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
349
356
|
style: styles.content,
|
|
350
|
-
children:
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SettingsRail, {
|
|
357
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SettingsRail, {
|
|
358
|
+
header: {
|
|
359
|
+
title: labels?.dialog ?? 'Settings',
|
|
360
|
+
closeLabel,
|
|
361
|
+
onClose: requestClose
|
|
362
|
+
},
|
|
357
363
|
groups: groups,
|
|
358
364
|
page: currentPage,
|
|
359
365
|
onSelect: selectPage,
|
|
@@ -361,7 +367,7 @@ function SettingsModal({
|
|
|
361
367
|
label: labels?.nav ?? 'Settings sections',
|
|
362
368
|
layout: "compact",
|
|
363
369
|
testID: testID
|
|
364
|
-
})
|
|
370
|
+
})
|
|
365
371
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
366
372
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SettingsRail, {
|
|
367
373
|
groups: groups,
|
|
@@ -371,21 +377,20 @@ function SettingsModal({
|
|
|
371
377
|
label: labels?.nav ?? 'Settings sections',
|
|
372
378
|
layout: layout,
|
|
373
379
|
testID: testID
|
|
374
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
380
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
375
381
|
style: styles.content,
|
|
376
|
-
children:
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(PageScroller, {
|
|
382
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PageScroller, {
|
|
383
|
+
header: {
|
|
384
|
+
title: pageConfig?.title ?? '',
|
|
385
|
+
closeLabel,
|
|
386
|
+
onClose: requestClose
|
|
387
|
+
},
|
|
383
388
|
palette: palette,
|
|
384
389
|
inset: CONTENT_INSET[layout],
|
|
385
390
|
insetTop: pageConfig?.compactTitle ? 6 : 12,
|
|
386
391
|
testID: testID,
|
|
387
392
|
children: pageConfig?.content
|
|
388
|
-
}, currentPage)
|
|
393
|
+
}, currentPage)
|
|
389
394
|
})]
|
|
390
395
|
})
|
|
391
396
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SavedToast, {
|
|
@@ -414,6 +419,7 @@ function ringVars(palette) {
|
|
|
414
419
|
// ---------------------------------------------------------------------------
|
|
415
420
|
|
|
416
421
|
function SettingsRail({
|
|
422
|
+
header,
|
|
417
423
|
groups,
|
|
418
424
|
page,
|
|
419
425
|
onSelect,
|
|
@@ -423,7 +429,11 @@ function SettingsRail({
|
|
|
423
429
|
testID
|
|
424
430
|
}) {
|
|
425
431
|
const compact = layout === 'compact';
|
|
426
|
-
|
|
432
|
+
const scrollY = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
433
|
+
const onScroll = (0, _reactNativeReanimated.useAnimatedScrollHandler)(event => {
|
|
434
|
+
scrollY.value = Math.max(0, event.contentOffset.y);
|
|
435
|
+
}, [scrollY]);
|
|
436
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.ScrollView, {
|
|
427
437
|
role: "navigation",
|
|
428
438
|
"aria-label": label,
|
|
429
439
|
style: [compact ? styles.railCompact : [styles.rail, {
|
|
@@ -432,31 +442,47 @@ function SettingsRail({
|
|
|
432
442
|
backgroundColor: palette.secondary,
|
|
433
443
|
borderRightColor: palette.separator
|
|
434
444
|
}],
|
|
435
|
-
contentContainerStyle:
|
|
445
|
+
contentContainerStyle: header ? undefined : styles.railContent,
|
|
446
|
+
stickyHeaderIndices: header && !_webCss.IS_WEB ? [0] : undefined,
|
|
447
|
+
onScroll: onScroll,
|
|
448
|
+
scrollEventThrottle: 16,
|
|
449
|
+
contentInsetAdjustmentBehavior: "never",
|
|
450
|
+
automaticallyAdjustContentInsets: false,
|
|
436
451
|
showsVerticalScrollIndicator: false,
|
|
437
452
|
testID: testID ? `${testID}-rail` : undefined,
|
|
438
|
-
children:
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
,
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
453
|
+
children: [header ? /*#__PURE__*/(0, _jsxRuntime.jsx)(SettingsHeader, {
|
|
454
|
+
...header,
|
|
455
|
+
palette: palette,
|
|
456
|
+
scrimColor: palette.secondary,
|
|
457
|
+
scrollY: scrollY,
|
|
458
|
+
testID: testID
|
|
459
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
460
|
+
style: header ? [styles.railContent, styles.railContentCompact] : {
|
|
461
|
+
gap: 20
|
|
462
|
+
},
|
|
463
|
+
children: groups.map(group => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
464
|
+
style: styles.group,
|
|
465
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.Text, {
|
|
466
|
+
variant: "body-medium",
|
|
467
|
+
style: [styles.groupLabel, {
|
|
468
|
+
color: palette.textSecondary
|
|
469
|
+
}],
|
|
470
|
+
children: group.label
|
|
471
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
472
|
+
style: styles.groupRows,
|
|
473
|
+
children: group.items.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(RailRow, {
|
|
474
|
+
item: item
|
|
475
|
+
// A list, not a selection, when the rows ARE the navigation.
|
|
476
|
+
,
|
|
477
|
+
selected: !compact && item.page !== undefined && item.page === page,
|
|
478
|
+
showChevron: compact && item.page !== undefined,
|
|
479
|
+
onSelect: onSelect,
|
|
480
|
+
palette: palette,
|
|
481
|
+
testID: testID ? `${testID}-nav-${item.key}` : undefined
|
|
482
|
+
}, item.key))
|
|
483
|
+
})]
|
|
484
|
+
}, group.key ?? group.label))
|
|
485
|
+
})]
|
|
460
486
|
});
|
|
461
487
|
}
|
|
462
488
|
function RailRow({
|
|
@@ -519,6 +545,7 @@ function RailRow({
|
|
|
519
545
|
// ---------------------------------------------------------------------------
|
|
520
546
|
|
|
521
547
|
/** Shared header on every layout; the modal already owns safe-area insets. */
|
|
548
|
+
|
|
522
549
|
function SettingsHeader({
|
|
523
550
|
title,
|
|
524
551
|
onBack,
|
|
@@ -526,21 +553,20 @@ function SettingsHeader({
|
|
|
526
553
|
closeLabel,
|
|
527
554
|
onClose,
|
|
528
555
|
palette,
|
|
556
|
+
scrollY,
|
|
557
|
+
scrimColor = palette.full,
|
|
529
558
|
testID
|
|
530
559
|
}) {
|
|
531
|
-
// Inline chrome does not reveal with scroll. An explicit local offset keeps
|
|
532
|
-
// the page behind the modal from influencing this header's paint or title.
|
|
533
|
-
const scrollY = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
534
560
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.PageHeader, {
|
|
535
561
|
title: title,
|
|
536
562
|
headingLevel: 2,
|
|
537
563
|
onBack: onBack,
|
|
538
564
|
backLabel: backLabel,
|
|
539
565
|
safeArea: false,
|
|
540
|
-
sticky:
|
|
566
|
+
sticky: _webCss.IS_WEB,
|
|
541
567
|
placement: "inline",
|
|
542
|
-
scrim: "
|
|
543
|
-
scrimColor:
|
|
568
|
+
scrim: "auto",
|
|
569
|
+
scrimColor: scrimColor,
|
|
544
570
|
scrollY: scrollY,
|
|
545
571
|
actions: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.ButtonGroup, {
|
|
546
572
|
accessibilityLabel: closeLabel,
|
|
@@ -555,47 +581,41 @@ function SettingsHeader({
|
|
|
555
581
|
testID: testID ? `${testID}-header` : undefined
|
|
556
582
|
});
|
|
557
583
|
}
|
|
584
|
+
|
|
585
|
+
/** Each page owns one full-height viewport, including its header. */
|
|
558
586
|
function PageScroller({
|
|
559
587
|
children,
|
|
588
|
+
header,
|
|
560
589
|
palette,
|
|
561
590
|
inset,
|
|
562
591
|
insetTop = 0,
|
|
563
592
|
testID
|
|
564
593
|
}) {
|
|
565
|
-
const
|
|
566
|
-
const onScroll = (0,
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
} :
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
594
|
+
const scrollY = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
595
|
+
const onScroll = (0, _reactNativeReanimated.useAnimatedScrollHandler)(event => {
|
|
596
|
+
scrollY.value = Math.max(0, event.contentOffset.y);
|
|
597
|
+
}, [scrollY]);
|
|
598
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.ScrollView, {
|
|
599
|
+
style: styles.scroll,
|
|
600
|
+
stickyHeaderIndices: _webCss.IS_WEB ? undefined : [0],
|
|
601
|
+
onScroll: onScroll,
|
|
602
|
+
scrollEventThrottle: 16,
|
|
603
|
+
contentInsetAdjustmentBehavior: "never",
|
|
604
|
+
automaticallyAdjustContentInsets: false,
|
|
605
|
+
testID: testID ? `${testID}-page` : undefined,
|
|
606
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SettingsHeader, {
|
|
607
|
+
...header,
|
|
608
|
+
palette: palette,
|
|
609
|
+
scrollY: scrollY,
|
|
610
|
+
testID: testID
|
|
611
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
612
|
+
style: {
|
|
583
613
|
paddingLeft: inset,
|
|
584
614
|
paddingRight: inset,
|
|
585
615
|
paddingBottom: inset,
|
|
586
616
|
paddingTop: insetTop
|
|
587
|
-
}
|
|
588
|
-
onScroll: onScroll,
|
|
589
|
-
scrollEventThrottle: 16,
|
|
590
|
-
testID: testID ? `${testID}-page` : undefined,
|
|
617
|
+
},
|
|
591
618
|
children: children
|
|
592
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
593
|
-
pointerEvents: "none",
|
|
594
|
-
style: [styles.fade, fade],
|
|
595
|
-
testID: testID ? `${testID}-fade` : undefined,
|
|
596
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingsArt.VerticalFade, {
|
|
597
|
-
color: palette.primary
|
|
598
|
-
})
|
|
599
619
|
})]
|
|
600
620
|
});
|
|
601
621
|
}
|
|
@@ -730,21 +750,9 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
730
750
|
flex: 1,
|
|
731
751
|
minWidth: 0
|
|
732
752
|
},
|
|
733
|
-
scrollHost: {
|
|
734
|
-
flex: 1,
|
|
735
|
-
minHeight: 0,
|
|
736
|
-
position: 'relative'
|
|
737
|
-
},
|
|
738
753
|
scroll: {
|
|
739
|
-
flex: 1
|
|
740
|
-
|
|
741
|
-
scrollContent: {},
|
|
742
|
-
fade: {
|
|
743
|
-
position: 'absolute',
|
|
744
|
-
left: 0,
|
|
745
|
-
right: 0,
|
|
746
|
-
top: 0,
|
|
747
|
-
height: 40
|
|
754
|
+
flex: 1,
|
|
755
|
+
minHeight: 0
|
|
748
756
|
},
|
|
749
757
|
toast: {
|
|
750
758
|
position: 'absolute',
|