{ "version": 3, "sources": ["../../../../../src/lib/ui/components/StylePanel/StylePanel.tsx"], "sourcesContent": ["import {\n\tArrowShapeArrowheadEndStyle,\n\tArrowShapeArrowheadStartStyle,\n\tDefaultColorStyle,\n\tDefaultDashStyle,\n\tDefaultFillStyle,\n\tDefaultFontStyle,\n\tDefaultHorizontalAlignStyle,\n\tDefaultSizeStyle,\n\tDefaultVerticalAlignStyle,\n\tGeoShapeGeoStyle,\n\tLineShapeSplineStyle,\n\tReadonlySharedStyleMap,\n\tSharedStyle,\n\tStyleProp,\n\tminBy,\n\tuseEditor,\n} from '@tldraw/editor'\nimport React, { useCallback } from 'react'\nimport { useRelevantStyles } from '../../hooks/useRevelantStyles'\nimport { useTranslation } from '../../hooks/useTranslation/useTranslation'\nimport { Button } from '../primitives/Button'\nimport { ButtonPicker } from '../primitives/ButtonPicker'\nimport { Slider } from '../primitives/Slider'\nimport { DoubleDropdownPicker } from './DoubleDropdownPicker'\nimport { DropdownPicker } from './DropdownPicker'\nimport { STYLES } from './styles'\n\ninterface StylePanelProps {\n\tisMobile?: boolean\n}\n\n/** @internal */\nexport const StylePanel = function StylePanel({ isMobile }: StylePanelProps) {\n\tconst editor = useEditor()\n\n\tconst relevantStyles = useRelevantStyles()\n\n\tconst handlePointerOut = useCallback(() => {\n\t\tif (!isMobile) {\n\t\t\teditor.updateInstanceState({ isChangingStyle: false })\n\t\t}\n\t}, [editor, isMobile])\n\n\tif (!relevantStyles) return null\n\n\tconst { styles, opacity } = relevantStyles\n\tconst geo = styles.get(GeoShapeGeoStyle)\n\tconst arrowheadEnd = styles.get(ArrowShapeArrowheadEndStyle)\n\tconst arrowheadStart = styles.get(ArrowShapeArrowheadStartStyle)\n\tconst spline = styles.get(LineShapeSplineStyle)\n\tconst font = styles.get(DefaultFontStyle)\n\n\tconst hideGeo = geo === undefined\n\tconst hideArrowHeads = arrowheadEnd === undefined && arrowheadStart === undefined\n\tconst hideSpline = spline === undefined\n\tconst hideText = font === undefined\n\n\treturn (\n\t\t