Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions packages/tds-widget/src/chat/bubble/bubble-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { ProductBubble } from './product'
import AlteredBubble from './altered'
import { ALTERNATIVE_TEXT_MESSAGE } from './constants'
import { ParentMessageUIProp } from './parent/parent-ui'
import { ParentMessageUIProp } from './parent'

export const BubbleTypeArray = ['text', 'images', 'rich', 'product'] as const

Expand Down Expand Up @@ -81,9 +81,15 @@ export type BubbleUIProps = (
mediaUrlBase?: string
hasArrow?: boolean
alteredTextColor?: string
fullTextViewAvailable?: boolean

onOpenMenu?: () => void
}
} & Pick<
TextBubbleProp,
| 'fullTextViewAvailable'
| 'isFullTextViewOpen'
| 'openFullTextView'
| 'closeFullTextView'
>

export default function BubbleUI({
type,
Expand All @@ -109,6 +115,9 @@ export default function BubbleUI({
hasArrow,
alteredTextColor,
fullTextViewAvailable = false,
isFullTextViewOpen,
openFullTextView,
closeFullTextView,
onOpenMenu,
...props
}: BubbleUIProps) {
Expand Down Expand Up @@ -145,6 +154,9 @@ export default function BubbleUI({
onOpenMenu={onOpenMenu}
hasArrow={hasArrow}
fullTextViewAvailable={fullTextViewAvailable}
isFullTextViewOpen={isFullTextViewOpen}
openFullTextView={openFullTextView}
closeFullTextView={closeFullTextView}
onParentMessageClick={onParentMessageClick}
{...props}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/tds-widget/src/chat/bubble/bubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useLongPress } from 'use-long-press'
import { Text } from '@titicaca/tds-ui'

import { BubbleCSSProp, BubbleProp } from './type'
import ParentMessageUI, { ParentMessageUIProp } from './parent/parent-ui'
import ParentMessageUI, { ParentMessageUIProp } from './parent'

const StyledBubble = styled(Text).attrs({
textAlign: 'left',
Expand Down
2 changes: 2 additions & 0 deletions packages/tds-widget/src/chat/bubble/parent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from './parent-ui'
export type { ParentMessageUIProp } from './parent-ui'
4 changes: 2 additions & 2 deletions packages/tds-widget/src/chat/bubble/parent/parent-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ interface ParentMessageInterface {
id: string
sender: UserInterface
}
export interface TextParentMessage extends ParentMessageInterface {
interface TextParentMessage extends ParentMessageInterface {
type: 'text'
value: {
message: string
}
}

export interface ImageParentMessage extends ParentMessageInterface {
interface ImageParentMessage extends ParentMessageInterface {
type: 'image'
value: {
images: MetaDataInterface[]
Expand Down
10 changes: 7 additions & 3 deletions packages/tds-widget/src/chat/bubble/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export function TextBubble({
}: TextBubbleProp) {
const aTagNavigator = useATagNavigator(onLinkClick)
const isEllipsis =
fullTextViewAvailable && message.length > MAX_VIEWABLE_TEXT_LENGTH
fullTextViewAvailable &&
openFullTextView &&
message.length > MAX_VIEWABLE_TEXT_LENGTH

return (
<>
Expand All @@ -64,7 +66,7 @@ export function TextBubble({
onClick={(e) => aTagNavigator(e)}
/>
{isEllipsis ? (
<FullTextViewButton my={my} onClick={openFullTextView}>
<FullTextViewButton my={my} onClick={() => openFullTextView?.(id)}>
전체보기
<ArrowRight
color={my ? 'var(--color-white900)' : 'var(--color-gray500)'}
Expand All @@ -74,7 +76,9 @@ export function TextBubble({
) : null}
</Bubble>

{isFullTextViewOpen && closeFullTextView ? (
{fullTextViewAvailable &&
closeFullTextView &&
isFullTextViewOpen?.(id) ? (
<FullTextMessageView
open
onClose={closeFullTextView}
Expand Down
6 changes: 3 additions & 3 deletions packages/tds-widget/src/chat/bubble/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CSSProp } from 'styled-components'

import { MetaDataInterface } from '../types'

import { ParentMessageUIProp } from './parent/parent-ui'
import { ParentMessageUIProp } from './parent'

type CustomerBookingStatus =
| 'BOOKED'
Expand Down Expand Up @@ -75,8 +75,8 @@ export type TextBubbleProp = {
created?: boolean
fullTextViewAvailable?: boolean
onOpenMenu?: () => void
isFullTextViewOpen?: boolean
openFullTextView?: () => void
isFullTextViewOpen?: (id: string) => boolean
openFullTextView?: (id: string) => void
closeFullTextView?: () => void
onParentMessageClick?: (id: string) => void
onLinkClick?: (href: string) => void
Expand Down