@agimon-ai/po-native-components 0.0.0-alpha.49 → 0.0.0-alpha.50

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.
@@ -18,9 +18,11 @@ export interface SheetContentProps {
18
18
  children?: ReactNode;
19
19
  /** False when an embedded SheetList owns vertical scrolling. */
20
20
  scrollable?: boolean;
21
+ /** The sheet holds unsaved work: a prompt arriving in the conversation leaves it open with a note. */
22
+ keep?: boolean;
21
23
  }
22
24
  /** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */
23
- export declare function SheetContent({ children, scrollable }: SheetContentProps): import("react").JSX.Element;
25
+ export declare function SheetContent({ children, scrollable, keep }: SheetContentProps): import("react").JSX.Element;
24
26
  export interface SheetPartProps extends Omit<ViewProps, 'children' | 'style'> {
25
27
  children?: ReactNode;
26
28
  style?: StyleProp<ViewStyle>;
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.d.mts","names":[],"sources":["../../src/components/Sheet.tsx"],"mappings":";;;;iBAwBiB;;EAEf;EACA;EACA,gBAAgB;EAChB,WAAW;;wBAGG,QAAQ,MAAM,aAAqB,cAAc,YAAY,6BAAU,IAAA;;wBAMvE,eAAe,YAAY,SAAS,8BAAW,IAAA;;wBAc/C,aAAa,YAAY,SAAS,8BAAW,IAAA;iBAa5C;EACf,WAAW;;EAEX;;;wBAIc,eAAe,UAAU,cAAqB,oCAAiB,IAAA;iBAS9D,uBAAuB,KAAK;EAC3C,WAAW;EACX,QAAQ,UAAU;;iBAGH,yBAAyB;;EAExC;;EAEA;;wBAGc,cAAc,aAAoB,YAAsB,OAAO,aAAa,SAAS,mCAAgB,IAAA;wBAoBrG,aAAa,UAAU,SAAS,4BAAS,IAAA;wBAIzC,mBAAmB,UAAU,SAAS,4BAAS,IAAA;;wBAK/C,YAAY,OAAO,aAAa,SAAS,iCAAc,IAAA;wBAQvD,cAAc,OAAO,aAAa,SAAS,iCAAc,IAAA"}
1
+ {"version":3,"file":"Sheet.d.mts","names":[],"sources":["../../src/components/Sheet.tsx"],"mappings":";;;;iBAwBiB;;EAEf;EACA;EACA,gBAAgB;EAChB,WAAW;;wBAGG,QAAQ,MAAM,aAAqB,cAAc,YAAY,6BAAU,IAAA;;wBAMvE,eAAe,YAAY,SAAS,8BAAW,IAAA;;wBAc/C,aAAa,YAAY,SAAS,8BAAW,IAAA;iBAa5C;EACf,WAAW;;EAEX;;EAEA;;;wBAIc,eAAe,UAAU,YAAmB,QAAQ,oCAAiB,IAAA;iBASpE,uBAAuB,KAAK;EAC3C,WAAW;EACX,QAAQ,UAAU;;iBAGH,yBAAyB;;EAExC;;EAEA;;wBAGc,cAAc,aAAoB,YAAsB,OAAO,aAAa,SAAS,mCAAgB,IAAA;wBAoBrG,aAAa,UAAU,SAAS,4BAAS,IAAA;wBAIzC,mBAAmB,UAAU,SAAS,4BAAS,IAAA;;wBAK/C,YAAY,OAAO,aAAa,SAAS,iCAAc,IAAA;wBAQvD,cAAc,OAAO,aAAa,SAAS,iCAAc,IAAA"}
@@ -48,12 +48,13 @@ function SheetClose({ onPress, ...props }) {
48
48
  });
49
49
  }
50
50
  /** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */
51
- function SheetContent({ children, scrollable = true }) {
51
+ function SheetContent({ children, scrollable = true, keep }) {
52
52
  const { open, setOpen } = useContext(SheetContext);
53
53
  return /* @__PURE__ */ jsx(SheetFrame, {
54
54
  open,
55
55
  onClose: () => setOpen(false),
56
56
  scrollable,
57
+ keep,
57
58
  children: /* @__PURE__ */ jsx(SheetContext.Provider, {
58
59
  value: {
59
60
  open,
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.mjs","names":["createContext","ReactNode","useContext","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","SheetFrame","SheetState","open","setOpen","SheetContext","undefined","SheetProps","defaultOpen","onOpenChange","children","Sheet","current","SheetTrigger","onPress","props","event","SheetClose","SheetContentProps","scrollable","SheetContent","SheetPartProps","Omit","style","SheetHeaderProps","dismissible","closeLabel","SheetHeader","styles","header","close","SheetTitle","title","SheetDescription","description","SheetBody","body","SheetFooter","footer","hint","create","theme","flexDirection","alignItems","gap","spacing","minWidth","height","borderBottomWidth","borderBottomColor","colors","border","paddingHorizontal","uni__dependencies","marginLeft","flexShrink","color","hi","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","semibold","dim","sm","lineHeightRelaxed","paddingVertical","flexWrap","justifyContent","minHeight","borderTopWidth","borderTopColor","backgroundColor","deep","faint"],"sources":["../../src/components/Sheet.tsx"],"sourcesContent":["import { createContext, type ReactNode, useContext } from 'react';\nimport { type StyleProp, Text, type TextProps, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CloseIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { useControllable } from '../lib/useControllable';\nimport { wrapText } from '../lib/wrapText';\nimport { Button, type ButtonProps } from './Button';\nimport { SheetFrame } from './SheetFrame';\n\n/*\n * The web Sheet as a bottom sheet: the native shape for a detail view or a\n * short form over what the reader was looking at. `side` and `width` are\n * dropped; a phone sheet rises from the bottom edge and takes the width.\n */\n\ninterface SheetState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const SheetContext = createContext<SheetState>({ open: false, setOpen: () => undefined });\n\nexport interface SheetProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the sheet keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Sheet({ open, defaultOpen = false, onOpenChange, children }: SheetProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n return <SheetContext.Provider value={{ open: current, setOpen }}>{children}</SheetContext.Provider>;\n}\n\n/** A Button that opens the enclosing sheet. */\nexport function SheetTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(true);\n }}\n {...props}\n />\n );\n}\n\n/** A Button that closes the enclosing sheet. */\nexport function SheetClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface SheetContentProps {\n children?: ReactNode;\n /** False when an embedded SheetList owns vertical scrolling. */\n scrollable?: boolean;\n}\n\n/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */\nexport function SheetContent({ children, scrollable = true }: SheetContentProps) {\n const { open, setOpen } = useContext(SheetContext);\n return (\n <SheetFrame open={open} onClose={() => setOpen(false)} scrollable={scrollable}>\n <SheetContext.Provider value={{ open, setOpen }}>{children}</SheetContext.Provider>\n </SheetFrame>\n );\n}\n\nexport interface SheetPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface SheetHeaderProps extends SheetPartProps {\n /** Show the close control at the right of the strip. On by default: a sheet is dismissed, not answered. */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function SheetHeader({ dismissible = true, closeLabel = 'close', style, children, ...props }: SheetHeaderProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\n style={styles.close}\n >\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function SheetTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" numberOfLines={1} style={[styles.title, style]} {...props} />;\n}\n\nexport function SheetDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\n/** The scrolling middle; the sheet itself scrolls, so this only spaces its children. */\nexport function SheetBody({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport function SheetFooter({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.footer, style]} {...props}>\n {wrapText(children, styles.hint)}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2.5),\n minWidth: 0,\n height: theme.spacing(11),\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n paddingHorizontal: theme.spacing(4),\n },\n close: { marginLeft: 'auto' },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n fontWeight: theme.fontWeight.semibold,\n },\n description: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n },\n body: {\n gap: theme.spacing(3),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n footer: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(2),\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(1.5),\n },\n hint: {\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize['2xs'],\n lineHeight: theme.lineHeight['2xs'],\n },\n}));\n"],"mappings":";;;;;;;;;;;;;AAsBA,MAAakB,eAAelB,cAA0B;CAAEgB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAU/F,SAAgBK,MAAM,EAAER,MAAMK,cAAc,OAAOC,cAAcC,YAAwB;CACvF,MAAM,CAACE,SAASR,WAAWP,gBAAgBM,MAA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WC,IAAI;EACxCC,UAAUnB,MAAMmB,SAASM;EACzBJ,YAAYrB,MAAM0B,kBAAkBD;EAAEb,mBAAA,CAAA,CAAA;CACxC;CACAjB,MAAM;EACJQ,KAAKH,MAAMI,QAAQ,CAAC;EACpBO,mBAAmBX,MAAMI,QAAQ,CAAC;EAClCuB,iBAAiB3B,MAAMI,QAAQ,CAAC;EAACQ,mBAAA,CAAA,CAAA;CACnC;CACAf,QAAQ;EACNI,eAAe;EACf2B,UAAU;EACV1B,YAAY;EACZ2B,gBAAgB;EAChB1B,KAAKH,MAAMI,QAAQ,CAAC;EACpB0B,WAAW;EACXC,gBAAgB;EAChBC,gBAAgBhC,MAAMS,OAAO;EAC7BwB,iBAAiBjC,MAAMS,OAAOyB;EAC9BvB,mBAAmBX,MAAMI,QAAQ,CAAC;EAClCuB,iBAAiB3B,MAAMI,QAAQ,GAAG;EAACQ,mBAAA,CAAA,CAAA;CACrC;CACAd,MAAM;EACJiB,OAAOf,MAAMS,OAAO0B;EACpBlB,YAAY9D,OAAO6C,MAAMiB,WAAWC,IAAI;EACxCC,UAAUnB,MAAMmB,SAAS;EACzBE,YAAYrB,MAAMqB,WAAW;EAAMT,mBAAA,CAAA,CAAA;CACrC;AACF,EAAE"}
1
+ {"version":3,"file":"Sheet.mjs","names":["createContext","ReactNode","useContext","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","SheetFrame","SheetState","open","setOpen","SheetContext","undefined","SheetProps","defaultOpen","onOpenChange","children","Sheet","current","SheetTrigger","onPress","props","event","SheetClose","SheetContentProps","scrollable","keep","SheetContent","SheetPartProps","Omit","style","SheetHeaderProps","dismissible","closeLabel","SheetHeader","styles","header","close","SheetTitle","title","SheetDescription","description","SheetBody","body","SheetFooter","footer","hint","create","theme","flexDirection","alignItems","gap","spacing","minWidth","height","borderBottomWidth","borderBottomColor","colors","border","paddingHorizontal","uni__dependencies","marginLeft","flexShrink","color","hi","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","semibold","dim","sm","lineHeightRelaxed","paddingVertical","flexWrap","justifyContent","minHeight","borderTopWidth","borderTopColor","backgroundColor","deep","faint"],"sources":["../../src/components/Sheet.tsx"],"sourcesContent":["import { createContext, type ReactNode, useContext } from 'react';\nimport { type StyleProp, Text, type TextProps, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CloseIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { useControllable } from '../lib/useControllable';\nimport { wrapText } from '../lib/wrapText';\nimport { Button, type ButtonProps } from './Button';\nimport { SheetFrame } from './SheetFrame';\n\n/*\n * The web Sheet as a bottom sheet: the native shape for a detail view or a\n * short form over what the reader was looking at. `side` and `width` are\n * dropped; a phone sheet rises from the bottom edge and takes the width.\n */\n\ninterface SheetState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const SheetContext = createContext<SheetState>({ open: false, setOpen: () => undefined });\n\nexport interface SheetProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the sheet keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Sheet({ open, defaultOpen = false, onOpenChange, children }: SheetProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n return <SheetContext.Provider value={{ open: current, setOpen }}>{children}</SheetContext.Provider>;\n}\n\n/** A Button that opens the enclosing sheet. */\nexport function SheetTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(true);\n }}\n {...props}\n />\n );\n}\n\n/** A Button that closes the enclosing sheet. */\nexport function SheetClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface SheetContentProps {\n children?: ReactNode;\n /** False when an embedded SheetList owns vertical scrolling. */\n scrollable?: boolean;\n /** The sheet holds unsaved work: a prompt arriving in the conversation leaves it open with a note. */\n keep?: boolean;\n}\n\n/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */\nexport function SheetContent({ children, scrollable = true, keep }: SheetContentProps) {\n const { open, setOpen } = useContext(SheetContext);\n return (\n <SheetFrame open={open} onClose={() => setOpen(false)} scrollable={scrollable} keep={keep}>\n <SheetContext.Provider value={{ open, setOpen }}>{children}</SheetContext.Provider>\n </SheetFrame>\n );\n}\n\nexport interface SheetPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface SheetHeaderProps extends SheetPartProps {\n /** Show the close control at the right of the strip. On by default: a sheet is dismissed, not answered. */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function SheetHeader({ dismissible = true, closeLabel = 'close', style, children, ...props }: SheetHeaderProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\n style={styles.close}\n >\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function SheetTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" numberOfLines={1} style={[styles.title, style]} {...props} />;\n}\n\nexport function SheetDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\n/** The scrolling middle; the sheet itself scrolls, so this only spaces its children. */\nexport function SheetBody({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport function SheetFooter({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.footer, style]} {...props}>\n {wrapText(children, styles.hint)}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2.5),\n minWidth: 0,\n height: theme.spacing(11),\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n paddingHorizontal: theme.spacing(4),\n },\n close: { marginLeft: 'auto' },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n fontWeight: theme.fontWeight.semibold,\n },\n description: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n },\n body: {\n gap: theme.spacing(3),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n footer: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(2),\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(1.5),\n },\n hint: {\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize['2xs'],\n lineHeight: theme.lineHeight['2xs'],\n },\n}));\n"],"mappings":";;;;;;;;;;;;;AAsBA,MAAakB,eAAelB,cAA0B;CAAEgB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAU/F,SAAgBK,MAAM,EAAER,MAAMK,cAAc,OAAOC,cAAcC,YAAwB;CACvF,MAAM,CAACE,SAASR,WAAWP,gBAAgBM,MAAMK,aAAaC,YAAY;CAC1E,OAAO,oBAAC,aAAa,UAAd;EAAuB,OAAO;GAAEN,MAAMS;GAASR;EAAQ;EAAIM;CAAgC;AACpG;;AAGA,SAAgBG,aAAa,EAAEC,SAAS,GAAGC,SAAsB;CAC/D,MAAM,EAAEX,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BAAmBX,MAAMI,QAAQ,CAAC;EAClCuB,iBAAiB3B,MAAMI,QAAQ,CAAC;EAACQ,mBAAA,CAAA,CAAA;CACnC;CACAf,QAAQ;EACNI,eAAe;EACf2B,UAAU;EACV1B,YAAY;EACZ2B,gBAAgB;EAChB1B,KAAKH,MAAMI,QAAQ,CAAC;EACpB0B,WAAW;EACXC,gBAAgB;EAChBC,gBAAgBhC,MAAMS,OAAO;EAC7BwB,iBAAiBjC,MAAMS,OAAOyB;EAC9BvB,mBAAmBX,MAAMI,QAAQ,CAAC;EAClCuB,iBAAiB3B,MAAMI,QAAQ,GAAG;EAACQ,mBAAA,CAAA,CAAA;CACrC;CACAd,MAAM;EACJiB,OAAOf,MAAMS,OAAO0B;EACpBlB,YAAY/D,OAAO8C,MAAMiB,WAAWC,IAAI;EACxCC,UAAUnB,MAAMmB,SAAS;EACzBE,YAAYrB,MAAMqB,WAAW;EAAMT,mBAAA,CAAA,CAAA;CACrC;AACF,EAAE"}
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/components/SheetFrame.d.ts
3
+ /** True while a prompt in the conversation holds the screen: a sheet should not open over it on its own. */
4
+ export declare function sheetsYielded(): boolean;
5
+ /**
6
+ * Clear the screen for a prompt in the conversation: close sheets from the top down, as a backdrop tap
7
+ * would. The first sheet that keeps unsaved work stops the walk, and it and every sheet under it stay
8
+ * open showing `note`, since closing a sheet also unmounts the sheets opened inside it. Undefined clears
9
+ * the note and closes nothing.
10
+ */
11
+ export declare function yieldSheets(note: string | undefined): void;
12
+ //#endregion
13
+ //# sourceMappingURL=SheetFrame.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetFrame.d.mts","names":[],"sources":["../../src/components/SheetFrame.tsx"],"mappings":";;;wBAwCgB;;;;;;;wBAUA,YAAY"}
@@ -1,38 +1,91 @@
1
+ import { fontOf } from "../lib/fonts.mjs";
1
2
  import { InsideSheetContext } from "../lib/insideSheet.mjs";
3
+ import { Text } from "react-native-unistyles/components/native/Text";
2
4
  import { StyleSheet, useUnistyles } from "react-native-unistyles";
3
5
  import { BackHandler, Keyboard } from "react-native";
4
6
  import { withAlpha } from "@agimon-ai/po-web-components/nativeTheme";
5
- import { useCallback, useContext, useEffect, useRef } from "react";
6
- import { jsx } from "react/jsx-runtime";
7
+ import { useCallback, useContext, useEffect, useRef, useState } from "react";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
9
  import { BottomSheetBackdrop, BottomSheetModal, BottomSheetScrollView } from "@gorhom/bottom-sheet";
8
10
  import { SafeAreaInsetsContext } from "react-native-safe-area-context";
9
11
 
10
12
  //#region src/components/SheetFrame.tsx
11
13
  /** `bg-po-deep/70`, the overlay every web sheet and dialog draws. */
12
14
  const BACKDROP_ALPHA_PERCENT = 70;
15
+ /** Presented sheets, oldest first: one opened from inside another sits after it. */
16
+ const openSheets = [];
17
+ let yielded = false;
18
+ /** True while a prompt in the conversation holds the screen: a sheet should not open over it on its own. */
19
+ function sheetsYielded() {
20
+ return yielded;
21
+ }
22
+ /**
23
+ * Clear the screen for a prompt in the conversation: close sheets from the top down, as a backdrop tap
24
+ * would. The first sheet that keeps unsaved work stops the walk, and it and every sheet under it stay
25
+ * open showing `note`, since closing a sheet also unmounts the sheets opened inside it. Undefined clears
26
+ * the note and closes nothing.
27
+ */
28
+ function yieldSheets(note) {
29
+ yielded = note !== void 0;
30
+ if (note === void 0) {
31
+ for (const sheet of openSheets) sheet.setNote(void 0);
32
+ return;
33
+ }
34
+ for (let index = openSheets.length - 1; index >= 0; index -= 1) {
35
+ if (openSheets[index].keep()) {
36
+ for (const sheet of openSheets.slice(0, index + 1)) sheet.setNote(note);
37
+ return;
38
+ }
39
+ openSheets[index].close();
40
+ }
41
+ }
13
42
  /**
14
43
  * The bottom sheet both Sheet and DropdownMenu sit in: a drag handle, sized
15
44
  * to its content, closed by dragging down, tapping the backdrop or Android
16
45
  * back, clear of the safe area and lifted by the keyboard. Private: the public
17
46
  * parts keep bottom-sheet types out of the package API.
18
47
  */
19
- function SheetFrame({ open, onClose, children, scrollable = true }) {
48
+ function SheetFrame({ open, onClose, children, scrollable = true, keep = false }) {
20
49
  const { theme } = useUnistyles();
21
50
  const insets = useContext(SafeAreaInsetsContext);
22
51
  const sheet = useRef(null);
23
52
  const openRef = useRef(open);
24
53
  const presented = useRef(false);
54
+ const [note, setNote] = useState();
55
+ const latest = useRef({
56
+ keep,
57
+ onClose
58
+ });
59
+ latest.current = {
60
+ keep,
61
+ onClose
62
+ };
63
+ const entry = useRef({
64
+ keep: () => latest.current.keep,
65
+ close: () => latest.current.onClose(),
66
+ setNote
67
+ });
25
68
  useEffect(() => {
26
69
  openRef.current = open;
70
+ const listed = openSheets.indexOf(entry.current);
27
71
  if (open) {
28
72
  presented.current = true;
73
+ if (listed < 0) openSheets.push(entry.current);
29
74
  Keyboard.dismiss();
30
75
  sheet.current?.present();
31
- } else if (presented.current) {
32
- presented.current = false;
33
- sheet.current?.dismiss();
76
+ } else {
77
+ if (listed >= 0) openSheets.splice(listed, 1);
78
+ setNote(void 0);
79
+ if (presented.current) {
80
+ presented.current = false;
81
+ sheet.current?.dismiss();
82
+ }
34
83
  }
35
84
  }, [open]);
85
+ useEffect(() => () => {
86
+ const listed = openSheets.indexOf(entry.current);
87
+ if (listed >= 0) openSheets.splice(listed, 1);
88
+ }, []);
36
89
  useEffect(() => {
37
90
  if (!open) return void 0;
38
91
  const subscription = BackHandler.addEventListener("hardwareBackPress", () => {
@@ -68,21 +121,40 @@ function SheetFrame({ open, onClose, children, scrollable = true }) {
68
121
  presented.current = false;
69
122
  if (openRef.current) onClose();
70
123
  },
71
- children: scrollable ? /* @__PURE__ */ jsx(BottomSheetScrollView, {
124
+ children: scrollable ? /* @__PURE__ */ jsxs(BottomSheetScrollView, {
72
125
  keyboardShouldPersistTaps: "handled",
73
126
  contentContainerStyle: [styles.content, { paddingBottom: insets?.bottom ?? 0 }],
74
- children: /* @__PURE__ */ jsx(InsideSheetContext.Provider, {
127
+ children: [note ? /* @__PURE__ */ jsx(SheetNote, { note }) : null, /* @__PURE__ */ jsx(InsideSheetContext.Provider, {
75
128
  value: true,
76
129
  children
77
- })
78
- }) : /* @__PURE__ */ jsx(InsideSheetContext.Provider, {
130
+ })]
131
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [note ? /* @__PURE__ */ jsx(SheetNote, { note }) : null, /* @__PURE__ */ jsx(InsideSheetContext.Provider, {
79
132
  value: true,
80
133
  children
81
- })
134
+ })] })
135
+ });
136
+ }
137
+ /** A gentle rose line: the person is asked something below, never told to hurry. */
138
+ function SheetNote({ note }) {
139
+ return /* @__PURE__ */ jsx(Text, {
140
+ style: styles.note,
141
+ accessibilityRole: "alert",
142
+ children: note
82
143
  });
83
144
  }
84
- const styles = StyleSheet.create({ content: { flexGrow: 1 } });
145
+ const styles = StyleSheet.create((theme) => ({
146
+ content: { flexGrow: 1 },
147
+ note: {
148
+ marginHorizontal: theme.spacing(4),
149
+ marginBottom: theme.spacing(2),
150
+ color: theme.colors.magenta,
151
+ fontFamily: fontOf(theme.fontFamily.sans),
152
+ fontSize: theme.fontSize.sm,
153
+ lineHeight: theme.lineHeight.sm,
154
+ uni__dependencies: [0]
155
+ }
156
+ }));
85
157
 
86
158
  //#endregion
87
- export { SheetFrame };
159
+ export { SheetFrame, sheetsYielded, yieldSheets };
88
160
  //# sourceMappingURL=SheetFrame.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SheetFrame.mjs","names":["withAlpha","BottomSheetBackdrop","BottomSheetBackdropProps","BottomSheetModal","BottomSheetScrollView","ReactNode","useCallback","useContext","useEffect","useRef","BackHandler","Keyboard","SafeAreaInsetsContext","StyleSheet","useUnistyles","InsideSheetContext","BACKDROP_ALPHA_PERCENT","SheetFrameProps","open","onClose","children","scrollable","SheetFrame","theme","insets","sheet","openRef","presented","current","dismiss","present","undefined","subscription","addEventListener","remove","backdropColor","colors","deep","renderBackdrop","props","style","backgroundColor","top","rail","borderRadius","lg","border","styles","content","paddingBottom","bottom","create","flexGrow"],"sources":["../../src/components/SheetFrame.tsx"],"sourcesContent":["import { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport {\n BottomSheetBackdrop,\n type BottomSheetBackdropProps,\n BottomSheetModal,\n BottomSheetScrollView,\n} from '@gorhom/bottom-sheet';\nimport { type ReactNode, useCallback, useContext, useEffect, useRef } from 'react';\nimport { BackHandler, Keyboard } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { InsideSheetContext } from '../lib/insideSheet';\n\n/** `bg-po-deep/70`, the overlay every web sheet and dialog draws. */\nconst BACKDROP_ALPHA_PERCENT = 70;\n\nexport interface SheetFrameProps {\n open: boolean;\n /** The sheet asked to close: a drag down, a backdrop tap or Android back. */\n onClose: () => void;\n children?: ReactNode;\n /** False when the content supplies its own Gorhom virtualized scroll owner. */\n scrollable?: boolean;\n}\n\n/**\n * The bottom sheet both Sheet and DropdownMenu sit in: a drag handle, sized\n * to its content, closed by dragging down, tapping the backdrop or Android\n * back, clear of the safe area and lifted by the keyboard. Private: the public\n * parts keep bottom-sheet types out of the package API.\n */\nexport function SheetFrame({ open, onClose, children, scrollable = true }: SheetFrameProps) {\n const { theme } = useUnistyles();\n const insets = useContext(SafeAreaInsetsContext);\n const sheet = useRef<BottomSheetModal>(null);\n const openRef = useRef(open);\n const presented = useRef(false);\n\n useEffect(() => {\n openRef.current = open;\n if (open) {\n presented.current = true;\n // The keyboard of the field behind would cover the sheet; a field inside it focuses after this.\n Keyboard.dismiss();\n sheet.current?.present();\n } else if (presented.current) {\n // Only a presented sheet is dismissed. Dismissing one that never opened leaves bottom-sheet's\n // modal stuck in its dismissing status, and the next present() then never draws.\n presented.current = false;\n sheet.current?.dismiss();\n }\n }, [open]);\n\n useEffect(() => {\n if (!open) return undefined;\n const subscription = BackHandler.addEventListener('hardwareBackPress', () => {\n onClose();\n return true;\n });\n return () => subscription.remove();\n }, [open, onClose]);\n\n const backdropColor = withAlpha(theme.colors.deep, BACKDROP_ALPHA_PERCENT);\n const renderBackdrop = useCallback(\n (props: BottomSheetBackdropProps) => (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n opacity={1}\n pressBehavior=\"close\"\n style={[props.style, { backgroundColor: backdropColor }]}\n />\n ),\n [backdropColor],\n );\n\n return (\n <BottomSheetModal\n ref={sheet}\n stackBehavior=\"push\"\n enablePanDownToClose\n topInset={insets?.top ?? 0}\n keyboardBehavior=\"interactive\"\n keyboardBlurBehavior=\"restore\"\n android_keyboardInputMode=\"adjustResize\"\n backdropComponent={renderBackdrop}\n backgroundStyle={{ backgroundColor: theme.colors.rail, borderRadius: theme.borderRadius.lg }}\n handleIndicatorStyle={{ backgroundColor: theme.colors.border }}\n // A sheet the caller closed is already shut; only a close the sheet started is reported.\n onDismiss={() => {\n // Already shut, so the close the parent answers with must not dismiss it a second time.\n presented.current = false;\n if (openRef.current) onClose();\n }}\n >\n {scrollable ? (\n <BottomSheetScrollView\n keyboardShouldPersistTaps=\"handled\"\n contentContainerStyle={[styles.content, { paddingBottom: insets?.bottom ?? 0 }]}\n >\n <InsideSheetContext.Provider value>{children}</InsideSheetContext.Provider>\n </BottomSheetScrollView>\n ) : (\n <InsideSheetContext.Provider value>{children}</InsideSheetContext.Provider>\n )}\n </BottomSheetModal>\n );\n}\n\nconst styles = StyleSheet.create({ content: { flexGrow: 1 } });\n"],"mappings":";;;;;;;;;;;AAeA,MAAMgB,yBAAyB;;;;;;;AAiB/B,SAAgBM,WAAW,EAAEJ,MAAMC,SAASC,UAAUC,aAAa,QAAyB;CAC1F,MAAM,EAAEE,UAAUT,aAAa;CAC/B,MAAMU,SAASjB,WAAWK,qBAAqB;CAC/C,MAAMa,QAAQhB,OAAyB,IAAI;CAC3C,MAAMiB,UAAUjB,OAAOS,IAAI;CAC3B,MAAMS,YAAYlB,OAAO,KAAK;CAE9BD,gBAAgB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EvB,oBAAC,mBAAmB,UAApB;GAA6B;GAAOA;EAAsC;CAE5D;AAEtB;AAEA,MAAM2B,SAASlC,WAAWsC,OAAO,EAAEH,SAAS,EAAEI,UAAU,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"SheetFrame.mjs","names":["withAlpha","BottomSheetBackdrop","BottomSheetBackdropProps","BottomSheetModal","BottomSheetScrollView","ReactNode","useCallback","useContext","useEffect","useRef","useState","BackHandler","Keyboard","SafeAreaInsetsContext","StyleSheet","useUnistyles","fontOf","InsideSheetContext","BACKDROP_ALPHA_PERCENT","SheetFrameProps","open","onClose","children","scrollable","keep","OpenSheet","close","setNote","note","openSheets","yielded","sheetsYielded","yieldSheets","undefined","sheet","index","length","slice","SheetFrame","theme","insets","openRef","presented","latest","current","entry","listed","indexOf","push","dismiss","present","splice","subscription","addEventListener","remove","backdropColor","colors","deep","renderBackdrop","props","style","backgroundColor","top","rail","borderRadius","lg","border","styles","content","paddingBottom","bottom","SheetNote","create","flexGrow","marginHorizontal","spacing","marginBottom","color","magenta","fontFamily","sans","fontSize","sm","lineHeight","uni__dependencies"],"sources":["../../src/components/SheetFrame.tsx"],"sourcesContent":["import { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport {\n BottomSheetBackdrop,\n type BottomSheetBackdropProps,\n BottomSheetModal,\n BottomSheetScrollView,\n} from '@gorhom/bottom-sheet';\nimport { type ReactNode, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { BackHandler, Keyboard, Text } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { InsideSheetContext } from '../lib/insideSheet';\n\n/** `bg-po-deep/70`, the overlay every web sheet and dialog draws. */\nconst BACKDROP_ALPHA_PERCENT = 70;\n\nexport interface SheetFrameProps {\n open: boolean;\n /** The sheet asked to close: a drag down, a backdrop tap or Android back. */\n onClose: () => void;\n children?: ReactNode;\n /** False when the content supplies its own Gorhom virtualized scroll owner. */\n scrollable?: boolean;\n /** The sheet holds work not yet saved, so a prompt arriving leaves it open with a note instead of closing it. */\n keep?: boolean;\n}\n\ninterface OpenSheet {\n keep: () => boolean;\n close: () => void;\n setNote: (note: string | undefined) => void;\n}\n\n/** Presented sheets, oldest first: one opened from inside another sits after it. */\nconst openSheets: OpenSheet[] = [];\nlet yielded = false;\n\n/** True while a prompt in the conversation holds the screen: a sheet should not open over it on its own. */\nexport function sheetsYielded(): boolean {\n return yielded;\n}\n\n/**\n * Clear the screen for a prompt in the conversation: close sheets from the top down, as a backdrop tap\n * would. The first sheet that keeps unsaved work stops the walk, and it and every sheet under it stay\n * open showing `note`, since closing a sheet also unmounts the sheets opened inside it. Undefined clears\n * the note and closes nothing.\n */\nexport function yieldSheets(note: string | undefined) {\n yielded = note !== undefined;\n if (note === undefined) {\n for (const sheet of openSheets) sheet.setNote(undefined);\n return;\n }\n for (let index = openSheets.length - 1; index >= 0; index -= 1) {\n if (openSheets[index].keep()) {\n for (const sheet of openSheets.slice(0, index + 1)) sheet.setNote(note);\n return;\n }\n openSheets[index].close();\n }\n}\n\n/**\n * The bottom sheet both Sheet and DropdownMenu sit in: a drag handle, sized\n * to its content, closed by dragging down, tapping the backdrop or Android\n * back, clear of the safe area and lifted by the keyboard. Private: the public\n * parts keep bottom-sheet types out of the package API.\n */\nexport function SheetFrame({ open, onClose, children, scrollable = true, keep = false }: SheetFrameProps) {\n const { theme } = useUnistyles();\n const insets = useContext(SafeAreaInsetsContext);\n const sheet = useRef<BottomSheetModal>(null);\n const openRef = useRef(open);\n const presented = useRef(false);\n const [note, setNote] = useState<string>();\n const latest = useRef({ keep, onClose });\n latest.current = { keep, onClose };\n const entry = useRef<OpenSheet>({\n keep: () => latest.current.keep,\n close: () => latest.current.onClose(),\n setNote,\n });\n\n useEffect(() => {\n openRef.current = open;\n const listed = openSheets.indexOf(entry.current);\n if (open) {\n presented.current = true;\n if (listed < 0) openSheets.push(entry.current);\n // The keyboard of the field behind would cover the sheet; a field inside it focuses after this.\n Keyboard.dismiss();\n sheet.current?.present();\n } else {\n if (listed >= 0) openSheets.splice(listed, 1);\n setNote(undefined);\n if (presented.current) {\n // Only a presented sheet is dismissed. Dismissing one that never opened leaves bottom-sheet's\n // modal stuck in its dismissing status, and the next present() then never draws.\n presented.current = false;\n sheet.current?.dismiss();\n }\n }\n }, [open]);\n\n useEffect(\n () => () => {\n const listed = openSheets.indexOf(entry.current);\n if (listed >= 0) openSheets.splice(listed, 1);\n },\n [],\n );\n\n useEffect(() => {\n if (!open) return undefined;\n const subscription = BackHandler.addEventListener('hardwareBackPress', () => {\n onClose();\n return true;\n });\n return () => subscription.remove();\n }, [open, onClose]);\n\n const backdropColor = withAlpha(theme.colors.deep, BACKDROP_ALPHA_PERCENT);\n const renderBackdrop = useCallback(\n (props: BottomSheetBackdropProps) => (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n opacity={1}\n pressBehavior=\"close\"\n style={[props.style, { backgroundColor: backdropColor }]}\n />\n ),\n [backdropColor],\n );\n\n return (\n <BottomSheetModal\n ref={sheet}\n stackBehavior=\"push\"\n enablePanDownToClose\n topInset={insets?.top ?? 0}\n keyboardBehavior=\"interactive\"\n keyboardBlurBehavior=\"restore\"\n android_keyboardInputMode=\"adjustResize\"\n backdropComponent={renderBackdrop}\n backgroundStyle={{ backgroundColor: theme.colors.rail, borderRadius: theme.borderRadius.lg }}\n handleIndicatorStyle={{ backgroundColor: theme.colors.border }}\n // A sheet the caller closed is already shut; only a close the sheet started is reported.\n onDismiss={() => {\n // Already shut, so the close the parent answers with must not dismiss it a second time.\n presented.current = false;\n if (openRef.current) onClose();\n }}\n >\n {scrollable ? (\n <BottomSheetScrollView\n keyboardShouldPersistTaps=\"handled\"\n contentContainerStyle={[styles.content, { paddingBottom: insets?.bottom ?? 0 }]}\n >\n {note ? <SheetNote note={note} /> : null}\n <InsideSheetContext.Provider value>{children}</InsideSheetContext.Provider>\n </BottomSheetScrollView>\n ) : (\n <>\n {note ? <SheetNote note={note} /> : null}\n <InsideSheetContext.Provider value>{children}</InsideSheetContext.Provider>\n </>\n )}\n </BottomSheetModal>\n );\n}\n\n/** A gentle rose line: the person is asked something below, never told to hurry. */\nfunction SheetNote({ note }: { note: string }) {\n return (\n <Text style={styles.note} accessibilityRole=\"alert\">\n {note}\n </Text>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n content: { flexGrow: 1 },\n note: {\n marginHorizontal: theme.spacing(4),\n marginBottom: theme.spacing(2),\n color: theme.colors.magenta,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n}));\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMkB,yBAAyB;;AAoB/B,MAAMW,aAA0B,CAAA;AAChC,IAAIC,UAAU;;AAGd,SAAgBC,gBAAyB;CACvC,OAAOD;AACT;;;;;;;AAQA,SAAgBE,YAAYJ,MAA0B;CACpDE,UAAUF,SAASK;CACnB,IAAIL,SAASK,QAAW;EACtB,KAAK,MAAMC,SAASL,YAAYK,MAAMP,QAAQM,MAAS;EACvD;CACF;CACA,KAAK,IAAIE,QAAQN,WAAWO,SAAS,GAAGD,SAAS,GAAGA,SAAS,GAAG;EAC9D,IAAIN,WAAWM,MAAM,CAACX,KAAK,GAAG;GAC5B,KAAK,MAAMU,SAASL,WAAWQ,MAAM,GAAGF,QAAQ,CAAC,GAAGD,MAAMP,QAAQC,IAAI;GACtE;EACF;EACAC,WAAWM,MAAM,CAACT,MAAM;CAC1B;AACF;;;;;;;AAQA,SAAgBY,WAAW,EAAElB,MAAMC,SAASC,UAAUC,aAAa,MAAMC,OAAO,SAA0B;CACxG,MAAM,EAAEe,UAAUxB,aAAa;CAC/B,MAAMyB,SAASjC,WAAWM,qBAAqB;CAC/C,MAAMqB,QAAQzB,OAAyB,IAAI;CAC3C,MAAMgC,UAAUhC,OAAOW,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C,MAAM0C,SAASC;EACzBC,YAAY5C,MAAM4C,WAAWD;EAAEE,mBAAA,CAAA,CAAA;CACjC;AACF,EAAE"}
@@ -5,8 +5,10 @@ export interface SheetListProps<T> extends FlatListProps<T> {
5
5
  embedded?: boolean;
6
6
  /** Reset the list without replacing its modal owner. */
7
7
  listKey?: string;
8
+ /** The sheet holds unsaved work: a prompt arriving in the conversation leaves it open with a note. */
9
+ keep?: boolean;
8
10
  }
9
11
  /** A sheet's only vertical scroll owner. Put headings and controls in its header/footer. */
10
- export declare function SheetList<T>({ contentContainerStyle, embedded, listKey, ...props }: SheetListProps<T>): import("react").JSX.Element;
12
+ export declare function SheetList<T>({ contentContainerStyle, embedded, listKey, keep, ...props }: SheetListProps<T>): import("react").JSX.Element;
11
13
  //#endregion
12
14
  //# sourceMappingURL=SheetList.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SheetList.d.mts","names":[],"sources":["../../src/components/SheetList.tsx"],"mappings":";;iBASiB,eAAe,WAAW,cAAc;;EAEvD;;EAEA;;;wBAMc,UAAU,KAAK,uBAAuB,UAAkB,YAAY,SAAS,eAAe,qBAAE,IAAA"}
1
+ {"version":3,"file":"SheetList.d.mts","names":[],"sources":["../../src/components/SheetList.tsx"],"mappings":";;iBASiB,eAAe,WAAW,cAAc;;EAEvD;;EAEA;;EAEA;;;wBAMc,UAAU,KAAK,uBAAuB,UAAkB,SAAS,SAAS,SAAS,eAAe,qBAAE,IAAA"}
@@ -9,7 +9,7 @@ import { SafeAreaInsetsContext } from "react-native-safe-area-context";
9
9
  //#region src/components/SheetList.tsx
10
10
  const ThemedSheetFlatList = withUnistyles(BottomSheetFlatList);
11
11
  /** A sheet's only vertical scroll owner. Put headings and controls in its header/footer. */
12
- function SheetList({ contentContainerStyle, embedded = false, listKey, ...props }) {
12
+ function SheetList({ contentContainerStyle, embedded = false, listKey, keep, ...props }) {
13
13
  const state = useContext(SheetContext);
14
14
  const insets = useContext(SafeAreaInsetsContext);
15
15
  const list = /* @__PURE__ */ jsx(SheetContext.Provider, {
@@ -24,6 +24,7 @@ function SheetList({ contentContainerStyle, embedded = false, listKey, ...props
24
24
  open: state.open,
25
25
  onClose: () => state.setOpen(false),
26
26
  scrollable: false,
27
+ keep,
27
28
  children: list
28
29
  });
29
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SheetList.mjs","names":["BottomSheetFlatList","useContext","FlatListProps","SafeAreaInsetsContext","withUnistyles","SheetContext","SheetFrame","SheetListProps","T","embedded","listKey","ThemedSheetFlatList","SheetList","contentContainerStyle","props","state","insets","list","paddingBottom","bottom","open","setOpen"],"sources":["../../src/components/SheetList.tsx"],"sourcesContent":["import { BottomSheetFlatList } from '@gorhom/bottom-sheet';\nimport { useContext } from 'react';\nimport type { FlatListProps } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { withUnistyles } from 'react-native-unistyles';\n\nimport { SheetContext } from './Sheet';\nimport { SheetFrame } from './SheetFrame';\n\nexport interface SheetListProps<T> extends FlatListProps<T> {\n /** Use inside a persistent SheetContent with scrollable={false}. */\n embedded?: boolean;\n /** Reset the list without replacing its modal owner. */\n listKey?: string;\n}\n\n// Gorhom normalizes scroll styles internally; resolve Unistyles before that boundary.\nconst ThemedSheetFlatList = withUnistyles(BottomSheetFlatList) as typeof BottomSheetFlatList;\n/** A sheet's only vertical scroll owner. Put headings and controls in its header/footer. */\nexport function SheetList<T>({ contentContainerStyle, embedded = false, listKey, ...props }: SheetListProps<T>) {\n const state = useContext(SheetContext);\n const insets = useContext(SafeAreaInsetsContext);\n const list = (\n <SheetContext.Provider value={state}>\n <ThemedSheetFlatList<T>\n key={listKey}\n keyboardShouldPersistTaps=\"handled\"\n {...props}\n contentContainerStyle={[{ paddingBottom: insets?.bottom ?? 0 }, contentContainerStyle]}\n />\n </SheetContext.Provider>\n );\n return embedded ? (\n list\n ) : (\n <SheetFrame open={state.open} onClose={() => state.setOpen(false)} scrollable={false}>\n {list}\n </SheetFrame>\n );\n}\n"],"mappings":";;;;;;;;;AAiBA,MAAMW,sBAAsBP,cAAcJ,mBAAmB;;AAE7D,SAAgBY,UAAa,EAAEC,uBAAuBJ,WAAW,OAAOC,SAAS,GAAGI,SAA4B;CAC9G,MAAMC,QAAQd,WAAWI,YAAY;CACrC,MAAMW,SAASf,WAAWE,qBAAqB;CAC/C,MAAMc,OACJ,oBAAC,aAAa,UAAd;EAAuB,OAAOF;YAC5B,oBAAC,qBAAD;GAEE,2BAA0B;GAC1B,GAAID;GACJ,uBAAuB,CAAC,EAAEI,eAAeF,QAAQG,UAAU,EAAE,GAAGN,qBAAqB;EAAE,GAHlFH,OAGkF;CAEpE;CAEzB,OAAOD,WACLQ,OAEA,oBAAC,YAAD;EAAY,MAAMF,MAAMK;EAAM,eAAeL,MAAMM,QAAQ,KAAK;EAAG,YAAY;YAC5EJ;CACS;AAEhB"}
1
+ {"version":3,"file":"SheetList.mjs","names":["BottomSheetFlatList","useContext","FlatListProps","SafeAreaInsetsContext","withUnistyles","SheetContext","SheetFrame","SheetListProps","T","embedded","listKey","keep","ThemedSheetFlatList","SheetList","contentContainerStyle","props","state","insets","list","paddingBottom","bottom","open","setOpen"],"sources":["../../src/components/SheetList.tsx"],"sourcesContent":["import { BottomSheetFlatList } from '@gorhom/bottom-sheet';\nimport { useContext } from 'react';\nimport type { FlatListProps } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { withUnistyles } from 'react-native-unistyles';\n\nimport { SheetContext } from './Sheet';\nimport { SheetFrame } from './SheetFrame';\n\nexport interface SheetListProps<T> extends FlatListProps<T> {\n /** Use inside a persistent SheetContent with scrollable={false}. */\n embedded?: boolean;\n /** Reset the list without replacing its modal owner. */\n listKey?: string;\n /** The sheet holds unsaved work: a prompt arriving in the conversation leaves it open with a note. */\n keep?: boolean;\n}\n\n// Gorhom normalizes scroll styles internally; resolve Unistyles before that boundary.\nconst ThemedSheetFlatList = withUnistyles(BottomSheetFlatList) as typeof BottomSheetFlatList;\n/** A sheet's only vertical scroll owner. Put headings and controls in its header/footer. */\nexport function SheetList<T>({ contentContainerStyle, embedded = false, listKey, keep, ...props }: SheetListProps<T>) {\n const state = useContext(SheetContext);\n const insets = useContext(SafeAreaInsetsContext);\n const list = (\n <SheetContext.Provider value={state}>\n <ThemedSheetFlatList<T>\n key={listKey}\n keyboardShouldPersistTaps=\"handled\"\n {...props}\n contentContainerStyle={[{ paddingBottom: insets?.bottom ?? 0 }, contentContainerStyle]}\n />\n </SheetContext.Provider>\n );\n return embedded ? (\n list\n ) : (\n <SheetFrame open={state.open} onClose={() => state.setOpen(false)} scrollable={false} keep={keep}>\n {list}\n </SheetFrame>\n );\n}\n"],"mappings":";;;;;;;;;AAmBA,MAAMY,sBAAsBR,cAAcJ,mBAAmB;;AAE7D,SAAgBa,UAAa,EAAEC,uBAAuBL,WAAW,OAAOC,SAASC,MAAM,GAAGI,SAA4B;CACpH,MAAMC,QAAQf,WAAWI,YAAY;CACrC,MAAMY,SAAShB,WAAWE,qBAAqB;CAC/C,MAAMe,OACJ,oBAAC,aAAa,UAAd;EAAuB,OAAOF;YAC5B,oBAAC,qBAAD;GAEE,2BAA0B;GAC1B,GAAID;GACJ,uBAAuB,CAAC,EAAEI,eAAeF,QAAQG,UAAU,EAAE,GAAGN,qBAAqB;EAAE,GAHlFJ,OAGkF;CAEpE;CAEzB,OAAOD,WACLS,OAEA,oBAAC,YAAD;EAAY,MAAMF,MAAMK;EAAM,eAAeL,MAAMM,QAAQ,KAAK;EAAG,YAAY;EAAaX;YACzFO;CACS;AAEhB"}
package/dist/index.d.mts CHANGED
@@ -21,6 +21,7 @@ import { PoNativeProvider, PoNativeProviderProps } from "./components/PoNativePr
21
21
  import { SectionLabel } from "./components/SectionLabel.mjs";
22
22
  import { SegmentedControl, SegmentedControlOption, SegmentedControlProps } from "./components/SegmentedControl.mjs";
23
23
  import { Sheet, SheetBody, SheetClose, SheetContent, SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetHeaderProps, SheetPartProps, SheetProps, SheetTitle, SheetTrigger } from "./components/Sheet.mjs";
24
+ import { sheetsYielded, yieldSheets } from "./components/SheetFrame.mjs";
24
25
  import { SheetList, SheetListProps } from "./components/SheetList.mjs";
25
26
  import { ShowMore, ShowMoreProps } from "./components/ShowMore.mjs";
26
27
  import { Spinner, SpinnerProps } from "./components/Spinner.mjs";
@@ -34,4 +35,4 @@ import { fontOf } from "./lib/fonts.mjs";
34
35
  import { IconColorContext } from "./icons/IconColorContext.mjs";
35
36
  import { impactLight, selectionTick } from "./lib/haptics.mjs";
36
37
  import { AnsiSpan, PresentedLine, ReviewComment, ansiSpans, buildReviewPrompt, collapseLines, hashlineBody, resultTextLines } from "@agimon-ai/po-web-components/text";
37
- export { ActivityIcon, AgentAvatar, type AgentState, AlertIcon, type AnnotationMark, AnnotationSurface, type AnnotationSurfaceProps, type AnsiSpan, ArrowRightIcon, Badge, type BadgeProps, type BadgeSize, type BadgeTone, BranchIcon, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CheckIcon, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CodeBlock, type CodeBlockProps, CopyButton, type CopyButtonProps, CopyIcon, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, type DialogFooterProps, type DialogFooterVariant, DialogHeader, type DialogHeaderProps, type DialogPartProps, type DialogProps, DialogTitle, DialogTrigger, type DialogWidth, Dot, type DotProps, type DotSize, type DotTone, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemVariant, DropdownMenuLabel, type DropdownMenuPartProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EditIcon, EmptyState, type EmptyStateProps, type FieldSize, type FieldVariant, FileIcon, type FileLinkHandler, FolderIcon, ForkIcon, GearIcon, GlobeIcon, HashlineLines, type HashlineLinesProps, HomeIcon, IconColorContext, type IconName, type IconProps, ImageIcon, Input, type InputProps, KebabIcon, Label, type LabelProps, LightbulbIcon, List, type ListProps, ListRow, type ListRowProps, LiveDuration, type LiveDurationProps, type LiveDurationReading, LockIcon, Markdown, type MarkdownImageLoader, type MarkdownProps, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, type MessageItemGroupProps, MessageItemHeader, type MessageItemHeaderProps, type MessageItemPartProps, type MessageItemProps, type MessageItemState, MessageItemStatus, type MessageItemStatusProps, MicIcon, PaletteIcon, Panel, PanelBody, PanelHeader, type PanelPartProps, PlayCircleIcon, PlusIcon, PoNativeProvider, type PoNativeProviderProps, type PresentedLine, type ReviewComment, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, SearchIcon, SectionLabel, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, SendIcon, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, SheetList, type SheetListProps, type SheetPartProps, type SheetProps, SheetTitle, SheetTrigger, ShowMore, type ShowMoreProps, SlidersIcon, SparklesIcon, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusBadgeSize, type StatusTone, StopIcon, SyntaxLine, type SyntaxLineProps, TabBadge, type TabBadgeProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, TaskIcon, Textarea, type TextareaProps, ToolPathLink, type ToolPathLinkProps, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon, agentInitials, ansiSpans, buildReviewPrompt, collapseLines, fontOf, hashlineBody, impactLight, resultTextLines, selectionTick, toolTone, useMessageItem, useSyntaxLines };
38
+ export { ActivityIcon, AgentAvatar, type AgentState, AlertIcon, type AnnotationMark, AnnotationSurface, type AnnotationSurfaceProps, type AnsiSpan, ArrowRightIcon, Badge, type BadgeProps, type BadgeSize, type BadgeTone, BranchIcon, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CheckIcon, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CodeBlock, type CodeBlockProps, CopyButton, type CopyButtonProps, CopyIcon, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, type DialogFooterProps, type DialogFooterVariant, DialogHeader, type DialogHeaderProps, type DialogPartProps, type DialogProps, DialogTitle, DialogTrigger, type DialogWidth, Dot, type DotProps, type DotSize, type DotTone, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemVariant, DropdownMenuLabel, type DropdownMenuPartProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EditIcon, EmptyState, type EmptyStateProps, type FieldSize, type FieldVariant, FileIcon, type FileLinkHandler, FolderIcon, ForkIcon, GearIcon, GlobeIcon, HashlineLines, type HashlineLinesProps, HomeIcon, IconColorContext, type IconName, type IconProps, ImageIcon, Input, type InputProps, KebabIcon, Label, type LabelProps, LightbulbIcon, List, type ListProps, ListRow, type ListRowProps, LiveDuration, type LiveDurationProps, type LiveDurationReading, LockIcon, Markdown, type MarkdownImageLoader, type MarkdownProps, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, type MessageItemGroupProps, MessageItemHeader, type MessageItemHeaderProps, type MessageItemPartProps, type MessageItemProps, type MessageItemState, MessageItemStatus, type MessageItemStatusProps, MicIcon, PaletteIcon, Panel, PanelBody, PanelHeader, type PanelPartProps, PlayCircleIcon, PlusIcon, PoNativeProvider, type PoNativeProviderProps, type PresentedLine, type ReviewComment, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, SearchIcon, SectionLabel, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, SendIcon, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, SheetList, type SheetListProps, type SheetPartProps, type SheetProps, SheetTitle, SheetTrigger, ShowMore, type ShowMoreProps, SlidersIcon, SparklesIcon, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusBadgeSize, type StatusTone, StopIcon, SyntaxLine, type SyntaxLineProps, TabBadge, type TabBadgeProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, TaskIcon, Textarea, type TextareaProps, ToolPathLink, type ToolPathLinkProps, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon, agentInitials, ansiSpans, buildReviewPrompt, collapseLines, fontOf, hashlineBody, impactLight, resultTextLines, selectionTick, sheetsYielded, toolTone, useMessageItem, useSyntaxLines, yieldSheets };
package/dist/index.mjs CHANGED
@@ -12,6 +12,7 @@ import { CopyButton } from "./components/CopyButton.mjs";
12
12
  import { ShowMore } from "./components/ShowMore.mjs";
13
13
  import { CodeBlock } from "./components/CodeBlock.mjs";
14
14
  import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./components/Dialog.mjs";
15
+ import { sheetsYielded, yieldSheets } from "./components/SheetFrame.mjs";
15
16
  import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "./components/DropdownMenu.mjs";
16
17
  import { EmptyState } from "./components/EmptyState.mjs";
17
18
  import { SyntaxLine, useSyntaxLines } from "./components/SyntaxLine.mjs";
@@ -34,4 +35,4 @@ import { Textarea } from "./components/Textarea.mjs";
34
35
  import { ToolPathLink } from "./components/ToolPathLink.mjs";
35
36
  import { ansiSpans, buildReviewPrompt, collapseLines, hashlineBody, resultTextLines } from "@agimon-ai/po-web-components/text";
36
37
 
37
- export { ActivityIcon, AgentAvatar, AlertIcon, AnnotationSurface, ArrowRightIcon, Badge, BranchIcon, Button, CheckIcon, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CodeBlock, CopyButton, CopyIcon, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Dot, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EditIcon, EmptyState, FileIcon, FolderIcon, ForkIcon, GearIcon, GlobeIcon, HashlineLines, HomeIcon, IconColorContext, ImageIcon, Input, KebabIcon, Label, LightbulbIcon, List, ListRow, LiveDuration, LockIcon, Markdown, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, MessageItemHeader, MessageItemStatus, MicIcon, PaletteIcon, Panel, PanelBody, PanelHeader, PlayCircleIcon, PlusIcon, PoNativeProvider, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, SearchIcon, SectionLabel, SegmentedControl, SendIcon, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetList, SheetTitle, SheetTrigger, ShowMore, SlidersIcon, SparklesIcon, Spinner, StatusBadge, StopIcon, SyntaxLine, TabBadge, Tabs, TabsContent, TabsList, TabsTrigger, TaskIcon, Textarea, ToolPathLink, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon, agentInitials, ansiSpans, buildReviewPrompt, collapseLines, fontOf, hashlineBody, impactLight, resultTextLines, selectionTick, toolTone, useMessageItem, useSyntaxLines };
38
+ export { ActivityIcon, AgentAvatar, AlertIcon, AnnotationSurface, ArrowRightIcon, Badge, BranchIcon, Button, CheckIcon, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CodeBlock, CopyButton, CopyIcon, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Dot, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EditIcon, EmptyState, FileIcon, FolderIcon, ForkIcon, GearIcon, GlobeIcon, HashlineLines, HomeIcon, IconColorContext, ImageIcon, Input, KebabIcon, Label, LightbulbIcon, List, ListRow, LiveDuration, LockIcon, Markdown, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, MessageItemHeader, MessageItemStatus, MicIcon, PaletteIcon, Panel, PanelBody, PanelHeader, PlayCircleIcon, PlusIcon, PoNativeProvider, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, SearchIcon, SectionLabel, SegmentedControl, SendIcon, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetList, SheetTitle, SheetTrigger, ShowMore, SlidersIcon, SparklesIcon, Spinner, StatusBadge, StopIcon, SyntaxLine, TabBadge, Tabs, TabsContent, TabsList, TabsTrigger, TaskIcon, Textarea, ToolPathLink, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon, agentInitials, ansiSpans, buildReviewPrompt, collapseLines, fontOf, hashlineBody, impactLight, resultTextLines, selectionTick, sheetsYielded, toolTone, useMessageItem, useSyntaxLines, yieldSheets };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-native-components",
3
- "version": "0.0.0-alpha.49",
3
+ "version": "0.0.0-alpha.50",
4
4
  "description": "Shared React Native components for Po and its native plugins: the web component library's look and API on native parts, tuned to the Po palette.",
5
5
  "keywords": [
6
6
  "ai",
@@ -45,11 +45,11 @@
45
45
  "access": "public"
46
46
  },
47
47
  "dependencies": {
48
- "@agimon-ai/po-web-components": "0.0.0-alpha.49"
48
+ "@agimon-ai/po-web-components": "0.0.0-alpha.50"
49
49
  },
50
50
  "devDependencies": {
51
- "@agimon-ai/po-build": "0.0.0-alpha.49",
52
- "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.49",
51
+ "@agimon-ai/po-build": "0.0.0-alpha.50",
52
+ "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.50",
53
53
  "@babel/core": "7.29.7",
54
54
  "@expo/vector-icons": "15.1.1",
55
55
  "@fontsource-variable/ibm-plex-sans": "5.3.0",