@bigbluebutton/tldraw 2.0.0-alpha.23 → 2.0.0-alpha.25

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.
Files changed (85) hide show
  1. package/dist-cjs/index.d.ts +9 -1
  2. package/dist-cjs/lib/defaultShapeUtils.js +3 -1
  3. package/dist-cjs/lib/defaultShapeUtils.js.map +2 -2
  4. package/dist-cjs/lib/shapes/arrow/ArrowShapeUtil.js.map +2 -2
  5. package/dist-cjs/lib/shapes/poll/PollShapeTool.js +30 -0
  6. package/dist-cjs/lib/shapes/poll/PollShapeTool.js.map +7 -0
  7. package/dist-cjs/lib/shapes/poll/PollShapeUtil.js +121 -0
  8. package/dist-cjs/lib/shapes/poll/PollShapeUtil.js.map +7 -0
  9. package/dist-cjs/lib/shapes/poll/components/poll-content.js +101 -0
  10. package/dist-cjs/lib/shapes/poll/components/poll-content.js.map +7 -0
  11. package/dist-cjs/lib/shapes/poll/components/styles.js +53 -0
  12. package/dist-cjs/lib/shapes/poll/components/styles.js.map +7 -0
  13. package/dist-cjs/lib/shapes/poll/poll-shape-migrations.js +45 -0
  14. package/dist-cjs/lib/shapes/poll/poll-shape-migrations.js.map +7 -0
  15. package/dist-cjs/lib/shapes/poll/poll-shape-props.js +39 -0
  16. package/dist-cjs/lib/shapes/poll/poll-shape-props.js.map +7 -0
  17. package/dist-cjs/lib/shapes/poll/poll-shape-types.js +17 -0
  18. package/dist-cjs/lib/shapes/poll/poll-shape-types.js.map +7 -0
  19. package/dist-cjs/lib/tools/HandTool/HandTool.js +3 -3
  20. package/dist-cjs/lib/tools/HandTool/HandTool.js.map +2 -2
  21. package/dist-cjs/lib/ui/components/ContextMenu.js +0 -1
  22. package/dist-cjs/lib/ui/components/ContextMenu.js.map +2 -2
  23. package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
  24. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js +6 -1
  25. package/dist-cjs/lib/ui/hooks/useTranslation/defaultTranslation.js.map +2 -2
  26. package/dist-cjs/lib/ui/hooks/useTranslation/translations.js +1 -1
  27. package/dist-cjs/lib/ui/hooks/useTranslation/translations.js.map +2 -2
  28. package/dist-esm/index.d.mts +9 -1
  29. package/dist-esm/lib/defaultShapeUtils.mjs +3 -1
  30. package/dist-esm/lib/defaultShapeUtils.mjs.map +2 -2
  31. package/dist-esm/lib/shapes/arrow/ArrowShapeUtil.mjs.map +2 -2
  32. package/dist-esm/lib/shapes/poll/PollShapeTool.mjs +10 -0
  33. package/dist-esm/lib/shapes/poll/PollShapeTool.mjs.map +7 -0
  34. package/dist-esm/lib/shapes/poll/PollShapeUtil.mjs +97 -0
  35. package/dist-esm/lib/shapes/poll/PollShapeUtil.mjs.map +7 -0
  36. package/dist-esm/lib/shapes/poll/components/poll-content.mjs +71 -0
  37. package/dist-esm/lib/shapes/poll/components/poll-content.mjs.map +7 -0
  38. package/dist-esm/lib/shapes/poll/components/styles.mjs +23 -0
  39. package/dist-esm/lib/shapes/poll/components/styles.mjs.map +7 -0
  40. package/dist-esm/lib/shapes/poll/poll-shape-migrations.mjs +25 -0
  41. package/dist-esm/lib/shapes/poll/poll-shape-migrations.mjs.map +7 -0
  42. package/dist-esm/lib/shapes/poll/poll-shape-props.mjs +19 -0
  43. package/dist-esm/lib/shapes/poll/poll-shape-props.mjs.map +7 -0
  44. package/dist-esm/lib/shapes/poll/poll-shape-types.mjs +1 -0
  45. package/dist-esm/lib/shapes/poll/poll-shape-types.mjs.map +7 -0
  46. package/dist-esm/lib/tools/HandTool/HandTool.mjs +3 -3
  47. package/dist-esm/lib/tools/HandTool/HandTool.mjs.map +2 -2
  48. package/dist-esm/lib/ui/components/ContextMenu.mjs +0 -1
  49. package/dist-esm/lib/ui/components/ContextMenu.mjs.map +2 -2
  50. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs +6 -1
  51. package/dist-esm/lib/ui/hooks/useTranslation/defaultTranslation.mjs.map +2 -2
  52. package/dist-esm/lib/ui/hooks/useTranslation/translations.mjs +1 -1
  53. package/dist-esm/lib/ui/hooks/useTranslation/translations.mjs.map +2 -2
  54. package/package.json +4 -3
  55. package/src/lib/Tldraw.test.tsx +9 -13
  56. package/src/lib/defaultShapeUtils.ts +2 -0
  57. package/src/lib/shapes/arrow/ArrowShapeUtil.tsx +1 -1
  58. package/src/lib/shapes/line/__snapshots__/LineShapeUtil.test.ts.snap +6 -6
  59. package/src/lib/shapes/poll/PollShapeTool.tsx +7 -0
  60. package/src/lib/shapes/poll/PollShapeUtil.tsx +108 -0
  61. package/src/lib/shapes/poll/components/poll-content.tsx +100 -0
  62. package/src/lib/shapes/poll/components/styles.ts +21 -0
  63. package/src/lib/shapes/poll/poll-shape-migrations.ts +23 -0
  64. package/src/lib/shapes/poll/poll-shape-props.ts +17 -0
  65. package/src/lib/shapes/poll/poll-shape-types.ts +21 -0
  66. package/src/lib/tools/HandTool/HandTool.ts +4 -5
  67. package/src/lib/ui/components/ContextMenu.tsx +1 -1
  68. package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +5 -0
  69. package/src/lib/ui/hooks/useTranslation/defaultTranslation.ts +5 -0
  70. package/src/lib/ui/hooks/useTranslation/translations.ts +1 -1
  71. package/src/test/Editor.test.tsx +2 -2
  72. package/src/test/HandTool.test.ts +55 -56
  73. package/src/test/TLSessionStateSnapshot.test.ts +5 -5
  74. package/src/test/TestEditor.ts +4 -1
  75. package/src/test/TldrawEditor.test.tsx +28 -30
  76. package/src/test/__snapshots__/resizing.test.ts.snap +8 -8
  77. package/src/test/commands/__snapshots__/packShapes.test.ts.snap +20 -20
  78. package/src/test/commands/__snapshots__/zoomToFit.test.ts.snap +2 -2
  79. package/src/test/commands/createShapes.test.ts +1 -1
  80. package/src/test/commands/putContent.test.ts +4 -4
  81. package/src/test/commands/updateShapes.test.ts +1 -1
  82. package/src/test/resizing.test.ts +203 -203
  83. package/src/test/selection-omnibus.test.ts +41 -41
  84. package/src/test/test-jsx.tsx +7 -3
  85. package/src/test/translating.test.ts +42 -42
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/shapes/arrow/ArrowShapeUtil.tsx"],
4
- "sourcesContent": ["import {\n\tArc2d,\n\tBox2d,\n\tDefaultFontFamilies,\n\tEdge2d,\n\tGroup2d,\n\tRectangle2d,\n\tSVGContainer,\n\tShapeUtil,\n\tSvgExportContext,\n\tTLArrowShape,\n\tTLArrowShapeArrowheadStyle,\n\tTLDefaultColorStyle,\n\tTLDefaultColorTheme,\n\tTLDefaultFillStyle,\n\tTLHandle,\n\tTLOnEditEndHandler,\n\tTLOnHandleChangeHandler,\n\tTLOnResizeHandler,\n\tTLOnTranslateStartHandler,\n\tTLShapePartial,\n\tTLShapeUtilCanvasSvgDef,\n\tTLShapeUtilFlag,\n\tVec2d,\n\tarrowShapeMigrations,\n\tarrowShapeProps,\n\tdeepCopy,\n\tgetArrowTerminalsInArrowSpace,\n\tgetArrowheadPathForType,\n\tgetCurvedArrowHandlePath,\n\tgetDefaultColorTheme,\n\tgetSolidCurvedArrowPath,\n\tgetSolidStraightArrowPath,\n\tgetStraightArrowHandlePath,\n\ttoDomPrecision,\n\tuseIsEditing,\n} from '@bigbluebutton/editor'\nimport React from 'react'\nimport { ShapeFill, getShapeFillSvg, useDefaultColorTheme } from '../shared/ShapeFill'\nimport { createTextSvgElementFromSpans } from '../shared/createTextSvgElementFromSpans'\nimport {\n\tARROW_LABEL_FONT_SIZES,\n\tFONT_FAMILIES,\n\tSTROKE_SIZES,\n\tTEXT_PROPS,\n} from '../shared/default-shape-constants'\nimport {\n\tgetFillDefForCanvas,\n\tgetFillDefForExport,\n\tgetFontDefForExport,\n} from '../shared/defaultStyleDefs'\nimport { getPerfectDashProps } from '../shared/getPerfectDashProps'\nimport { ArrowTextLabel } from './components/ArrowTextLabel'\n\nlet globalRenderIndex = 0\n\nexport const ARROW_END_OFFSET = 0.1\n\n/** @public */\nexport class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {\n\tstatic override type = 'arrow' as const\n\tstatic override props = arrowShapeProps\n\tstatic override migrations = arrowShapeMigrations\n\n\toverride canEdit = () => true\n\toverride canBind = () => false\n\toverride canSnap = () => false\n\toverride hideResizeHandles: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideRotateHandle: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideSelectionBoundsBg: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideSelectionBoundsFg: TLShapeUtilFlag<TLArrowShape> = () => true\n\n\toverride getDefaultProps(): TLArrowShape['props'] {\n\t\treturn {\n\t\t\tdash: 'draw',\n\t\t\tsize: 'm',\n\t\t\tfill: 'none',\n\t\t\tcolor: 'black',\n\t\t\tlabelColor: 'black',\n\t\t\tbend: 0,\n\t\t\tstart: { type: 'point', x: 0, y: 0 },\n\t\t\tend: { type: 'point', x: 2, y: 0 },\n\t\t\tarrowheadStart: 'none',\n\t\t\tarrowheadEnd: 'arrow',\n\t\t\ttext: '',\n\t\t\tfont: 'draw',\n\t\t}\n\t}\n\n\tgetGeometry(shape: TLArrowShape) {\n\t\tconst info = this.editor.getArrowInfo(shape)!\n\n\t\tconst bodyGeom = info.isStraight\n\t\t\t? new Edge2d({\n\t\t\t\t\tstart: Vec2d.From(info.start.point),\n\t\t\t\t\tend: Vec2d.From(info.end.point),\n\t\t\t })\n\t\t\t: new Arc2d({\n\t\t\t\t\tcenter: Vec2d.Cast(info.handleArc.center),\n\t\t\t\t\tradius: info.handleArc.radius,\n\t\t\t\t\tstart: Vec2d.Cast(info.start.point),\n\t\t\t\t\tend: Vec2d.Cast(info.end.point),\n\t\t\t\t\tsweepFlag: info.bodyArc.sweepFlag,\n\t\t\t\t\tlargeArcFlag: info.bodyArc.largeArcFlag,\n\t\t\t })\n\n\t\tlet labelGeom: Rectangle2d | undefined\n\n\t\tif (shape.props.text.trim()) {\n\t\t\tconst bodyBounds = bodyGeom.bounds\n\n\t\t\tconst { w, h } = this.editor.textMeasure.measureText(shape.props.text, {\n\t\t\t\t...TEXT_PROPS,\n\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\tmaxWidth: null,\n\t\t\t})\n\n\t\t\tlet width = w\n\t\t\tlet height = h\n\n\t\t\tif (bodyBounds.width > bodyBounds.height) {\n\t\t\t\twidth = Math.max(Math.min(w, 64), Math.min(bodyBounds.width - 64, w))\n\n\t\t\t\tconst { w: squishedWidth, h: squishedHeight } = this.editor.textMeasure.measureText(\n\t\t\t\t\tshape.props.text,\n\t\t\t\t\t{\n\t\t\t\t\t\t...TEXT_PROPS,\n\t\t\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\t\t\tmaxWidth: width,\n\t\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\twidth = squishedWidth\n\t\t\t\theight = squishedHeight\n\t\t\t}\n\n\t\t\tif (width > 16 * ARROW_LABEL_FONT_SIZES[shape.props.size]) {\n\t\t\t\twidth = 16 * ARROW_LABEL_FONT_SIZES[shape.props.size]\n\n\t\t\t\tconst { w: squishedWidth, h: squishedHeight } = this.editor.textMeasure.measureText(\n\t\t\t\t\tshape.props.text,\n\t\t\t\t\t{\n\t\t\t\t\t\t...TEXT_PROPS,\n\t\t\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\t\t\tmaxWidth: width,\n\t\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\twidth = squishedWidth\n\t\t\t\theight = squishedHeight\n\t\t\t}\n\n\t\t\tlabelGeom = new Rectangle2d({\n\t\t\t\tx: info.middle.x - width / 2 - 4.25,\n\t\t\t\ty: info.middle.y - height / 2 - 4.25,\n\t\t\t\twidth: width + 8.5,\n\t\t\t\theight: height + 8.5,\n\t\t\t\tisFilled: true,\n\t\t\t\tisLabel: true,\n\t\t\t})\n\t\t}\n\n\t\treturn new Group2d({\n\t\t\tchildren: labelGeom ? [bodyGeom, labelGeom] : [bodyGeom],\n\t\t\tisSnappable: false,\n\t\t})\n\t}\n\n\toverride getHandles(shape: TLArrowShape): TLHandle[] {\n\t\tconst info = this.editor.getArrowInfo(shape)!\n\t\treturn [\n\t\t\t{\n\t\t\t\tid: 'start',\n\t\t\t\ttype: 'vertex',\n\t\t\t\tindex: 'a0',\n\t\t\t\tx: info.start.handle.x,\n\t\t\t\ty: info.start.handle.y,\n\t\t\t\tcanBind: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'middle',\n\t\t\t\ttype: 'virtual',\n\t\t\t\tindex: 'a2',\n\t\t\t\tx: info.middle.x,\n\t\t\t\ty: info.middle.y,\n\t\t\t\tcanBind: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'end',\n\t\t\t\ttype: 'vertex',\n\t\t\t\tindex: 'a3',\n\t\t\t\tx: info.end.handle.x,\n\t\t\t\ty: info.end.handle.y,\n\t\t\t\tcanBind: true,\n\t\t\t},\n\t\t]\n\t}\n\n\toverride onHandleChange: TLOnHandleChangeHandler<TLArrowShape> = (\n\t\tshape,\n\t\t{ handle, isPrecise }\n\t) => {\n\t\tconst handleId = handle.id as 'start' | 'middle' | 'end'\n\n\t\tif (handleId === 'middle') {\n\t\t\t// Bending the arrow...\n\t\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\t\tconst delta = Vec2d.Sub(end, start)\n\t\t\tconst v = Vec2d.Per(delta)\n\n\t\t\tconst med = Vec2d.Med(end, start)\n\t\t\tconst A = Vec2d.Sub(med, v)\n\t\t\tconst B = Vec2d.Add(med, v)\n\n\t\t\tconst point = Vec2d.NearestPointOnLineSegment(A, B, handle, false)\n\t\t\tlet bend = Vec2d.Dist(point, med)\n\t\t\tif (Vec2d.Clockwise(point, end, med)) bend *= -1\n\t\t\treturn { id: shape.id, type: shape.type, props: { bend } }\n\t\t}\n\n\t\t// Start or end, pointing the arrow...\n\n\t\tconst next = deepCopy(shape) as TLArrowShape\n\n\t\tconst pageTransform = this.editor.getShapePageTransform(next.id)!\n\t\tconst pointInPageSpace = pageTransform.applyToPoint(handle)\n\n\t\tif (this.editor.inputs.ctrlKey) {\n\t\t\t// todo: maybe double check that this isn't equal to the other handle too?\n\t\t\t// Skip binding\n\t\t\tnext.props[handleId] = {\n\t\t\t\ttype: 'point',\n\t\t\t\tx: handle.x,\n\t\t\t\ty: handle.y,\n\t\t\t}\n\t\t\treturn next\n\t\t}\n\n\t\tconst point = this.editor.getShapePageTransform(shape.id)!.applyToPoint(handle)\n\n\t\tconst target = this.editor.getShapeAtPoint(point, {\n\t\t\thitInside: true,\n\t\t\thitFrameInside: true,\n\t\t\tmargin: 0,\n\t\t\tfilter: (targetShape) => {\n\t\t\t\treturn !targetShape.isLocked && this.editor.getShapeUtil(targetShape).canBind(targetShape)\n\t\t\t},\n\t\t})\n\n\t\tif (!target) {\n\t\t\t// todo: maybe double check that this isn't equal to the other handle too?\n\t\t\tnext.props[handleId] = {\n\t\t\t\ttype: 'point',\n\t\t\t\tx: handle.x,\n\t\t\t\ty: handle.y,\n\t\t\t}\n\t\t\treturn next\n\t\t}\n\n\t\t// we've got a target! the handle is being dragged over a shape, bind to it\n\n\t\tconst targetGeometry = this.editor.getShapeGeometry(target)\n\t\tconst targetBounds = Box2d.ZeroFix(targetGeometry.bounds)\n\t\tconst pointInTargetSpace = this.editor.getPointInShapeSpace(target, pointInPageSpace)\n\n\t\tlet precise = isPrecise\n\n\t\tif (!precise) {\n\t\t\t// If we're switching to a new bound shape, then precise only if moving slowly\n\t\t\tconst prevHandle = next.props[handleId]\n\t\t\tif (\n\t\t\t\tprevHandle.type === 'point' ||\n\t\t\t\t(prevHandle.type === 'binding' && target.id !== prevHandle.boundShapeId)\n\t\t\t) {\n\t\t\t\tprecise = this.editor.inputs.pointerVelocity.len() < 0.5\n\t\t\t}\n\t\t}\n\n\t\tif (!isPrecise) {\n\t\t\tif (!targetGeometry.isClosed) {\n\t\t\t\tprecise = true\n\t\t\t}\n\n\t\t\t// Double check that we're not going to be doing an imprecise snap on\n\t\t\t// the same shape twice, as this would result in a zero length line\n\t\t\tconst otherHandle = next.props[handleId === 'start' ? 'end' : 'start']\n\t\t\tif (\n\t\t\t\totherHandle.type === 'binding' &&\n\t\t\t\ttarget.id === otherHandle.boundShapeId &&\n\t\t\t\totherHandle.isPrecise\n\t\t\t) {\n\t\t\t\tprecise = true\n\t\t\t}\n\t\t}\n\n\t\tconst normalizedAnchor = {\n\t\t\tx: (pointInTargetSpace.x - targetBounds.minX) / targetBounds.width,\n\t\t\ty: (pointInTargetSpace.y - targetBounds.minY) / targetBounds.height,\n\t\t}\n\n\t\tif (precise) {\n\t\t\t// Turn off precision if we're within a certain distance to the center of the shape.\n\t\t\t// Funky math but we want the snap distance to be 4 at the minimum and either\n\t\t\t// 16 or 15% of the smaller dimension of the target shape, whichever is smaller\n\t\t\tif (\n\t\t\t\tVec2d.Dist(pointInTargetSpace, targetBounds.center) <\n\t\t\t\tMath.max(4, Math.min(Math.min(targetBounds.width, targetBounds.height) * 0.15, 16)) /\n\t\t\t\t\tthis.editor.getZoomLevel()\n\t\t\t) {\n\t\t\t\tnormalizedAnchor.x = 0.5\n\t\t\t\tnormalizedAnchor.y = 0.5\n\t\t\t}\n\t\t}\n\n\t\tnext.props[handleId] = {\n\t\t\ttype: 'binding',\n\t\t\tboundShapeId: target.id,\n\t\t\tnormalizedAnchor: normalizedAnchor,\n\t\t\tisPrecise: precise,\n\t\t\tisExact: this.editor.inputs.altKey,\n\t\t}\n\n\t\tif (next.props.start.type === 'binding' && next.props.end.type === 'binding') {\n\t\t\tif (next.props.start.boundShapeId === next.props.end.boundShapeId) {\n\t\t\t\tif (Vec2d.Equals(next.props.start.normalizedAnchor, next.props.end.normalizedAnchor)) {\n\t\t\t\t\tnext.props.end.normalizedAnchor.x += 0.05\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn next\n\t}\n\n\toverride onTranslateStart: TLOnTranslateStartHandler<TLArrowShape> = (shape) => {\n\t\tconst startBindingId =\n\t\t\tshape.props.start.type === 'binding' ? shape.props.start.boundShapeId : null\n\t\tconst endBindingId = shape.props.end.type === 'binding' ? shape.props.end.boundShapeId : null\n\n\t\t// If at least one bound shape is in the selection, do nothing;\n\t\t// If no bound shapes are in the selection, unbind any bound shapes\n\n\t\tconst selectedShapeIds = this.editor.getSelectedShapeIds()\n\n\t\tif (\n\t\t\t(startBindingId &&\n\t\t\t\t(selectedShapeIds.includes(startBindingId) ||\n\t\t\t\t\tthis.editor.isAncestorSelected(startBindingId))) ||\n\t\t\t(endBindingId &&\n\t\t\t\t(selectedShapeIds.includes(endBindingId) || this.editor.isAncestorSelected(endBindingId)))\n\t\t) {\n\t\t\treturn\n\t\t}\n\n\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\treturn {\n\t\t\tid: shape.id,\n\t\t\ttype: shape.type,\n\t\t\tprops: {\n\t\t\t\t...shape.props,\n\t\t\t\tstart: {\n\t\t\t\t\ttype: 'point',\n\t\t\t\t\tx: start.x,\n\t\t\t\t\ty: start.y,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\ttype: 'point',\n\t\t\t\t\tx: end.x,\n\t\t\t\t\ty: end.y,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\toverride onResize: TLOnResizeHandler<TLArrowShape> = (shape, info) => {\n\t\tconst { scaleX, scaleY } = info\n\n\t\tconst terminals = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\tconst { start, end } = deepCopy<TLArrowShape['props']>(shape.props)\n\t\tlet { bend } = shape.props\n\n\t\t// Rescale start handle if it's not bound to a shape\n\t\tif (start.type === 'point') {\n\t\t\tstart.x = terminals.start.x * scaleX\n\t\t\tstart.y = terminals.start.y * scaleY\n\t\t}\n\n\t\t// Rescale end handle if it's not bound to a shape\n\t\tif (end.type === 'point') {\n\t\t\tend.x = terminals.end.x * scaleX\n\t\t\tend.y = terminals.end.y * scaleY\n\t\t}\n\n\t\t// todo: we should only change the normalized anchor positions\n\t\t// of the shape's handles if the bound shape is also being resized\n\n\t\tconst mx = Math.abs(scaleX)\n\t\tconst my = Math.abs(scaleY)\n\n\t\tif (scaleX < 0 && scaleY >= 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= -1\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.x = 1 - start.normalizedAnchor.x\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.x = 1 - end.normalizedAnchor.x\n\t\t\t}\n\t\t} else if (scaleX >= 0 && scaleY < 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= -1\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.y = 1 - start.normalizedAnchor.y\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.y = 1 - end.normalizedAnchor.y\n\t\t\t}\n\t\t} else if (scaleX >= 0 && scaleY >= 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\t\t} else if (scaleX < 0 && scaleY < 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.x = 1 - start.normalizedAnchor.x\n\t\t\t\tstart.normalizedAnchor.y = 1 - start.normalizedAnchor.y\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.x = 1 - end.normalizedAnchor.x\n\t\t\t\tend.normalizedAnchor.y = 1 - end.normalizedAnchor.y\n\t\t\t}\n\t\t}\n\n\t\tconst next = {\n\t\t\tprops: {\n\t\t\t\tstart,\n\t\t\t\tend,\n\t\t\t\tbend,\n\t\t\t},\n\t\t}\n\n\t\treturn next\n\t}\n\n\toverride onDoubleClickHandle = (\n\t\tshape: TLArrowShape,\n\t\thandle: TLHandle\n\t): TLShapePartial<TLArrowShape> | void => {\n\t\tswitch (handle.id) {\n\t\t\tcase 'start': {\n\t\t\t\treturn {\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tarrowheadStart: shape.props.arrowheadStart === 'none' ? 'arrow' : 'none',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 'end': {\n\t\t\t\treturn {\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tarrowheadEnd: shape.props.arrowheadEnd === 'none' ? 'arrow' : 'none',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponent(shape: TLArrowShape) {\n\t\t// Not a class component, but eslint can't tell that :(\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst theme = useDefaultColorTheme()\n\t\tconst onlySelectedShape = this.editor.getOnlySelectedShape()\n\t\tconst shouldDisplayHandles =\n\t\t\tthis.editor.isInAny(\n\t\t\t\t'select.idle',\n\t\t\t\t'select.pointing_handle',\n\t\t\t\t'select.dragging_handle',\n\t\t\t\t'arrow.dragging'\n\t\t\t) && !this.editor.getInstanceState().isReadonly\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\t\tconst bounds = Box2d.ZeroFix(this.editor.getShapeGeometry(shape).bounds)\n\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst changeIndex = React.useMemo<number>(() => {\n\t\t\treturn this.editor.environment.isSafari ? (globalRenderIndex += 1) : 0\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [shape])\n\n\t\tif (!info?.isValid) return null\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst path = info.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info)\n\n\t\tlet handlePath: null | JSX.Element = null\n\n\t\tif (onlySelectedShape === shape && shouldDisplayHandles) {\n\t\t\tconst sw = 2\n\t\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\t\tinfo.isStraight\n\t\t\t\t\t? Vec2d.Dist(info.start.handle, info.end.handle)\n\t\t\t\t\t: Math.abs(info.handleArc.length),\n\t\t\t\tsw,\n\t\t\t\t{\n\t\t\t\t\tend: 'skip',\n\t\t\t\t\tstart: 'skip',\n\t\t\t\t\tlengthRatio: 2.5,\n\t\t\t\t}\n\t\t\t)\n\n\t\t\thandlePath =\n\t\t\t\tshape.props.start.type === 'binding' || shape.props.end.type === 'binding' ? (\n\t\t\t\t\t<path\n\t\t\t\t\t\tclassName=\"tl-arrow-hint\"\n\t\t\t\t\t\td={info.isStraight ? getStraightArrowHandlePath(info) : getCurvedArrowHandlePath(info)}\n\t\t\t\t\t\tstrokeDasharray={strokeDasharray}\n\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\tstrokeWidth={sw}\n\t\t\t\t\t\tmarkerStart={\n\t\t\t\t\t\t\tshape.props.start.type === 'binding'\n\t\t\t\t\t\t\t\t? shape.props.start.isExact\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: shape.props.start.isPrecise\n\t\t\t\t\t\t\t\t\t? 'url(#arrowhead-cross)'\n\t\t\t\t\t\t\t\t\t: 'url(#arrowhead-dot)'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmarkerEnd={\n\t\t\t\t\t\t\tshape.props.end.type === 'binding'\n\t\t\t\t\t\t\t\t? shape.props.end.isExact\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: shape.props.end.isPrecise\n\t\t\t\t\t\t\t\t\t? 'url(#arrowhead-cross)'\n\t\t\t\t\t\t\t\t\t: 'url(#arrowhead-dot)'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\topacity={0.16}\n\t\t\t\t\t/>\n\t\t\t\t) : null\n\t\t}\n\n\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\tinfo.isStraight ? info.length : Math.abs(info.bodyArc.length),\n\t\t\tstrokeWidth,\n\t\t\t{\n\t\t\t\tstyle: shape.props.dash,\n\t\t\t}\n\t\t)\n\n\t\tconst labelGeometry = shape.props.text.trim()\n\t\t\t? (this.editor.getShapeGeometry<Group2d>(shape).children[1] as Rectangle2d)\n\t\t\t: null\n\n\t\tconst maskStartArrowhead = !(\n\t\t\tinfo.start.arrowhead === 'none' || info.start.arrowhead === 'arrow'\n\t\t)\n\t\tconst maskEndArrowhead = !(info.end.arrowhead === 'none' || info.end.arrowhead === 'arrow')\n\n\t\t// NOTE: I know right setting `changeIndex` hacky-as right! But we need this because otherwise safari loses\n\t\t// the mask, see <https://linear.app/tldraw/issue/TLD-1500/changing-arrow-color-makes-line-pass-through-text>\n\t\tconst maskId = (shape.id + '_clip_' + changeIndex).replace(':', '_')\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<SVGContainer id={shape.id} style={{ minWidth: 50, minHeight: 50 }}>\n\t\t\t\t\t{/* Yep */}\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<mask id={maskId}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={toDomPrecision(-100 + bounds.minX)}\n\t\t\t\t\t\t\t\ty={toDomPrecision(-100 + bounds.minY)}\n\t\t\t\t\t\t\t\twidth={toDomPrecision(bounds.width + 200)}\n\t\t\t\t\t\t\t\theight={toDomPrecision(bounds.height + 200)}\n\t\t\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{labelGeometry && (\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tx={labelGeometry.x}\n\t\t\t\t\t\t\t\t\ty={labelGeometry.y}\n\t\t\t\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\t\t\t\tfill=\"black\"\n\t\t\t\t\t\t\t\t\trx={4}\n\t\t\t\t\t\t\t\t\try={4}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{as && maskStartArrowhead && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={as}\n\t\t\t\t\t\t\t\t\tfill={info.start.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{ae && maskEndArrowhead && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={ae}\n\t\t\t\t\t\t\t\t\tfill={info.end.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</mask>\n\t\t\t\t\t</defs>\n\t\t\t\t\t<g\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke={theme[shape.props.color].solid}\n\t\t\t\t\t\tstrokeWidth={strokeWidth}\n\t\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\tpointerEvents=\"none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{handlePath}\n\t\t\t\t\t\t{/* firefox will clip if you provide a maskURL even if there is no mask matching that URL in the DOM */}\n\t\t\t\t\t\t<g mask={`url(#${maskId})`}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={toDomPrecision(bounds.minX - 100)}\n\t\t\t\t\t\t\t\ty={toDomPrecision(bounds.minY - 100)}\n\t\t\t\t\t\t\t\twidth={toDomPrecision(bounds.width + 200)}\n\t\t\t\t\t\t\t\theight={toDomPrecision(bounds.height + 200)}\n\t\t\t\t\t\t\t\topacity={0}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td={path}\n\t\t\t\t\t\t\t\tstrokeDasharray={strokeDasharray}\n\t\t\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</g>\n\t\t\t\t\t\t{as && maskStartArrowhead && shape.props.fill !== 'none' && (\n\t\t\t\t\t\t\t<ShapeFill theme={theme} d={as} color={shape.props.color} fill={shape.props.fill} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{ae && maskEndArrowhead && shape.props.fill !== 'none' && (\n\t\t\t\t\t\t\t<ShapeFill theme={theme} d={ae} color={shape.props.color} fill={shape.props.fill} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{as && <path d={as} />}\n\t\t\t\t\t\t{ae && <path d={ae} />}\n\t\t\t\t\t</g>\n\t\t\t\t</SVGContainer>\n\t\t\t\t<ArrowTextLabel\n\t\t\t\t\tid={shape.id}\n\t\t\t\t\ttext={shape.props.text}\n\t\t\t\t\tfont={shape.props.font}\n\t\t\t\t\tsize={shape.props.size}\n\t\t\t\t\tposition={info.middle}\n\t\t\t\t\twidth={labelGeometry?.w ?? 0}\n\t\t\t\t\tlabelColor={theme[shape.props.labelColor].solid}\n\t\t\t\t/>\n\t\t\t</>\n\t\t)\n\t}\n\n\tindicator(shape: TLArrowShape) {\n\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\t\tconst geometry = this.editor.getShapeGeometry<Group2d>(shape)\n\t\tconst bounds = geometry.bounds\n\n\t\tconst labelGeometry = shape.props.text.trim() ? (geometry.children[1] as Rectangle2d) : null\n\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst isEditing = useIsEditing(shape.id)\n\n\t\tif (!info) return null\n\t\tif (Vec2d.Equals(start, end)) return null\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst path = info.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info)\n\n\t\tconst includeMask =\n\t\t\t(as && info.start.arrowhead !== 'arrow') ||\n\t\t\t(ae && info.end.arrowhead !== 'arrow') ||\n\t\t\t!!labelGeometry\n\n\t\tconst maskId = (shape.id + '_clip').replace(':', '_')\n\n\t\tif (isEditing && labelGeometry) {\n\t\t\treturn (\n\t\t\t\t<rect\n\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\trx={3.5}\n\t\t\t\t\try={3.5}\n\t\t\t\t/>\n\t\t\t)\n\t\t}\n\n\t\treturn (\n\t\t\t<g>\n\t\t\t\t{includeMask && (\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<mask id={maskId}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={bounds.minX - 100}\n\t\t\t\t\t\t\t\ty={bounds.minY - 100}\n\t\t\t\t\t\t\t\twidth={bounds.w + 200}\n\t\t\t\t\t\t\t\theight={bounds.h + 200}\n\t\t\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{labelGeometry && (\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\t\t\t\tfill=\"black\"\n\t\t\t\t\t\t\t\t\trx={3.5}\n\t\t\t\t\t\t\t\t\try={3.5}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{as && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={as}\n\t\t\t\t\t\t\t\t\tfill={info.start.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{ae && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={ae}\n\t\t\t\t\t\t\t\t\tfill={info.end.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</mask>\n\t\t\t\t\t</defs>\n\t\t\t\t)}\n\t\t\t\t{/* firefox will clip if you provide a maskURL even if there is no mask matching that URL in the DOM */}\n\t\t\t\t<g {...(includeMask ? { mask: `url(#${maskId})` } : undefined)}>\n\t\t\t\t\t{/* This rect needs to be here if we're creating a mask due to an svg quirk on Chrome */}\n\t\t\t\t\t{includeMask && (\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tx={bounds.minX - 100}\n\t\t\t\t\t\t\ty={bounds.minY - 100}\n\t\t\t\t\t\t\twidth={bounds.width + 200}\n\t\t\t\t\t\t\theight={bounds.height + 200}\n\t\t\t\t\t\t\topacity={0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<path d={path} />\n\t\t\t\t</g>\n\t\t\t\t{as && <path d={as} />}\n\t\t\t\t{ae && <path d={ae} />}\n\t\t\t\t{labelGeometry && (\n\t\t\t\t\t<rect\n\t\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\trx={3.5}\n\t\t\t\t\t\try={3.5}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</g>\n\t\t)\n\t}\n\n\toverride onEditEnd: TLOnEditEndHandler<TLArrowShape> = (shape) => {\n\t\tconst {\n\t\t\tid,\n\t\t\ttype,\n\t\t\tprops: { text },\n\t\t} = shape\n\n\t\tif (text.trimEnd() !== shape.props.text) {\n\t\t\tthis.editor.updateShapes<TLArrowShape>([\n\t\t\t\t{\n\t\t\t\t\tid,\n\t\t\t\t\ttype,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\ttext: text.trimEnd(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t])\n\t\t}\n\t}\n\n\toverride toSvg(shape: TLArrowShape, ctx: SvgExportContext) {\n\t\tconst theme = getDefaultColorTheme({ isDarkMode: this.editor.user.getIsDarkMode() })\n\t\tctx.addExportDef(getFillDefForExport(shape.props.fill, theme))\n\n\t\tconst color = theme[shape.props.color].solid\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\t// Group for arrow\n\t\tconst g = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tif (!info) return g\n\n\t\t// Arrowhead start path\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\t// Arrowhead end path\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst geometry = this.editor.getShapeGeometry<Group2d>(shape)\n\t\tconst bounds = geometry.bounds\n\n\t\tconst labelGeometry = shape.props.text.trim() ? (geometry.children[1] as Rectangle2d) : null\n\n\t\tconst maskId = (shape.id + '_clip').replace(':', '_')\n\n\t\t// If we have any arrowheads, then mask the arrowheads\n\t\tif (as || ae || !!labelGeometry) {\n\t\t\t// Create mask for arrowheads\n\n\t\t\t// Create defs\n\t\t\tconst defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs')\n\n\t\t\t// Create mask\n\t\t\tconst mask = document.createElementNS('http://www.w3.org/2000/svg', 'mask')\n\t\t\tmask.id = maskId\n\n\t\t\t// Create large white shape for mask\n\t\t\tconst rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\t\trect.setAttribute('x', bounds.minX - 100 + '')\n\t\t\trect.setAttribute('y', bounds.minY - 100 + '')\n\t\t\trect.setAttribute('width', bounds.width + 200 + '')\n\t\t\trect.setAttribute('height', bounds.height + 200 + '')\n\t\t\trect.setAttribute('fill', 'white')\n\t\t\tmask.appendChild(rect)\n\n\t\t\t// add arrowhead start mask\n\t\t\tif (as) mask.appendChild(getArrowheadSvgMask(as, info.start.arrowhead))\n\n\t\t\t// add arrowhead end mask\n\t\t\tif (ae) mask.appendChild(getArrowheadSvgMask(ae, info.end.arrowhead))\n\n\t\t\t// Mask out text label if text is present\n\t\t\tif (labelGeometry) {\n\t\t\t\tconst labelMask = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\t\t\tlabelMask.setAttribute('x', labelGeometry.x + '')\n\t\t\t\tlabelMask.setAttribute('y', labelGeometry.y + '')\n\t\t\t\tlabelMask.setAttribute('width', labelGeometry.w + '')\n\t\t\t\tlabelMask.setAttribute('height', labelGeometry.h + '')\n\t\t\t\tlabelMask.setAttribute('fill', 'black')\n\n\t\t\t\tmask.appendChild(labelMask)\n\t\t\t}\n\n\t\t\tdefs.appendChild(mask)\n\t\t\tg.appendChild(defs)\n\t\t}\n\n\t\tconst g2 = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tg2.setAttribute('mask', `url(#${maskId})`)\n\t\tg.appendChild(g2)\n\n\t\t// Dumb mask fix thing\n\t\tconst rect2 = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\trect2.setAttribute('x', '-100')\n\t\trect2.setAttribute('y', '-100')\n\t\trect2.setAttribute('width', bounds.width + 200 + '')\n\t\trect2.setAttribute('height', bounds.height + 200 + '')\n\t\trect2.setAttribute('fill', 'transparent')\n\t\trect2.setAttribute('stroke', 'none')\n\t\tg2.appendChild(rect2)\n\n\t\t// Arrowhead body path\n\t\tconst path = getArrowSvgPath(\n\t\t\tinfo.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info),\n\t\t\tcolor,\n\t\t\tstrokeWidth\n\t\t)\n\n\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\tinfo.isStraight ? info.length : Math.abs(info.bodyArc.length),\n\t\t\tstrokeWidth,\n\t\t\t{\n\t\t\t\tstyle: shape.props.dash,\n\t\t\t}\n\t\t)\n\n\t\tpath.setAttribute('stroke-dasharray', strokeDasharray)\n\t\tpath.setAttribute('stroke-dashoffset', strokeDashoffset)\n\n\t\tg2.appendChild(path)\n\n\t\t// Arrowhead start path\n\t\tif (as) {\n\t\t\tg.appendChild(\n\t\t\t\tgetArrowheadSvgPath(\n\t\t\t\t\tas,\n\t\t\t\t\tshape.props.color,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tshape.props.arrowheadStart === 'arrow' ? 'none' : shape.props.fill,\n\t\t\t\t\ttheme\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\t\t// Arrowhead end path\n\t\tif (ae) {\n\t\t\tg.appendChild(\n\t\t\t\tgetArrowheadSvgPath(\n\t\t\t\t\tae,\n\t\t\t\t\tshape.props.color,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tshape.props.arrowheadEnd === 'arrow' ? 'none' : shape.props.fill,\n\t\t\t\t\ttheme\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\t// Text Label\n\t\tif (labelGeometry) {\n\t\t\tctx.addExportDef(getFontDefForExport(shape.props.font))\n\n\t\t\tconst opts = {\n\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\tlineHeight: TEXT_PROPS.lineHeight,\n\t\t\t\tfontFamily: DefaultFontFamilies[shape.props.font],\n\t\t\t\tpadding: 0,\n\t\t\t\ttextAlign: 'middle' as const,\n\t\t\t\twidth: labelGeometry.w - 8,\n\t\t\t\tverticalTextAlign: 'middle' as const,\n\t\t\t\theight: labelGeometry.h,\n\t\t\t\tfontStyle: 'normal',\n\t\t\t\tfontWeight: 'normal',\n\t\t\t\toverflow: 'wrap' as const,\n\t\t\t}\n\n\t\t\tconst textElm = createTextSvgElementFromSpans(\n\t\t\t\tthis.editor,\n\t\t\t\tthis.editor.textMeasure.measureTextSpans(shape.props.text, opts),\n\t\t\t\topts\n\t\t\t)\n\t\t\ttextElm.setAttribute('fill', theme[shape.props.labelColor].solid)\n\n\t\t\tconst children = Array.from(textElm.children) as unknown as SVGTSpanElement[]\n\n\t\t\tchildren.forEach((child) => {\n\t\t\t\tconst x = parseFloat(child.getAttribute('x') || '0')\n\t\t\t\tconst y = parseFloat(child.getAttribute('y') || '0')\n\n\t\t\t\tchild.setAttribute('x', x + 4 + labelGeometry.x + 'px')\n\t\t\t\tchild.setAttribute('y', y + labelGeometry.y + 'px')\n\t\t\t})\n\n\t\t\tconst textBgEl = textElm.cloneNode(true) as SVGTextElement\n\t\t\ttextBgEl.setAttribute('stroke-width', '2')\n\t\t\ttextBgEl.setAttribute('fill', theme.background)\n\t\t\ttextBgEl.setAttribute('stroke', theme.background)\n\n\t\t\tg.appendChild(textBgEl)\n\t\t\tg.appendChild(textElm)\n\t\t}\n\n\t\treturn g\n\t}\n\n\toverride getCanvasSvgDefs(): TLShapeUtilCanvasSvgDef[] {\n\t\treturn [getFillDefForCanvas()]\n\t}\n}\n\nfunction getArrowheadSvgMask(d: string, arrowhead: TLArrowShapeArrowheadStyle) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', arrowhead === 'arrow' ? 'none' : 'black')\n\tpath.setAttribute('stroke', 'none')\n\treturn path\n}\n\nfunction getArrowSvgPath(d: string, color: string, strokeWidth: number) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', 'none')\n\tpath.setAttribute('stroke', color)\n\tpath.setAttribute('stroke-width', strokeWidth + '')\n\treturn path\n}\n\nfunction getArrowheadSvgPath(\n\td: string,\n\tcolor: TLDefaultColorStyle,\n\tstrokeWidth: number,\n\tfill: TLDefaultFillStyle,\n\ttheme: TLDefaultColorTheme\n) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', 'none')\n\tpath.setAttribute('stroke', theme[color].solid)\n\tpath.setAttribute('stroke-width', strokeWidth + '')\n\n\t// Get the fill element, if any\n\tconst shapeFill = getShapeFillSvg({\n\t\td,\n\t\tfill,\n\t\tcolor,\n\t\ttheme,\n\t})\n\n\tif (shapeFill) {\n\t\t// If there is a fill element, return a group containing the fill and the path\n\t\tconst g = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tg.appendChild(shapeFill)\n\t\tg.appendChild(path)\n\t\treturn g\n\t} else {\n\t\t// Otherwise, just return the path\n\t\treturn path\n\t}\n}\n"],
5
- "mappings": "AA0hBK,SAmDF,UAnDE,KAuDC,YAvDD;AA1hBL;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAeA;AAAA,EACA;AA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OAAK,aAAa,KAAK,CAAC;AACxB,OAAK,aAAa,QAAQ,MAAM;AAChC,OAAK,aAAa,UAAU,MAAM,KAAK,EAAE,KAAK;AAC9C,OAAK,aAAa,gBAAgB,cAAc,EAAE;AAGlD,QAAM,YAAY,gBAAgB;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAED,MAAI,WAAW;AAEd,UAAM,IAAI,SAAS,gBAAgB,8BAA8B,GAAG;AACpE,MAAE,YAAY,SAAS;AACvB,MAAE,YAAY,IAAI;AAClB,WAAO;AAAA,EACR,OAAO;AAEN,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["import {\n\tArc2d,\n\tBox2d,\n\tDefaultFontFamilies,\n\tEdge2d,\n\tGroup2d,\n\tRectangle2d,\n\tSVGContainer,\n\tShapeUtil,\n\tSvgExportContext,\n\tTLArrowShape,\n\tTLArrowShapeArrowheadStyle,\n\tTLDefaultColorStyle,\n\tTLDefaultColorTheme,\n\tTLDefaultFillStyle,\n\tTLHandle,\n\tTLOnEditEndHandler,\n\tTLOnHandleChangeHandler,\n\tTLOnResizeHandler,\n\tTLOnTranslateStartHandler,\n\tTLShapePartial,\n\tTLShapeUtilCanvasSvgDef,\n\tTLShapeUtilFlag,\n\tVec2d,\n\tarrowShapeMigrations,\n\tarrowShapeProps,\n\tdeepCopy,\n\tgetArrowTerminalsInArrowSpace,\n\tgetArrowheadPathForType,\n\tgetCurvedArrowHandlePath,\n\tgetDefaultColorTheme,\n\tgetSolidCurvedArrowPath,\n\tgetSolidStraightArrowPath,\n\tgetStraightArrowHandlePath,\n\ttoDomPrecision,\n\tuseIsEditing,\n} from '@bigbluebutton/editor'\nimport React from 'react'\nimport { ShapeFill, getShapeFillSvg, useDefaultColorTheme } from '../shared/ShapeFill'\nimport { createTextSvgElementFromSpans } from '../shared/createTextSvgElementFromSpans'\nimport {\n\tARROW_LABEL_FONT_SIZES,\n\tFONT_FAMILIES,\n\tSTROKE_SIZES,\n\tTEXT_PROPS,\n} from '../shared/default-shape-constants'\nimport {\n\tgetFillDefForCanvas,\n\tgetFillDefForExport,\n\tgetFontDefForExport,\n} from '../shared/defaultStyleDefs'\nimport { getPerfectDashProps } from '../shared/getPerfectDashProps'\nimport { ArrowTextLabel } from './components/ArrowTextLabel'\n\nlet globalRenderIndex = 0\n\nexport const ARROW_END_OFFSET = 0.1\n\n/** @public */\nexport class ArrowShapeUtil extends ShapeUtil<TLArrowShape> {\n\tstatic override type = 'arrow' as const\n\tstatic override props = arrowShapeProps\n\tstatic override migrations = arrowShapeMigrations\n\n\toverride canEdit = () => true\n\toverride canBind = () => false\n\toverride canSnap = () => false\n\toverride hideResizeHandles: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideRotateHandle: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideSelectionBoundsBg: TLShapeUtilFlag<TLArrowShape> = () => true\n\toverride hideSelectionBoundsFg: TLShapeUtilFlag<TLArrowShape> = () => true\n\n\toverride getDefaultProps(): TLArrowShape['props'] {\n\t\treturn {\n\t\t\tdash: 'draw',\n\t\t\tsize: 'm',\n\t\t\tfill: 'none',\n\t\t\tcolor: 'black',\n\t\t\tlabelColor: 'black',\n\t\t\tbend: 0,\n\t\t\tstart: { type: 'point', x: 0, y: 0 },\n\t\t\tend: { type: 'point', x: 2, y: 0 },\n\t\t\tarrowheadStart: 'none',\n\t\t\tarrowheadEnd: 'arrow',\n\t\t\ttext: '',\n\t\t\tfont: 'draw',\n\t\t}\n\t}\n\n\tgetGeometry(shape: TLArrowShape) {\n\t\tconst info = this.editor.getArrowInfo(shape)!\n\n\t\tconst bodyGeom = info.isStraight\n\t\t\t? new Edge2d({\n\t\t\t\t\tstart: Vec2d.From(info.start.point),\n\t\t\t\t\tend: Vec2d.From(info.end.point),\n\t\t\t })\n\t\t\t: new Arc2d({\n\t\t\t\t\tcenter: Vec2d.Cast(info.handleArc.center),\n\t\t\t\t\tradius: info.handleArc.radius,\n\t\t\t\t\tstart: Vec2d.Cast(info.start.point),\n\t\t\t\t\tend: Vec2d.Cast(info.end.point),\n\t\t\t\t\tsweepFlag: info.bodyArc.sweepFlag,\n\t\t\t\t\tlargeArcFlag: info.bodyArc.largeArcFlag,\n\t\t\t })\n\n\t\tlet labelGeom: Rectangle2d | undefined\n\n\t\tif (shape.props.text.trim()) {\n\t\t\tconst bodyBounds = bodyGeom.bounds\n\n\t\t\tconst { w, h } = this.editor.textMeasure.measureText(shape.props.text, {\n\t\t\t\t...TEXT_PROPS,\n\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\tmaxWidth: null,\n\t\t\t})\n\n\t\t\tlet width = w\n\t\t\tlet height = h\n\n\t\t\tif (bodyBounds.width > bodyBounds.height) {\n\t\t\t\twidth = Math.max(Math.min(w, 64), Math.min(bodyBounds.width - 64, w))\n\n\t\t\t\tconst { w: squishedWidth, h: squishedHeight } = this.editor.textMeasure.measureText(\n\t\t\t\t\tshape.props.text,\n\t\t\t\t\t{\n\t\t\t\t\t\t...TEXT_PROPS,\n\t\t\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\t\t\tmaxWidth: width,\n\t\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\twidth = squishedWidth\n\t\t\t\theight = squishedHeight\n\t\t\t}\n\n\t\t\tif (width > 16 * ARROW_LABEL_FONT_SIZES[shape.props.size]) {\n\t\t\t\twidth = 16 * ARROW_LABEL_FONT_SIZES[shape.props.size]\n\n\t\t\t\tconst { w: squishedWidth, h: squishedHeight } = this.editor.textMeasure.measureText(\n\t\t\t\t\tshape.props.text,\n\t\t\t\t\t{\n\t\t\t\t\t\t...TEXT_PROPS,\n\t\t\t\t\t\tfontFamily: FONT_FAMILIES[shape.props.font],\n\t\t\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\t\t\tmaxWidth: width,\n\t\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\twidth = squishedWidth\n\t\t\t\theight = squishedHeight\n\t\t\t}\n\n\t\t\tlabelGeom = new Rectangle2d({\n\t\t\t\tx: info.middle.x - width / 2 - 4.25,\n\t\t\t\ty: info.middle.y - height / 2 - 4.25,\n\t\t\t\twidth: width + 8.5,\n\t\t\t\theight: height + 8.5,\n\t\t\t\tisFilled: true,\n\t\t\t\tisLabel: true,\n\t\t\t})\n\t\t}\n\n\t\treturn new Group2d({\n\t\t\tchildren: labelGeom ? [bodyGeom, labelGeom] : [bodyGeom],\n\t\t\tisSnappable: false,\n\t\t})\n\t}\n\n\toverride getHandles(shape: TLArrowShape): TLHandle[] {\n\t\tconst info = this.editor.getArrowInfo(shape)!\n\t\treturn [\n\t\t\t{\n\t\t\t\tid: 'start',\n\t\t\t\ttype: 'vertex',\n\t\t\t\tindex: 'a0',\n\t\t\t\tx: info.start.handle.x,\n\t\t\t\ty: info.start.handle.y,\n\t\t\t\tcanBind: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'middle',\n\t\t\t\ttype: 'virtual',\n\t\t\t\tindex: 'a2',\n\t\t\t\tx: info.middle.x,\n\t\t\t\ty: info.middle.y,\n\t\t\t\tcanBind: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'end',\n\t\t\t\ttype: 'vertex',\n\t\t\t\tindex: 'a3',\n\t\t\t\tx: info.end.handle.x,\n\t\t\t\ty: info.end.handle.y,\n\t\t\t\tcanBind: true,\n\t\t\t},\n\t\t]\n\t}\n\n\toverride onHandleChange: TLOnHandleChangeHandler<TLArrowShape> = (\n\t\tshape,\n\t\t{ handle, isPrecise }\n\t) => {\n\t\tconst handleId = handle.id as 'start' | 'middle' | 'end'\n\n\t\tif (handleId === 'middle') {\n\t\t\t// Bending the arrow...\n\t\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\t\tconst delta = Vec2d.Sub(end, start)\n\t\t\tconst v = Vec2d.Per(delta)\n\n\t\t\tconst med = Vec2d.Med(end, start)\n\t\t\tconst A = Vec2d.Sub(med, v)\n\t\t\tconst B = Vec2d.Add(med, v)\n\n\t\t\tconst point = Vec2d.NearestPointOnLineSegment(A, B, handle, false)\n\t\t\tlet bend = Vec2d.Dist(point, med)\n\t\t\tif (Vec2d.Clockwise(point, end, med)) bend *= -1\n\t\t\treturn { id: shape.id, type: shape.type, props: { bend } }\n\t\t}\n\n\t\t// Start or end, pointing the arrow...\n\n\t\tconst next = deepCopy(shape) as TLArrowShape\n\n\t\tconst pageTransform = this.editor.getShapePageTransform(next.id)!\n\t\tconst pointInPageSpace = pageTransform.applyToPoint(handle)\n\n\t\tif (this.editor.inputs.ctrlKey) {\n\t\t\t// todo: maybe double check that this isn't equal to the other handle too?\n\t\t\t// Skip binding\n\t\t\tnext.props[handleId] = {\n\t\t\t\ttype: 'point',\n\t\t\t\tx: handle.x,\n\t\t\t\ty: handle.y,\n\t\t\t}\n\t\t\treturn next\n\t\t}\n\n\t\tconst point = this.editor.getShapePageTransform(shape.id)!.applyToPoint(handle)\n\n\t\tconst target = this.editor.getShapeAtPoint(point, {\n\t\t\thitInside: true,\n\t\t\thitFrameInside: true,\n\t\t\tmargin: 0,\n\t\t\tfilter: (targetShape) => {\n\t\t\t\treturn !targetShape.isLocked && this.editor.getShapeUtil(targetShape).canBind(targetShape)\n\t\t\t},\n\t\t})\n\n\t\tif (!target) {\n\t\t\t// todo: maybe double check that this isn't equal to the other handle too?\n\t\t\tnext.props[handleId] = {\n\t\t\t\ttype: 'point',\n\t\t\t\tx: handle.x,\n\t\t\t\ty: handle.y,\n\t\t\t}\n\t\t\treturn next\n\t\t}\n\n\t\t// we've got a target! the handle is being dragged over a shape, bind to it\n\n\t\tconst targetGeometry = this.editor.getShapeGeometry(target)\n\t\tconst targetBounds = Box2d.ZeroFix(targetGeometry.bounds)\n\t\tconst pointInTargetSpace = this.editor.getPointInShapeSpace(target, pointInPageSpace)\n\n\t\tlet precise = isPrecise\n\n\t\tif (!precise) {\n\t\t\t// If we're switching to a new bound shape, then precise only if moving slowly\n\t\t\tconst prevHandle = next.props[handleId]\n\t\t\tif (\n\t\t\t\tprevHandle.type === 'point' ||\n\t\t\t\t(prevHandle.type === 'binding' && target.id !== prevHandle.boundShapeId)\n\t\t\t) {\n\t\t\t\tprecise = this.editor.inputs.pointerVelocity.len() < 0.5\n\t\t\t}\n\t\t}\n\n\t\tif (!isPrecise) {\n\t\t\tif (!targetGeometry.isClosed) {\n\t\t\t\tprecise = true\n\t\t\t}\n\n\t\t\t// Double check that we're not going to be doing an imprecise snap on\n\t\t\t// the same shape twice, as this would result in a zero length line\n\t\t\tconst otherHandle = next.props[handleId === 'start' ? 'end' : 'start']\n\t\t\tif (\n\t\t\t\totherHandle.type === 'binding' &&\n\t\t\t\ttarget.id === otherHandle.boundShapeId &&\n\t\t\t\totherHandle.isPrecise\n\t\t\t) {\n\t\t\t\tprecise = true\n\t\t\t}\n\t\t}\n\n\t\tconst normalizedAnchor = {\n\t\t\tx: (pointInTargetSpace.x - targetBounds.minX) / targetBounds.width,\n\t\t\ty: (pointInTargetSpace.y - targetBounds.minY) / targetBounds.height,\n\t\t}\n\n\t\tif (precise) {\n\t\t\t// Turn off precision if we're within a certain distance to the center of the shape.\n\t\t\t// Funky math but we want the snap distance to be 4 at the minimum and either\n\t\t\t// 16 or 15% of the smaller dimension of the target shape, whichever is smaller\n\t\t\tif (\n\t\t\t\tVec2d.Dist(pointInTargetSpace, targetBounds.center) <\n\t\t\t\tMath.max(4, Math.min(Math.min(targetBounds.width, targetBounds.height) * 0.15, 16)) /\n\t\t\t\t\tthis.editor.getZoomLevel()\n\t\t\t) {\n\t\t\t\tnormalizedAnchor.x = 0.5\n\t\t\t\tnormalizedAnchor.y = 0.5\n\t\t\t}\n\t\t}\n\n\t\tnext.props[handleId] = {\n\t\t\ttype: 'binding',\n\t\t\tboundShapeId: target.id,\n\t\t\tnormalizedAnchor: normalizedAnchor,\n\t\t\tisPrecise: precise,\n\t\t\tisExact: this.editor.inputs.altKey,\n\t\t}\n\n\t\tif (next.props.start.type === 'binding' && next.props.end.type === 'binding') {\n\t\t\tif (next.props.start.boundShapeId === next.props.end.boundShapeId) {\n\t\t\t\tif (Vec2d.Equals(next.props.start.normalizedAnchor, next.props.end.normalizedAnchor)) {\n\t\t\t\t\tnext.props.end.normalizedAnchor.x += 0.05\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn next\n\t}\n\n\toverride onTranslateStart: TLOnTranslateStartHandler<TLArrowShape> = (shape) => {\n\t\tconst startBindingId =\n\t\t\tshape.props.start.type === 'binding' ? shape.props.start.boundShapeId : null\n\t\tconst endBindingId = shape.props.end.type === 'binding' ? shape.props.end.boundShapeId : null\n\n\t\t// If at least one bound shape is in the selection, do nothing;\n\t\t// If no bound shapes are in the selection, unbind any bound shapes\n\n\t\tconst selectedShapeIds = this.editor.getSelectedShapeIds()\n\n\t\tif (\n\t\t\t(startBindingId &&\n\t\t\t\t(selectedShapeIds.includes(startBindingId) ||\n\t\t\t\t\tthis.editor.isAncestorSelected(startBindingId))) ||\n\t\t\t(endBindingId &&\n\t\t\t\t(selectedShapeIds.includes(endBindingId) || this.editor.isAncestorSelected(endBindingId)))\n\t\t) {\n\t\t\treturn\n\t\t}\n\n\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\treturn {\n\t\t\tid: shape.id,\n\t\t\ttype: shape.type,\n\t\t\tprops: {\n\t\t\t\t...shape.props,\n\t\t\t\tstart: {\n\t\t\t\t\ttype: 'point',\n\t\t\t\t\tx: start.x,\n\t\t\t\t\ty: start.y,\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\ttype: 'point',\n\t\t\t\t\tx: end.x,\n\t\t\t\t\ty: end.y,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\toverride onResize: TLOnResizeHandler<TLArrowShape> = (shape, info) => {\n\t\tconst { scaleX, scaleY } = info\n\n\t\tconst terminals = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\tconst { start, end } = deepCopy<TLArrowShape['props']>(shape.props)\n\t\tlet { bend } = shape.props\n\n\t\t// Rescale start handle if it's not bound to a shape\n\t\tif (start.type === 'point') {\n\t\t\tstart.x = terminals.start.x * scaleX\n\t\t\tstart.y = terminals.start.y * scaleY\n\t\t}\n\n\t\t// Rescale end handle if it's not bound to a shape\n\t\tif (end.type === 'point') {\n\t\t\tend.x = terminals.end.x * scaleX\n\t\t\tend.y = terminals.end.y * scaleY\n\t\t}\n\n\t\t// todo: we should only change the normalized anchor positions\n\t\t// of the shape's handles if the bound shape is also being resized\n\n\t\tconst mx = Math.abs(scaleX)\n\t\tconst my = Math.abs(scaleY)\n\n\t\tif (scaleX < 0 && scaleY >= 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= -1\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.x = 1 - start.normalizedAnchor.x\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.x = 1 - end.normalizedAnchor.x\n\t\t\t}\n\t\t} else if (scaleX >= 0 && scaleY < 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= -1\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.y = 1 - start.normalizedAnchor.y\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.y = 1 - end.normalizedAnchor.y\n\t\t\t}\n\t\t} else if (scaleX >= 0 && scaleY >= 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\t\t} else if (scaleX < 0 && scaleY < 0) {\n\t\t\tif (bend !== 0) {\n\t\t\t\tbend *= Math.max(mx, my)\n\t\t\t}\n\n\t\t\tif (start.type === 'binding') {\n\t\t\t\tstart.normalizedAnchor.x = 1 - start.normalizedAnchor.x\n\t\t\t\tstart.normalizedAnchor.y = 1 - start.normalizedAnchor.y\n\t\t\t}\n\n\t\t\tif (end.type === 'binding') {\n\t\t\t\tend.normalizedAnchor.x = 1 - end.normalizedAnchor.x\n\t\t\t\tend.normalizedAnchor.y = 1 - end.normalizedAnchor.y\n\t\t\t}\n\t\t}\n\n\t\tconst next = {\n\t\t\tprops: {\n\t\t\t\tstart,\n\t\t\t\tend,\n\t\t\t\tbend,\n\t\t\t},\n\t\t}\n\n\t\treturn next\n\t}\n\n\toverride onDoubleClickHandle = (\n\t\tshape: TLArrowShape,\n\t\thandle: TLHandle\n\t): TLShapePartial<TLArrowShape> | void => {\n\t\tswitch (handle.id) {\n\t\t\tcase 'start': {\n\t\t\t\treturn {\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tarrowheadStart: shape.props.arrowheadStart === 'none' ? 'arrow' : 'none',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 'end': {\n\t\t\t\treturn {\n\t\t\t\t\tid: shape.id,\n\t\t\t\t\ttype: shape.type,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...shape.props,\n\t\t\t\t\t\tarrowheadEnd: shape.props.arrowheadEnd === 'none' ? 'arrow' : 'none',\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponent(shape: TLArrowShape) {\n\t\t// Not a class component, but eslint can't tell that :(\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst theme = useDefaultColorTheme()\n\t\tconst onlySelectedShape = this.editor.getOnlySelectedShape()\n\t\tconst shouldDisplayHandles =\n\t\t\tthis.editor.isInAny(\n\t\t\t\t'select.idle',\n\t\t\t\t'select.pointing_handle',\n\t\t\t\t'select.dragging_handle',\n\t\t\t\t'arrow.dragging'\n\t\t\t) && !this.editor.getInstanceState().isReadonly\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\t\tconst bounds = Box2d.ZeroFix(this.editor.getShapeGeometry(shape).bounds)\n\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst changeIndex = React.useMemo<number>(() => {\n\t\t\treturn this.editor.environment.isSafari ? (globalRenderIndex += 1) : 0\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [shape])\n\n\t\tif (!info?.isValid) return null\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst path = info.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info)\n\n\t\tlet handlePath: null | React.JSX.Element = null\n\n\t\tif (onlySelectedShape === shape && shouldDisplayHandles) {\n\t\t\tconst sw = 2\n\t\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\t\tinfo.isStraight\n\t\t\t\t\t? Vec2d.Dist(info.start.handle, info.end.handle)\n\t\t\t\t\t: Math.abs(info.handleArc.length),\n\t\t\t\tsw,\n\t\t\t\t{\n\t\t\t\t\tend: 'skip',\n\t\t\t\t\tstart: 'skip',\n\t\t\t\t\tlengthRatio: 2.5,\n\t\t\t\t}\n\t\t\t)\n\n\t\t\thandlePath =\n\t\t\t\tshape.props.start.type === 'binding' || shape.props.end.type === 'binding' ? (\n\t\t\t\t\t<path\n\t\t\t\t\t\tclassName=\"tl-arrow-hint\"\n\t\t\t\t\t\td={info.isStraight ? getStraightArrowHandlePath(info) : getCurvedArrowHandlePath(info)}\n\t\t\t\t\t\tstrokeDasharray={strokeDasharray}\n\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\tstrokeWidth={sw}\n\t\t\t\t\t\tmarkerStart={\n\t\t\t\t\t\t\tshape.props.start.type === 'binding'\n\t\t\t\t\t\t\t\t? shape.props.start.isExact\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: shape.props.start.isPrecise\n\t\t\t\t\t\t\t\t\t? 'url(#arrowhead-cross)'\n\t\t\t\t\t\t\t\t\t: 'url(#arrowhead-dot)'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmarkerEnd={\n\t\t\t\t\t\t\tshape.props.end.type === 'binding'\n\t\t\t\t\t\t\t\t? shape.props.end.isExact\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: shape.props.end.isPrecise\n\t\t\t\t\t\t\t\t\t? 'url(#arrowhead-cross)'\n\t\t\t\t\t\t\t\t\t: 'url(#arrowhead-dot)'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\topacity={0.16}\n\t\t\t\t\t/>\n\t\t\t\t) : null\n\t\t}\n\n\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\tinfo.isStraight ? info.length : Math.abs(info.bodyArc.length),\n\t\t\tstrokeWidth,\n\t\t\t{\n\t\t\t\tstyle: shape.props.dash,\n\t\t\t}\n\t\t)\n\n\t\tconst labelGeometry = shape.props.text.trim()\n\t\t\t? (this.editor.getShapeGeometry<Group2d>(shape).children[1] as Rectangle2d)\n\t\t\t: null\n\n\t\tconst maskStartArrowhead = !(\n\t\t\tinfo.start.arrowhead === 'none' || info.start.arrowhead === 'arrow'\n\t\t)\n\t\tconst maskEndArrowhead = !(info.end.arrowhead === 'none' || info.end.arrowhead === 'arrow')\n\n\t\t// NOTE: I know right setting `changeIndex` hacky-as right! But we need this because otherwise safari loses\n\t\t// the mask, see <https://linear.app/tldraw/issue/TLD-1500/changing-arrow-color-makes-line-pass-through-text>\n\t\tconst maskId = (shape.id + '_clip_' + changeIndex).replace(':', '_')\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<SVGContainer id={shape.id} style={{ minWidth: 50, minHeight: 50 }}>\n\t\t\t\t\t{/* Yep */}\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<mask id={maskId}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={toDomPrecision(-100 + bounds.minX)}\n\t\t\t\t\t\t\t\ty={toDomPrecision(-100 + bounds.minY)}\n\t\t\t\t\t\t\t\twidth={toDomPrecision(bounds.width + 200)}\n\t\t\t\t\t\t\t\theight={toDomPrecision(bounds.height + 200)}\n\t\t\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{labelGeometry && (\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tx={labelGeometry.x}\n\t\t\t\t\t\t\t\t\ty={labelGeometry.y}\n\t\t\t\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\t\t\t\tfill=\"black\"\n\t\t\t\t\t\t\t\t\trx={4}\n\t\t\t\t\t\t\t\t\try={4}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{as && maskStartArrowhead && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={as}\n\t\t\t\t\t\t\t\t\tfill={info.start.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{ae && maskEndArrowhead && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={ae}\n\t\t\t\t\t\t\t\t\tfill={info.end.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</mask>\n\t\t\t\t\t</defs>\n\t\t\t\t\t<g\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke={theme[shape.props.color].solid}\n\t\t\t\t\t\tstrokeWidth={strokeWidth}\n\t\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\tpointerEvents=\"none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{handlePath}\n\t\t\t\t\t\t{/* firefox will clip if you provide a maskURL even if there is no mask matching that URL in the DOM */}\n\t\t\t\t\t\t<g mask={`url(#${maskId})`}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={toDomPrecision(bounds.minX - 100)}\n\t\t\t\t\t\t\t\ty={toDomPrecision(bounds.minY - 100)}\n\t\t\t\t\t\t\t\twidth={toDomPrecision(bounds.width + 200)}\n\t\t\t\t\t\t\t\theight={toDomPrecision(bounds.height + 200)}\n\t\t\t\t\t\t\t\topacity={0}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td={path}\n\t\t\t\t\t\t\t\tstrokeDasharray={strokeDasharray}\n\t\t\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</g>\n\t\t\t\t\t\t{as && maskStartArrowhead && shape.props.fill !== 'none' && (\n\t\t\t\t\t\t\t<ShapeFill theme={theme} d={as} color={shape.props.color} fill={shape.props.fill} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{ae && maskEndArrowhead && shape.props.fill !== 'none' && (\n\t\t\t\t\t\t\t<ShapeFill theme={theme} d={ae} color={shape.props.color} fill={shape.props.fill} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{as && <path d={as} />}\n\t\t\t\t\t\t{ae && <path d={ae} />}\n\t\t\t\t\t</g>\n\t\t\t\t</SVGContainer>\n\t\t\t\t<ArrowTextLabel\n\t\t\t\t\tid={shape.id}\n\t\t\t\t\ttext={shape.props.text}\n\t\t\t\t\tfont={shape.props.font}\n\t\t\t\t\tsize={shape.props.size}\n\t\t\t\t\tposition={info.middle}\n\t\t\t\t\twidth={labelGeometry?.w ?? 0}\n\t\t\t\t\tlabelColor={theme[shape.props.labelColor].solid}\n\t\t\t\t/>\n\t\t\t</>\n\t\t)\n\t}\n\n\tindicator(shape: TLArrowShape) {\n\t\tconst { start, end } = getArrowTerminalsInArrowSpace(this.editor, shape)\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\t\tconst geometry = this.editor.getShapeGeometry<Group2d>(shape)\n\t\tconst bounds = geometry.bounds\n\n\t\tconst labelGeometry = shape.props.text.trim() ? (geometry.children[1] as Rectangle2d) : null\n\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst isEditing = useIsEditing(shape.id)\n\n\t\tif (!info) return null\n\t\tif (Vec2d.Equals(start, end)) return null\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst path = info.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info)\n\n\t\tconst includeMask =\n\t\t\t(as && info.start.arrowhead !== 'arrow') ||\n\t\t\t(ae && info.end.arrowhead !== 'arrow') ||\n\t\t\t!!labelGeometry\n\n\t\tconst maskId = (shape.id + '_clip').replace(':', '_')\n\n\t\tif (isEditing && labelGeometry) {\n\t\t\treturn (\n\t\t\t\t<rect\n\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\trx={3.5}\n\t\t\t\t\try={3.5}\n\t\t\t\t/>\n\t\t\t)\n\t\t}\n\n\t\treturn (\n\t\t\t<g>\n\t\t\t\t{includeMask && (\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<mask id={maskId}>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tx={bounds.minX - 100}\n\t\t\t\t\t\t\t\ty={bounds.minY - 100}\n\t\t\t\t\t\t\t\twidth={bounds.w + 200}\n\t\t\t\t\t\t\t\theight={bounds.h + 200}\n\t\t\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{labelGeometry && (\n\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\t\t\t\tfill=\"black\"\n\t\t\t\t\t\t\t\t\trx={3.5}\n\t\t\t\t\t\t\t\t\try={3.5}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{as && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={as}\n\t\t\t\t\t\t\t\t\tfill={info.start.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{ae && (\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td={ae}\n\t\t\t\t\t\t\t\t\tfill={info.end.arrowhead === 'arrow' ? 'none' : 'black'}\n\t\t\t\t\t\t\t\t\tstroke=\"none\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</mask>\n\t\t\t\t\t</defs>\n\t\t\t\t)}\n\t\t\t\t{/* firefox will clip if you provide a maskURL even if there is no mask matching that URL in the DOM */}\n\t\t\t\t<g {...(includeMask ? { mask: `url(#${maskId})` } : undefined)}>\n\t\t\t\t\t{/* This rect needs to be here if we're creating a mask due to an svg quirk on Chrome */}\n\t\t\t\t\t{includeMask && (\n\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\tx={bounds.minX - 100}\n\t\t\t\t\t\t\ty={bounds.minY - 100}\n\t\t\t\t\t\t\twidth={bounds.width + 200}\n\t\t\t\t\t\t\theight={bounds.height + 200}\n\t\t\t\t\t\t\topacity={0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<path d={path} />\n\t\t\t\t</g>\n\t\t\t\t{as && <path d={as} />}\n\t\t\t\t{ae && <path d={ae} />}\n\t\t\t\t{labelGeometry && (\n\t\t\t\t\t<rect\n\t\t\t\t\t\tx={toDomPrecision(labelGeometry.x)}\n\t\t\t\t\t\ty={toDomPrecision(labelGeometry.y)}\n\t\t\t\t\t\twidth={labelGeometry.w}\n\t\t\t\t\t\theight={labelGeometry.h}\n\t\t\t\t\t\trx={3.5}\n\t\t\t\t\t\try={3.5}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</g>\n\t\t)\n\t}\n\n\toverride onEditEnd: TLOnEditEndHandler<TLArrowShape> = (shape) => {\n\t\tconst {\n\t\t\tid,\n\t\t\ttype,\n\t\t\tprops: { text },\n\t\t} = shape\n\n\t\tif (text.trimEnd() !== shape.props.text) {\n\t\t\tthis.editor.updateShapes<TLArrowShape>([\n\t\t\t\t{\n\t\t\t\t\tid,\n\t\t\t\t\ttype,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\ttext: text.trimEnd(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t])\n\t\t}\n\t}\n\n\toverride toSvg(shape: TLArrowShape, ctx: SvgExportContext) {\n\t\tconst theme = getDefaultColorTheme({ isDarkMode: this.editor.user.getIsDarkMode() })\n\t\tctx.addExportDef(getFillDefForExport(shape.props.fill, theme))\n\n\t\tconst color = theme[shape.props.color].solid\n\n\t\tconst info = this.editor.getArrowInfo(shape)\n\n\t\tconst strokeWidth = STROKE_SIZES[shape.props.size]\n\n\t\t// Group for arrow\n\t\tconst g = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tif (!info) return g\n\n\t\t// Arrowhead start path\n\t\tconst as = info.start.arrowhead && getArrowheadPathForType(info, 'start', strokeWidth)\n\t\t// Arrowhead end path\n\t\tconst ae = info.end.arrowhead && getArrowheadPathForType(info, 'end', strokeWidth)\n\n\t\tconst geometry = this.editor.getShapeGeometry<Group2d>(shape)\n\t\tconst bounds = geometry.bounds\n\n\t\tconst labelGeometry = shape.props.text.trim() ? (geometry.children[1] as Rectangle2d) : null\n\n\t\tconst maskId = (shape.id + '_clip').replace(':', '_')\n\n\t\t// If we have any arrowheads, then mask the arrowheads\n\t\tif (as || ae || !!labelGeometry) {\n\t\t\t// Create mask for arrowheads\n\n\t\t\t// Create defs\n\t\t\tconst defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs')\n\n\t\t\t// Create mask\n\t\t\tconst mask = document.createElementNS('http://www.w3.org/2000/svg', 'mask')\n\t\t\tmask.id = maskId\n\n\t\t\t// Create large white shape for mask\n\t\t\tconst rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\t\trect.setAttribute('x', bounds.minX - 100 + '')\n\t\t\trect.setAttribute('y', bounds.minY - 100 + '')\n\t\t\trect.setAttribute('width', bounds.width + 200 + '')\n\t\t\trect.setAttribute('height', bounds.height + 200 + '')\n\t\t\trect.setAttribute('fill', 'white')\n\t\t\tmask.appendChild(rect)\n\n\t\t\t// add arrowhead start mask\n\t\t\tif (as) mask.appendChild(getArrowheadSvgMask(as, info.start.arrowhead))\n\n\t\t\t// add arrowhead end mask\n\t\t\tif (ae) mask.appendChild(getArrowheadSvgMask(ae, info.end.arrowhead))\n\n\t\t\t// Mask out text label if text is present\n\t\t\tif (labelGeometry) {\n\t\t\t\tconst labelMask = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\t\t\tlabelMask.setAttribute('x', labelGeometry.x + '')\n\t\t\t\tlabelMask.setAttribute('y', labelGeometry.y + '')\n\t\t\t\tlabelMask.setAttribute('width', labelGeometry.w + '')\n\t\t\t\tlabelMask.setAttribute('height', labelGeometry.h + '')\n\t\t\t\tlabelMask.setAttribute('fill', 'black')\n\n\t\t\t\tmask.appendChild(labelMask)\n\t\t\t}\n\n\t\t\tdefs.appendChild(mask)\n\t\t\tg.appendChild(defs)\n\t\t}\n\n\t\tconst g2 = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tg2.setAttribute('mask', `url(#${maskId})`)\n\t\tg.appendChild(g2)\n\n\t\t// Dumb mask fix thing\n\t\tconst rect2 = document.createElementNS('http://www.w3.org/2000/svg', 'rect')\n\t\trect2.setAttribute('x', '-100')\n\t\trect2.setAttribute('y', '-100')\n\t\trect2.setAttribute('width', bounds.width + 200 + '')\n\t\trect2.setAttribute('height', bounds.height + 200 + '')\n\t\trect2.setAttribute('fill', 'transparent')\n\t\trect2.setAttribute('stroke', 'none')\n\t\tg2.appendChild(rect2)\n\n\t\t// Arrowhead body path\n\t\tconst path = getArrowSvgPath(\n\t\t\tinfo.isStraight ? getSolidStraightArrowPath(info) : getSolidCurvedArrowPath(info),\n\t\t\tcolor,\n\t\t\tstrokeWidth\n\t\t)\n\n\t\tconst { strokeDasharray, strokeDashoffset } = getPerfectDashProps(\n\t\t\tinfo.isStraight ? info.length : Math.abs(info.bodyArc.length),\n\t\t\tstrokeWidth,\n\t\t\t{\n\t\t\t\tstyle: shape.props.dash,\n\t\t\t}\n\t\t)\n\n\t\tpath.setAttribute('stroke-dasharray', strokeDasharray)\n\t\tpath.setAttribute('stroke-dashoffset', strokeDashoffset)\n\n\t\tg2.appendChild(path)\n\n\t\t// Arrowhead start path\n\t\tif (as) {\n\t\t\tg.appendChild(\n\t\t\t\tgetArrowheadSvgPath(\n\t\t\t\t\tas,\n\t\t\t\t\tshape.props.color,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tshape.props.arrowheadStart === 'arrow' ? 'none' : shape.props.fill,\n\t\t\t\t\ttheme\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\t\t// Arrowhead end path\n\t\tif (ae) {\n\t\t\tg.appendChild(\n\t\t\t\tgetArrowheadSvgPath(\n\t\t\t\t\tae,\n\t\t\t\t\tshape.props.color,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tshape.props.arrowheadEnd === 'arrow' ? 'none' : shape.props.fill,\n\t\t\t\t\ttheme\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\t// Text Label\n\t\tif (labelGeometry) {\n\t\t\tctx.addExportDef(getFontDefForExport(shape.props.font))\n\n\t\t\tconst opts = {\n\t\t\t\tfontSize: ARROW_LABEL_FONT_SIZES[shape.props.size],\n\t\t\t\tlineHeight: TEXT_PROPS.lineHeight,\n\t\t\t\tfontFamily: DefaultFontFamilies[shape.props.font],\n\t\t\t\tpadding: 0,\n\t\t\t\ttextAlign: 'middle' as const,\n\t\t\t\twidth: labelGeometry.w - 8,\n\t\t\t\tverticalTextAlign: 'middle' as const,\n\t\t\t\theight: labelGeometry.h,\n\t\t\t\tfontStyle: 'normal',\n\t\t\t\tfontWeight: 'normal',\n\t\t\t\toverflow: 'wrap' as const,\n\t\t\t}\n\n\t\t\tconst textElm = createTextSvgElementFromSpans(\n\t\t\t\tthis.editor,\n\t\t\t\tthis.editor.textMeasure.measureTextSpans(shape.props.text, opts),\n\t\t\t\topts\n\t\t\t)\n\t\t\ttextElm.setAttribute('fill', theme[shape.props.labelColor].solid)\n\n\t\t\tconst children = Array.from(textElm.children) as unknown as SVGTSpanElement[]\n\n\t\t\tchildren.forEach((child) => {\n\t\t\t\tconst x = parseFloat(child.getAttribute('x') || '0')\n\t\t\t\tconst y = parseFloat(child.getAttribute('y') || '0')\n\n\t\t\t\tchild.setAttribute('x', x + 4 + labelGeometry.x + 'px')\n\t\t\t\tchild.setAttribute('y', y + labelGeometry.y + 'px')\n\t\t\t})\n\n\t\t\tconst textBgEl = textElm.cloneNode(true) as SVGTextElement\n\t\t\ttextBgEl.setAttribute('stroke-width', '2')\n\t\t\ttextBgEl.setAttribute('fill', theme.background)\n\t\t\ttextBgEl.setAttribute('stroke', theme.background)\n\n\t\t\tg.appendChild(textBgEl)\n\t\t\tg.appendChild(textElm)\n\t\t}\n\n\t\treturn g\n\t}\n\n\toverride getCanvasSvgDefs(): TLShapeUtilCanvasSvgDef[] {\n\t\treturn [getFillDefForCanvas()]\n\t}\n}\n\nfunction getArrowheadSvgMask(d: string, arrowhead: TLArrowShapeArrowheadStyle) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', arrowhead === 'arrow' ? 'none' : 'black')\n\tpath.setAttribute('stroke', 'none')\n\treturn path\n}\n\nfunction getArrowSvgPath(d: string, color: string, strokeWidth: number) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', 'none')\n\tpath.setAttribute('stroke', color)\n\tpath.setAttribute('stroke-width', strokeWidth + '')\n\treturn path\n}\n\nfunction getArrowheadSvgPath(\n\td: string,\n\tcolor: TLDefaultColorStyle,\n\tstrokeWidth: number,\n\tfill: TLDefaultFillStyle,\n\ttheme: TLDefaultColorTheme\n) {\n\tconst path = document.createElementNS('http://www.w3.org/2000/svg', 'path')\n\tpath.setAttribute('d', d)\n\tpath.setAttribute('fill', 'none')\n\tpath.setAttribute('stroke', theme[color].solid)\n\tpath.setAttribute('stroke-width', strokeWidth + '')\n\n\t// Get the fill element, if any\n\tconst shapeFill = getShapeFillSvg({\n\t\td,\n\t\tfill,\n\t\tcolor,\n\t\ttheme,\n\t})\n\n\tif (shapeFill) {\n\t\t// If there is a fill element, return a group containing the fill and the path\n\t\tconst g = document.createElementNS('http://www.w3.org/2000/svg', 'g')\n\t\tg.appendChild(shapeFill)\n\t\tg.appendChild(path)\n\t\treturn g\n\t} else {\n\t\t// Otherwise, just return the path\n\t\treturn path\n\t}\n}\n"],
5
+ "mappings": "AA0hBK,SAmDF,UAnDE,KAuDC,YAvDD;AA1hBL;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAeA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,WAAW;AAClB,SAAS,WAAW,iBAAiB,4BAA4B;AACjE,SAAS,qCAAqC;AAC9C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAE/B,IAAI,oBAAoB;AAEjB,MAAM,mBAAmB;AAGzB,MAAM,uBAAuB,UAAwB;AAAA,EAC3D,OAAgB,OAAO;AAAA,EACvB,OAAgB,QAAQ;AAAA,EACxB,OAAgB,aAAa;AAAA,EAEpB,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,oBAAmD,MAAM;AAAA,EACzD,mBAAkD,MAAM;AAAA,EACxD,wBAAuD,MAAM;AAAA,EAC7D,wBAAuD,MAAM;AAAA,EAE7D,kBAAyC;AACjD,WAAO;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,OAAO,EAAE,MAAM,SAAS,GAAG,GAAG,GAAG,EAAE;AAAA,MACnC,KAAK,EAAE,MAAM,SAAS,GAAG,GAAG,GAAG,EAAE;AAAA,MACjC,gBAAgB;AAAA,MAChB,cA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AAgB,8BAA8B,MAAM;AAC1E,OAAK,aAAa,KAAK,CAAC;AACxB,OAAK,aAAa,QAAQ,MAAM;AAChC,OAAK,aAAa,UAAU,KAAK;AACjC,OAAK,aAAa,gBAAgB,cAAc,EAAE;AAClD,SAAO;AACR;AAEA,SAAS,oBACR,GACA,OACA,aACA,MACA,OACC;AACD,QAAM,OAAO,SAAS,gBAAgB,8BAA8B,MAAM;AAC1E,OAAK,aAAa,KAAK,CAAC;AACxB,OAAK,aAAa,QAAQ,MAAM;AAChC,OAAK,aAAa,UAAU,MAAM,KAAK,EAAE,KAAK;AAC9C,OAAK,aAAa,gBAAgB,cAAc,EAAE;AAGlD,QAAM,YAAY,gBAAgB;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAED,MAAI,WAAW;AAEd,UAAM,IAAI,SAAS,gBAAgB,8BAA8B,GAAG;AACpE,MAAE,YAAY,SAAS;AACvB,MAAE,YAAY,IAAI;AAClB,WAAO;AAAA,EACR,OAAO;AAEN,WAAO;AAAA,EACR;AACD;",
6
6
  "names": ["point", "strokeDasharray", "strokeDashoffset"]
7
7
  }
@@ -0,0 +1,10 @@
1
+ import { BaseBoxShapeTool } from "@bigbluebutton/editor";
2
+ class PollShapeTool extends BaseBoxShapeTool {
3
+ static id = "poll";
4
+ static initial = "idle";
5
+ shapeType = "poll";
6
+ }
7
+ export {
8
+ PollShapeTool
9
+ };
10
+ //# sourceMappingURL=PollShapeTool.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/shapes/poll/PollShapeTool.tsx"],
4
+ "sourcesContent": ["import { BaseBoxShapeTool } from '@bigbluebutton/editor'\n\nexport class PollShapeTool extends BaseBoxShapeTool {\n\tstatic override id = 'poll'\n\tstatic override initial = 'idle'\n\toverride shapeType = 'poll'\n}\n"],
5
+ "mappings": "AAAA,SAAS,wBAAwB;AAE1B,MAAM,sBAAsB,iBAAiB;AAAA,EACnD,OAAgB,KAAK;AAAA,EACrB,OAAgB,UAAU;AAAA,EACjB,YAAY;AACtB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,97 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import {
3
+ HTMLContainer,
4
+ Rectangle2d,
5
+ ShapeUtil,
6
+ getDefaultColorTheme,
7
+ resizeBox
8
+ } from "@bigbluebutton/editor";
9
+ import ChatPollContent from "./components/poll-content.mjs";
10
+ import { pollShapeMigrations } from "./poll-shape-migrations.mjs";
11
+ import { pollShapeProps } from "./poll-shape-props.mjs";
12
+ class PollShapeUtil extends ShapeUtil {
13
+ static type = "poll";
14
+ static props = pollShapeProps;
15
+ static migrations = pollShapeMigrations;
16
+ isAspectRatioLocked = (_shape) => false;
17
+ canResize = (_shape) => true;
18
+ canBind = (_shape) => true;
19
+ getDefaultProps() {
20
+ return {
21
+ w: 300,
22
+ h: 300,
23
+ color: "black",
24
+ fill: "white",
25
+ question: "",
26
+ numRespondents: 0,
27
+ numResponders: 0,
28
+ questionText: "",
29
+ questionType: "",
30
+ answers: []
31
+ };
32
+ }
33
+ getGeometry(shape) {
34
+ return new Rectangle2d({
35
+ width: shape.props.w,
36
+ height: shape.props.h,
37
+ isFilled: true
38
+ });
39
+ }
40
+ component(shape) {
41
+ const { bounds } = this.editor.getShapeGeometry(shape);
42
+ const theme = getDefaultColorTheme({
43
+ isDarkMode: this.editor.user.getIsDarkMode()
44
+ });
45
+ const pollMetadata = JSON.stringify({
46
+ id: shape.id,
47
+ question: shape.props.question,
48
+ numRespondents: shape.props.numRespondents,
49
+ numResponders: shape.props.numResponders,
50
+ questionText: shape.props.questionText,
51
+ questionType: shape.props.questionType,
52
+ answers: shape.props.answers
53
+ });
54
+ const adjustedHeight = shape.props.questionText.length > 0 ? bounds.height - 75 : bounds.height;
55
+ return /* @__PURE__ */ jsx(
56
+ HTMLContainer,
57
+ {
58
+ id: shape.id,
59
+ style: {
60
+ border: "1px solid #8B9AA8",
61
+ borderRadius: "4px",
62
+ boxShadow: "0px 0px 4px 0px rgba(0, 0, 0, 0.20)",
63
+ display: "flex",
64
+ flexDirection: "column",
65
+ alignItems: "center",
66
+ justifyContent: "center",
67
+ pointerEvents: "all",
68
+ backgroundColor: theme[shape.props.color].semi,
69
+ color: theme[shape.props.color].solid
70
+ },
71
+ children: /* @__PURE__ */ jsx(
72
+ "div",
73
+ {
74
+ style: {
75
+ width: `${bounds.width}px`,
76
+ overflow: "hidden",
77
+ position: "relative"
78
+ },
79
+ children: /* @__PURE__ */ jsx(ChatPollContent, { metadata: pollMetadata, height: adjustedHeight })
80
+ }
81
+ )
82
+ }
83
+ );
84
+ }
85
+ indicator(shape) {
86
+ return /* @__PURE__ */ jsx("rect", { width: shape.props.w, height: shape.props.h });
87
+ }
88
+ onResize = (shape, info) => {
89
+ return resizeBox(shape, info);
90
+ };
91
+ }
92
+ var PollShapeUtil_default = PollShapeUtil;
93
+ export {
94
+ PollShapeUtil,
95
+ PollShapeUtil_default as default
96
+ };
97
+ //# sourceMappingURL=PollShapeUtil.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/shapes/poll/PollShapeUtil.tsx"],
4
+ "sourcesContent": ["import {\n\tHTMLContainer,\n\tRectangle2d,\n\tShapeUtil,\n\tTLOnResizeHandler,\n\tgetDefaultColorTheme,\n\tresizeBox,\n} from '@bigbluebutton/editor'\n\nimport ChatPollContent from './components/poll-content'\nimport { pollShapeMigrations } from './poll-shape-migrations'\nimport { pollShapeProps } from './poll-shape-props'\nimport { IPollShape } from './poll-shape-types'\n\nexport class PollShapeUtil extends ShapeUtil<IPollShape> {\n\tstatic override type = 'poll' as const\n\n\tstatic override props = pollShapeProps\n\n\tstatic override migrations = pollShapeMigrations\n\n\toverride isAspectRatioLocked = (_shape: IPollShape) => false\n\n\toverride canResize = (_shape: IPollShape) => true\n\n\toverride canBind = (_shape: IPollShape) => true\n\n\tgetDefaultProps(): IPollShape['props'] {\n\t\treturn {\n\t\t\tw: 300,\n\t\t\th: 300,\n\t\t\tcolor: 'black',\n\t\t\tfill: 'white',\n\t\t\tquestion: '',\n\t\t\tnumRespondents: 0,\n\t\t\tnumResponders: 0,\n\t\t\tquestionText: '',\n\t\t\tquestionType: '',\n\t\t\tanswers: [],\n\t\t}\n\t}\n\n\tgetGeometry(shape: IPollShape) {\n\t\treturn new Rectangle2d({\n\t\t\twidth: shape.props.w,\n\t\t\theight: shape.props.h,\n\t\t\tisFilled: true,\n\t\t})\n\t}\n\n\tcomponent(shape: IPollShape) {\n\t\tconst { bounds } = this.editor.getShapeGeometry(shape)\n\t\tconst theme = getDefaultColorTheme({\n\t\t\tisDarkMode: this.editor.user.getIsDarkMode(),\n\t\t})\n\n\t\t// const contentRef = React.useRef<HTMLDivElement>(null)\n\t\tconst pollMetadata = JSON.stringify({\n\t\t\tid: shape.id,\n\t\t\tquestion: shape.props.question,\n\t\t\tnumRespondents: shape.props.numRespondents,\n\t\t\tnumResponders: shape.props.numResponders,\n\t\t\tquestionText: shape.props.questionText,\n\t\t\tquestionType: shape.props.questionType,\n\t\t\tanswers: shape.props.answers,\n\t\t})\n\n\t\tconst adjustedHeight = shape.props.questionText.length > 0 ? bounds.height - 75 : bounds.height\n\n\t\treturn (\n\t\t\t<HTMLContainer\n\t\t\t\tid={shape.id}\n\t\t\t\tstyle={{\n\t\t\t\t\tborder: '1px solid #8B9AA8',\n\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\tboxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.20)',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpointerEvents: 'all',\n\t\t\t\t\tbackgroundColor: theme[shape.props.color].semi,\n\t\t\t\t\tcolor: theme[shape.props.color].solid,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: `${bounds.width}px`,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<ChatPollContent metadata={pollMetadata} height={adjustedHeight} />\n\t\t\t\t</div>\n\t\t\t</HTMLContainer>\n\t\t)\n\t}\n\n\tindicator(shape: IPollShape) {\n\t\treturn <rect width={shape.props.w} height={shape.props.h} />\n\t}\n\n\toverride onResize: TLOnResizeHandler<IPollShape> = (shape, info) => {\n\t\treturn resizeBox(shape, info)\n\t}\n}\n\nexport default PollShapeUtil\n"],
5
+ "mappings": "AA4FK;AA5FL;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACM;AAEP,OAAO,qBAAqB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAGxB,MAAM,sBAAsB,UAAsB;AAAA,EACxD,OAAgB,OAAO;AAAA,EAEvB,OAAgB,QAAQ;AAAA,EAExB,OAAgB,aAAa;AAAA,EAEpB,sBAAsB,CAAC,WAAuB;AAAA,EAE9C,YAAY,CAAC,WAAuB;AAAA,EAEpC,UAAU,CAAC,WAAuB;AAAA,EAE3C,kBAAuC;AACtC,WAAO;AAAA,MACN,GAAG;AAAA,MACH,GAAG;AAAA,MACH,OAAO;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,cAAc;AAAA,MACd,cAAc;AAAA,MACd,SAAS,CAAC;AAAA,IACX;AAAA,EACD;AAAA,EAEA,YAAY,OAAmB;AAC9B,WAAO,IAAI,YAAY;AAAA,MACtB,OAAO,MAAM,MAAM;AAAA,MACnB,QAAQ,MAAM,MAAM;AAAA,MACpB,UAAU;AAAA,IACX,CAAC;AAAA,EACF;AAAA,EAEA,UAAU,OAAmB;AAC5B,UAAM,EAAE,OAAO,IAAI,KAAK,OAAO,iBAAiB,KAAK;AACrD,UAAM,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sxs } from "react/jsx-runtime";
2
+ import { Bar, BarChart, ResponsiveContainer, XAxis, YAxis } from "recharts";
3
+ import Styled from "./styles.mjs";
4
+ const caseInsensitiveReducer = (acc, item) => {
5
+ const index = acc.findIndex((ans) => ans.key.toLowerCase() === item.key.toLowerCase());
6
+ if (index !== -1) {
7
+ if (acc[index].numVotes >= item.numVotes)
8
+ acc[index].numVotes += item.numVotes;
9
+ else {
10
+ const tempVotes = acc[index].numVotes;
11
+ acc[index] = item;
12
+ acc[index].numVotes += tempVotes;
13
+ }
14
+ } else {
15
+ acc.push(item);
16
+ }
17
+ return acc;
18
+ };
19
+ function assertAsMetadata(metadata) {
20
+ if (typeof metadata !== "object" || metadata === null) {
21
+ throw new Error("metadata is not an object");
22
+ }
23
+ if (typeof metadata.id !== "string") {
24
+ throw new Error("metadata.id is not a string");
25
+ }
26
+ if (typeof metadata.numRespondents !== "number") {
27
+ throw new Error("metadata.numRespondents is not a number");
28
+ }
29
+ if (typeof metadata.numResponders !== "number") {
30
+ throw new Error("metadata.numResponders is not a number");
31
+ }
32
+ if (typeof metadata.questionText !== "string") {
33
+ throw new Error("metadata.questionText is not a string");
34
+ }
35
+ if (typeof metadata.questionType !== "string") {
36
+ throw new Error("metadata.questionType is not a string");
37
+ }
38
+ if (!Array.isArray(metadata.answers)) {
39
+ throw new Error("metadata.answers is not an array");
40
+ }
41
+ }
42
+ const ChatPollContent = ({
43
+ metadata: string,
44
+ height = void 0
45
+ }) => {
46
+ const pollData = JSON.parse(string);
47
+ assertAsMetadata(pollData);
48
+ const answers = pollData.answers.reduce(caseInsensitiveReducer, []);
49
+ const translatedAnswers = answers.map((answer) => {
50
+ const translationKey = answer.key;
51
+ const pollAnswer = translationKey ? translationKey : answer.key;
52
+ return {
53
+ ...answer,
54
+ pollAnswer
55
+ };
56
+ });
57
+ const useHeight = height || translatedAnswers.length * 50;
58
+ return /* @__PURE__ */ jsxs(Styled.PollWrapper, { "data-test": "chatPollMessageText", children: [
59
+ /* @__PURE__ */ jsx(Styled.PollText, { children: pollData.questionText }),
60
+ /* @__PURE__ */ jsx(ResponsiveContainer, { width: "90%", height: useHeight, children: /* @__PURE__ */ jsxs(BarChart, { data: translatedAnswers, layout: "vertical", children: [
61
+ /* @__PURE__ */ jsx(XAxis, { type: "number" }),
62
+ /* @__PURE__ */ jsx(YAxis, { width: 80, type: "category", dataKey: "pollAnswer" }),
63
+ /* @__PURE__ */ jsx(Bar, { dataKey: "numVotes", fill: "#0C57A7" })
64
+ ] }) })
65
+ ] });
66
+ };
67
+ var poll_content_default = ChatPollContent;
68
+ export {
69
+ poll_content_default as default
70
+ };
71
+ //# sourceMappingURL=poll-content.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/lib/shapes/poll/components/poll-content.tsx"],
4
+ "sourcesContent": ["/* eslint-disable import/no-extraneous-dependencies */\nimport React from 'react'\nimport { Bar, BarChart, ResponsiveContainer, XAxis, YAxis } from 'recharts'\nimport { TLUiTranslationKey } from '../../../ui/hooks/useTranslation/TLUiTranslationKey'\nimport Styled from './styles'\n\nconst caseInsensitiveReducer = (acc: any[], item: { key: string; numVotes: number }) => {\n\tconst index = acc.findIndex((ans) => ans.key.toLowerCase() === item.key.toLowerCase())\n\tif (index !== -1) {\n\t\tif (acc[index].numVotes >= item.numVotes) acc[index].numVotes += item.numVotes\n\t\telse {\n\t\t\tconst tempVotes = acc[index].numVotes\n\t\t\tacc[index] = item\n\t\t\tacc[index].numVotes += tempVotes\n\t\t}\n\t} else {\n\t\tacc.push(item)\n\t}\n\treturn acc\n}\n\ninterface ChatPollContentProps {\n\tmetadata: string\n\theight?: number\n}\n\ninterface Metadata {\n\tid: string\n\tquestion: string\n\tnumRespondents: number\n\tnumResponders: number\n\tquestionText: string\n\tquestionType: string\n\tanswers: Array<Answers>\n}\n\ninterface Answers {\n\tkey: string\n\tnumVotes: number\n\tid: number\n}\n\nfunction assertAsMetadata(metadata: unknown): asserts metadata is Metadata {\n\tif (typeof metadata !== 'object' || metadata === null) {\n\t\tthrow new Error('metadata is not an object')\n\t}\n\tif (typeof (metadata as Metadata).id !== 'string') {\n\t\tthrow new Error('metadata.id is not a string')\n\t}\n\tif (typeof (metadata as Metadata).numRespondents !== 'number') {\n\t\tthrow new Error('metadata.numRespondents is not a number')\n\t}\n\tif (typeof (metadata as Metadata).numResponders !== 'number') {\n\t\tthrow new Error('metadata.numResponders is not a number')\n\t}\n\tif (typeof (metadata as Metadata).questionText !== 'string') {\n\t\tthrow new Error('metadata.questionText is not a string')\n\t}\n\tif (typeof (metadata as Metadata).questionType !== 'string') {\n\t\tthrow new Error('metadata.questionType is not a string')\n\t}\n\tif (!Array.isArray((metadata as Metadata).answers)) {\n\t\tthrow new Error('metadata.answers is not an array')\n\t}\n}\n\nconst ChatPollContent: React.FC<ChatPollContentProps> = ({\n\tmetadata: string,\n\theight = undefined,\n}) => {\n\tconst pollData = JSON.parse(string) as unknown\n\tassertAsMetadata(pollData)\n\n\tconst answers = pollData.answers.reduce(caseInsensitiveReducer, [])\n\n\tconst translatedAnswers = answers.map((answer: Answers) => {\n\t\tconst translationKey = answer.key as TLUiTranslationKey\n\t\tconst pollAnswer = translationKey ? translationKey : answer.key\n\t\treturn {\n\t\t\t...answer,\n\t\t\tpollAnswer,\n\t\t}\n\t})\n\n\tconst useHeight = height || translatedAnswers.length * 50\n\treturn (\n\t\t<Styled.PollWrapper data-test=\"chatPollMessageText\">\n\t\t\t<Styled.PollText>{pollData.questionText}</Styled.PollText>\n\t\t\t<ResponsiveContainer width=\"90%\" height={useHeight}>\n\t\t\t\t<BarChart data={translatedAnswers} layout=\"vertical\">\n\t\t\t\t\t<XAxis type=\"number\" />\n\t\t\t\t\t<YAxis width={80} type=\"category\" dataKey=\"pollAnswer\" />\n\t\t\t\t\t<Bar dataKey=\"numVotes\" fill=\"#0C57A7\" />\n\t\t\t\t</BarChart>\n\t\t\t</ResponsiveContainer>\n\t\t</Styled.PollWrapper>\n\t)\n}\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AS;AACV,MAAM;AACL,QAAM,WAAW,KAAK,MAAM,MAAM;AAClC,mBAAiB,QAAQ;AAEzB,QAAM,UAAU,SAAS,QAAQ,OAAO,wBAAwB,CAAC,CAAC;AAElE,QAAM,oBAAoB,QAAQ,IAAI,CAAC,WAAoB;AAC1D,UAAM,iBAAiB,OAAO;AAC9B,UAAM,aAAa,iBAAiB,iBAAiB,OAAO;AAC5D,WAAO;AAAA,MACN,GAAG;AAAA,MACH;AAAA,IACD;AAAA,EACD,CAAC;AAED,QAAM,YAAY,UAAU,kBAAkB,SAAS;AACvD,SACC,qBAAC,OAAO,aAAP,EAAmB,aAAU,uBAC7B;AAAA,wBAAC,OAAO,UAAP,EAAiB,mBAAS,cAAa;AAAA,IACxC,oBAAC,uBAAoB,OAAM,OAAM,QAAQ,WACxC,+BAAC,YAAS,MAAM,mBAAmB,QAAO,YACzC;AAAA,0BAAC,SAAM,MAAK,UAAS;AAAA,MACrB,oBAAC,SAAM,OAAO,IAAI,MAAK,YAAW,SAAQ,cAAa;AAAA,MACvD,oBAAC,OAAI,SAAQ,YAAW,MAAK,WAAU;AAAA,OACxC,GACD;AAAA,KACD;AAEF;AAEA,IAAO,uBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,23 @@
1
+ import styled from "styled-components";
2
+ const PollText = styled.div`
3
+ margin-top: 0.5rem;
4
+ margin-bottom: 0.5rem;
5
+ font-size: 1.25rem;
6
+ font-weight: 500;
7
+ margin-left: 2.75rem;
8
+ color: var(--color-text, var(--color-gray, #4e5a66));
9
+ word-break: break-word;
10
+ `;
11
+ const PollWrapper = styled.div`
12
+ width: 100%;
13
+ `;
14
+ var styles_default = {
15
+ PollText,
16
+ PollWrapper
17
+ };
18
+ export {
19
+ PollText,
20
+ PollWrapper,
21
+ styles_default as default
22
+ };
23
+ //# sourceMappingURL=styles.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/lib/shapes/poll/components/styles.ts"],
4
+ "sourcesContent": ["/* eslint-disable import/no-extraneous-dependencies */\nimport styled from 'styled-components'\n\nexport const PollText = styled.div`\n\tmargin-top: 0.5rem;\n\tmargin-bottom: 0.5rem;\n\tfont-size: 1.25rem;\n\tfont-weight: 500;\n\tmargin-left: 2.75rem;\n\tcolor: var(--color-text, var(--color-gray, #4e5a66));\n\tword-break: break-word;\n`\n\nexport const PollWrapper = styled.div`\n\twidth: 100%;\n`\n\nexport default {\n\tPollText,\n\tPollWrapper,\n}\n"],
5
+ "mappings": "AACA,OAAO,YAAY;AAEZ,MAAM,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUxB,MAAM,cAAc,OAAO;AAAA;AAAA;AAIlC,IAAO,iBAAQ;AAAA,EACd;AAAA,EACA;AACD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,25 @@
1
+ import { defineMigrations } from "@bigbluebutton/editor";
2
+ const pollShapeMigrations = defineMigrations({
3
+ currentVersion: 1,
4
+ migrators: {
5
+ 1: {
6
+ // example, removing a property from the shape
7
+ up(shape) {
8
+ const migratedUpShape = { ...shape };
9
+ delete migratedUpShape.somePropertyToRemove;
10
+ return migratedUpShape;
11
+ },
12
+ down(shape) {
13
+ const migratedDownShape = { ...shape };
14
+ migratedDownShape.somePropertyToRemove = "some value";
15
+ return migratedDownShape;
16
+ }
17
+ }
18
+ }
19
+ });
20
+ var poll_shape_migrations_default = pollShapeMigrations;
21
+ export {
22
+ poll_shape_migrations_default as default,
23
+ pollShapeMigrations
24
+ };
25
+ //# sourceMappingURL=poll-shape-migrations.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/shapes/poll/poll-shape-migrations.ts"],
4
+ "sourcesContent": ["import { defineMigrations } from '@bigbluebutton/editor'\n\n// Migrations for the custom poll shape (optional but very helpful)\nexport const pollShapeMigrations = defineMigrations({\n\tcurrentVersion: 1,\n\tmigrators: {\n\t\t1: {\n\t\t\t// example, removing a property from the shape\n\t\t\tup(shape) {\n\t\t\t\tconst migratedUpShape = { ...shape }\n\t\t\t\tdelete migratedUpShape.somePropertyToRemove\n\t\t\t\treturn migratedUpShape\n\t\t\t},\n\t\t\tdown(shape) {\n\t\t\t\tconst migratedDownShape = { ...shape }\n\t\t\t\tmigratedDownShape.somePropertyToRemove = 'some value'\n\t\t\t\treturn migratedDownShape\n\t\t\t},\n\t\t},\n\t},\n})\n\nexport default pollShapeMigrations\n"],
5
+ "mappings": "AAAA,SAAS,wBAAwB;AAG1B,MAAM,sBAAsB,iBAAiB;AAAA,EACnD,gBAAgB;AAAA,EAChB,WAAW;AAAA,IACV,GAAG;AAAA;AAAA,MAEF,GAAG,OAAO;AACT,cAAM,kBAAkB,EAAE,GAAG,MAAM;AACnC,eAAO,gBAAgB;AACvB,eAAO;AAAA,MACR;AAAA,MACA,KAAK,OAAO;AACX,cAAM,oBAAoB,EAAE,GAAG,MAAM;AACrC,0BAAkB,uBAAuB;AACzC,eAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD,CAAC;AAED,IAAO,gCAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import { DefaultColorStyle, T } from "@bigbluebutton/editor";
2
+ const pollShapeProps = {
3
+ w: T.number,
4
+ h: T.number,
5
+ color: DefaultColorStyle,
6
+ fill: T.string,
7
+ question: T.string,
8
+ numRespondents: T.number,
9
+ numResponders: T.number,
10
+ questionText: T.string,
11
+ questionType: T.string,
12
+ answers: T.any
13
+ };
14
+ var poll_shape_props_default = pollShapeProps;
15
+ export {
16
+ poll_shape_props_default as default,
17
+ pollShapeProps
18
+ };
19
+ //# sourceMappingURL=poll-shape-props.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/lib/shapes/poll/poll-shape-props.ts"],
4
+ "sourcesContent": ["import { DefaultColorStyle, ShapeProps, T } from '@bigbluebutton/editor'\nimport { IPollShape } from './poll-shape-types'\n\nexport const pollShapeProps: ShapeProps<IPollShape> = {\n\tw: T.number,\n\th: T.number,\n\tcolor: DefaultColorStyle,\n\tfill: T.string,\n\tquestion: T.string,\n\tnumRespondents: T.number,\n\tnumResponders: T.number,\n\tquestionText: T.string,\n\tquestionType: T.string,\n\tanswers: T.any,\n}\n\nexport default pollShapeProps\n"],
5
+ "mappings": "AAAA,SAAS,mBAA+B,SAAS;AAG1C,MAAM,iBAAyC;AAAA,EACrD,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AAAA,EACL,OAAO;AAAA,EACP,MAAM,EAAE;AAAA,EACR,UAAU,EAAE;AAAA,EACZ,gBAAgB,EAAE;AAAA,EAClB,eAAe,EAAE;AAAA,EACjB,cAAc,EAAE;AAAA,EAChB,cAAc,EAAE;AAAA,EAChB,SAAS,EAAE;AACZ;AAEA,IAAO,2BAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=poll-shape-types.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -6,11 +6,11 @@ class HandTool extends StateNode {
6
6
  static id = "hand";
7
7
  static initial = "idle";
8
8
  static children = () => [Idle, Pointing, Dragging];
9
- onDoubleClick = (info) => {
9
+ onDoubleClick = (_info) => {
10
10
  };
11
- onTripleClick = (info) => {
11
+ onTripleClick = (_info) => {
12
12
  };
13
- onQuadrupleClick = (info) => {
13
+ onQuadrupleClick = (_info) => {
14
14
  };
15
15
  }
16
16
  export {