{
  "version": 3,
  "sources": ["../../../../src/lib/shapes/note/DefaultNoteShapeAttribution.tsx"],
  "sourcesContent": ["import { TLNoteShape } from '@tldraw/editor'\nimport { ComponentType } from 'react'\nimport { TldrawUiTooltip } from '../../ui/components/primitives/TldrawUiTooltip'\n\n/** @public */\nexport interface TLNoteShapeAttributionProps {\n\t/** The note shape the attribution belongs to. */\n\tshape: TLNoteShape\n\t/** The full display name of the user who last edited the note's text. */\n\tname: string\n\t/** The first name (the part shown in the badge). */\n\tfirstName: string\n\t/** The label color to use for the badge. */\n\tcolor: string\n\t/** The note's scale. Only meaningful for the `'canvas'` variant. */\n\tscale: number\n\t/**\n\t * Where the attribution is being rendered. The `'canvas'` variant renders the interactive badge\n\t * (with a tooltip); the `'export'` variant renders static markup suitable for an SVG/PNG export.\n\t */\n\tvariant: 'canvas' | 'export'\n}\n\n/**\n * The default attribution badge shown in the corner of a note shape \u2014 the display name of the user\n * who last edited the note's text.\n *\n * Override it (or hide it) with the note shape util's `AttributionComponent` option:\n *\n * ```tsx\n * // hide the attribution badge\n * <Tldraw shapeUtils={[NoteShapeUtil.configure({ AttributionComponent: null })]} />\n *\n * // render your own\n * <Tldraw shapeUtils={[NoteShapeUtil.configure({ AttributionComponent: (props) => <MyBadge {...props} /> })]} />\n * ```\n *\n * @public @react\n */\nexport function DefaultNoteShapeAttribution({\n\tname,\n\tfirstName,\n\tcolor,\n\tscale,\n\tvariant,\n}: TLNoteShapeAttributionProps) {\n\tif (variant === 'export') {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName=\"tl-note__attribution\"\n\t\t\t\tstyle={{\n\t\t\t\t\tfontSize: 11,\n\t\t\t\t\tcolor,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{firstName}\n\t\t\t</div>\n\t\t)\n\t}\n\n\treturn (\n\t\t<TldrawUiTooltip content={name} side=\"bottom\">\n\t\t\t<div\n\t\t\t\tclassName=\"tl-note__attribution\"\n\t\t\t\tstyle={{\n\t\t\t\t\t['--note-attribution-scale' as string]: scale,\n\t\t\t\t\tfontSize: 11 * scale,\n\t\t\t\t\tcolor,\n\t\t\t\t\topacity: 0.6,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{firstName}\n\t\t\t</div>\n\t\t</TldrawUiTooltip>\n\t)\n}\n\n/**\n * The component used to render a note shape's attribution badge, or `null` to hide it.\n *\n * @public\n */\nexport type TLNoteShapeAttributionComponent = ComponentType<TLNoteShapeAttributionProps> | null\n"],
  "mappings": "AAgDG;AA9CH,SAAS,uBAAuB;AAqCzB,SAAS,4BAA4B;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAgC;AAC/B,MAAI,YAAY,UAAU;AACzB,WACC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,OAAO;AAAA,UACN,UAAU;AAAA,UACV;AAAA,UACA,SAAS;AAAA,QACV;AAAA,QAEC;AAAA;AAAA,IACF;AAAA,EAEF;AAEA,SACC,oBAAC,mBAAgB,SAAS,MAAM,MAAK,UACpC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAO;AAAA,QACN,CAAC,0BAAoC,GAAG;AAAA,QACxC,UAAU,KAAK;AAAA,QACf;AAAA,QACA,SAAS;AAAA,MACV;AAAA,MAEC;AAAA;AAAA,EACF,GACD;AAEF;",
  "names": []
}
