@assistant-ui/react-native 0.1.30 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/attachment/AttachmentName.js.map +1 -1
- package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
- package/dist/primitives/error/ErrorMessage.d.ts.map +1 -1
- package/dist/primitives/error/ErrorMessage.js.map +1 -1
- package/dist/primitives/error/ErrorRoot.d.ts.map +1 -1
- package/dist/primitives/message/MessageIf.js.map +1 -1
- package/dist/primitives/suggestion/SuggestionDescription.js.map +1 -1
- package/dist/primitives/suggestion/SuggestionTitle.js.map +1 -1
- package/dist/primitives/thread/ThreadIf.js.map +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts +12 -3
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js +374 -33
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread.d.ts +3 -3
- package/dist/primitives/thread.js +3 -2
- package/dist/primitives/thread.js.map +1 -1
- package/package.json +8 -8
- package/src/primitives/thread/ThreadMessages.test.tsx +423 -9
- package/src/primitives/thread/ThreadMessages.tsx +318 -28
- package/src/primitives/thread.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBarCopy.js","names":["ReactNode","Pressable","PressableProps","useActionBarCopy","UseActionBarCopyOptions","ActionBarCopyProps","Omit","children","props","isCopied","ActionBarCopy","t0","$","_c","copiedDuration","copyToClipboard","disabledProp","pressableProps","disabled","t1","copy","t2","t3","t4"],"sources":["../../../src/primitives/actionBar/ActionBarCopy.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport {\n useActionBarCopy,\n type UseActionBarCopyOptions,\n} from \"@assistant-ui/core/react\";\n\nexport type ActionBarCopyProps = Omit<PressableProps, \"onPress\" | \"children\"> &\n UseActionBarCopyOptions & {\n children: ReactNode | ((props: { isCopied: boolean }) => ReactNode);\n };\n\nexport const ActionBarCopy = ({\n children,\n disabled: disabledProp,\n copiedDuration,\n copyToClipboard,\n ...pressableProps\n}: ActionBarCopyProps) => {\n const { copy, disabled, isCopied } = useActionBarCopy({\n copiedDuration,\n copyToClipboard,\n });\n\n return (\n <Pressable\n onPress={copy}\n disabled={disabledProp ?? disabled}\n {...pressableProps}\n >\n {typeof children === \"function\" ? children({ isCopied }) : children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;AAYA,MAAaU,iBAAgBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAJ,UAAAW,UAAAF,cAAAF,gBAAAC,oBAAAE,kBAAAN;EAMTC,EAAA,KAAAD;EAAAC,EAAA,KAAAL;EAAAK,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAV,WAAAK,EAAA;EAAAE,iBAAAF,EAAA;EAAAG,kBAAAH,EAAA;EAAAI,eAAAJ,EAAA;EAAAK,iBAAAL,EAAA;CAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAE,kBAAAF,EAAA,OAAAG,iBAAA;EACmCI,KAAA;GAAAL;GAAAC;EAGtD;EAACH,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAHD,MAAA,EAAAQ,MAAAF,UAAAT,aAAqCN,iBAAiBgB,EAGrD;CAKa,MAAAE,KAAAL,gBAAAE;CAAwB,IAAAI;CAAA,IAAAV,EAAA,OAAAL,YAAAK,EAAA,QAAAH,UAAA;EAGjCa,KAAA,OAAOf,aAAa,aAAaA,SAAS,EAAAE,SAAW,CAAY,IAAjEF;EAAkEK,EAAA,KAAAL;EAAAK,EAAA,MAAAH;EAAAG,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAQ,QAAAR,EAAA,QAAAK,kBAAAL,EAAA,QAAAS,MAAAT,EAAA,QAAAU,IAAA;EALrEC,KAAA,oBAAC,WAAD;GACWH,SAAAA;GACC,UAAAC;GAAwB,GAC9BJ;
|
|
1
|
+
{"version":3,"file":"ActionBarCopy.js","names":["ReactNode","Pressable","PressableProps","useActionBarCopy","UseActionBarCopyOptions","ActionBarCopyProps","Omit","children","props","isCopied","ActionBarCopy","t0","$","_c","copiedDuration","copyToClipboard","disabledProp","pressableProps","disabled","t1","copy","t2","t3","t4"],"sources":["../../../src/primitives/actionBar/ActionBarCopy.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport {\n useActionBarCopy,\n type UseActionBarCopyOptions,\n} from \"@assistant-ui/core/react\";\n\nexport type ActionBarCopyProps = Omit<PressableProps, \"onPress\" | \"children\"> &\n UseActionBarCopyOptions & {\n children: ReactNode | ((props: { isCopied: boolean }) => ReactNode);\n };\n\nexport const ActionBarCopy = ({\n children,\n disabled: disabledProp,\n copiedDuration,\n copyToClipboard,\n ...pressableProps\n}: ActionBarCopyProps) => {\n const { copy, disabled, isCopied } = useActionBarCopy({\n copiedDuration,\n copyToClipboard,\n });\n\n return (\n <Pressable\n onPress={copy}\n disabled={disabledProp ?? disabled}\n {...pressableProps}\n >\n {typeof children === \"function\" ? children({ isCopied }) : children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;AAYA,MAAaU,iBAAgBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAJ,UAAAW,UAAAF,cAAAF,gBAAAC,oBAAAE,kBAAAN;EAMTC,EAAA,KAAAD;EAAAC,EAAA,KAAAL;EAAAK,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAV,WAAAK,EAAA;EAAAE,iBAAAF,EAAA;EAAAG,kBAAAH,EAAA;EAAAI,eAAAJ,EAAA;EAAAK,iBAAAL,EAAA;CAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAE,kBAAAF,EAAA,OAAAG,iBAAA;EACmCI,KAAA;GAAAL;GAAAC;EAGtD;EAACH,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAHD,MAAA,EAAAQ,MAAAF,UAAAT,aAAqCN,iBAAiBgB,EAGrD;CAKa,MAAAE,KAAAL,gBAAAE;CAAwB,IAAAI;CAAA,IAAAV,EAAA,OAAAL,YAAAK,EAAA,QAAAH,UAAA;EAGjCa,KAAA,OAAOf,aAAa,aAAaA,SAAS,EAAAE,SAAW,CAAY,IAAjEF;EAAkEK,EAAA,KAAAL;EAAAK,EAAA,MAAAH;EAAAG,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAQ,QAAAR,EAAA,QAAAK,kBAAAL,EAAA,QAAAS,MAAAT,EAAA,QAAAU,IAAA;EALrEC,KAAA,oBAAC,WAAD;GACWH,SAAAA;GACC,UAAAC;GAAwB,GAC9BJ;GAEHK,UAAAA;EALO,CAAA;EAMEV,EAAA,MAAAQ;EAAAR,EAAA,MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OANZW;AAMY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBarFeedbackNegative.js","names":["ReactNode","Pressable","PressableProps","useActionBarFeedbackNegative","ActionBarFeedbackNegativeProps","Omit","children","props","isSubmitted","ActionBarFeedbackNegative","t0","$","_c","pressableProps","submit","t1","t2"],"sources":["../../../src/primitives/actionBar/ActionBarFeedbackNegative.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport { useActionBarFeedbackNegative } from \"@assistant-ui/core/react\";\n\nexport type ActionBarFeedbackNegativeProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: ReactNode | ((props: { isSubmitted: boolean }) => ReactNode);\n};\n\nexport const ActionBarFeedbackNegative = ({\n children,\n ...pressableProps\n}: ActionBarFeedbackNegativeProps) => {\n const { submit, isSubmitted } = useActionBarFeedbackNegative();\n\n return (\n <Pressable onPress={submit} {...pressableProps}>\n {typeof children === \"function\" ? children({ isSubmitted }) : children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;AAWA,MAAaS,6BAA4BC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAJ,aAAAO,kBAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAL;EAAAK,EAAA,KAAAE;CAAA,OAAA;EAAAP,WAAAK,EAAA;EAAAE,iBAAAF,EAAA;CAAA;CAC/B,MAAA,EAAAG,QAAAN,gBAAgCL,6BAA6B;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAL,YAAAK,EAAA,OAAAH,aAAA;EAI1DO,KAAA,OAAOT,aAAa,aAAaA,SAAS,EAAAE,YAAc,CAAY,IAApEF;EAAqEK,EAAA,KAAAL;EAAAK,EAAA,KAAAH;EAAAG,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAE,kBAAAF,EAAA,OAAAG,UAAAH,EAAA,OAAAI,IAAA;EADxEC,KAAA,oBAAC,WAAD;GAAoBF,SAAAA;GAAM,GAAMD;
|
|
1
|
+
{"version":3,"file":"ActionBarFeedbackNegative.js","names":["ReactNode","Pressable","PressableProps","useActionBarFeedbackNegative","ActionBarFeedbackNegativeProps","Omit","children","props","isSubmitted","ActionBarFeedbackNegative","t0","$","_c","pressableProps","submit","t1","t2"],"sources":["../../../src/primitives/actionBar/ActionBarFeedbackNegative.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport { useActionBarFeedbackNegative } from \"@assistant-ui/core/react\";\n\nexport type ActionBarFeedbackNegativeProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: ReactNode | ((props: { isSubmitted: boolean }) => ReactNode);\n};\n\nexport const ActionBarFeedbackNegative = ({\n children,\n ...pressableProps\n}: ActionBarFeedbackNegativeProps) => {\n const { submit, isSubmitted } = useActionBarFeedbackNegative();\n\n return (\n <Pressable onPress={submit} {...pressableProps}>\n {typeof children === \"function\" ? children({ isSubmitted }) : children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;AAWA,MAAaS,6BAA4BC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAJ,aAAAO,kBAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAL;EAAAK,EAAA,KAAAE;CAAA,OAAA;EAAAP,WAAAK,EAAA;EAAAE,iBAAAF,EAAA;CAAA;CAC/B,MAAA,EAAAG,QAAAN,gBAAgCL,6BAA6B;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAL,YAAAK,EAAA,OAAAH,aAAA;EAI1DO,KAAA,OAAOT,aAAa,aAAaA,SAAS,EAAAE,YAAc,CAAY,IAApEF;EAAqEK,EAAA,KAAAL;EAAAK,EAAA,KAAAH;EAAAG,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAE,kBAAAF,EAAA,OAAAG,UAAAH,EAAA,OAAAI,IAAA;EADxEC,KAAA,oBAAC,WAAD;GAAoBF,SAAAA;GAAM,GAAMD;GAC7BE,UAAAA;EADO,CAAA;EAEEJ,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFZK;AAEY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBarFeedbackPositive.js","names":["ReactNode","Pressable","PressableProps","useActionBarFeedbackPositive","ActionBarFeedbackPositiveProps","Omit","children","props","isSubmitted","ActionBarFeedbackPositive","t0","$","_c","pressableProps","submit","t1","t2"],"sources":["../../../src/primitives/actionBar/ActionBarFeedbackPositive.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport { useActionBarFeedbackPositive } from \"@assistant-ui/core/react\";\n\nexport type ActionBarFeedbackPositiveProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: ReactNode | ((props: { isSubmitted: boolean }) => ReactNode);\n};\n\nexport const ActionBarFeedbackPositive = ({\n children,\n ...pressableProps\n}: ActionBarFeedbackPositiveProps) => {\n const { submit, isSubmitted } = useActionBarFeedbackPositive();\n\n return (\n <Pressable onPress={submit} {...pressableProps}>\n {typeof children === \"function\" ? children({ isSubmitted }) : children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;AAWA,MAAaS,6BAA4BC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAJ,aAAAO,kBAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAL;EAAAK,EAAA,KAAAE;CAAA,OAAA;EAAAP,WAAAK,EAAA;EAAAE,iBAAAF,EAAA;CAAA;CAC/B,MAAA,EAAAG,QAAAN,gBAAgCL,6BAA6B;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAL,YAAAK,EAAA,OAAAH,aAAA;EAI1DO,KAAA,OAAOT,aAAa,aAAaA,SAAS,EAAAE,YAAc,CAAY,IAApEF;EAAqEK,EAAA,KAAAL;EAAAK,EAAA,KAAAH;EAAAG,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAE,kBAAAF,EAAA,OAAAG,UAAAH,EAAA,OAAAI,IAAA;EADxEC,KAAA,oBAAC,WAAD;GAAoBF,SAAAA;GAAM,GAAMD;
|
|
1
|
+
{"version":3,"file":"ActionBarFeedbackPositive.js","names":["ReactNode","Pressable","PressableProps","useActionBarFeedbackPositive","ActionBarFeedbackPositiveProps","Omit","children","props","isSubmitted","ActionBarFeedbackPositive","t0","$","_c","pressableProps","submit","t1","t2"],"sources":["../../../src/primitives/actionBar/ActionBarFeedbackPositive.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport { useActionBarFeedbackPositive } from \"@assistant-ui/core/react\";\n\nexport type ActionBarFeedbackPositiveProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: ReactNode | ((props: { isSubmitted: boolean }) => ReactNode);\n};\n\nexport const ActionBarFeedbackPositive = ({\n children,\n ...pressableProps\n}: ActionBarFeedbackPositiveProps) => {\n const { submit, isSubmitted } = useActionBarFeedbackPositive();\n\n return (\n <Pressable onPress={submit} {...pressableProps}>\n {typeof children === \"function\" ? children({ isSubmitted }) : children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;AAWA,MAAaS,6BAA4BC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAJ,aAAAO,kBAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAL;EAAAK,EAAA,KAAAE;CAAA,OAAA;EAAAP,WAAAK,EAAA;EAAAE,iBAAAF,EAAA;CAAA;CAC/B,MAAA,EAAAG,QAAAN,gBAAgCL,6BAA6B;CAAE,IAAAY;CAAA,IAAAJ,EAAA,OAAAL,YAAAK,EAAA,OAAAH,aAAA;EAI1DO,KAAA,OAAOT,aAAa,aAAaA,SAAS,EAAAE,YAAc,CAAY,IAApEF;EAAqEK,EAAA,KAAAL;EAAAK,EAAA,KAAAH;EAAAG,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAE,kBAAAF,EAAA,OAAAG,UAAAH,EAAA,OAAAI,IAAA;EADxEC,KAAA,oBAAC,WAAD;GAAoBF,SAAAA;GAAM,GAAMD;GAC7BE,UAAAA;EADO,CAAA;EAEEJ,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFZK;AAEY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentName.js","names":["FC","Text","TextProps","useAuiState","AttachmentNameProps","AttachmentName","props","$","_c","name","_temp","t0","s","attachment"],"sources":["../../../src/primitives/attachment/AttachmentName.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type AttachmentNameProps = TextProps;\n\nexport const AttachmentName: FC<AttachmentNameProps> = (props) => {\n const name = useAuiState((s) => s.attachment.name);\n return <Text {...props}>{name}</Text>;\n};\n"],"mappings":";;;;;AAMA,MAAaK,kBAA0CC,UAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACrD,MAAAC,OAAaN,YAAYO,KAAwB;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAE,QAAAF,EAAA,OAAAD,OAAA;EAC5CK,KAAA,oBAAC,MAAD;GAAK,GAAKL;
|
|
1
|
+
{"version":3,"file":"AttachmentName.js","names":["FC","Text","TextProps","useAuiState","AttachmentNameProps","AttachmentName","props","$","_c","name","_temp","t0","s","attachment"],"sources":["../../../src/primitives/attachment/AttachmentName.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type AttachmentNameProps = TextProps;\n\nexport const AttachmentName: FC<AttachmentNameProps> = (props) => {\n const name = useAuiState((s) => s.attachment.name);\n return <Text {...props}>{name}</Text>;\n};\n"],"mappings":";;;;;AAMA,MAAaK,kBAA0CC,UAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACrD,MAAAC,OAAaN,YAAYO,KAAwB;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAE,QAAAF,EAAA,OAAAD,OAAA;EAC5CK,KAAA,oBAAC,MAAD;GAAK,GAAKL;GAAQG,UAAAA;EAAb,CAAA;EAAyBF,EAAA,KAAAE;EAAAF,EAAA,KAAAD;EAAAC,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAA9BI;AAA8B;AAFgB,SAAAD,MAAAE,GAAA;CAAA,OACrBA,EAACC,WAAWJ;AAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentThumb.js","names":["FC","Text","TextProps","useAuiState","AttachmentThumbProps","AttachmentThumb","props","$","_c","ext","_temp","t0","s","parts","attachment","name","split","length","pop"],"sources":["../../../src/primitives/attachment/AttachmentThumb.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type AttachmentThumbProps = TextProps;\n\nexport const AttachmentThumb: FC<AttachmentThumbProps> = (props) => {\n const ext = useAuiState((s) => {\n const parts = s.attachment.name.split(\".\");\n return parts.length > 1 ? parts.pop()! : \"\";\n });\n return <Text {...props}>.{ext}</Text>;\n};\n"],"mappings":";;;;;AAMA,MAAaK,mBAA4CC,UAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACvD,MAAAC,MAAYN,YAAYO,KAGvB;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAE,OAAAF,EAAA,OAAAD,OAAA;EACIK,KAAA,qBAAC,MAAD;GAAK,GAAKL;
|
|
1
|
+
{"version":3,"file":"AttachmentThumb.js","names":["FC","Text","TextProps","useAuiState","AttachmentThumbProps","AttachmentThumb","props","$","_c","ext","_temp","t0","s","parts","attachment","name","split","length","pop"],"sources":["../../../src/primitives/attachment/AttachmentThumb.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type AttachmentThumbProps = TextProps;\n\nexport const AttachmentThumb: FC<AttachmentThumbProps> = (props) => {\n const ext = useAuiState((s) => {\n const parts = s.attachment.name.split(\".\");\n return parts.length > 1 ? parts.pop()! : \"\";\n });\n return <Text {...props}>.{ext}</Text>;\n};\n"],"mappings":";;;;;AAMA,MAAaK,mBAA4CC,UAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACvD,MAAAC,MAAYN,YAAYO,KAGvB;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAE,OAAAF,EAAA,OAAAD,OAAA;EACIK,KAAA,qBAAC,MAAD;GAAK,GAAKL;GAAV,UAAA,CAAiB,KAAEG,GAAd;;EAAyBF,EAAA,KAAAE;EAAAF,EAAA,KAAAD;EAAAC,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAA9BI;AAA8B;AALkB,SAAAD,MAAAE,GAAA;CAErD,MAAAC,QAAcD,EAACE,WAAWC,KAAKC,MAAO,GAAG;CAAE,OACpCH,MAAKI,SAAU,IAAIJ,MAAKK,IAAW,IAAnC;AAAoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchPickerCount.js","names":["Text","TextProps","useAuiState","BranchPickerCountProps","BranchPickerCount","props","$","_c","branchCount","_temp","t0","s","message"],"sources":["../../../src/primitives/branchPicker/BranchPickerCount.tsx"],"sourcesContent":["import { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type BranchPickerCountProps = TextProps;\n\nexport const BranchPickerCount = (props: BranchPickerCountProps) => {\n const branchCount = useAuiState((s) => s.message.branchCount);\n return <Text {...props}>{branchCount}</Text>;\n};\n"],"mappings":";;;;;AAKA,MAAaI,qBAAoBC,UAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAC/B,MAAAC,cAAoBN,YAAYO,KAA4B;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAE,eAAAF,EAAA,OAAAD,OAAA;EACvDK,KAAA,oBAAC,MAAD;GAAK,GAAKL;
|
|
1
|
+
{"version":3,"file":"BranchPickerCount.js","names":["Text","TextProps","useAuiState","BranchPickerCountProps","BranchPickerCount","props","$","_c","branchCount","_temp","t0","s","message"],"sources":["../../../src/primitives/branchPicker/BranchPickerCount.tsx"],"sourcesContent":["import { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type BranchPickerCountProps = TextProps;\n\nexport const BranchPickerCount = (props: BranchPickerCountProps) => {\n const branchCount = useAuiState((s) => s.message.branchCount);\n return <Text {...props}>{branchCount}</Text>;\n};\n"],"mappings":";;;;;AAKA,MAAaI,qBAAoBC,UAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAC/B,MAAAC,cAAoBN,YAAYO,KAA4B;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAE,eAAAF,EAAA,OAAAD,OAAA;EACvDK,KAAA,oBAAC,MAAD;GAAK,GAAKL;GAAQG,UAAAA;EAAb,CAAA;EAAgCF,EAAA,KAAAE;EAAAF,EAAA,KAAAD;EAAAC,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAArCI;AAAqC;AAFb,SAAAD,MAAAE,GAAA;CAAA,OACQA,EAACC,QAAQJ;AAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchPickerNumber.js","names":["Text","TextProps","useAuiState","BranchPickerNumberProps","BranchPickerNumber","props","$","_c","branchNumber","_temp","t0","s","message"],"sources":["../../../src/primitives/branchPicker/BranchPickerNumber.tsx"],"sourcesContent":["import { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type BranchPickerNumberProps = TextProps;\n\nexport const BranchPickerNumber = (props: BranchPickerNumberProps) => {\n const branchNumber = useAuiState((s) => s.message.branchNumber);\n return <Text {...props}>{branchNumber}</Text>;\n};\n"],"mappings":";;;;;AAKA,MAAaI,sBAAqBC,UAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAChC,MAAAC,eAAqBN,YAAYO,KAA6B;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAE,gBAAAF,EAAA,OAAAD,OAAA;EACzDK,KAAA,oBAAC,MAAD;GAAK,GAAKL;
|
|
1
|
+
{"version":3,"file":"BranchPickerNumber.js","names":["Text","TextProps","useAuiState","BranchPickerNumberProps","BranchPickerNumber","props","$","_c","branchNumber","_temp","t0","s","message"],"sources":["../../../src/primitives/branchPicker/BranchPickerNumber.tsx"],"sourcesContent":["import { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type BranchPickerNumberProps = TextProps;\n\nexport const BranchPickerNumber = (props: BranchPickerNumberProps) => {\n const branchNumber = useAuiState((s) => s.message.branchNumber);\n return <Text {...props}>{branchNumber}</Text>;\n};\n"],"mappings":";;;;;AAKA,MAAaI,sBAAqBC,UAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAChC,MAAAC,eAAqBN,YAAYO,KAA6B;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAE,gBAAAF,EAAA,OAAAD,OAAA;EACzDK,KAAA,oBAAC,MAAD;GAAK,GAAKL;GAAQG,UAAAA;EAAb,CAAA;EAAiCF,EAAA,KAAAE;EAAAF,EAAA,KAAAD;EAAAC,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAAtCI;AAAsC;AAFb,SAAAD,MAAAE,GAAA;CAAA,OACQA,EAACC,QAAQJ;AAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorMessage.d.ts","names":[],"sources":["../../../src/primitives/error/ErrorMessage.tsx"],"mappings":";;;KAIY,oBAAoB;EAC9B,WAAW;;cAGA;
|
|
1
|
+
{"version":3,"file":"ErrorMessage.d.ts","names":[],"sources":["../../../src/primitives/error/ErrorMessage.tsx"],"mappings":";;;KAIY,oBAAoB;EAC9B,WAAW;;cAGA;KAA4C,aAAA,aAAA,oCAAiB,IAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorMessage.js","names":["ReactNode","Text","TextProps","useMessageError","ErrorMessageProps","children","ErrorMessage","t0","$","_c","textProps","error","undefined","t1","String","t2","displayName"],"sources":["../../../src/primitives/error/ErrorMessage.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useMessageError } from \"@assistant-ui/core/react\";\n\nexport type ErrorMessageProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const ErrorMessage = ({ children, ...textProps }: ErrorMessageProps) => {\n const error = useMessageError();\n\n if (error === undefined) return null;\n\n return <Text {...textProps}>{children ?? String(error)}</Text>;\n};\n\nErrorMessage.displayName = \"ErrorPrimitive.Message\";\n"],"mappings":";;;;;AAQA,MAAaM,gBAAeC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,aAAAK,aAAAH;EAA6CC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACxE,MAAAG,QAAcR,gBAAgB;CAE9B,IAAIQ,UAAUC,KAAAA,GAAS,OAAS;CAEH,MAAAC,KAAAR,YAAYS,OAAOH,KAAK;CAAC,IAAAI;CAAA,IAAAP,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAA/CK,KAAA,oBAAC,MAAD;GAAK,GAAKL;
|
|
1
|
+
{"version":3,"file":"ErrorMessage.js","names":["ReactNode","Text","TextProps","useMessageError","ErrorMessageProps","children","ErrorMessage","t0","$","_c","textProps","error","undefined","t1","String","t2","displayName"],"sources":["../../../src/primitives/error/ErrorMessage.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useMessageError } from \"@assistant-ui/core/react\";\n\nexport type ErrorMessageProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const ErrorMessage = ({ children, ...textProps }: ErrorMessageProps) => {\n const error = useMessageError();\n\n if (error === undefined) return null;\n\n return <Text {...textProps}>{children ?? String(error)}</Text>;\n};\n\nErrorMessage.displayName = \"ErrorPrimitive.Message\";\n"],"mappings":";;;;;AAQA,MAAaM,gBAAeC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,aAAAK,aAAAH;EAA6CC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACxE,MAAAG,QAAcR,gBAAgB;CAE9B,IAAIQ,UAAUC,KAAAA,GAAS,OAAS;CAEH,MAAAC,KAAAR,YAAYS,OAAOH,KAAK;CAAC,IAAAI;CAAA,IAAAP,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAA/CK,KAAA,oBAAC,MAAD;GAAK,GAAKL;GAAYG,UAAAA;EAAjB,CAAA;EAAkDL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAAvDO;AAAuD;AAGhET,aAAaU,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorRoot.d.ts","names":[],"sources":["../../../src/primitives/error/ErrorRoot.tsx"],"mappings":";;;KAIY,iBAAiB;EAC3B,UAAU;;cAGC;
|
|
1
|
+
{"version":3,"file":"ErrorRoot.d.ts","names":[],"sources":["../../../src/primitives/error/ErrorRoot.tsx"],"mappings":";;;KAIY,iBAAiB;EAC3B,UAAU;;cAGC;KAAyC,aAAA,aAAA,iCAAc,IAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageIf.js","names":["ReactNode","useAuiState","MessageIfProps","children","user","assistant","running","last","MessageIf","t0","$","_c","message","_temp","undefined","role","isRunning","status","type","isLast","t1","s"],"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type MessageIfProps = {\n children: ReactNode;\n user?: boolean | undefined;\n assistant?: boolean | undefined;\n running?: boolean | undefined;\n last?: boolean | undefined;\n};\n\nexport const MessageIf = ({\n children,\n user,\n assistant,\n running,\n last,\n}: MessageIfProps) => {\n const message = useAuiState((s) => s.message);\n\n if (user !== undefined) {\n if (user !== (message.role === \"user\")) return null;\n }\n\n if (assistant !== undefined) {\n if (assistant !== (message.role === \"assistant\")) return null;\n }\n\n if (running !== undefined) {\n const isRunning =\n message.role === \"assistant\" && message.status.type === \"running\";\n if (running !== isRunning) return null;\n }\n\n if (last !== undefined) {\n if (last !== message.isLast) return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;AAWA,MAAaQ,aAAYC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAR,UAAAC,MAAAC,WAAAC,SAAAC,SAAAE;CAOxB,MAAAG,UAAgBX,YAAYY,KAAgB;CAE5C,IAAIT,SAASU,KAAAA;
|
|
1
|
+
{"version":3,"file":"MessageIf.js","names":["ReactNode","useAuiState","MessageIfProps","children","user","assistant","running","last","MessageIf","t0","$","_c","message","_temp","undefined","role","isRunning","status","type","isLast","t1","s"],"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type MessageIfProps = {\n children: ReactNode;\n user?: boolean | undefined;\n assistant?: boolean | undefined;\n running?: boolean | undefined;\n last?: boolean | undefined;\n};\n\nexport const MessageIf = ({\n children,\n user,\n assistant,\n running,\n last,\n}: MessageIfProps) => {\n const message = useAuiState((s) => s.message);\n\n if (user !== undefined) {\n if (user !== (message.role === \"user\")) return null;\n }\n\n if (assistant !== undefined) {\n if (assistant !== (message.role === \"assistant\")) return null;\n }\n\n if (running !== undefined) {\n const isRunning =\n message.role === \"assistant\" && message.status.type === \"running\";\n if (running !== isRunning) return null;\n }\n\n if (last !== undefined) {\n if (last !== message.isLast) return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;AAWA,MAAaQ,aAAYC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAR,UAAAC,MAAAC,WAAAC,SAAAC,SAAAE;CAOxB,MAAAG,UAAgBX,YAAYY,KAAgB;CAE5C,IAAIT,SAASU,KAAAA,GACPV;MAAAA,UAAUQ,QAAOG,SAAU,SAAO,OAAS;CAAA;CAGjD,IAAIV,cAAcS,KAAAA,GACZT;MAAAA,eAAeO,QAAOG,SAAU,cAAY,OAAS;CAAA;CAG3D,IAAIT,YAAYQ,KAAAA,GAGVR;MAAAA,aADFM,QAAOG,SAAU,eAAeH,QAAOK,OAAOC,SAAU,YACjC,OAAS;CAAA;CAGpC,IAAIX,SAASO,KAAAA,GACPP;MAAAA,SAASK,QAAOO,QAAO,OAAS;CAAA;CACrC,IAAAC;CAAA,IAAAV,EAAA,OAAAP,UAAA;EAEMiB,KAAA,oBAAA,UAAA,EAAGjB,SAAQ,CAAA;EAAIO,EAAA,KAAAP;EAAAO,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAAfU;AAAe;AA3BC,SAAAP,MAAAQ,GAAA;CAAA,OAOYA,EAACT;AAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionDescription.js","names":["ReactNode","Text","TextProps","useAuiState","SuggestionDescriptionProps","children","SuggestionDescription","t0","$","_c","textProps","label","_temp","t1","t2","s","suggestion"],"sources":["../../../src/primitives/suggestion/SuggestionDescription.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SuggestionDescriptionProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const SuggestionDescription = ({\n children,\n ...textProps\n}: SuggestionDescriptionProps) => {\n const label = useAuiState((s) => s.suggestion.label);\n\n return <Text {...textProps}>{children ?? label}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,yBAAwBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,aAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CAC3B,MAAAG,QAAcR,YAAYS,KAAyB;CAEtB,MAAAC,KAAAR,YAAAM;CAAiB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAvCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;
|
|
1
|
+
{"version":3,"file":"SuggestionDescription.js","names":["ReactNode","Text","TextProps","useAuiState","SuggestionDescriptionProps","children","SuggestionDescription","t0","$","_c","textProps","label","_temp","t1","t2","s","suggestion"],"sources":["../../../src/primitives/suggestion/SuggestionDescription.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SuggestionDescriptionProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const SuggestionDescription = ({\n children,\n ...textProps\n}: SuggestionDescriptionProps) => {\n const label = useAuiState((s) => s.suggestion.label);\n\n return <Text {...textProps}>{children ?? label}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,yBAAwBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,aAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CAC3B,MAAAG,QAAcR,YAAYS,KAAyB;CAEtB,MAAAC,KAAAR,YAAAM;CAAiB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAvCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAYG,UAAAA;EAAjB,CAAA;EAA0CL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA/CM;AAA+C;AANnB,SAAAF,MAAAG,GAAA;CAAA,OAIFA,EAACC,WAAWL;AAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionTitle.js","names":["ReactNode","Text","TextProps","useAuiState","SuggestionTitleProps","children","SuggestionTitle","t0","$","_c","textProps","title","_temp","t1","t2","s","suggestion"],"sources":["../../../src/primitives/suggestion/SuggestionTitle.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SuggestionTitleProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const SuggestionTitle = ({\n children,\n ...textProps\n}: SuggestionTitleProps) => {\n const title = useAuiState((s) => s.suggestion.title);\n\n return <Text {...textProps}>{children ?? title}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,mBAAkBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,aAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACrB,MAAAG,QAAcR,YAAYS,KAAyB;CAEtB,MAAAC,KAAAR,YAAAM;CAAiB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAvCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;
|
|
1
|
+
{"version":3,"file":"SuggestionTitle.js","names":["ReactNode","Text","TextProps","useAuiState","SuggestionTitleProps","children","SuggestionTitle","t0","$","_c","textProps","title","_temp","t1","t2","s","suggestion"],"sources":["../../../src/primitives/suggestion/SuggestionTitle.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SuggestionTitleProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const SuggestionTitle = ({\n children,\n ...textProps\n}: SuggestionTitleProps) => {\n const title = useAuiState((s) => s.suggestion.title);\n\n return <Text {...textProps}>{children ?? title}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,mBAAkBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,aAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACrB,MAAAG,QAAcR,YAAYS,KAAyB;CAEtB,MAAAC,KAAAR,YAAAM;CAAiB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAvCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAYG,UAAAA;EAAjB,CAAA;EAA0CL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA/CM;AAA+C;AANzB,SAAAF,MAAAG,GAAA;CAAA,OAIIA,EAACC,WAAWL;AAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadIf.js","names":["ReactNode","useAuiState","ThreadIfProps","children","empty","running","ThreadIf","t0","$","_c","thread","_temp","undefined","isEmpty","messages","length","isRunning","t1","s"],"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type ThreadIfProps = {\n children: ReactNode;\n empty?: boolean | undefined;\n running?: boolean | undefined;\n};\n\nexport const ThreadIf = ({ children, empty, running }: ThreadIfProps) => {\n const thread = useAuiState((s) => s.thread);\n\n if (empty !== undefined) {\n const isEmpty = thread.messages.length === 0;\n if (empty !== isEmpty) return null;\n }\n\n if (running !== undefined) {\n if (running !== thread.isRunning) return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;AASA,MAAaM,YAAWC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAN,UAAAC,OAAAC,YAAAE;CACvB,MAAAG,SAAeT,YAAYU,KAAe;CAE1C,IAAIP,UAAUQ,KAAAA;
|
|
1
|
+
{"version":3,"file":"ThreadIf.js","names":["ReactNode","useAuiState","ThreadIfProps","children","empty","running","ThreadIf","t0","$","_c","thread","_temp","undefined","isEmpty","messages","length","isRunning","t1","s"],"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type ThreadIfProps = {\n children: ReactNode;\n empty?: boolean | undefined;\n running?: boolean | undefined;\n};\n\nexport const ThreadIf = ({ children, empty, running }: ThreadIfProps) => {\n const thread = useAuiState((s) => s.thread);\n\n if (empty !== undefined) {\n const isEmpty = thread.messages.length === 0;\n if (empty !== isEmpty) return null;\n }\n\n if (running !== undefined) {\n if (running !== thread.isRunning) return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;AASA,MAAaM,YAAWC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAN,UAAAC,OAAAC,YAAAE;CACvB,MAAAG,SAAeT,YAAYU,KAAe;CAE1C,IAAIP,UAAUQ,KAAAA,GAERR;MAAAA,WADYM,OAAMI,SAASC,WAAY,IACtB,OAAS;CAAA;CAGhC,IAAIV,YAAYO,KAAAA,GACVP;MAAAA,YAAYK,OAAMM,WAAU,OAAS;CAAA;CAC1C,IAAAC;CAAA,IAAAT,EAAA,OAAAL,UAAA;EAEMc,KAAA,oBAAA,UAAA,EAAGd,SAAQ,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAAfS;AAAe;AAZA,SAAAN,MAAAO,GAAA;CAAA,OACYA,EAACR;AAAO"}
|
|
@@ -31,8 +31,17 @@ type MessagesContent = {
|
|
|
31
31
|
}) => ReactNode;
|
|
32
32
|
components?: never;
|
|
33
33
|
};
|
|
34
|
-
type
|
|
35
|
-
|
|
34
|
+
type ThreadMessagesFlatListProps = Omit<FlatListProps<ThreadMessage>, "data" | "renderItem" | "children"> & MessagesContent & {
|
|
35
|
+
autoScroll?: boolean | undefined;
|
|
36
|
+
scrollToBottomOnRunStart?: boolean | undefined;
|
|
37
|
+
scrollToBottomOnInitialize?: boolean | undefined;
|
|
38
|
+
scrollToBottomOnThreadSwitch?: boolean | undefined;
|
|
39
|
+
};
|
|
40
|
+
/** @deprecated Use ThreadMessagesFlatListProps instead. */
|
|
41
|
+
type ThreadMessagesProps = ThreadMessagesFlatListProps;
|
|
42
|
+
declare const ThreadMessagesFlatList: import("react").ForwardRefExoticComponent<ThreadMessagesFlatListProps & import("react").RefAttributes<FlatList<ThreadMessage>>>;
|
|
43
|
+
/** @deprecated Use ThreadPrimitive.MessagesFlatList instead. */
|
|
44
|
+
declare const ThreadMessages: import("react").ForwardRefExoticComponent<ThreadMessagesFlatListProps & import("react").RefAttributes<FlatList<ThreadMessage>>>;
|
|
36
45
|
//#endregion
|
|
37
|
-
export { ThreadMessages, ThreadMessagesProps };
|
|
46
|
+
export { ThreadMessages, ThreadMessagesFlatList, ThreadMessagesFlatListProps, ThreadMessagesProps };
|
|
38
47
|
//# sourceMappingURL=ThreadMessages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadMessages.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ThreadMessages.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"mappings":";;;;KA2BK;EAEC,SAAS;EACT,eAAe;EACf,mBAAmB;EACnB,wBAAwB;EACxB,qBAAqB;EACrB,cAAc;EACd,mBAAmB;EACnB,gBAAgB;;EAGhB,UAAU;EACV,eAAe;EACf,mBAAmB;EACnB,wBAAwB;EACxB,qBAAqB;EACrB,aAAa;EACb,kBAAkB;EAClB,gBAAgB;;KAGjB;;EAGC,YAAY;EACZ;;EAGA,WAAW;IAAS,SAAS;QAAmB;EAChD;;KAGM,8BAA8B,KACxC,cAAc,sDAGd;EACE;EACA;EACA;EACA;;;KAIQ,sBAAsB;cAmRrB,wCAAsB,0BAAA,8CAAA,cAAA,SAAA;;cA4GtB,gCAAc,0BAAA,8CAAA,cAAA,SAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
1
|
+
import { RenderChildrenWithAccessor, useAuiEvent, useAuiState } from "@assistant-ui/store";
|
|
2
2
|
import { MessageByIndexProvider } from "@assistant-ui/core/react";
|
|
3
3
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
4
4
|
import { FlatList } from "react-native";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { forwardRef, memo } from "@assistant-ui/tap/react-shim";
|
|
6
|
+
import { forwardRef, memo, useEffect, useRef } from "@assistant-ui/tap/react-shim";
|
|
7
7
|
//#region src/primitives/thread/ThreadMessages.tsx
|
|
8
8
|
const DEFAULT_SYSTEM_MESSAGE = () => null;
|
|
9
|
+
const AT_BOTTOM_THRESHOLD = 4;
|
|
9
10
|
const getComponent = (components, role, isEditing) => {
|
|
10
11
|
switch (role) {
|
|
11
12
|
case "user": if (isEditing) return components.UserEditComposer ?? components.EditComposer ?? components.UserMessage ?? components.Message;
|
|
@@ -73,27 +74,260 @@ const ThreadMessageByChildren = memo(({ index, children }) => {
|
|
|
73
74
|
});
|
|
74
75
|
}, (prev, next) => prev.index === next.index && prev.children === next.children);
|
|
75
76
|
ThreadMessageByChildren.displayName = "ThreadPrimitive.MessageByChildren";
|
|
76
|
-
const
|
|
77
|
-
|
|
77
|
+
const setForwardedRef = (ref, value) => {
|
|
78
|
+
if (typeof ref === "function") ref(value);
|
|
79
|
+
else if (ref) ref.current = value;
|
|
80
|
+
};
|
|
81
|
+
const useComposedFlatListRef = (forwardedRef) => {
|
|
82
|
+
const $ = c(4);
|
|
83
|
+
const flatListRef = useRef(null);
|
|
84
|
+
let t0;
|
|
85
|
+
if ($[0] !== forwardedRef) {
|
|
86
|
+
t0 = (node) => {
|
|
87
|
+
flatListRef.current = node;
|
|
88
|
+
setForwardedRef(forwardedRef, node);
|
|
89
|
+
};
|
|
90
|
+
$[0] = forwardedRef;
|
|
91
|
+
$[1] = t0;
|
|
92
|
+
} else t0 = $[1];
|
|
93
|
+
const setFlatListRef = t0;
|
|
94
|
+
let t1;
|
|
95
|
+
if ($[2] !== setFlatListRef) {
|
|
96
|
+
t1 = [flatListRef, setFlatListRef];
|
|
97
|
+
$[2] = setFlatListRef;
|
|
98
|
+
$[3] = t1;
|
|
99
|
+
} else t1 = $[3];
|
|
100
|
+
return t1;
|
|
101
|
+
};
|
|
102
|
+
const useThreadMessagesFlatListAutoScroll = (t0) => {
|
|
103
|
+
const $ = c(22);
|
|
104
|
+
const { flatListRef, hasMessages, autoScroll: t1, scrollToBottomOnRunStart: t2, scrollToBottomOnInitialize: t3, scrollToBottomOnThreadSwitch: t4 } = t0;
|
|
105
|
+
const autoScroll = t1 === void 0 ? true : t1;
|
|
106
|
+
const scrollToBottomOnRunStart = t2 === void 0 ? true : t2;
|
|
107
|
+
const scrollToBottomOnInitialize = t3 === void 0 ? true : t3;
|
|
108
|
+
const scrollToBottomOnThreadSwitch = t4 === void 0 ? true : t4;
|
|
109
|
+
let t5;
|
|
110
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
111
|
+
t5 = {
|
|
112
|
+
contentHeight: 0,
|
|
113
|
+
viewportHeight: 0,
|
|
114
|
+
scrollY: 0
|
|
115
|
+
};
|
|
116
|
+
$[0] = t5;
|
|
117
|
+
} else t5 = $[0];
|
|
118
|
+
const metricsRef = useRef(t5);
|
|
119
|
+
const isAtBottomRef = useRef(true);
|
|
120
|
+
const lastScrollEventYRef = useRef(0);
|
|
121
|
+
const initializeScrollRequestedRef = useRef(false);
|
|
122
|
+
const pendingScrollToBottomRef = useRef(false);
|
|
123
|
+
let t6;
|
|
124
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
125
|
+
t6 = () => {
|
|
126
|
+
const { contentHeight, scrollY, viewportHeight } = metricsRef.current;
|
|
127
|
+
isAtBottomRef.current = contentHeight <= viewportHeight || contentHeight - scrollY - viewportHeight <= AT_BOTTOM_THRESHOLD;
|
|
128
|
+
};
|
|
129
|
+
$[1] = t6;
|
|
130
|
+
} else t6 = $[1];
|
|
131
|
+
const updateIsAtBottom = t6;
|
|
132
|
+
let t7;
|
|
133
|
+
if ($[2] !== flatListRef) {
|
|
134
|
+
t7 = (animated) => {
|
|
135
|
+
const { contentHeight: contentHeight_0, viewportHeight: viewportHeight_0 } = metricsRef.current;
|
|
136
|
+
metricsRef.current.scrollY = Math.max(0, contentHeight_0 - viewportHeight_0);
|
|
137
|
+
isAtBottomRef.current = true;
|
|
138
|
+
flatListRef.current?.scrollToEnd({ animated });
|
|
139
|
+
};
|
|
140
|
+
$[2] = flatListRef;
|
|
141
|
+
$[3] = t7;
|
|
142
|
+
} else t7 = $[3];
|
|
143
|
+
const scrollToBottom = t7;
|
|
144
|
+
let t8;
|
|
145
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
146
|
+
t8 = (event) => {
|
|
147
|
+
metricsRef.current.viewportHeight = event.nativeEvent.layout.height;
|
|
148
|
+
updateIsAtBottom();
|
|
149
|
+
};
|
|
150
|
+
$[4] = t8;
|
|
151
|
+
} else t8 = $[4];
|
|
152
|
+
const handleLayout = t8;
|
|
153
|
+
let t9;
|
|
154
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
155
|
+
t9 = (event_0) => {
|
|
156
|
+
const { contentOffset, contentSize, layoutMeasurement } = event_0.nativeEvent;
|
|
157
|
+
const previousEventY = lastScrollEventYRef.current;
|
|
158
|
+
const wasPinnedToBottom = isAtBottomRef.current;
|
|
159
|
+
lastScrollEventYRef.current = contentOffset.y;
|
|
160
|
+
metricsRef.current = {
|
|
161
|
+
contentHeight: contentSize.height,
|
|
162
|
+
viewportHeight: layoutMeasurement.height,
|
|
163
|
+
scrollY: contentOffset.y
|
|
164
|
+
};
|
|
165
|
+
updateIsAtBottom();
|
|
166
|
+
const upwardMove = contentOffset.y < previousEventY;
|
|
167
|
+
if (wasPinnedToBottom && !upwardMove) isAtBottomRef.current = true;
|
|
168
|
+
if (!isAtBottomRef.current && upwardMove) pendingScrollToBottomRef.current = false;
|
|
169
|
+
};
|
|
170
|
+
$[5] = t9;
|
|
171
|
+
} else t9 = $[5];
|
|
172
|
+
const handleScroll = t9;
|
|
173
|
+
let t10;
|
|
174
|
+
if ($[6] !== autoScroll || $[7] !== scrollToBottom) {
|
|
175
|
+
t10 = (_width, height) => {
|
|
176
|
+
const metrics = metricsRef.current;
|
|
177
|
+
const previousContentHeight = metrics.contentHeight;
|
|
178
|
+
const wasAtBottom = isAtBottomRef.current;
|
|
179
|
+
metrics.contentHeight = height;
|
|
180
|
+
updateIsAtBottom();
|
|
181
|
+
const pendingScroll = pendingScrollToBottomRef.current;
|
|
182
|
+
if (pendingScroll) {
|
|
183
|
+
pendingScrollToBottomRef.current = false;
|
|
184
|
+
scrollToBottom(pendingScroll.animated);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (!autoScroll) return;
|
|
188
|
+
if (!wasAtBottom) return;
|
|
189
|
+
if (previousContentHeight === 0) return;
|
|
190
|
+
if (height <= previousContentHeight) return;
|
|
191
|
+
scrollToBottom(false);
|
|
192
|
+
};
|
|
193
|
+
$[6] = autoScroll;
|
|
194
|
+
$[7] = scrollToBottom;
|
|
195
|
+
$[8] = t10;
|
|
196
|
+
} else t10 = $[8];
|
|
197
|
+
const handleContentSizeChange = t10;
|
|
198
|
+
let t11;
|
|
199
|
+
let t12;
|
|
200
|
+
if ($[9] !== hasMessages || $[10] !== scrollToBottom || $[11] !== scrollToBottomOnInitialize) {
|
|
201
|
+
t11 = () => {
|
|
202
|
+
if (!scrollToBottomOnInitialize) return;
|
|
203
|
+
if (!hasMessages) {
|
|
204
|
+
initializeScrollRequestedRef.current = false;
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (initializeScrollRequestedRef.current) return;
|
|
208
|
+
initializeScrollRequestedRef.current = true;
|
|
209
|
+
pendingScrollToBottomRef.current = { animated: false };
|
|
210
|
+
scrollToBottom(false);
|
|
211
|
+
};
|
|
212
|
+
t12 = [
|
|
213
|
+
hasMessages,
|
|
214
|
+
scrollToBottom,
|
|
215
|
+
scrollToBottomOnInitialize
|
|
216
|
+
];
|
|
217
|
+
$[9] = hasMessages;
|
|
218
|
+
$[10] = scrollToBottom;
|
|
219
|
+
$[11] = scrollToBottomOnInitialize;
|
|
220
|
+
$[12] = t11;
|
|
221
|
+
$[13] = t12;
|
|
222
|
+
} else {
|
|
223
|
+
t11 = $[12];
|
|
224
|
+
t12 = $[13];
|
|
225
|
+
}
|
|
226
|
+
useEffect(t11, t12);
|
|
227
|
+
let t13;
|
|
228
|
+
if ($[14] !== scrollToBottom || $[15] !== scrollToBottomOnRunStart) {
|
|
229
|
+
t13 = () => {
|
|
230
|
+
if (!scrollToBottomOnRunStart) return;
|
|
231
|
+
pendingScrollToBottomRef.current = { animated: true };
|
|
232
|
+
scrollToBottom(true);
|
|
233
|
+
};
|
|
234
|
+
$[14] = scrollToBottom;
|
|
235
|
+
$[15] = scrollToBottomOnRunStart;
|
|
236
|
+
$[16] = t13;
|
|
237
|
+
} else t13 = $[16];
|
|
238
|
+
useAuiEvent("thread.runStart", t13);
|
|
239
|
+
let t14;
|
|
240
|
+
if ($[17] !== scrollToBottom || $[18] !== scrollToBottomOnThreadSwitch) {
|
|
241
|
+
t14 = () => {
|
|
242
|
+
if (!scrollToBottomOnThreadSwitch) return;
|
|
243
|
+
initializeScrollRequestedRef.current = false;
|
|
244
|
+
lastScrollEventYRef.current = 0;
|
|
245
|
+
pendingScrollToBottomRef.current = { animated: false };
|
|
246
|
+
scrollToBottom(false);
|
|
247
|
+
};
|
|
248
|
+
$[17] = scrollToBottom;
|
|
249
|
+
$[18] = scrollToBottomOnThreadSwitch;
|
|
250
|
+
$[19] = t14;
|
|
251
|
+
} else t14 = $[19];
|
|
252
|
+
useAuiEvent("threadListItem.switchedTo", t14);
|
|
253
|
+
let t15;
|
|
254
|
+
if ($[20] !== handleContentSizeChange) {
|
|
255
|
+
t15 = {
|
|
256
|
+
handleLayout,
|
|
257
|
+
handleScroll,
|
|
258
|
+
handleContentSizeChange
|
|
259
|
+
};
|
|
260
|
+
$[20] = handleContentSizeChange;
|
|
261
|
+
$[21] = t15;
|
|
262
|
+
} else t15 = $[21];
|
|
263
|
+
return t15;
|
|
264
|
+
};
|
|
265
|
+
const ThreadMessagesFlatList = forwardRef((t0, forwardedRef) => {
|
|
266
|
+
const $ = c(46);
|
|
267
|
+
let autoScroll;
|
|
78
268
|
let children;
|
|
79
269
|
let components;
|
|
80
270
|
let flatListProps;
|
|
271
|
+
let onContentSizeChange;
|
|
272
|
+
let onLayout;
|
|
273
|
+
let onScroll;
|
|
274
|
+
let scrollEventThrottle;
|
|
275
|
+
let scrollToBottomOnInitialize;
|
|
276
|
+
let scrollToBottomOnRunStart;
|
|
277
|
+
let scrollToBottomOnThreadSwitch;
|
|
81
278
|
if ($[0] !== t0) {
|
|
82
|
-
({components, children, ...flatListProps} = t0);
|
|
279
|
+
({autoScroll, components, children, onContentSizeChange, onLayout, onScroll, scrollEventThrottle, scrollToBottomOnInitialize, scrollToBottomOnRunStart, scrollToBottomOnThreadSwitch, ...flatListProps} = t0);
|
|
83
280
|
$[0] = t0;
|
|
84
|
-
$[1] =
|
|
85
|
-
$[2] =
|
|
86
|
-
$[3] =
|
|
281
|
+
$[1] = autoScroll;
|
|
282
|
+
$[2] = children;
|
|
283
|
+
$[3] = components;
|
|
284
|
+
$[4] = flatListProps;
|
|
285
|
+
$[5] = onContentSizeChange;
|
|
286
|
+
$[6] = onLayout;
|
|
287
|
+
$[7] = onScroll;
|
|
288
|
+
$[8] = scrollEventThrottle;
|
|
289
|
+
$[9] = scrollToBottomOnInitialize;
|
|
290
|
+
$[10] = scrollToBottomOnRunStart;
|
|
291
|
+
$[11] = scrollToBottomOnThreadSwitch;
|
|
87
292
|
} else {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
293
|
+
autoScroll = $[1];
|
|
294
|
+
children = $[2];
|
|
295
|
+
components = $[3];
|
|
296
|
+
flatListProps = $[4];
|
|
297
|
+
onContentSizeChange = $[5];
|
|
298
|
+
onLayout = $[6];
|
|
299
|
+
onScroll = $[7];
|
|
300
|
+
scrollEventThrottle = $[8];
|
|
301
|
+
scrollToBottomOnInitialize = $[9];
|
|
302
|
+
scrollToBottomOnRunStart = $[10];
|
|
303
|
+
scrollToBottomOnThreadSwitch = $[11];
|
|
91
304
|
}
|
|
92
305
|
const messages = useAuiState(_temp3);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
306
|
+
const [flatListRef, setFlatListRef] = useComposedFlatListRef(forwardedRef);
|
|
307
|
+
const t1 = messages.length > 0;
|
|
308
|
+
let t2;
|
|
309
|
+
if ($[12] !== autoScroll || $[13] !== flatListRef || $[14] !== scrollToBottomOnInitialize || $[15] !== scrollToBottomOnRunStart || $[16] !== scrollToBottomOnThreadSwitch || $[17] !== t1) {
|
|
310
|
+
t2 = {
|
|
311
|
+
flatListRef,
|
|
312
|
+
hasMessages: t1,
|
|
313
|
+
autoScroll,
|
|
314
|
+
scrollToBottomOnInitialize,
|
|
315
|
+
scrollToBottomOnRunStart,
|
|
316
|
+
scrollToBottomOnThreadSwitch
|
|
317
|
+
};
|
|
318
|
+
$[12] = autoScroll;
|
|
319
|
+
$[13] = flatListRef;
|
|
320
|
+
$[14] = scrollToBottomOnInitialize;
|
|
321
|
+
$[15] = scrollToBottomOnRunStart;
|
|
322
|
+
$[16] = scrollToBottomOnThreadSwitch;
|
|
323
|
+
$[17] = t1;
|
|
324
|
+
$[18] = t2;
|
|
325
|
+
} else t2 = $[18];
|
|
326
|
+
const { handleContentSizeChange: handleAutoScrollContentSizeChange, handleLayout: handleAutoScrollLayout, handleScroll: handleAutoScrollScroll } = useThreadMessagesFlatListAutoScroll(t2);
|
|
327
|
+
let t3;
|
|
328
|
+
if ($[19] !== children || $[20] !== components) {
|
|
329
|
+
t3 = (t4) => {
|
|
330
|
+
const { index } = t4;
|
|
97
331
|
if (children) return /* @__PURE__ */ jsx(ThreadMessageByChildren, {
|
|
98
332
|
index,
|
|
99
333
|
children
|
|
@@ -103,29 +337,136 @@ const ThreadMessages = forwardRef((t0, ref) => {
|
|
|
103
337
|
components
|
|
104
338
|
});
|
|
105
339
|
};
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
} else
|
|
110
|
-
const renderItem =
|
|
340
|
+
$[19] = children;
|
|
341
|
+
$[20] = components;
|
|
342
|
+
$[21] = t3;
|
|
343
|
+
} else t3 = $[21];
|
|
344
|
+
const renderItem = t3;
|
|
111
345
|
const keyExtractor = _temp4;
|
|
112
|
-
const
|
|
113
|
-
let
|
|
114
|
-
if ($[
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
346
|
+
const scrollTracking = (autoScroll ?? true) || (scrollToBottomOnInitialize ?? true) || (scrollToBottomOnRunStart ?? true) || (scrollToBottomOnThreadSwitch ?? true);
|
|
347
|
+
let t4;
|
|
348
|
+
if ($[22] !== handleAutoScrollLayout || $[23] !== onLayout) {
|
|
349
|
+
t4 = (event) => {
|
|
350
|
+
handleAutoScrollLayout(event);
|
|
351
|
+
onLayout?.(event);
|
|
352
|
+
};
|
|
353
|
+
$[22] = handleAutoScrollLayout;
|
|
354
|
+
$[23] = onLayout;
|
|
355
|
+
$[24] = t4;
|
|
356
|
+
} else t4 = $[24];
|
|
357
|
+
const handleLayout = t4;
|
|
358
|
+
let t5;
|
|
359
|
+
if ($[25] !== handleAutoScrollScroll || $[26] !== onScroll) {
|
|
360
|
+
t5 = (event_0) => {
|
|
361
|
+
handleAutoScrollScroll(event_0);
|
|
362
|
+
onScroll?.(event_0);
|
|
363
|
+
};
|
|
364
|
+
$[25] = handleAutoScrollScroll;
|
|
365
|
+
$[26] = onScroll;
|
|
366
|
+
$[27] = t5;
|
|
367
|
+
} else t5 = $[27];
|
|
368
|
+
const handleScroll = t5;
|
|
369
|
+
let t6;
|
|
370
|
+
if ($[28] !== handleAutoScrollContentSizeChange || $[29] !== onContentSizeChange) {
|
|
371
|
+
t6 = (width, height) => {
|
|
372
|
+
handleAutoScrollContentSizeChange(width, height);
|
|
373
|
+
onContentSizeChange?.(width, height);
|
|
374
|
+
};
|
|
375
|
+
$[28] = handleAutoScrollContentSizeChange;
|
|
376
|
+
$[29] = onContentSizeChange;
|
|
377
|
+
$[30] = t6;
|
|
378
|
+
} else t6 = $[30];
|
|
379
|
+
const handleContentSizeChange = t6;
|
|
380
|
+
const t7 = messages;
|
|
381
|
+
let t8;
|
|
382
|
+
if ($[31] !== handleContentSizeChange || $[32] !== handleLayout || $[33] !== handleScroll || $[34] !== onContentSizeChange || $[35] !== onLayout || $[36] !== onScroll || $[37] !== scrollEventThrottle || $[38] !== scrollTracking) {
|
|
383
|
+
t8 = scrollTracking ? {
|
|
384
|
+
onContentSizeChange: handleContentSizeChange,
|
|
385
|
+
onLayout: handleLayout,
|
|
386
|
+
onScroll: handleScroll,
|
|
387
|
+
scrollEventThrottle: scrollEventThrottle ?? 16
|
|
388
|
+
} : {
|
|
389
|
+
...onContentSizeChange && { onContentSizeChange },
|
|
390
|
+
...onLayout && { onLayout },
|
|
391
|
+
...onScroll && { onScroll },
|
|
392
|
+
...scrollEventThrottle !== void 0 && { scrollEventThrottle }
|
|
393
|
+
};
|
|
394
|
+
$[31] = handleContentSizeChange;
|
|
395
|
+
$[32] = handleLayout;
|
|
396
|
+
$[33] = handleScroll;
|
|
397
|
+
$[34] = onContentSizeChange;
|
|
398
|
+
$[35] = onLayout;
|
|
399
|
+
$[36] = onScroll;
|
|
400
|
+
$[37] = scrollEventThrottle;
|
|
401
|
+
$[38] = scrollTracking;
|
|
402
|
+
$[39] = t8;
|
|
403
|
+
} else t8 = $[39];
|
|
404
|
+
let t9;
|
|
405
|
+
if ($[40] !== flatListProps || $[41] !== renderItem || $[42] !== setFlatListRef || $[43] !== t7 || $[44] !== t8) {
|
|
406
|
+
t9 = /* @__PURE__ */ jsx(FlatList, {
|
|
407
|
+
ref: setFlatListRef,
|
|
408
|
+
data: t7,
|
|
118
409
|
renderItem,
|
|
119
410
|
keyExtractor,
|
|
411
|
+
...t8,
|
|
120
412
|
...flatListProps
|
|
121
413
|
});
|
|
122
|
-
$[
|
|
414
|
+
$[40] = flatListProps;
|
|
415
|
+
$[41] = renderItem;
|
|
416
|
+
$[42] = setFlatListRef;
|
|
417
|
+
$[43] = t7;
|
|
418
|
+
$[44] = t8;
|
|
419
|
+
$[45] = t9;
|
|
420
|
+
} else t9 = $[45];
|
|
421
|
+
return t9;
|
|
422
|
+
});
|
|
423
|
+
ThreadMessagesFlatList.displayName = "ThreadPrimitive.MessagesFlatList";
|
|
424
|
+
/** @deprecated Use ThreadPrimitive.MessagesFlatList instead. */
|
|
425
|
+
const ThreadMessages = forwardRef((t0, ref) => {
|
|
426
|
+
const $ = c(13);
|
|
427
|
+
let props;
|
|
428
|
+
let t1;
|
|
429
|
+
let t2;
|
|
430
|
+
let t3;
|
|
431
|
+
let t4;
|
|
432
|
+
if ($[0] !== t0) {
|
|
433
|
+
({autoScroll: t1, scrollToBottomOnInitialize: t2, scrollToBottomOnRunStart: t3, scrollToBottomOnThreadSwitch: t4, ...props} = t0);
|
|
434
|
+
$[0] = t0;
|
|
435
|
+
$[1] = props;
|
|
436
|
+
$[2] = t1;
|
|
437
|
+
$[3] = t2;
|
|
438
|
+
$[4] = t3;
|
|
439
|
+
$[5] = t4;
|
|
440
|
+
} else {
|
|
441
|
+
props = $[1];
|
|
442
|
+
t1 = $[2];
|
|
443
|
+
t2 = $[3];
|
|
444
|
+
t3 = $[4];
|
|
445
|
+
t4 = $[5];
|
|
446
|
+
}
|
|
447
|
+
const autoScroll = t1 === void 0 ? false : t1;
|
|
448
|
+
const scrollToBottomOnInitialize = t2 === void 0 ? false : t2;
|
|
449
|
+
const scrollToBottomOnRunStart = t3 === void 0 ? false : t3;
|
|
450
|
+
const scrollToBottomOnThreadSwitch = t4 === void 0 ? false : t4;
|
|
451
|
+
let t5;
|
|
452
|
+
if ($[6] !== autoScroll || $[7] !== props || $[8] !== ref || $[9] !== scrollToBottomOnInitialize || $[10] !== scrollToBottomOnRunStart || $[11] !== scrollToBottomOnThreadSwitch) {
|
|
453
|
+
t5 = /* @__PURE__ */ jsx(ThreadMessagesFlatList, {
|
|
454
|
+
ref,
|
|
455
|
+
autoScroll,
|
|
456
|
+
scrollToBottomOnInitialize,
|
|
457
|
+
scrollToBottomOnRunStart,
|
|
458
|
+
scrollToBottomOnThreadSwitch,
|
|
459
|
+
...props
|
|
460
|
+
});
|
|
461
|
+
$[6] = autoScroll;
|
|
462
|
+
$[7] = props;
|
|
123
463
|
$[8] = ref;
|
|
124
|
-
$[9] =
|
|
125
|
-
$[10] =
|
|
126
|
-
$[11] =
|
|
127
|
-
|
|
128
|
-
|
|
464
|
+
$[9] = scrollToBottomOnInitialize;
|
|
465
|
+
$[10] = scrollToBottomOnRunStart;
|
|
466
|
+
$[11] = scrollToBottomOnThreadSwitch;
|
|
467
|
+
$[12] = t5;
|
|
468
|
+
} else t5 = $[12];
|
|
469
|
+
return t5;
|
|
129
470
|
});
|
|
130
471
|
ThreadMessages.displayName = "ThreadPrimitive.Messages";
|
|
131
472
|
function _temp(s) {
|
|
@@ -141,6 +482,6 @@ function _temp4(item) {
|
|
|
141
482
|
return item.id;
|
|
142
483
|
}
|
|
143
484
|
//#endregion
|
|
144
|
-
export { ThreadMessages };
|
|
485
|
+
export { ThreadMessages, ThreadMessagesFlatList };
|
|
145
486
|
|
|
146
487
|
//# sourceMappingURL=ThreadMessages.js.map
|