@razorpay/blade 12.89.1 → 12.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/web/development/_virtual/cloneDeep.js +1 -1
- package/build/lib/web/development/_virtual/cloneDeep3.js +1 -1
- package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js +6 -1
- package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
- package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js +10 -2
- package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js.map +1 -1
- package/build/lib/web/development/components/ChatMessage/DefaultMessageBubble.web.js +26 -7
- package/build/lib/web/development/components/ChatMessage/DefaultMessageBubble.web.js.map +1 -1
- package/build/lib/web/development/components/ChatMessage/ReasoningTraces.web.js +378 -0
- package/build/lib/web/development/components/ChatMessage/ReasoningTraces.web.js.map +1 -0
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
- package/build/lib/web/production/_virtual/flatten.js +1 -1
- package/build/lib/web/production/_virtual/flatten3.js +1 -1
- package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js +6 -1
- package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
- package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js +10 -2
- package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js.map +1 -1
- package/build/lib/web/production/components/ChatMessage/DefaultMessageBubble.web.js +26 -7
- package/build/lib/web/production/components/ChatMessage/DefaultMessageBubble.web.js.map +1 -1
- package/build/lib/web/production/components/ChatMessage/ReasoningTraces.web.js +378 -0
- package/build/lib/web/production/components/ChatMessage/ReasoningTraces.web.js.map +1 -0
- package/build/lib/web/production/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/types/components/index.d.ts +41 -0
- package/build/types/components/index.native.d.ts +41 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../node_modules/es-toolkit/dist/object/cloneDeep.js';
|
|
1
|
+
import '../node_modules/es-toolkit/dist/compat/object/cloneDeep.js';
|
|
2
2
|
//# sourceMappingURL=cloneDeep.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../node_modules/es-toolkit/dist/
|
|
1
|
+
import '../node_modules/es-toolkit/dist/object/cloneDeep.js';
|
|
2
2
|
//# sourceMappingURL=cloneDeep3.js.map
|
|
@@ -515,7 +515,12 @@ var _ChartDonut = function _ChartDonut(_ref3) {
|
|
|
515
515
|
fill: "transparent",
|
|
516
516
|
legendType: "none",
|
|
517
517
|
tooltipType: "none",
|
|
518
|
-
paddingAngle: 1.5
|
|
518
|
+
paddingAngle: 1.5
|
|
519
|
+
// ToolTip is already disabled here.. need to disable pointer events to prevent the tooltip from being shown when the user hovers over the donut chart in some cases
|
|
520
|
+
,
|
|
521
|
+
style: {
|
|
522
|
+
pointerEvents: 'none'
|
|
523
|
+
},
|
|
519
524
|
children: modifiedExternalDonutChildren
|
|
520
525
|
}))]
|
|
521
526
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DonutChart.web.js","sources":["../../../../../../../src/components/Charts/DonutChart/DonutChart.web.tsx"],"sourcesContent":["import React, { isValidElement, useMemo, useState, useRef, useEffect } from 'react';\nimport {\n PieChart as RechartsPieChart,\n Pie as RechartsPie,\n Cell as RechartsCell,\n ResponsiveContainer as RechartsResponsiveContainer,\n Label,\n} from 'recharts';\nimport {\n useChartsColorTheme,\n getHighestColorInRange,\n sanitizeString,\n assignDataColorMapping,\n} from '../utils';\nimport { componentId as commonChartComponentId } from '../CommonChartComponents/tokens';\nimport {\n CommonChartComponentsContext,\n useCommonChartComponentsContext,\n} from '../CommonChartComponents';\nimport type { DataColorMapping } from '../CommonChartComponents/types';\nimport type {\n ChartDonutWrapperProps,\n ChartDonutCellProps,\n ChartDonutProps,\n ChartRadius,\n} from './types';\nimport {\n RADIUS_MAPPING,\n BASE_CONTAINER_SIZE,\n START_AND_END_ANGLES,\n componentId,\n LABEL_DISTANCE_FROM_CENTER,\n LABEL_FONT_STYLES,\n} from './tokens';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\n\n// Context to share container dimensions for responsive radius calculation\ntype DonutContainerContextType = {\n containerWidth: number;\n containerHeight: number;\n};\n\nconst DonutContainerContext = React.createContext<DonutContainerContextType>({\n containerWidth: 0,\n containerHeight: 0,\n});\n\n// Helper to calculate scaled radius based on container size\nconst getScaledRadius = (\n baseRadius: number,\n containerSize: number,\n baseContainerSize: number,\n): number => {\n if (containerSize <= 0) return baseRadius;\n // Scale the radius proportionally, but cap it at the base value\n const scaleFactor = Math.min(containerSize / baseContainerSize, 1);\n return Math.round(baseRadius * scaleFactor);\n};\n\n// Cell component\nconst _Cell: React.FC<ChartDonutCellProps> = ({ ...rest }) => {\n return <RechartsCell {...rest} />;\n};\n\nconst ChartDonutCell = assignWithoutSideEffects(_Cell, {\n componentId: componentId.cell,\n});\n\nconst getTranslate = (\n legendLayout: 'horizontal' | 'vertical',\n legendAlignment: 'left' | 'right',\n legendWidth: number,\n legendHeight: number,\n): string => {\n if (legendLayout === 'vertical') {\n return `translate(calc(-50% + ${\n legendAlignment === 'right' ? -legendWidth / 2 : legendWidth / 2\n }px) , calc(-50%))`;\n }\n return `translate(-50%, calc(-50% - ${legendHeight / 2}px))`;\n};\n\n/**\n * Gets the item name from data based on nameKey.\n * nameKey can be a string (used as property key) or a function (called with data item).\n */\nconst getItemName = (\n item: Record<string, unknown> | undefined,\n nameKey: ChartDonutProps['nameKey'],\n): unknown => {\n if (!item) return undefined;\n if (!nameKey) return item.name;\n if (typeof nameKey === 'function') return nameKey(item);\n return item[nameKey];\n};\n\nconst ChartDonutWrapper: React.FC<ChartDonutWrapperProps & TestID & DataAnalyticsAttribute> = ({\n children,\n content,\n testID,\n ...restProps\n}) => {\n const { theme } = useTheme();\n // State to track which data keys are currently selected (visible)\n const [selectedDataKeys, setSelectedDataKeys] = useState<string[] | undefined>(undefined);\n\n const colorTheme = useMemo(() => {\n if (Array.isArray(children)) {\n const donutChild = children.find((child) => getComponentId(child) === componentId.chartDonut);\n if (!donutChild || !isValidElement(donutChild)) {\n return 'categorical';\n }\n return donutChild?.props?.colorTheme || 'categorical';\n }\n return 'categorical';\n }, [children]);\n\n const themeColors = useChartsColorTheme({\n colorTheme,\n chartName: 'donut',\n });\n const [legendHeight, setLegendHeight] = useState(0);\n const [legendWidth, setLegendWidth] = useState(0);\n const [containerDimensions, setContainerDimensions] = useState({ width: 0, height: 0 });\n const chartRef = useRef<HTMLDivElement>(null);\n const isValuePresentInContent = content && typeof content === 'object' && 'value' in content;\n const isLabelPresentInContent = content && typeof content === 'object' && 'label' in content;\n\n useEffect(() => {\n const mutationObserver = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'childList') {\n const legendWrapper = chartRef.current?.querySelector('.recharts-legend-wrapper');\n if (legendWrapper) {\n const height = legendWrapper.getBoundingClientRect().height;\n const width = legendWrapper.getBoundingClientRect().width;\n setLegendHeight(height);\n setLegendWidth(width);\n }\n }\n });\n });\n\n // ResizeObserver to track container dimensions for responsive radius\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n setContainerDimensions({ width, height });\n }\n });\n\n if (chartRef.current) {\n mutationObserver.observe(chartRef.current, { childList: true, subtree: true });\n resizeObserver.observe(chartRef.current);\n }\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n };\n }, []);\n\n const pieChartRadius: ChartRadius = useMemo(() => {\n if (Array.isArray(children)) {\n const donutChild = children.find((child) => getComponentId(child) === componentId.chartDonut);\n if (!donutChild || !isValidElement(donutChild)) {\n return 'medium';\n }\n return donutChild?.props?.radius || 'medium';\n }\n return 'medium';\n }, [children]);\n\n const legendLayout = useMemo(() => {\n if (Array.isArray(children)) {\n const legendChild = children.find(\n (child) => getComponentId(child) === commonChartComponentId.chartLegend,\n );\n if (!legendChild || !isValidElement(legendChild)) {\n return 'horizontal';\n }\n return legendChild?.props?.layout || 'horizontal';\n }\n return 'horizontal';\n }, [children]);\n\n const legendAlignment = useMemo(() => {\n if (Array.isArray(children)) {\n const legendChild = children.find(\n (child) => getComponentId(child) === commonChartComponentId.chartLegend,\n );\n if (!legendChild || !isValidElement(legendChild)) {\n return 'right';\n }\n return legendChild?.props?.align || 'right';\n }\n return 'right';\n }, [children]);\n /**\n * We need to check child of ChartDonutWrapper. if they have any custom color we store that.\n * We need these mapping because colors of tooltip & legend is determine based on this\n * recharts do provide a color but it is hex code and we need blade color token .\n */\n\n const dataColorMapping = useMemo(() => {\n const dataColorMapping: DataColorMapping = {};\n if (Array.isArray(children)) {\n children.forEach((child) => {\n if (getComponentId(child) === componentId.chartDonut) {\n const data = (child as React.ReactElement<ChartDonutProps>).props.data;\n const nameKey = (child as React.ReactElement<ChartDonutProps>).props.nameKey;\n // Donut Chart can also have <Cell/> which will come under donutChildren.\n const donutChildren = (child as React.ReactElement<ChartDonutProps>).props.children;\n if (Array.isArray(donutChildren)) {\n donutChildren.forEach((child, index) => {\n const itemName = getItemName(data[index], nameKey);\n if (getComponentId(child) === componentId.cell && itemName) {\n // assign colors to the dataColorMapping, if no color is assigned we assign color in `assignDataColorMapping`\n\n dataColorMapping[sanitizeString(itemName as string)] = {\n colorToken: child.props?.color,\n isCustomColor: Boolean(child.props?.color),\n };\n }\n });\n } else {\n // if we don't have cell as child component then we can we directly assign theme colors\n data.forEach((item, index) => {\n const itemName = getItemName(item, nameKey);\n dataColorMapping[sanitizeString(itemName as string)] = {\n colorToken: themeColors[index],\n isCustomColor: false,\n };\n });\n }\n }\n });\n }\n assignDataColorMapping(dataColorMapping, themeColors);\n\n return dataColorMapping;\n }, [children, themeColors]);\n\n return (\n <CommonChartComponentsContext.Provider\n value={{ chartName: 'donut', dataColorMapping, selectedDataKeys, setSelectedDataKeys }}\n >\n <DonutContainerContext.Provider\n value={{\n containerWidth: containerDimensions.width,\n containerHeight: containerDimensions.height,\n }}\n >\n <BaseBox\n ref={chartRef}\n {...metaAttribute({ name: 'donut-chart', testID })}\n {...makeAnalyticsAttribute(restProps)}\n width=\"100%\"\n height=\"100%\"\n {...restProps}\n position={isValidElement(content) ? 'relative' : undefined}\n >\n <RechartsResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsPieChart>\n {children}\n {isLabelPresentInContent && (\n <Label\n position=\"center\"\n fill={theme.colors.surface.text.gray.muted}\n fontSize={\n theme.typography.fonts.size[\n LABEL_FONT_STYLES[pieChartRadius].fontSize\n .label as keyof typeof theme.typography.fonts.size\n ]\n }\n fontFamily={theme.typography.fonts.family.text}\n fontWeight={theme.typography.fonts.weight.medium}\n letterSpacing={theme.typography.letterSpacings[100]}\n dy={\n isValuePresentInContent\n ? LABEL_DISTANCE_FROM_CENTER[pieChartRadius].withText\n : LABEL_DISTANCE_FROM_CENTER[pieChartRadius].normal\n }\n >\n {content?.label}\n </Label>\n )}\n {isValuePresentInContent && (\n <Label\n position=\"center\"\n fill={theme.colors.surface.text.gray.normal}\n fontSize={\n theme.typography.fonts.size[\n LABEL_FONT_STYLES[pieChartRadius].fontSize\n .text as keyof typeof theme.typography.fonts.size\n ]\n }\n fontFamily={theme.typography.fonts.family.heading}\n fontWeight={theme.typography.fonts.weight.bold}\n letterSpacing={theme.typography.letterSpacings[100]}\n dy={\n isLabelPresentInContent\n ? LABEL_DISTANCE_FROM_CENTER[pieChartRadius].withLabel\n : LABEL_DISTANCE_FROM_CENTER[pieChartRadius].normal\n }\n >\n {content?.value}\n </Label>\n )}\n </RechartsPieChart>\n </RechartsResponsiveContainer>\n\n {isValidElement(content) && (\n <BaseBox\n position=\"absolute\"\n top=\"50%\"\n left=\"50%\"\n transform={getTranslate(legendLayout, legendAlignment, legendWidth, legendHeight)}\n zIndex={10}\n textAlign=\"center\"\n >\n {content}\n </BaseBox>\n )}\n </BaseBox>\n </DonutContainerContext.Provider>\n </CommonChartComponentsContext.Provider>\n );\n};\n\nconst _ChartDonut: React.FC<ChartDonutProps> = ({\n cx = '50%',\n cy = '50%',\n radius = 'medium',\n dataKey,\n nameKey,\n children,\n data,\n colorTheme = 'categorical',\n type = 'circle',\n ...rest\n}) => {\n const baseRadiusConfig = RADIUS_MAPPING[radius];\n const baseContainerSize = BASE_CONTAINER_SIZE[radius];\n const { containerWidth, containerHeight } = React.useContext(DonutContainerContext);\n const themeColors = useChartsColorTheme({\n colorTheme,\n chartName: 'donut',\n });\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n const { theme } = useTheme();\n const { selectedDataKeys } = useCommonChartComponentsContext();\n\n // Filter data based on selectedDataKeys and build index mapping in a single pass\n // - filteredData: allows the donut chart to re-render with correct proportions\n // - filteredToOriginalIndexMap: ensures colors remain consistent even when data is filtered\n const { filteredData, filteredToOriginalIndexMap } = useMemo(() => {\n if (!selectedDataKeys) return { filteredData: data, filteredToOriginalIndexMap: null };\n\n const filteredData: typeof data = [];\n const filteredToOriginalIndexMap: Record<number, number> = {};\n\n data.forEach((item, originalIdx) => {\n const itemName = getItemName(item, nameKey);\n if (selectedDataKeys.includes(sanitizeString(itemName as string))) {\n filteredToOriginalIndexMap[filteredData.length] = originalIdx;\n filteredData.push(item);\n }\n });\n\n return { filteredData, filteredToOriginalIndexMap };\n }, [data, nameKey, selectedDataKeys]);\n\n // Calculate responsive radius based on container size\n const containerSize = Math.min(containerWidth, containerHeight);\n const scaledOuterRadius = getScaledRadius(\n baseRadiusConfig.outerRadius,\n containerSize,\n baseContainerSize,\n );\n const scaledInnerRadius = getScaledRadius(\n baseRadiusConfig.innerRadius,\n containerSize,\n baseContainerSize,\n );\n // Stroke inner radius is slightly smaller than outer for the border effect\n const scaledStrokeInnerRadius = scaledOuterRadius - 0.75;\n\n const getCellOpacity = (hoveredIndex: number | null, currentIndex: number): number => {\n if (hoveredIndex === null) return 1;\n if (hoveredIndex === currentIndex) return 1;\n return 0.2;\n };\n\n const modifiedChildren = useMemo(() => {\n if (Array.isArray(children)) {\n // Filter children based on selectedDataKeys to match filtered data\n const filteredChildren = selectedDataKeys\n ? children.filter((child, index) => {\n if (getComponentId(child) !== componentId.cell) return true;\n const itemName = getItemName(data[index], nameKey) as string;\n return selectedDataKeys.includes(sanitizeString(itemName));\n })\n : children;\n\n return filteredChildren.map((child, filteredIndex) => {\n if (getComponentId(child) === componentId.cell) {\n /* \n Why we are not using React.cloneElement ? just use ChartDonutCell no?\n cell can never be custom component in recharts. (as of v3.1.2)\n (https://github.com/recharts/recharts/issues/2788)\n https://github.com/recharts/recharts/discussions/5474\n\n So we have placeholder component ChartDonutCell. which we replaced by RechartsCell internally so dev can see hover effects\n working out of box. \n */\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap\n ? filteredToOriginalIndexMap[filteredIndex]\n : filteredIndex;\n const fill = getIn(theme.colors, child.props.color || themeColors[originalIndex]);\n return (\n <RechartsCell\n {...child.props}\n fill={fill}\n key={filteredIndex}\n opacity={getCellOpacity(hoveredIndex, filteredIndex)}\n strokeWidth={0}\n />\n );\n } else {\n return child;\n }\n });\n }\n return filteredData?.map((_, index) => {\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap ? filteredToOriginalIndexMap[index] : index;\n return (\n <RechartsCell\n fill={getIn(theme.colors, themeColors[originalIndex])}\n key={index}\n opacity={getCellOpacity(hoveredIndex, index)}\n strokeWidth={0}\n />\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n children,\n data,\n filteredData,\n colorTheme,\n hoveredIndex,\n themeColors,\n selectedDataKeys,\n filteredToOriginalIndexMap,\n nameKey,\n ]);\n\n const modifiedExternalDonutChildren = useMemo(() => {\n if (Array.isArray(children)) {\n // Filter children based on selectedDataKeys to match filtered data\n const filteredChildren = selectedDataKeys\n ? children.filter((child, index) => {\n if (getComponentId(child) !== componentId.cell) return true;\n const itemName = getItemName(data[index], nameKey) as string;\n return selectedDataKeys.includes(sanitizeString(itemName));\n })\n : children;\n\n return filteredChildren.map((child, filteredIndex) => {\n if (getComponentId(child) === componentId.cell) {\n /* \n Why we are not using React.cloneElement ? just use ChartDonutCell no?\n cell can never be custom component in recharts. (as of v3.1.2)\n (https://github.com/recharts/recharts/issues/2788)\n https://github.com/recharts/recharts/discussions/5474\n\n So we have placeholder component ChartDonutCell. which we replaced by RechartsCell internally so dev can see hover effects\n working out of box. \n */\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap\n ? filteredToOriginalIndexMap[filteredIndex]\n : filteredIndex;\n\n const fill = getIn(\n theme.colors,\n getHighestColorInRange({\n colorToken: child.props.color || themeColors[originalIndex],\n followIntensityMapping: Boolean(child.props.color),\n }),\n );\n return (\n <RechartsCell\n {...child.props}\n key={`stroke-${filteredIndex}`}\n fill=\"transparent\"\n stroke={fill} // Different stroke color for each cell\n strokeWidth={0.75}\n strokeOpacity={getCellOpacity(hoveredIndex, filteredIndex)}\n />\n );\n } else {\n return child;\n }\n });\n }\n return filteredData?.map((_, index) => {\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap ? filteredToOriginalIndexMap[index] : index;\n return (\n <RechartsCell\n key={`stroke-${index}`}\n fill=\"transparent\"\n stroke={getIn(\n theme.colors,\n getHighestColorInRange({\n colorToken: themeColors[originalIndex],\n }),\n )} // Different stroke color for each cell\n strokeWidth={0.75}\n strokeOpacity={getCellOpacity(hoveredIndex, index)}\n />\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n children,\n data,\n filteredData,\n colorTheme,\n hoveredIndex,\n themeColors,\n selectedDataKeys,\n filteredToOriginalIndexMap,\n nameKey,\n ]);\n\n return (\n <>\n <RechartsPie\n {...rest}\n dataKey={dataKey}\n nameKey={nameKey}\n cx={cx}\n cy={cy}\n outerRadius={scaledOuterRadius}\n innerRadius={scaledInnerRadius}\n data={filteredData}\n startAngle={START_AND_END_ANGLES[type].startAngle}\n endAngle={START_AND_END_ANGLES[type].endAngle}\n onMouseEnter={(_, index) => {\n setHoveredIndex(index);\n }}\n onMouseLeave={() => {\n setHoveredIndex(null);\n }}\n paddingAngle={1.5}\n >\n {modifiedChildren}\n </RechartsPie>\n <RechartsPie\n {...rest}\n cx={cx}\n cy={cy}\n outerRadius={scaledOuterRadius}\n innerRadius={scaledStrokeInnerRadius}\n dataKey={dataKey}\n nameKey={nameKey}\n data={filteredData}\n startAngle={START_AND_END_ANGLES[type].startAngle}\n endAngle={START_AND_END_ANGLES[type].endAngle}\n fill=\"transparent\"\n legendType=\"none\"\n tooltipType=\"none\"\n paddingAngle={1.5}\n >\n {modifiedExternalDonutChildren}\n </RechartsPie>\n </>\n );\n};\n\nconst ChartDonut = assignWithoutSideEffects(_ChartDonut, {\n componentId: componentId.chartDonut,\n});\n\nexport { ChartDonut, ChartDonutWrapper, ChartDonutCell };\n"],"names":["DonutContainerContext","React","createContext","containerWidth","containerHeight","getScaledRadius","baseRadius","containerSize","baseContainerSize","scaleFactor","Math","min","round","_Cell","_ref","rest","_extends","_objectDestructuringEmpty","_jsx","RechartsCell","_objectSpread","ChartDonutCell","assignWithoutSideEffects","componentId","cell","getTranslate","legendLayout","legendAlignment","legendWidth","legendHeight","concat","getItemName","item","nameKey","undefined","name","ChartDonutWrapper","_ref2","children","content","testID","restProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useState","useState","_useState2","_slicedToArray","selectedDataKeys","setSelectedDataKeys","colorTheme","useMemo","Array","isArray","_donutChild$props","donutChild","find","child","getComponentId","chartDonut","isValidElement","props","themeColors","useChartsColorTheme","chartName","_useState3","_useState4","setLegendHeight","_useState5","_useState6","setLegendWidth","_useState7","width","height","_useState8","containerDimensions","setContainerDimensions","chartRef","useRef","isValuePresentInContent","_typeof","isLabelPresentInContent","useEffect","mutationObserver","MutationObserver","mutations","forEach","mutation","type","_chartRef$current","legendWrapper","current","querySelector","getBoundingClientRect","resizeObserver","ResizeObserver","entries","_iterator","_createForOfIteratorHelper","_step","s","n","done","entry","value","_entry$contentRect","contentRect","err","e","f","observe","childList","subtree","disconnect","pieChartRadius","_donutChild$props2","radius","_legendChild$props","legendChild","commonChartComponentId","chartLegend","layout","_legendChild$props2","align","dataColorMapping","data","donutChildren","index","itemName","_child$props","_child$props2","sanitizeString","colorToken","color","isCustomColor","Boolean","assignDataColorMapping","CommonChartComponentsContext","Provider","_jsxs","BaseBox","ref","metaAttribute","makeAnalyticsAttribute","position","RechartsResponsiveContainer","RechartsPieChart","Label","fill","colors","surface","text","gray","muted","fontSize","typography","fonts","size","LABEL_FONT_STYLES","label","fontFamily","family","fontWeight","weight","medium","letterSpacing","letterSpacings","dy","LABEL_DISTANCE_FROM_CENTER","withText","normal","heading","bold","withLabel","top","left","transform","zIndex","textAlign","_ChartDonut","_ref3","_ref3$cx","cx","_ref3$cy","cy","_ref3$radius","dataKey","_ref3$colorTheme","_ref3$type","_excluded2","baseRadiusConfig","RADIUS_MAPPING","BASE_CONTAINER_SIZE","_React$useContext","useContext","_useState9","_useState0","hoveredIndex","setHoveredIndex","_useTheme2","_useCommonChartCompon","useCommonChartComponentsContext","_useMemo","filteredData","filteredToOriginalIndexMap","originalIdx","includes","length","push","scaledOuterRadius","outerRadius","scaledInnerRadius","innerRadius","scaledStrokeInnerRadius","getCellOpacity","currentIndex","modifiedChildren","filteredChildren","filter","map","filteredIndex","originalIndex","getIn","_createElement","key","opacity","strokeWidth","_","modifiedExternalDonutChildren","getHighestColorInRange","followIntensityMapping","stroke","strokeOpacity","_Fragment","RechartsPie","startAngle","START_AND_END_ANGLES","endAngle","onMouseEnter","onMouseLeave","paddingAngle","legendType","tooltipType","ChartDonut"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAMA,qBAAqB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAC3EC,EAAAA,cAAc,EAAE,CAAC;AACjBC,EAAAA,eAAe,EAAE,CAAA;AACnB,CAAC,CAAC,CAAA;;AAEF;AACA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CACnBC,UAAkB,EAClBC,aAAqB,EACrBC,iBAAyB,EACd;AACX,EAAA,IAAID,aAAa,IAAI,CAAC,EAAE,OAAOD,UAAU,CAAA;AACzC;EACA,IAAMG,WAAW,GAAGC,IAAI,CAACC,GAAG,CAACJ,aAAa,GAAGC,iBAAiB,EAAE,CAAC,CAAC,CAAA;AAClE,EAAA,OAAOE,IAAI,CAACE,KAAK,CAACN,UAAU,GAAGG,WAAW,CAAC,CAAA;AAC7C,CAAC,CAAA;;AAED;AACA,IAAMI,KAAoC,GAAG,SAAvCA,KAAoCA,CAAAC,IAAA,EAAoB;EAAA,IAAXC,IAAI,GAAAC,QAAA,CAAA,EAAA,GAAAC,yBAAA,CAAAH,IAAA,GAAAA,IAAA,EAAA,CAAA;EACrD,oBAAOI,GAAA,CAACC,IAAY,EAAAC,aAAA,CAAKL,EAAAA,EAAAA,IAAI,CAAG,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,IAAMM,cAAc,gBAAGC,wBAAwB,CAACT,KAAK,EAAE;EACrDU,WA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A,UAAU,EAAC,MAAM;AACjBC,MAAAA,WAAW,EAAC,MAAM;AAClBF,MAAAA,YAAY,EAAE,GAAI;AAAA7M,MAAAA,QAAA,EAEjBiM,6BAAAA;AAA6B,KAAA,CACnB,CAAC,CAAA;AAAA,GACd,CAAC,CAAA;AAEP,CAAC,CAAA;AAED,IAAMe,UAAU,gBAAGhO,wBAAwB,CAACgK,WAAW,EAAE;EACvD/J,WAAW,EAAEA,WAAW,CAACuC,UAAAA;AAC3B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"DonutChart.web.js","sources":["../../../../../../../src/components/Charts/DonutChart/DonutChart.web.tsx"],"sourcesContent":["import React, { isValidElement, useMemo, useState, useRef, useEffect } from 'react';\nimport {\n PieChart as RechartsPieChart,\n Pie as RechartsPie,\n Cell as RechartsCell,\n ResponsiveContainer as RechartsResponsiveContainer,\n Label,\n} from 'recharts';\nimport {\n useChartsColorTheme,\n getHighestColorInRange,\n sanitizeString,\n assignDataColorMapping,\n} from '../utils';\nimport { componentId as commonChartComponentId } from '../CommonChartComponents/tokens';\nimport {\n CommonChartComponentsContext,\n useCommonChartComponentsContext,\n} from '../CommonChartComponents';\nimport type { DataColorMapping } from '../CommonChartComponents/types';\nimport type {\n ChartDonutWrapperProps,\n ChartDonutCellProps,\n ChartDonutProps,\n ChartRadius,\n} from './types';\nimport {\n RADIUS_MAPPING,\n BASE_CONTAINER_SIZE,\n START_AND_END_ANGLES,\n componentId,\n LABEL_DISTANCE_FROM_CENTER,\n LABEL_FONT_STYLES,\n} from './tokens';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\n\n// Context to share container dimensions for responsive radius calculation\ntype DonutContainerContextType = {\n containerWidth: number;\n containerHeight: number;\n};\n\nconst DonutContainerContext = React.createContext<DonutContainerContextType>({\n containerWidth: 0,\n containerHeight: 0,\n});\n\n// Helper to calculate scaled radius based on container size\nconst getScaledRadius = (\n baseRadius: number,\n containerSize: number,\n baseContainerSize: number,\n): number => {\n if (containerSize <= 0) return baseRadius;\n // Scale the radius proportionally, but cap it at the base value\n const scaleFactor = Math.min(containerSize / baseContainerSize, 1);\n return Math.round(baseRadius * scaleFactor);\n};\n\n// Cell component\nconst _Cell: React.FC<ChartDonutCellProps> = ({ ...rest }) => {\n return <RechartsCell {...rest} />;\n};\n\nconst ChartDonutCell = assignWithoutSideEffects(_Cell, {\n componentId: componentId.cell,\n});\n\nconst getTranslate = (\n legendLayout: 'horizontal' | 'vertical',\n legendAlignment: 'left' | 'right',\n legendWidth: number,\n legendHeight: number,\n): string => {\n if (legendLayout === 'vertical') {\n return `translate(calc(-50% + ${\n legendAlignment === 'right' ? -legendWidth / 2 : legendWidth / 2\n }px) , calc(-50%))`;\n }\n return `translate(-50%, calc(-50% - ${legendHeight / 2}px))`;\n};\n\n/**\n * Gets the item name from data based on nameKey.\n * nameKey can be a string (used as property key) or a function (called with data item).\n */\nconst getItemName = (\n item: Record<string, unknown> | undefined,\n nameKey: ChartDonutProps['nameKey'],\n): unknown => {\n if (!item) return undefined;\n if (!nameKey) return item.name;\n if (typeof nameKey === 'function') return nameKey(item);\n return item[nameKey];\n};\n\nconst ChartDonutWrapper: React.FC<ChartDonutWrapperProps & TestID & DataAnalyticsAttribute> = ({\n children,\n content,\n testID,\n ...restProps\n}) => {\n const { theme } = useTheme();\n // State to track which data keys are currently selected (visible)\n const [selectedDataKeys, setSelectedDataKeys] = useState<string[] | undefined>(undefined);\n\n const colorTheme = useMemo(() => {\n if (Array.isArray(children)) {\n const donutChild = children.find((child) => getComponentId(child) === componentId.chartDonut);\n if (!donutChild || !isValidElement(donutChild)) {\n return 'categorical';\n }\n return donutChild?.props?.colorTheme || 'categorical';\n }\n return 'categorical';\n }, [children]);\n\n const themeColors = useChartsColorTheme({\n colorTheme,\n chartName: 'donut',\n });\n const [legendHeight, setLegendHeight] = useState(0);\n const [legendWidth, setLegendWidth] = useState(0);\n const [containerDimensions, setContainerDimensions] = useState({ width: 0, height: 0 });\n const chartRef = useRef<HTMLDivElement>(null);\n const isValuePresentInContent = content && typeof content === 'object' && 'value' in content;\n const isLabelPresentInContent = content && typeof content === 'object' && 'label' in content;\n\n useEffect(() => {\n const mutationObserver = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'childList') {\n const legendWrapper = chartRef.current?.querySelector('.recharts-legend-wrapper');\n if (legendWrapper) {\n const height = legendWrapper.getBoundingClientRect().height;\n const width = legendWrapper.getBoundingClientRect().width;\n setLegendHeight(height);\n setLegendWidth(width);\n }\n }\n });\n });\n\n // ResizeObserver to track container dimensions for responsive radius\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n setContainerDimensions({ width, height });\n }\n });\n\n if (chartRef.current) {\n mutationObserver.observe(chartRef.current, { childList: true, subtree: true });\n resizeObserver.observe(chartRef.current);\n }\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n };\n }, []);\n\n const pieChartRadius: ChartRadius = useMemo(() => {\n if (Array.isArray(children)) {\n const donutChild = children.find((child) => getComponentId(child) === componentId.chartDonut);\n if (!donutChild || !isValidElement(donutChild)) {\n return 'medium';\n }\n return donutChild?.props?.radius || 'medium';\n }\n return 'medium';\n }, [children]);\n\n const legendLayout = useMemo(() => {\n if (Array.isArray(children)) {\n const legendChild = children.find(\n (child) => getComponentId(child) === commonChartComponentId.chartLegend,\n );\n if (!legendChild || !isValidElement(legendChild)) {\n return 'horizontal';\n }\n return legendChild?.props?.layout || 'horizontal';\n }\n return 'horizontal';\n }, [children]);\n\n const legendAlignment = useMemo(() => {\n if (Array.isArray(children)) {\n const legendChild = children.find(\n (child) => getComponentId(child) === commonChartComponentId.chartLegend,\n );\n if (!legendChild || !isValidElement(legendChild)) {\n return 'right';\n }\n return legendChild?.props?.align || 'right';\n }\n return 'right';\n }, [children]);\n /**\n * We need to check child of ChartDonutWrapper. if they have any custom color we store that.\n * We need these mapping because colors of tooltip & legend is determine based on this\n * recharts do provide a color but it is hex code and we need blade color token .\n */\n\n const dataColorMapping = useMemo(() => {\n const dataColorMapping: DataColorMapping = {};\n if (Array.isArray(children)) {\n children.forEach((child) => {\n if (getComponentId(child) === componentId.chartDonut) {\n const data = (child as React.ReactElement<ChartDonutProps>).props.data;\n const nameKey = (child as React.ReactElement<ChartDonutProps>).props.nameKey;\n // Donut Chart can also have <Cell/> which will come under donutChildren.\n const donutChildren = (child as React.ReactElement<ChartDonutProps>).props.children;\n if (Array.isArray(donutChildren)) {\n donutChildren.forEach((child, index) => {\n const itemName = getItemName(data[index], nameKey);\n if (getComponentId(child) === componentId.cell && itemName) {\n // assign colors to the dataColorMapping, if no color is assigned we assign color in `assignDataColorMapping`\n\n dataColorMapping[sanitizeString(itemName as string)] = {\n colorToken: child.props?.color,\n isCustomColor: Boolean(child.props?.color),\n };\n }\n });\n } else {\n // if we don't have cell as child component then we can we directly assign theme colors\n data.forEach((item, index) => {\n const itemName = getItemName(item, nameKey);\n dataColorMapping[sanitizeString(itemName as string)] = {\n colorToken: themeColors[index],\n isCustomColor: false,\n };\n });\n }\n }\n });\n }\n assignDataColorMapping(dataColorMapping, themeColors);\n\n return dataColorMapping;\n }, [children, themeColors]);\n\n return (\n <CommonChartComponentsContext.Provider\n value={{ chartName: 'donut', dataColorMapping, selectedDataKeys, setSelectedDataKeys }}\n >\n <DonutContainerContext.Provider\n value={{\n containerWidth: containerDimensions.width,\n containerHeight: containerDimensions.height,\n }}\n >\n <BaseBox\n ref={chartRef}\n {...metaAttribute({ name: 'donut-chart', testID })}\n {...makeAnalyticsAttribute(restProps)}\n width=\"100%\"\n height=\"100%\"\n {...restProps}\n position={isValidElement(content) ? 'relative' : undefined}\n >\n <RechartsResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsPieChart>\n {children}\n {isLabelPresentInContent && (\n <Label\n position=\"center\"\n fill={theme.colors.surface.text.gray.muted}\n fontSize={\n theme.typography.fonts.size[\n LABEL_FONT_STYLES[pieChartRadius].fontSize\n .label as keyof typeof theme.typography.fonts.size\n ]\n }\n fontFamily={theme.typography.fonts.family.text}\n fontWeight={theme.typography.fonts.weight.medium}\n letterSpacing={theme.typography.letterSpacings[100]}\n dy={\n isValuePresentInContent\n ? LABEL_DISTANCE_FROM_CENTER[pieChartRadius].withText\n : LABEL_DISTANCE_FROM_CENTER[pieChartRadius].normal\n }\n >\n {content?.label}\n </Label>\n )}\n {isValuePresentInContent && (\n <Label\n position=\"center\"\n fill={theme.colors.surface.text.gray.normal}\n fontSize={\n theme.typography.fonts.size[\n LABEL_FONT_STYLES[pieChartRadius].fontSize\n .text as keyof typeof theme.typography.fonts.size\n ]\n }\n fontFamily={theme.typography.fonts.family.heading}\n fontWeight={theme.typography.fonts.weight.bold}\n letterSpacing={theme.typography.letterSpacings[100]}\n dy={\n isLabelPresentInContent\n ? LABEL_DISTANCE_FROM_CENTER[pieChartRadius].withLabel\n : LABEL_DISTANCE_FROM_CENTER[pieChartRadius].normal\n }\n >\n {content?.value}\n </Label>\n )}\n </RechartsPieChart>\n </RechartsResponsiveContainer>\n\n {isValidElement(content) && (\n <BaseBox\n position=\"absolute\"\n top=\"50%\"\n left=\"50%\"\n transform={getTranslate(legendLayout, legendAlignment, legendWidth, legendHeight)}\n zIndex={10}\n textAlign=\"center\"\n >\n {content}\n </BaseBox>\n )}\n </BaseBox>\n </DonutContainerContext.Provider>\n </CommonChartComponentsContext.Provider>\n );\n};\n\nconst _ChartDonut: React.FC<ChartDonutProps> = ({\n cx = '50%',\n cy = '50%',\n radius = 'medium',\n dataKey,\n nameKey,\n children,\n data,\n colorTheme = 'categorical',\n type = 'circle',\n ...rest\n}) => {\n const baseRadiusConfig = RADIUS_MAPPING[radius];\n const baseContainerSize = BASE_CONTAINER_SIZE[radius];\n const { containerWidth, containerHeight } = React.useContext(DonutContainerContext);\n const themeColors = useChartsColorTheme({\n colorTheme,\n chartName: 'donut',\n });\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n const { theme } = useTheme();\n const { selectedDataKeys } = useCommonChartComponentsContext();\n\n // Filter data based on selectedDataKeys and build index mapping in a single pass\n // - filteredData: allows the donut chart to re-render with correct proportions\n // - filteredToOriginalIndexMap: ensures colors remain consistent even when data is filtered\n const { filteredData, filteredToOriginalIndexMap } = useMemo(() => {\n if (!selectedDataKeys) return { filteredData: data, filteredToOriginalIndexMap: null };\n\n const filteredData: typeof data = [];\n const filteredToOriginalIndexMap: Record<number, number> = {};\n\n data.forEach((item, originalIdx) => {\n const itemName = getItemName(item, nameKey);\n if (selectedDataKeys.includes(sanitizeString(itemName as string))) {\n filteredToOriginalIndexMap[filteredData.length] = originalIdx;\n filteredData.push(item);\n }\n });\n\n return { filteredData, filteredToOriginalIndexMap };\n }, [data, nameKey, selectedDataKeys]);\n\n // Calculate responsive radius based on container size\n const containerSize = Math.min(containerWidth, containerHeight);\n const scaledOuterRadius = getScaledRadius(\n baseRadiusConfig.outerRadius,\n containerSize,\n baseContainerSize,\n );\n const scaledInnerRadius = getScaledRadius(\n baseRadiusConfig.innerRadius,\n containerSize,\n baseContainerSize,\n );\n // Stroke inner radius is slightly smaller than outer for the border effect\n const scaledStrokeInnerRadius = scaledOuterRadius - 0.75;\n\n const getCellOpacity = (hoveredIndex: number | null, currentIndex: number): number => {\n if (hoveredIndex === null) return 1;\n if (hoveredIndex === currentIndex) return 1;\n return 0.2;\n };\n\n const modifiedChildren = useMemo(() => {\n if (Array.isArray(children)) {\n // Filter children based on selectedDataKeys to match filtered data\n const filteredChildren = selectedDataKeys\n ? children.filter((child, index) => {\n if (getComponentId(child) !== componentId.cell) return true;\n const itemName = getItemName(data[index], nameKey) as string;\n return selectedDataKeys.includes(sanitizeString(itemName));\n })\n : children;\n\n return filteredChildren.map((child, filteredIndex) => {\n if (getComponentId(child) === componentId.cell) {\n /* \n Why we are not using React.cloneElement ? just use ChartDonutCell no?\n cell can never be custom component in recharts. (as of v3.1.2)\n (https://github.com/recharts/recharts/issues/2788)\n https://github.com/recharts/recharts/discussions/5474\n\n So we have placeholder component ChartDonutCell. which we replaced by RechartsCell internally so dev can see hover effects\n working out of box. \n */\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap\n ? filteredToOriginalIndexMap[filteredIndex]\n : filteredIndex;\n const fill = getIn(theme.colors, child.props.color || themeColors[originalIndex]);\n return (\n <RechartsCell\n {...child.props}\n fill={fill}\n key={filteredIndex}\n opacity={getCellOpacity(hoveredIndex, filteredIndex)}\n strokeWidth={0}\n />\n );\n } else {\n return child;\n }\n });\n }\n return filteredData?.map((_, index) => {\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap ? filteredToOriginalIndexMap[index] : index;\n return (\n <RechartsCell\n fill={getIn(theme.colors, themeColors[originalIndex])}\n key={index}\n opacity={getCellOpacity(hoveredIndex, index)}\n strokeWidth={0}\n />\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n children,\n data,\n filteredData,\n colorTheme,\n hoveredIndex,\n themeColors,\n selectedDataKeys,\n filteredToOriginalIndexMap,\n nameKey,\n ]);\n\n const modifiedExternalDonutChildren = useMemo(() => {\n if (Array.isArray(children)) {\n // Filter children based on selectedDataKeys to match filtered data\n const filteredChildren = selectedDataKeys\n ? children.filter((child, index) => {\n if (getComponentId(child) !== componentId.cell) return true;\n const itemName = getItemName(data[index], nameKey) as string;\n return selectedDataKeys.includes(sanitizeString(itemName));\n })\n : children;\n\n return filteredChildren.map((child, filteredIndex) => {\n if (getComponentId(child) === componentId.cell) {\n /* \n Why we are not using React.cloneElement ? just use ChartDonutCell no?\n cell can never be custom component in recharts. (as of v3.1.2)\n (https://github.com/recharts/recharts/issues/2788)\n https://github.com/recharts/recharts/discussions/5474\n\n So we have placeholder component ChartDonutCell. which we replaced by RechartsCell internally so dev can see hover effects\n working out of box. \n */\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap\n ? filteredToOriginalIndexMap[filteredIndex]\n : filteredIndex;\n\n const fill = getIn(\n theme.colors,\n getHighestColorInRange({\n colorToken: child.props.color || themeColors[originalIndex],\n followIntensityMapping: Boolean(child.props.color),\n }),\n );\n return (\n <RechartsCell\n {...child.props}\n key={`stroke-${filteredIndex}`}\n fill=\"transparent\"\n stroke={fill} // Different stroke color for each cell\n strokeWidth={0.75}\n strokeOpacity={getCellOpacity(hoveredIndex, filteredIndex)}\n />\n );\n } else {\n return child;\n }\n });\n }\n return filteredData?.map((_, index) => {\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap ? filteredToOriginalIndexMap[index] : index;\n return (\n <RechartsCell\n key={`stroke-${index}`}\n fill=\"transparent\"\n stroke={getIn(\n theme.colors,\n getHighestColorInRange({\n colorToken: themeColors[originalIndex],\n }),\n )} // Different stroke color for each cell\n strokeWidth={0.75}\n strokeOpacity={getCellOpacity(hoveredIndex, index)}\n />\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n children,\n data,\n filteredData,\n colorTheme,\n hoveredIndex,\n themeColors,\n selectedDataKeys,\n filteredToOriginalIndexMap,\n nameKey,\n ]);\n\n return (\n <>\n <RechartsPie\n {...rest}\n dataKey={dataKey}\n nameKey={nameKey}\n cx={cx}\n cy={cy}\n outerRadius={scaledOuterRadius}\n innerRadius={scaledInnerRadius}\n data={filteredData}\n startAngle={START_AND_END_ANGLES[type].startAngle}\n endAngle={START_AND_END_ANGLES[type].endAngle}\n onMouseEnter={(_, index) => {\n setHoveredIndex(index);\n }}\n onMouseLeave={() => {\n setHoveredIndex(null);\n }}\n paddingAngle={1.5}\n >\n {modifiedChildren}\n </RechartsPie>\n <RechartsPie\n {...rest}\n cx={cx}\n cy={cy}\n outerRadius={scaledOuterRadius}\n innerRadius={scaledStrokeInnerRadius}\n dataKey={dataKey}\n nameKey={nameKey}\n data={filteredData}\n startAngle={START_AND_END_ANGLES[type].startAngle}\n endAngle={START_AND_END_ANGLES[type].endAngle}\n fill=\"transparent\"\n legendType=\"none\"\n tooltipType=\"none\"\n paddingAngle={1.5}\n // ToolTip is already disabled here.. need to disable pointer events to prevent the tooltip from being shown when the user hovers over the donut chart in some cases\n style={{ pointerEvents: 'none' }}\n >\n {modifiedExternalDonutChildren}\n </RechartsPie>\n </>\n );\n};\n\nconst ChartDonut = assignWithoutSideEffects(_ChartDonut, {\n componentId: componentId.chartDonut,\n});\n\nexport { ChartDonut, ChartDonutWrapper, ChartDonutCell };\n"],"names":["DonutContainerContext","React","createContext","containerWidth","containerHeight","getScaledRadius","baseRadius","containerSize","baseContainerSize","scaleFactor","Math","min","round","_Cell","_ref","rest","_extends","_objectDestructuringEmpty","_jsx","RechartsCell","_objectSpread","ChartDonutCell","assignWithoutSideEffects","componentId","cell","getTranslate","legendLayout","legendAlignment","legendWidth","legendHeight","concat","getItemName","item","nameKey","undefined","name","ChartDonutWrapper","_ref2","children","content","testID","restProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useState","useState","_useState2","_slicedToArray","selectedDataKeys","setSelectedDataKeys","colorTheme","useMemo","Array","isArray","_donutChild$props","donutChild","find","child","getComponentId","chartDonut","isValidElement","props","themeColors","useChartsColorTheme","chartName","_useState3","_useState4","setLegendHeight","_useState5","_useState6","setLegendWidth","_useState7","width","height","_useState8","containerDimensions","setContainerDimensions","chartRef","useRef","isValuePresentInContent","_typeof","isLabelPresentInContent","useEffect","mutationObserver","MutationObserver","mutations","forEach","mutation","type","_chartRef$current","legendWrapper","current","querySelector","getBoundingClientRect","resizeObserver","ResizeObserver","entries","_iterator","_createForOfIteratorHelper","_step","s","n","done","entry","value","_entry$contentRect","contentRect","err","e","f","observe","childList","subtree","disconnect","pieChartRadius","_donutChild$props2","radius","_legendChild$props","legendChild","commonChartComponentId","chartLegend","layout","_legendChild$props2","align","dataColorMapping","data","donutChildren","index","itemName","_child$props","_child$props2","sanitizeString","colorToken","color","isCustomColor","Boolean","assignDataColorMapping","CommonChartComponentsContext","Provider","_jsxs","BaseBox","ref","metaAttribute","makeAnalyticsAttribute","position","RechartsResponsiveContainer","RechartsPieChart","Label","fill","colors","surface","text","gray","muted","fontSize","typography","fonts","size","LABEL_FONT_STYLES","label","fontFamily","family","fontWeight","weight","medium","letterSpacing","letterSpacings","dy","LABEL_DISTANCE_FROM_CENTER","withText","normal","heading","bold","withLabel","top","left","transform","zIndex","textAlign","_ChartDonut","_ref3","_ref3$cx","cx","_ref3$cy","cy","_ref3$radius","dataKey","_ref3$colorTheme","_ref3$type","_excluded2","baseRadiusConfig","RADIUS_MAPPING","BASE_CONTAINER_SIZE","_React$useContext","useContext","_useState9","_useState0","hoveredIndex","setHoveredIndex","_useTheme2","_useCommonChartCompon","useCommonChartComponentsContext","_useMemo","filteredData","filteredToOriginalIndexMap","originalIdx","includes","length","push","scaledOuterRadius","outerRadius","scaledInnerRadius","innerRadius","scaledStrokeInnerRadius","getCellOpacity","currentIndex","modifiedChildren","filteredChildren","filter","map","filteredIndex","originalIndex","getIn","_createElement","key","opacity","strokeWidth","_","modifiedExternalDonutChildren","getHighestColorInRange","followIntensityMapping","stroke","strokeOpacity","_Fragment","RechartsPie","startAngle","START_AND_END_ANGLES","endAngle","onMouseEnter","onMouseLeave","paddingAngle","legendType","tooltipType","style","pointerEvents","ChartDonut"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAMA,qBAAqB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAC3EC,EAAAA,cAAc,EAAE,CAAC;AACjBC,EAAAA,eAAe,EAAE,CAAA;AACnB,CAAC,CAAC,CAAA;;AAEF;AACA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,C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CAAA;OACrB;AACF0C,MAAAA,YAAY,EAAE,GAAI;AAAA7M,MAAAA,QAAA,EAEjBqL,gBAAAA;KACU,CAAA,CAAC,eACdzM,GAAA,CAAC2N,GAAW,EAAAzN,aAAA,CAAAA,aAAA,CAAA,EAAA,EACNL,IAAI,CAAA,EAAA,EAAA,EAAA;AACR0K,MAAAA,EAAE,EAAEA,EAAG;AACPE,MAAAA,EAAE,EAAEA,EAAG;AACP0B,MAAAA,WAAW,EAAED,iBAAkB;AAC/BG,MAAAA,WAAW,EAAEC,uBAAwB;AACrC3B,MAAAA,OAAO,EAAEA,OAAQ;AACjB5J,MAAAA,OAAO,EAAEA,OAAQ;AACjB+F,MAAAA,IAAI,EAAE8E,YAAa;AACnBgC,MAAAA,UAAU,EAAEC,oBAAoB,CAACpJ,IAAI,CAAC,CAACmJ,UAAW;AAClDE,MAAAA,QAAQ,EAAED,oBAAoB,CAACpJ,IAAI,CAAC,CAACqJ,QAAS;AAC9CzF,MAAAA,IAAI,EAAC,aAAa;AAClB6F,MAAAA,UAAU,EAAC,MAAM;AACjBC,MAAAA,WAAW,EAAC,MAAM;AAClBF,MAAAA,YAAY,EAAE,GAAA;AACd;AAAA;AACAG,MAAAA,KAAK,EAAE;AAAEC,QAAAA,aAAa,EAAE,MAAA;OAAS;AAAAjN,MAAAA,QAAA,EAEhCiM,6BAAAA;AAA6B,KAAA,CACnB,CAAC,CAAA;AAAA,GACd,CAAC,CAAA;AAEP,CAAC,CAAA;AAED,IAAMiB,UAAU,gBAAGlO,wBAAwB,CAACgK,WAAW,EAAE;EACvD/J,WAAW,EAAEA,WAAW,CAACuC,UAAAA;AAC3B,CAAC;;;;"}
|
|
@@ -23,7 +23,7 @@ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeA
|
|
|
23
23
|
import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
|
|
24
24
|
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
25
25
|
|
|
26
|
-
var _excluded = ["messageType", "senderType", "isLoading", "validationState", "errorText", "onClick", "footerActions", "children", "leading", "loadingText", "wordBreak", "maxWidth", "thumbnails", "onThumbnailClick"];
|
|
26
|
+
var _excluded = ["messageType", "senderType", "isLoading", "validationState", "errorText", "onClick", "footerActions", "children", "leading", "loadingText", "wordBreak", "maxWidth", "thumbnails", "onThumbnailClick", "reasoningTraces", "reasoningStatus", "reasoningTitle", "reasoningActiveStepIndex"];
|
|
27
27
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
28
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
29
|
var ButtonResetCss = {
|
|
@@ -58,6 +58,10 @@ var _ChatMessage = function _ChatMessage(_ref, ref) {
|
|
|
58
58
|
maxWidth = _ref.maxWidth,
|
|
59
59
|
thumbnails = _ref.thumbnails,
|
|
60
60
|
onThumbnailClick = _ref.onThumbnailClick,
|
|
61
|
+
reasoningTraces = _ref.reasoningTraces,
|
|
62
|
+
reasoningStatus = _ref.reasoningStatus,
|
|
63
|
+
reasoningTitle = _ref.reasoningTitle,
|
|
64
|
+
reasoningActiveStepIndex = _ref.reasoningActiveStepIndex,
|
|
61
65
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
62
66
|
// Keep deprecated prop "used" to avoid lint errors while preserving compatibility.
|
|
63
67
|
void messageType;
|
|
@@ -88,7 +92,11 @@ var _ChatMessage = function _ChatMessage(_ref, ref) {
|
|
|
88
92
|
leading: leading,
|
|
89
93
|
isLoading: isLoading,
|
|
90
94
|
footerActions: footerActions,
|
|
91
|
-
isChildText: shouldWrapInText
|
|
95
|
+
isChildText: shouldWrapInText,
|
|
96
|
+
reasoningTraces: reasoningTraces,
|
|
97
|
+
reasoningStatus: reasoningStatus,
|
|
98
|
+
reasoningTitle: reasoningTitle,
|
|
99
|
+
reasoningActiveStepIndex: reasoningActiveStepIndex
|
|
92
100
|
});
|
|
93
101
|
var imagePreviewAlignment = senderType === 'self' ? 'flex-end' : 'flex-start';
|
|
94
102
|
return /*#__PURE__*/jsxs(BaseBox, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMessage.web.js","sources":["../../../../../../src/components/ChatMessage/ChatMessage.web.tsx"],"sourcesContent":["import React from 'react';\nimport { SelfMessageBubble } from './SelfMessageBubble.web';\nimport { DefaultMessageBubble } from './DefaultMessageBubble.web';\nimport type { ChatMessageProps } from './types';\nimport { ThumbnailPreview } from './ThumbnailPreview.web';\nimport { RollingText } from '~components/RollingText';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getStringFromReactText } from '~utils/getStringChildren';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport type { BladeElementRef } from '~utils/types';\n\nconst ButtonResetCss = {\n background: 'none',\n border: 'none',\n padding: undefined,\n cursor: 'pointer',\n color: 'inherit',\n font: 'inherit',\n textAlign: 'left' as const,\n outline: 'inherit',\n appearance: 'none',\n backgroundColor: 'inherit',\n};\n\nconst _ChatMessage: React.ForwardRefRenderFunction<BladeElementRef, ChatMessageProps> = (\n {\n messageType = 'default',\n senderType = 'self',\n isLoading = false,\n validationState = 'none',\n errorText,\n onClick,\n footerActions,\n children,\n leading,\n loadingText,\n wordBreak = 'break-word',\n maxWidth,\n thumbnails,\n onThumbnailClick,\n ...props\n }: ChatMessageProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n // Keep deprecated prop \"used\" to avoid lint errors while preserving compatibility.\n void messageType;\n\n // since we can pass both string and Card component as children, we need to check if children is string or Card component\n // if children is string or array of string, we need to wrap it in Text component otherwise we will pass children as it is\n const shouldWrapInText =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every((child) => typeof child === 'string')) ||\n isLoading;\n\n const loadingContent =\n isLoading && Array.isArray(loadingText) ? <RollingText texts={loadingText} /> : loadingText;\n\n const finalChildren = shouldWrapInText ? (\n <Text\n color={\n isLoading\n ? Array.isArray(loadingText)\n ? 'feedback.text.positive.intense'\n : 'surface.text.gray.muted'\n : 'surface.text.gray.normal'\n }\n weight=\"regular\"\n variant=\"body\"\n size=\"medium\"\n wordBreak={wordBreak}\n >\n {isLoading ? loadingContent : getStringFromReactText(children as string | string[])}\n </Text>\n ) : (\n (children as React.ReactElement)\n );\n\n const messageBubble =\n senderType === 'self' ? (\n <SelfMessageBubble\n validationState={validationState}\n errorText={errorText}\n children={finalChildren}\n isChildText={shouldWrapInText}\n />\n ) : (\n <DefaultMessageBubble\n children={finalChildren}\n leading={leading}\n isLoading={isLoading}\n footerActions={footerActions}\n isChildText={shouldWrapInText}\n />\n );\n\n const imagePreviewAlignment = senderType === 'self' ? 'flex-end' : 'flex-start';\n\n return (\n <BaseBox display=\"flex\" flexDirection=\"column\" gap=\"spacing.3\">\n {thumbnails && thumbnails.length > 0 ? (\n <BaseBox alignSelf={imagePreviewAlignment}>\n <ThumbnailPreview thumbnails={thumbnails} onThumbnailClick={onThumbnailClick} />\n </BaseBox>\n ) : null}\n <BaseBox\n onClick={onClick}\n {...(onClick ? { ...ButtonResetCss } : {})}\n {...metaAttribute({ name: MetaConstants.ChatMessage, testID: props.testID })}\n {...makeAnalyticsAttribute(props)}\n {...getStyledProps(props)}\n maxWidth={maxWidth}\n ref={ref as never}\n as={onClick ? 'button' : undefined}\n >\n {messageBubble}\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst ChatMessage = assignWithoutSideEffects(React.forwardRef(_ChatMessage), {\n displayName: 'ChatMessage',\n componentId: MetaConstants.ChatMessage,\n});\nexport { ChatMessage };\n"],"names":["ButtonResetCss","background","border","padding","undefined","cursor","color","font","textAlign","outline","appearance","backgroundColor","_ChatMessage","_ref","ref","_ref$messageType","messageType","_ref$senderType","senderType","_ref$isLoading","isLoading","_ref$validationState","validationState","errorText","onClick","footerActions","children","leading","loadingText","_ref$wordBreak","wordBreak","maxWidth","thumbnails","onThumbnailClick","props","_objectWithoutProperties","_excluded","shouldWrapInText","Array","isArray","every","child","loadingContent","_jsx","RollingText","texts","finalChildren","Text","weight","variant","size","getStringFromReactText","messageBubble","SelfMessageBubble","isChildText","DefaultMessageBubble","imagePreviewAlignment","_jsxs","BaseBox","display","flexDirection","gap","length","alignSelf","ThumbnailPreview","_objectSpread","metaAttribute","name","MetaConstants","ChatMessage","testID","makeAnalyticsAttribute","getStyledProps","as","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAMA,cAAc,GAAG;AACrBC,EAAAA,UAAU,EAAE,MAAM;AAClBC,EAAAA,MAAM,EAAE,MAAM;AACdC,EAAAA,OAAO,EAAEC,SAAS;AAClBC,EAAAA,MAAM,EAAE,SAAS;AACjBC,EAAAA,KAAK,EAAE,SAAS;AAChBC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,SAAS,EAAE,MAAe;AAC1BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,UAAU,EAAE,MAAM;AAClBC,EAAAA,eAAe,EAAE,SAAA;AACnB,CAAC,CAAA;AAED,IAAMC,YAA+E,GAAG,SAAlFA,YAA+EA,CAAAC,IAAA,
|
|
1
|
+
{"version":3,"file":"ChatMessage.web.js","sources":["../../../../../../src/components/ChatMessage/ChatMessage.web.tsx"],"sourcesContent":["import React from 'react';\nimport { SelfMessageBubble } from './SelfMessageBubble.web';\nimport { DefaultMessageBubble } from './DefaultMessageBubble.web';\nimport type { ChatMessageProps } from './types';\nimport { ThumbnailPreview } from './ThumbnailPreview.web';\nimport { RollingText } from '~components/RollingText';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getStringFromReactText } from '~utils/getStringChildren';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport type { BladeElementRef } from '~utils/types';\n\nconst ButtonResetCss = {\n background: 'none',\n border: 'none',\n padding: undefined,\n cursor: 'pointer',\n color: 'inherit',\n font: 'inherit',\n textAlign: 'left' as const,\n outline: 'inherit',\n appearance: 'none',\n backgroundColor: 'inherit',\n};\n\nconst _ChatMessage: React.ForwardRefRenderFunction<BladeElementRef, ChatMessageProps> = (\n {\n messageType = 'default',\n senderType = 'self',\n isLoading = false,\n validationState = 'none',\n errorText,\n onClick,\n footerActions,\n children,\n leading,\n loadingText,\n wordBreak = 'break-word',\n maxWidth,\n thumbnails,\n onThumbnailClick,\n reasoningTraces,\n reasoningStatus,\n reasoningTitle,\n reasoningActiveStepIndex,\n ...props\n }: ChatMessageProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n // Keep deprecated prop \"used\" to avoid lint errors while preserving compatibility.\n void messageType;\n\n // since we can pass both string and Card component as children, we need to check if children is string or Card component\n // if children is string or array of string, we need to wrap it in Text component otherwise we will pass children as it is\n const shouldWrapInText =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every((child) => typeof child === 'string')) ||\n isLoading;\n\n const loadingContent =\n isLoading && Array.isArray(loadingText) ? <RollingText texts={loadingText} /> : loadingText;\n\n const finalChildren = shouldWrapInText ? (\n <Text\n color={\n isLoading\n ? Array.isArray(loadingText)\n ? 'feedback.text.positive.intense'\n : 'surface.text.gray.muted'\n : 'surface.text.gray.normal'\n }\n weight=\"regular\"\n variant=\"body\"\n size=\"medium\"\n wordBreak={wordBreak}\n >\n {isLoading ? loadingContent : getStringFromReactText(children as string | string[])}\n </Text>\n ) : (\n (children as React.ReactElement)\n );\n\n const messageBubble =\n senderType === 'self' ? (\n <SelfMessageBubble\n validationState={validationState}\n errorText={errorText}\n children={finalChildren}\n isChildText={shouldWrapInText}\n />\n ) : (\n <DefaultMessageBubble\n children={finalChildren}\n leading={leading}\n isLoading={isLoading}\n footerActions={footerActions}\n isChildText={shouldWrapInText}\n reasoningTraces={reasoningTraces}\n reasoningStatus={reasoningStatus}\n reasoningTitle={reasoningTitle}\n reasoningActiveStepIndex={reasoningActiveStepIndex}\n />\n );\n\n const imagePreviewAlignment = senderType === 'self' ? 'flex-end' : 'flex-start';\n\n return (\n <BaseBox display=\"flex\" flexDirection=\"column\" gap=\"spacing.3\">\n {thumbnails && thumbnails.length > 0 ? (\n <BaseBox alignSelf={imagePreviewAlignment}>\n <ThumbnailPreview thumbnails={thumbnails} onThumbnailClick={onThumbnailClick} />\n </BaseBox>\n ) : null}\n <BaseBox\n onClick={onClick}\n {...(onClick ? { ...ButtonResetCss } : {})}\n {...metaAttribute({ name: MetaConstants.ChatMessage, testID: props.testID })}\n {...makeAnalyticsAttribute(props)}\n {...getStyledProps(props)}\n maxWidth={maxWidth}\n ref={ref as never}\n as={onClick ? 'button' : undefined}\n >\n {messageBubble}\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst ChatMessage = assignWithoutSideEffects(React.forwardRef(_ChatMessage), {\n displayName: 'ChatMessage',\n componentId: MetaConstants.ChatMessage,\n});\nexport { ChatMessage };\n"],"names":["ButtonResetCss","background","border","padding","undefined","cursor","color","font","textAlign","outline","appearance","backgroundColor","_ChatMessage","_ref","ref","_ref$messageType","messageType","_ref$senderType","senderType","_ref$isLoading","isLoading","_ref$validationState","validationState","errorText","onClick","footerActions","children","leading","loadingText","_ref$wordBreak","wordBreak","maxWidth","thumbnails","onThumbnailClick","reasoningTraces","reasoningStatus","reasoningTitle","reasoningActiveStepIndex","props","_objectWithoutProperties","_excluded","shouldWrapInText","Array","isArray","every","child","loadingContent","_jsx","RollingText","texts","finalChildren","Text","weight","variant","size","getStringFromReactText","messageBubble","SelfMessageBubble","isChildText","DefaultMessageBubble","imagePreviewAlignment","_jsxs","BaseBox","display","flexDirection","gap","length","alignSelf","ThumbnailPreview","_objectSpread","metaAttribute","name","MetaConstants","ChatMessage","testID","makeAnalyticsAttribute","getStyledProps","as","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAMA,cAAc,GAAG;AACrBC,EAAAA,UAAU,EAAE,MAAM;AAClBC,EAAAA,MAAM,EAAE,MAAM;AACdC,EAAAA,OAAO,EAAEC,SAAS;AAClBC,EAAAA,MAAM,EAAE,SAAS;AACjBC,EAAAA,KAAK,EAAE,SAAS;AAChBC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,SAAS,EAAE,MAAe;AAC1BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,UAAU,EAAE,MAAM;AAClBC,EAAAA,eAAe,EAAE,SAAA;AACnB,CAAC,CAAA;AAED,IAAMC,YAA+E,GAAG,SAAlFA,YAA+EA,CAAAC,IAAA,EAsBnFC,GAA+B,EACR;AAAA,EAAA,IAAAC,gBAAA,GAAAF,IAAA,CArBrBG,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,SAAS,GAAAA,gBAAA;IAAAE,eAAA,GAAAJ,IAAA,CACvBK,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,eAAA;IAAAE,cAAA,GAAAN,IAAA,CACnBO,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KA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AACpE,YAAY,CAAC,EAAE;AAC3EqE,EAAAA,WAAW,EAAE,aAAa;EAC1BC,WAAW,EAAEV,aAAa,CAACC,WAAAA;AAC7B,CAAC;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import Rotate from './Rotate.web.js';
|
|
3
|
+
import { ReasoningTraces } from './ReasoningTraces.web.js';
|
|
3
4
|
import '../Box/BaseBox/index.js';
|
|
4
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
6
|
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
@@ -9,24 +10,42 @@ var DefaultMessageBubble = function DefaultMessageBubble(_ref) {
|
|
|
9
10
|
leading = _ref.leading,
|
|
10
11
|
isLoading = _ref.isLoading,
|
|
11
12
|
footerActions = _ref.footerActions,
|
|
12
|
-
isChildText = _ref.isChildText
|
|
13
|
+
isChildText = _ref.isChildText,
|
|
14
|
+
reasoningTraces = _ref.reasoningTraces,
|
|
15
|
+
reasoningStatus = _ref.reasoningStatus,
|
|
16
|
+
reasoningTitle = _ref.reasoningTitle,
|
|
17
|
+
reasoningActiveStepIndex = _ref.reasoningActiveStepIndex;
|
|
18
|
+
var hasReasoningTraces = reasoningTraces && reasoningTraces.length > 0;
|
|
13
19
|
return /*#__PURE__*/jsx(BaseBox, {
|
|
14
20
|
children: /*#__PURE__*/jsxs(BaseBox, {
|
|
15
21
|
display: "grid",
|
|
16
22
|
gridTemplateColumns: "auto 1fr",
|
|
17
|
-
gridTemplateRows: "auto auto",
|
|
18
23
|
columnGap: "spacing.4",
|
|
24
|
+
alignItems: "start",
|
|
19
25
|
children: [/*#__PURE__*/jsx(BaseBox, {
|
|
20
|
-
padding: "spacing.
|
|
26
|
+
padding: "spacing.1",
|
|
21
27
|
children: /*#__PURE__*/jsx(Rotate, {
|
|
22
28
|
animate: isLoading,
|
|
23
29
|
children: leading
|
|
24
30
|
})
|
|
25
|
-
}), /*#__PURE__*/
|
|
31
|
+
}), /*#__PURE__*/jsxs(BaseBox, {
|
|
26
32
|
display: "flex",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
flexDirection: "column",
|
|
34
|
+
children: [hasReasoningTraces && reasoningStatus === 'loading' && isLoading && /*#__PURE__*/jsx(BaseBox, {
|
|
35
|
+
paddingY: isChildText ? 'spacing.2' : 'spacing.0',
|
|
36
|
+
children: children
|
|
37
|
+
}), hasReasoningTraces && /*#__PURE__*/jsx(ReasoningTraces, {
|
|
38
|
+
traces: reasoningTraces,
|
|
39
|
+
status: reasoningStatus,
|
|
40
|
+
title: reasoningTitle,
|
|
41
|
+
activeStepIndex: reasoningActiveStepIndex
|
|
42
|
+
}), hasReasoningTraces && reasoningStatus === 'complete' && !isLoading && children && /*#__PURE__*/jsx(BaseBox, {
|
|
43
|
+
paddingY: isChildText ? 'spacing.2' : 'spacing.0',
|
|
44
|
+
children: children
|
|
45
|
+
}), !hasReasoningTraces && children && /*#__PURE__*/jsx(BaseBox, {
|
|
46
|
+
paddingY: isChildText ? 'spacing.2' : 'spacing.0',
|
|
47
|
+
children: children
|
|
48
|
+
})]
|
|
30
49
|
}), /*#__PURE__*/jsx(BaseBox, {
|
|
31
50
|
gridColumn: "2",
|
|
32
51
|
children: footerActions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultMessageBubble.web.js","sources":["../../../../../../src/components/ChatMessage/DefaultMessageBubble.web.tsx"],"sourcesContent":["import React from 'react';\nimport Rotate from './Rotate.web';\nimport type { CommonChatMessageProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst DefaultMessageBubble = ({\n children,\n leading,\n isLoading,\n footerActions,\n isChildText,\n}: Pick
|
|
1
|
+
{"version":3,"file":"DefaultMessageBubble.web.js","sources":["../../../../../../src/components/ChatMessage/DefaultMessageBubble.web.tsx"],"sourcesContent":["import React from 'react';\nimport Rotate from './Rotate.web';\nimport { ReasoningTraces } from './ReasoningTraces.web';\nimport type { CommonChatMessageProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst DefaultMessageBubble = ({\n children,\n leading,\n isLoading,\n footerActions,\n isChildText,\n reasoningTraces,\n reasoningStatus,\n reasoningTitle,\n reasoningActiveStepIndex,\n}: Pick<\n CommonChatMessageProps,\n | 'children'\n | 'leading'\n | 'isLoading'\n | 'footerActions'\n | 'reasoningTraces'\n | 'reasoningStatus'\n | 'reasoningTitle'\n | 'reasoningActiveStepIndex'\n> & {\n isChildText: boolean;\n}): React.ReactElement => {\n const hasReasoningTraces = reasoningTraces && reasoningTraces.length > 0;\n\n return (\n <BaseBox>\n <BaseBox\n display=\"grid\"\n gridTemplateColumns=\"auto 1fr\"\n columnGap=\"spacing.4\"\n alignItems=\"start\"\n >\n {/* Icon aligns with message content */}\n <BaseBox padding=\"spacing.1\">\n <Rotate animate={isLoading}>{leading as React.ReactElement}</Rotate>\n </BaseBox>\n\n {/* Column 2: Main message content + ReasoningTraces */}\n <BaseBox display=\"flex\" flexDirection=\"column\">\n {/* While loading: show loadingText above traces (only if reasoning is still loading) */}\n {hasReasoningTraces && reasoningStatus === 'loading' && isLoading && (\n <BaseBox paddingY={isChildText ? 'spacing.2' : 'spacing.0'}>{children}</BaseBox>\n )}\n\n {/* ReasoningTraces: shown while loading or when complete */}\n {hasReasoningTraces && (\n <ReasoningTraces\n traces={reasoningTraces}\n status={reasoningStatus}\n title={reasoningTitle}\n activeStepIndex={reasoningActiveStepIndex}\n />\n )}\n\n {/* When complete: show final content below reasoning (only if not loading) */}\n {hasReasoningTraces && reasoningStatus === 'complete' && !isLoading && children && (\n <BaseBox paddingY={isChildText ? 'spacing.2' : 'spacing.0'}>{children}</BaseBox>\n )}\n\n {/* No reasoning traces: show content normally */}\n {!hasReasoningTraces && children && (\n <BaseBox paddingY={isChildText ? 'spacing.2' : 'spacing.0'}>{children}</BaseBox>\n )}\n </BaseBox>\n\n <BaseBox gridColumn=\"2\">{footerActions}</BaseBox>\n </BaseBox>\n </BaseBox>\n );\n};\n\nexport { DefaultMessageBubble };\n"],"names":["DefaultMessageBubble","_ref","children","leading","isLoading","footerActions","isChildText","reasoningTraces","reasoningStatus","reasoningTitle","reasoningActiveStepIndex","hasReasoningTraces","length","_jsx","BaseBox","_jsxs","display","gridTemplateColumns","columnGap","alignItems","padding","Rotate","animate","flexDirection","paddingY","ReasoningTraces","traces","status","title","activeStepIndex","gridColumn"],"mappings":";;;;;;;AAMA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAsBA;AAAA,EAAA,IArBxBC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,eAAe,GAAAN,IAAA,CAAfM,eAAe;IACfC,eAAe,GAAAP,IAAA,CAAfO,eAAe;IACfC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;IACdC,wBAAwB,GAAAT,IAAA,CAAxBS,wBAAwB,CAAA;EAcxB,IAAMC,kBAAkB,GAAGJ,eAAe,IAAIA,eAAe,CAACK,MAAM,GAAG,CAAC,CAAA;EAExE,oBACEC,GAAA,CAACC,OAAO,EAAA;IAAAZ,QAAA,eACNa,IAAA,CAACD,OAAO,EAAA;AACNE,MAAAA,OAAO,EAAC,MAAM;AACdC,MAAAA,mBAAmB,EAAC,UAAU;AAC9BC,MAAAA,SAAS,EAAC,WAAW;AACrBC,MAAAA,UAAU,EAAC,OAAO;MAAAjB,QAAA,EAAA,cAGlBW,GAAA,CAACC,OAAO,EAAA;AAACM,QAAAA,OAAO,EAAC,WAAW;QAAAlB,QAAA,eAC1BW,GAAA,CAACQ,MAAM,EAAA;AAACC,UAAAA,OAAO,EAAElB,SAAU;AAAAF,UAAAA,QAAA,EAAEC,OAAAA;SAAsC,CAAA;AAAC,OAC7D,CAAC,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