scorer-ui-kit 3.0.4 → 3.0.6

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 (59) hide show
  1. package/dist/Alerts/atom/AlertBar.d.ts +4 -4
  2. package/dist/Alerts/atom/AlertBar.d.ts.map +1 -1
  3. package/dist/CameraPanels/molecules/CameraPanel.d.ts +4 -4
  4. package/dist/CameraPanels/molecules/CameraPanel.d.ts.map +1 -1
  5. package/dist/Chips/molecules/ChipDropdown.d.ts.map +1 -1
  6. package/dist/Form/atoms/Label.d.ts +4 -4
  7. package/dist/Form/atoms/Label.d.ts.map +1 -1
  8. package/dist/Form/atoms/SelectField.d.ts +3 -1
  9. package/dist/Form/atoms/SelectField.d.ts.map +1 -1
  10. package/dist/Global/atoms/Layout.d.ts +17 -14
  11. package/dist/Global/atoms/Layout.d.ts.map +1 -1
  12. package/dist/Global/atoms/TopBarBadge.d.ts.map +1 -1
  13. package/dist/Global/molecules/Sidebar.d.ts +12 -4
  14. package/dist/Global/molecules/Sidebar.d.ts.map +1 -1
  15. package/dist/Icons/Icon.d.ts +6 -2
  16. package/dist/Icons/Icon.d.ts.map +1 -1
  17. package/dist/{LineUIVideoBase-CJ61ZqPJ.mjs → LineUIVideoBase-Bo0pvCP-.mjs} +18 -12
  18. package/dist/{LineUIVideoBase-CJ61ZqPJ.mjs.map → LineUIVideoBase-Bo0pvCP-.mjs.map} +1 -1
  19. package/dist/{LineUIVideoBase-VxlYHeJG.js → LineUIVideoBase-DmQtfhyc.js} +19 -13
  20. package/dist/{LineUIVideoBase-VxlYHeJG.js.map → LineUIVideoBase-DmQtfhyc.js.map} +1 -1
  21. package/dist/Misc/atoms/MediaBox.d.ts +4 -5
  22. package/dist/Misc/atoms/MediaBox.d.ts.map +1 -1
  23. package/dist/Misc/atoms/Tag.d.ts +4 -8
  24. package/dist/Misc/atoms/Tag.d.ts.map +1 -1
  25. package/dist/Misc/molecules/TagList.d.ts +3 -1
  26. package/dist/Misc/molecules/TagList.d.ts.map +1 -1
  27. package/dist/Tabs/TabList.d.ts +3 -1
  28. package/dist/Tabs/TabList.d.ts.map +1 -1
  29. package/dist/hls.js +1 -2
  30. package/dist/hls.js.map +1 -1
  31. package/dist/hls.modern.js +1 -2
  32. package/dist/hls.modern.js.map +1 -1
  33. package/dist/index.js +161 -120
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.modern.js +645 -595
  36. package/dist/index.modern.js.map +1 -1
  37. package/dist/svg/AvatarPlaceholder.d.ts +1 -1
  38. package/dist/svg/AvatarPlaceholder.d.ts.map +1 -1
  39. package/dist/svg/Invalid.d.ts +1 -1
  40. package/dist/svg/Invalid.d.ts.map +1 -1
  41. package/dist/svg/LogoMark.d.ts +1 -1
  42. package/dist/svg/LogoMark.d.ts.map +1 -1
  43. package/dist/svg/LogoText.d.ts +1 -1
  44. package/dist/svg/LogoText.d.ts.map +1 -1
  45. package/dist/svg/NoImage.d.ts +1 -1
  46. package/dist/svg/NoImage.d.ts.map +1 -1
  47. package/dist/svg/NoImageBig.d.ts +1 -1
  48. package/dist/svg/NoImageBig.d.ts.map +1 -1
  49. package/dist/svg/PasswordHide.d.ts +1 -1
  50. package/dist/svg/PasswordHide.d.ts.map +1 -1
  51. package/dist/svg/PasswordShow.d.ts +1 -1
  52. package/dist/svg/PasswordShow.d.ts.map +1 -1
  53. package/dist/svg/Required.d.ts +1 -1
  54. package/dist/svg/Required.d.ts.map +1 -1
  55. package/dist/svg/Success.d.ts +1 -1
  56. package/dist/svg/Success.d.ts.map +1 -1
  57. package/dist/svg/checkmark.d.ts +1 -1
  58. package/dist/svg/checkmark.d.ts.map +1 -1
  59. package/package.json +13 -13
@@ -1 +1 @@
1
- {"version":3,"file":"LineUIVideoBase-CJ61ZqPJ.mjs","names":[],"sources":["../src/theme/common.tsx","../src/Icons/Icon.tsx","../src/Indicators/Spinner.tsx","../src/LineUI/Contexts.tsx","../src/LineUI/HandleUnit.tsx","../src/LineUI/LineUnit.tsx","../src/LineUI/LineSet.tsx","../src/LineUI/LineUIVideoBase.tsx"],"sourcesContent":["export const fontFamily = {\n ui: 'Monorale, Hiragino Sans, \"ヒラギノ角ゴシック\", Hiragino Kaku Gothic ProN, \"ヒラギノ角ゴ ProN W3\", Roboto, YuGothic, \"游ゴシック\", Meiryo, \"メイリオ\", sans-serif;',\n data: 'Lato, Hiragino Sans, \"ヒラギノ角ゴシック\", Hiragino Kaku Gothic ProN, \"ヒラギノ角ゴ ProN W3\", Roboto, YuGothic, \"游ゴシック\", Meiryo, \"メイリオ\", sans-serif;',\n};\n\nexport const dimensions = {\n icons: {\n weights: {\n light: 1,\n regular: 1.5,\n heavy: 3,\n strong: 5,\n },\n },\n form: {\n button: {\n xsmall: {\n height: '20px',\n padding: '0 10px',\n iconSize: 12,\n },\n small: {\n height: '30px',\n padding: '0 20px',\n iconSize: 14,\n },\n normal: {\n height: '40px',\n padding: '0 20px',\n iconSize: 16,\n },\n large: {\n height: '60px',\n padding: '0 20px',\n iconSize: 20,\n },\n },\n input: {\n height: '40px',\n },\n switch: {\n outer: {\n width: '38px',\n height: '22px',\n borderRadius: '11px',\n },\n inner: {\n width: '16px',\n height: '16px',\n borderRadius: '8px',\n },\n positions: {\n top: '2px',\n off: '2px',\n neutral: '10px',\n locked: '2px',\n on: '18px',\n },\n },\n },\n global: {\n mainMenu: {\n width: {\n open: '280px',\n closed: '80px',\n },\n },\n },\n};\n\nexport const animation = {\n easing: {\n primary: {\n inOut: 'cubic-bezier(0.87, 0, 0.13, 1)',\n out: 'cubic-bezier(0.16, 1, 0.3, 1)',\n in: 'cubic-bezier(0.7, 0, 0.84, 0)',\n },\n },\n speed: {\n faster: '0.085s',\n fast: '0.175s',\n normal: '0.35s',\n slow: '0.7s',\n slower: '1.4s',\n slowest: '2.8s',\n },\n};\n\nexport const deviceSize = {\n small: 0,\n medium: 768,\n large: 1024,\n xlarge: 1280,\n xxlarge: 1536,\n};\n\nexport const deviceMediaQuery = {\n small: `(min-width: ${deviceSize.small}px)`,\n medium: `(min-width: ${deviceSize.medium}px)`,\n large: `(min-width: ${deviceSize.large}px)`,\n xlarge: `(min-width: ${deviceSize.xlarge}px)`,\n xxlarge: `(min-width: ${deviceSize.xxlarge}px)`,\n};\n","import { IconSVGs } from '@future-standard/icons';\nimport type React from 'react';\nimport styled, { css } from 'styled-components';\nimport type { IWeight } from '..';\nimport { dimensions } from '../theme/common';\n\nconst wrapperCss = css`\n\n line-height: 0;\n\n svg {\n overflow: visible;\n vector-effect: non-scaling-stroke;\n\n line, path, circle, ellipse, foreignObject, polygon, polyline, rect, text, textPath, tspan {\n vector-effect: non-scaling-stroke;\n transition: stroke var(--speed-normal) var(--easing-primary-out);\n }\n }\n`;\n\nconst IconWrapper = styled.div`\n ${wrapperCss};\n`;\n\nconst IconWrapperForSVG = styled.g`\n ${wrapperCss};\n`;\n\nexport { IconSVGs, IconWrapper, IconWrapperForSVG };\n\nexport interface IconProps {\n icon: string;\n size?: number;\n weight?: IWeight;\n color?: ISvgIcons['color'];\n forSvgUsage?: boolean;\n}\n\nconst Icon: React.FC<IconProps> = ({\n icon,\n size = 24,\n weight = 'regular',\n color = 'grey-12',\n forSvgUsage = false,\n}) => {\n // For later use in deprecation of aliases.\n // const legacyColors = ['mono', 'dimmed', 'subtle', 'inverse', 'primary', 'danger'];\n // if(legacyColors.indexOf(color) >= 0){\n // console.warn(\"Deprecation warning: The use of \" + color + \" is deprecated. Please replace it with theme color variable.\");\n // }\n\n const iconWeight: number = dimensions.icons.weights[weight];\n //@ts-expect-error\n const IconSVG = IconSVGs[icon];\n\n return IconSVG != null ? (\n forSvgUsage ? (\n <IconWrapperForSVG>\n {IconSVG({ size: size, weight: iconWeight, color: `var(--${color}, var(--grey-12))` })}\n </IconWrapperForSVG>\n ) : (\n <IconWrapper>\n {IconSVG({ size: size, weight: iconWeight, color: `var(--${color}, var(--grey-12))` })}\n </IconWrapper>\n )\n ) : null;\n};\n\nexport default Icon;\n","import type React from 'react';\nimport styled, { keyframes } from 'styled-components';\n\nconst circumference = (radius: number) => {\n return 2 * Math.PI * radius;\n};\n\nconst animation = (radius: number) => {\n const c = circumference(radius);\n\n return keyframes`\n 0% {\n stroke-dashoffset: -${c * 0.85};\n }\n 50% {\n stroke-dashoffset: -${c * 0.5};\n }\n 100% {\n stroke-dashoffset: -${c * 0.85};\n }\n `;\n};\n\nconst rotate = keyframes`\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n`;\n\nconst BaseCircle = styled.circle<{ $styling: string; $customColor?: string }>`\n stroke: ${({ $styling, $customColor }) => ($customColor ? $customColor : `var(--spinner-${$styling}-base, var(--grey-a8))`)};\n fill: none;\n`;\n\nconst RotatingCircle = styled.circle<{ r: number; $styling: string; $customColor?: string }>`\n stroke: ${({ $styling, $customColor }) => ($customColor ? $customColor : `var(--spinner-${$styling}-top, var(--white-1))`)};\n fill: none;\n stroke-dasharray: ${({ r }) => circumference(r)};\n stroke-dashoffset: ${({ r }) => (2 * Math.PI * r) / 2};\n animation:\n ${({ r }) => animation(r)} 4s linear infinite,\n ${rotate} 1s linear infinite;\n stroke-linecap: round;\n`;\n\nexport type SpinnerSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';\n\nexport const getButtonDesign = (value: string) => {\n if (value === 'primary' || value === 'secondary' || value === 'warning') {\n return value;\n } else if (value === 'danger') {\n console.warn(\n 'Button.tsx - Warning, the design prop value `danger` is being deprecated. Use `warning` instead.'\n );\n return 'danger';\n }\n\n return 'simple';\n};\n\nconst sizeGuide = {\n xsmall: 12,\n small: 16,\n medium: 24,\n large: 36,\n xlarge: 48,\n};\n\ninterface ICustomSpinner {\n size?: number;\n baseColor?: string;\n topColor?: string;\n}\n\ninterface IProps {\n size?: SpinnerSize;\n styling: string;\n custom?: ICustomSpinner;\n}\n\nconst Spinner: React.FC<IProps> = ({ size = 'medium', styling = 'primary', custom = {} }) => {\n const { baseColor, topColor } = custom;\n const sizeVal = custom?.size ? custom.size : sizeGuide[size];\n const strokeWidth = sizeVal / 5.333;\n const circleRadius = sizeVal / 2 - strokeWidth / 2;\n\n return (\n <svg\n viewBox={`-${sizeVal / 2} -${sizeVal / 2} ${sizeVal} ${sizeVal}`}\n width={sizeVal}\n height={sizeVal}\n xmlns='http://www.w3.org/2000/svg'\n role='img'\n aria-label='Loading'\n >\n <BaseCircle\n cx='0'\n cy='0'\n r={circleRadius}\n strokeWidth={strokeWidth}\n $styling={getButtonDesign(styling)}\n $customColor={baseColor}\n />\n <RotatingCircle\n cx='0'\n cy='0'\n r={circleRadius}\n strokeWidth={strokeWidth}\n $styling={getButtonDesign(styling)}\n $customColor={topColor}\n />\n </svg>\n );\n};\n\nexport default Spinner;\n","import { createContext, type Dispatch } from 'react';\nimport type { IPointSet } from '.';\nimport type { IReducerActions } from './LineReducer';\n\ninterface IContextProps {\n state: IPointSet[];\n dispatch: Dispatch<IReducerActions>;\n}\n\nexport const LineSetContext = createContext({} as IContextProps);\n","import type React from 'react';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { IDragLineUISharedOptions, IVector2 } from '.';\n\nconst HandleTouchReactionKeyframes = keyframes`\n 0% {\n transform: scale(1);\n }\n\n 75% {\n transform: scale(3);\n }\n\n 100% {\n transform: scale(1.75);\n }\n`;\n\nconst HandleMouseReactionKeyframes = keyframes`\n 0% {\n transform: scale(1);\n }\n\n 75% {\n transform: scale(0);\n }\n\n 100% {\n transform: scale(0.5);\n }\n`;\n\nconst HandleBase = styled.svg<{ $mouseDragging: boolean; $styling: string }>`\n touch-action: none;\n user-select: none;\n overflow: visible;\n cursor: pointer;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].handleBase.fill};\n appearance: none;\n`;\n\nconst HandleRingLayer = styled.circle<{ $maskID: string; $styling: string }>`\n fill: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].handleRingLayer.stroke};\n mask: url(#${(props) => props.$maskID});\n`;\nconst HandleReactiveGroup = styled.g<{ $touchDragging: boolean; $mouseDragging: boolean }>`\n opacity: 0.65;\n cursor: pointer;\n transform: scale(1);\n\n ${(props) =>\n props.$touchDragging &&\n css`\n animation: ${HandleTouchReactionKeyframes} 0.5s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275) 1;\n `}\n\n ${(props) =>\n props.$mouseDragging &&\n css`\n animation: ${HandleMouseReactionKeyframes} 0.25s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275) 1;\n `}\n\n`;\nconst HandleReactiveFill = styled.circle<{ $styling: string }>`\n mix-blend-mode: multiply;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].handleReactiveFill.fill};\n stroke: none;\n`;\nconst HandleReactiveRing = styled.circle<{ $styling: string }>`\n fill: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].handleReactiveRing.stroke};\n`;\n\nconst HandleContrastLayer = styled.circle<{ $styling: string }>`\n overflow: visible;\n mix-blend-mode: multiply;\n fill: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].handleContrastLayer.stroke};\n`;\nconst HandleShadowLayer = styled.circle<{ $fillID: string }>`\n mix-blend-mode: multiply;\n fill: url(#${(props) => props.$fillID});\n`;\n\nconst GrabHandleIndexGroup = styled.g<{ $showIndex: boolean }>`\n opacity: 0;\n pointer-events: none;\n ${(props) =>\n props.$showIndex &&\n css`\n opacity: 1;\n `};\n\n`;\n\nconst StopStart = styled.stop<{ $styling: string }>`\n stop-color: ${({ theme, $styling }) => theme.custom.lines[$styling].stopStart.stopColor};\n`;\nconst StopEnd = styled.stop<{ $styling: string }>`\n stop-color: ${({ theme, $styling }) => theme.custom.lines[$styling].stopEnd.stopColor};\n`;\n\nconst GrabHandleIndexText = styled.text<{ $showIndex: boolean; $styling: string }>`\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandleText.stroke};\n text-align: center;\n\n font-weight: bold;\n transition: opacity 250ms ease;\n pointer-events: none;\n\n\n`;\n\nconst IconGroup = styled.g`\n\n`;\n\ninterface IHandleUnitProps {\n lineSetId: number;\n index: number;\n angle: number | null;\n useAngles: boolean;\n unit: number;\n size: number;\n x: number;\n y: number;\n Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>> & { rotate?: number };\n rotate?: number;\n moveCallback: (pointerPosition: IVector2, index: number) => void;\n moveEndCB?: () => void;\n options: IDragLineUISharedOptions;\n readOnlyHandle?: boolean;\n styling?: string;\n}\n\nconst HandleUnit: React.FC<IHandleUnitProps> = (props) => {\n // console.log(props.lineSetId, typeof props.lineSetId)\n const {\n index,\n useAngles,\n angle,\n unit,\n size,\n lineSetId,\n x,\n y,\n moveCallback,\n moveEndCB = () => {},\n Icon,\n rotate = 0,\n options,\n readOnlyHandle = false,\n styling = 'primary',\n } = props;\n // console.log(\"Handle \"+ index +\" from set \"+ lineSetId + \" :: \" + x, \", \" + y)\n const handleInstance = useRef<SVGSVGElement>(null);\n\n const [touchDragging, setTouchDragging] = useState(false);\n const [mouseDragging, setMouseDragging] = useState(false);\n const [touchIndex, setTouchIndex] = useState<number | null>(null);\n\n /** --- Toucher Events Section --- */\n const handleTouchStart = useCallback(\n (e: React.TouchEvent<SVGSVGElement>) => {\n e.preventDefault();\n if (readOnlyHandle) {\n return;\n }\n // Remember what touch event index is for this handle.\n for (let i = 0; i < e.touches.length; i++) {\n const touchTarget = e.touches[i].target as Element;\n if (\n touchTarget.parentNode?.parentElement === handleInstance.current ||\n touchTarget.parentNode?.parentElement?.parentElement\n ) {\n setTouchDragging(true);\n setTouchIndex(i);\n }\n }\n },\n [readOnlyHandle]\n );\n\n const handleTouchEnd = useCallback(() => {\n if (readOnlyHandle) {\n return;\n }\n setTouchDragging(false);\n setTouchIndex(null);\n moveEndCB();\n }, [moveEndCB, readOnlyHandle]);\n\n const handleTouchMove = useCallback(\n (e: React.TouchEvent<SVGSVGElement>) => {\n if (readOnlyHandle) {\n return;\n }\n for (let i = 0; i < e.touches.length; i++) {\n if (i === touchIndex) {\n moveCallback({ x: e.touches[i].pageX, y: e.touches[i].pageY }, index);\n }\n }\n },\n [index, moveCallback, readOnlyHandle, touchIndex]\n );\n\n /** --- Mouse Events Section --- */\n\n const handleMouseMoveRef = useRef<((e: MouseEvent) => void) | null>(null);\n const handleMouseUpRef = useRef<((e: MouseEvent) => void) | null>(null);\n\n const cleanupMouseListeners = useCallback(() => {\n if (handleMouseMoveRef.current) {\n window.removeEventListener('mousemove', handleMouseMoveRef.current);\n handleMouseMoveRef.current = null;\n }\n if (handleMouseUpRef.current) {\n window.removeEventListener('mouseup', handleMouseUpRef.current);\n handleMouseUpRef.current = null;\n }\n }, []);\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n e.preventDefault();\n if (readOnlyHandle) {\n return;\n }\n moveCallback({ x: e.pageX, y: e.pageY }, index);\n },\n [index, moveCallback, readOnlyHandle]\n );\n\n const handleMouseUp = useCallback(\n (e: MouseEvent) => {\n e.preventDefault();\n if (readOnlyHandle) {\n return;\n }\n setMouseDragging(false);\n cleanupMouseListeners();\n moveCallback({ x: e.pageX, y: e.pageY }, index);\n setTimeout(moveEndCB);\n },\n [cleanupMouseListeners, index, moveCallback, moveEndCB, readOnlyHandle]\n );\n\n const handleMouseDown = useCallback(\n (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n e.preventDefault();\n if (readOnlyHandle) {\n return;\n }\n cleanupMouseListeners();\n setMouseDragging(true);\n handleMouseMoveRef.current = handleMouseMove;\n handleMouseUpRef.current = handleMouseUp;\n window.addEventListener('mousemove', handleMouseMove);\n window.addEventListener('mouseup', handleMouseUp);\n },\n [cleanupMouseListeners, handleMouseMove, handleMouseUp, readOnlyHandle]\n );\n\n useEffect(() => {\n return cleanupMouseListeners;\n }, [cleanupMouseListeners]);\n\n const maskID = useAngles ? `mask-${lineSetId}-${index}` : '';\n const shadowGradientID = `shadowGradient-${lineSetId}-${index}`;\n const {\n showPointHandle = true,\n showPointLabel = false,\n pointIndexOffset,\n } = options as IDragLineUISharedOptions;\n\n return (\n <HandleBase\n ref={handleInstance}\n $styling={styling}\n x={x}\n y={y}\n $mouseDragging={mouseDragging}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onMouseDown={handleMouseDown}\n >\n <defs>\n <mask id={maskID}>\n <rect width='100%' height='100%' x='-50%' y='-50%' fill='white' />\n <rect\n width={size / 3}\n height={size / 0.9}\n x={-(size / 3 / 2)}\n y={-(size / 0.9 + 5)}\n fill='black'\n transform={`rotate(${angle || 0} 0 0)`}\n />\n </mask>\n <radialGradient id={shadowGradientID}>\n <StopStart $styling={styling} offset='0%' />\n <StopEnd $styling={styling} offset='80%' />\n </radialGradient>\n </defs>\n\n {Icon ? (\n <IconGroup transform={`scale(${unit * 1.5}) translate(-21 -21) rotate(${rotate}, 21, 21 )`}>\n <Icon height='42' width='42' />\n </IconGroup>\n ) : (\n showPointHandle && (\n <g transform={`scale(${unit})`}>\n <HandleShadowLayer r={size * 1} $fillID={shadowGradientID} />\n <HandleContrastLayer $styling={styling} r={size / 2.4} strokeWidth={size / 3} />\n\n <HandleReactiveGroup $touchDragging={touchDragging} $mouseDragging={mouseDragging}>\n <HandleReactiveFill $styling={styling} r={size / 1.8} />\n <HandleReactiveRing $styling={styling} r={size / 2.25} strokeWidth={size / 3} />\n </HandleReactiveGroup>\n\n <HandleRingLayer\n $styling={styling}\n r={size / 2}\n strokeWidth={size / 6}\n $maskID={maskID}\n />\n\n {showPointLabel && (\n <GrabHandleIndexGroup $showIndex>\n <GrabHandleIndexText\n $styling={styling}\n transform='translate(-5,6)'\n fontSize='20px'\n $showIndex\n >\n {index + pointIndexOffset}\n </GrabHandleIndexText>\n </GrabHandleIndexGroup>\n )}\n </g>\n )\n )}\n </HandleBase>\n );\n};\n\nexport default HandleUnit;\n","import type React from 'react';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\nimport Icon from '../Icons/Icon';\nimport type { IDragLineUISharedOptions, IVector2 } from '.';\n\nconst ContrastLine = styled.line<{\n $styling: string;\n $lineClickSensing?: number;\n $showLineBorder?: boolean;\n}>`\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].contrastLine.stroke};\n mix-blend-mode: multiply;\n stroke-width: ${({ $lineClickSensing }) => $lineClickSensing}px;\n stroke-opacity: ${({ $showLineBorder }) => ($showLineBorder ? '0.35' : '0')};\n cursor: pointer;\n`;\n\nconst HighlightLine = styled.line<{ $styling: string }>`\n pointer-events: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].highlightLineBorder.stroke};\n`;\n\nconst GrabHandle = styled.circle<{ $hide: boolean; $styling: string }>`\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandle.fill};\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandle.stroke};\n opacity: 1;\n transition: opacity 250ms ease;\n cursor: grab;\n\n ${(props) =>\n props.$hide &&\n css`\n pointer-events: none;\n opacity: 0;\n `};\n`;\n\nconst GrabHandleIndexGroup = styled.g<{ $showIndex: boolean }>`\n opacity: 0;\n pointer-events: none;\n ${(props) =>\n props.$showIndex &&\n css`\n opacity: 1;\n `};\n\n`;\n\nconst GrabHandleIndexText = styled.text<{ $showIndex: boolean; $styling: string }>`\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n text-align: center;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandleText.stroke};\n font-weight: bold;\n transition: opacity 250ms ease;\n pointer-events: none;\n`;\n\nconst LabelText = styled.text<{ $showIndex: boolean; $styling: string; $showLabelShadow: boolean }>`\n text-align: center;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].label.fill};\n font-weight: bold;\n transition: opacity 250ms ease;\n cursor: pointer;\n ${({ $showLabelShadow }) =>\n $showLabelShadow &&\n css`\n text-shadow:\n -1px -1px 0 #000,\n 1px -1px 0 #000,\n -1px 1px 0 #000,\n 1px 1px 0 #000;\n `}\n`;\n\nconst GrabHandleContrast = styled(GrabHandle)`\n fill: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandleContrast.stroke};\n`;\n\nconst GrabHandleGroup = styled.g<{\n $showIndex: boolean;\n $originalRadius: number;\n $styling: string;\n}>`\n\n ${GrabHandle}, ${GrabHandleContrast} {\n transition: r 250ms ease;\n }\n\n ${(props) =>\n props.$showIndex &&\n css`\n ${GrabHandle}, ${GrabHandleContrast} {\n pointer-events: none;\n r: ${props.$originalRadius * 1.75};\n }\n `};\n`;\n\nconst DMCircle = styled.circle`\n fill: hsla(203, 100%, 35%, 0.49);\n cursor: pointer;\n`;\n\nconst IconFormat = styled(Icon)`\n cursor: pointer;\n`;\n\ninterface ILineUnitProps {\n lineSetId: number;\n options: IDragLineUISharedOptions;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n unit: number;\n lineClickCallback?: (lineSetId: number) => void;\n lineMoveCallback: (position: IVector2) => void;\n lineMoveStartCallback: (position: IVector2) => void;\n moveEndCB?: () => void;\n label?: string;\n styling?: string;\n showSmallDirectionMark?: boolean;\n overrideShowMoveHandle?: boolean;\n lineClickSensingBorder?: string;\n hasClickSensingBorder?: boolean;\n}\n\nconst LineUnit: React.FC<ILineUnitProps> = (props) => {\n const {\n x1,\n y1,\n x2,\n y2,\n unit,\n lineMoveCallback,\n lineMoveStartCallback,\n options,\n lineSetId,\n label,\n styling = 'primary',\n moveEndCB = () => {},\n lineClickCallback = () => {},\n showSmallDirectionMark = false,\n overrideShowMoveHandle = true,\n } = props;\n const {\n handleFinderActive,\n revealSetIndex,\n showMoveHandle,\n setIndexOffset,\n showDirectionMark,\n showLabelShadow = false,\n } = options;\n const [showLineBorder, setShowLineBorder] = useState<boolean>();\n\n // const a = x1 - x2;\n // const b = y1 - y2;\n // const distance = Math.sqrt( a*a + b*b );\n //this distance 60 doesn't work now...\n // const hideGrabHandle = showMoveHandle === false || (showMoveHandle !== true && distance < 60);\n\n const hideGrabHandle = !showMoveHandle || !overrideShowMoveHandle;\n const lineClickSensing = parseInt(props.lineClickSensingBorder as string, 10);\n\n /** --- Toucher Events Section --- */\n const grabTouchMove = (e: React.TouchEvent<SVGCircleElement>) => {\n for (let i = 0; i < e.touches.length; i++) {\n // if(i === touchIndex){\n lineMoveCallback({ x: e.touches[i].pageX, y: e.touches[i].pageY });\n // }\n }\n moveEndCB();\n };\n\n const grabTouchStart = (e: React.TouchEvent<SVGCircleElement>) => {\n for (let i = 0; i < e.touches.length; i++) {\n // if(i === touchIndex){\n lineMoveStartCallback({ x: e.touches[i].pageX, y: e.touches[i].pageY });\n // }\n }\n };\n\n /** --- Mouse Events Section --- */\n const mouseMoveRef = useRef<((e: MouseEvent) => void) | null>(null);\n const mouseUpRef = useRef<((e: MouseEvent) => void) | null>(null);\n\n const cleanupMouseListeners = useCallback(() => {\n if (mouseMoveRef.current) {\n window.removeEventListener('mousemove', mouseMoveRef.current);\n mouseMoveRef.current = null;\n }\n if (mouseUpRef.current) {\n window.removeEventListener('mouseup', mouseUpRef.current);\n mouseUpRef.current = null;\n }\n }, []);\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n lineMoveCallback({ x: e.pageX, y: e.pageY });\n e.preventDefault();\n },\n [lineMoveCallback]\n );\n\n const handleMouseUp = useCallback(\n (e: MouseEvent) => {\n cleanupMouseListeners();\n lineMoveCallback({ x: e.pageX, y: e.pageY });\n moveEndCB();\n e.preventDefault();\n },\n [cleanupMouseListeners, lineMoveCallback, moveEndCB]\n );\n\n const handleMouseDown = useCallback(\n (e: React.MouseEvent<SVGCircleElement, MouseEvent>) => {\n cleanupMouseListeners();\n lineMoveStartCallback({ x: e.pageX, y: e.pageY });\n mouseMoveRef.current = handleMouseMove;\n mouseUpRef.current = handleMouseUp;\n window.addEventListener('mousemove', handleMouseMove);\n window.addEventListener('mouseup', handleMouseUp);\n e.preventDefault();\n },\n [cleanupMouseListeners, lineMoveStartCallback, handleMouseMove, handleMouseUp]\n );\n\n useEffect(() => {\n return cleanupMouseListeners;\n }, [cleanupMouseListeners]);\n const midpoint = {\n x: (x2 + x1) / 2,\n y: (y2 + y1) / 2,\n };\n\n const directionMarkCoordinate = () => {\n const angle = Math.atan2(y2 - y1, x2 - x1);\n const angleMode = Math.PI / 2 - angle;\n const x = midpoint.x + Math.sin(angleMode) - 5;\n const y = midpoint.y + Math.cos(angleMode);\n const rotate = (180 / Math.PI) * Math.atan2(y2 - y1, x2 - x1);\n const labelRotate = -rotate;\n return { x, y, rotate, labelRotate };\n };\n\n const getDirectionMarkLine = () => {\n const dmCoordinate = directionMarkCoordinate();\n return (\n <g\n transform={`translate(${dmCoordinate.x},${dmCoordinate.y}) rotate(${dmCoordinate.rotate}) scale(${unit * 1})`}\n style={{ cursor: 'pointer' }}\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions: SVG group element in canvas drawing context */}\n <g onClick={() => lineClickCallback(lineSetId)} transform='translate(-3,-30) scale(0.8)'>\n <DMCircle r={12} cx={6} cy={7} />\n <IconFormat color='inverse' icon='Up' size={12} weight='heavy' forSvgUsage />\n </g>\n {showSmallDirectionMark && (\n // biome-ignore lint/a11y/noStaticElementInteractions: SVG group element in canvas drawing context\n <g\n onClick={() => lineClickCallback(lineSetId)}\n transform='translate(5,25) rotate(-180) scale(0.8)'\n >\n <DMCircle r={8} cx={3.5} cy={4.5} />\n <IconFormat color='inverse' icon='Up' size={7} weight='heavy' forSvgUsage />\n </g>\n )}\n {label && (\n <g\n transform={`translate(0,${showSmallDirectionMark ? 45 : 30}) rotate(${dmCoordinate.labelRotate})`}\n >\n <LabelText\n onClick={() => lineClickCallback(lineSetId)}\n textAnchor={\n showSmallDirectionMark ? (dmCoordinate.labelRotate < 0 ? 'end' : 'start') : 'middle'\n }\n dominantBaseline='middle'\n $styling={styling}\n fontSize={`${14}px`}\n x={0}\n y={0}\n $showIndex={revealSetIndex || handleFinderActive}\n $showLabelShadow={showLabelShadow}\n >\n {label}\n </LabelText>\n </g>\n )}\n </g>\n );\n };\n\n //hover on line show border\n const getMouseOver = useCallback(() => {\n if (props.hasClickSensingBorder) {\n setShowLineBorder(true);\n }\n }, [props.hasClickSensingBorder]);\n\n const getMouseOut = useCallback(() => {\n if (props.hasClickSensingBorder) {\n setShowLineBorder(false);\n }\n }, [props.hasClickSensingBorder]);\n\n return (\n <g>\n <ContrastLine\n onMouseOver={getMouseOver}\n onMouseOut={getMouseOut}\n $lineClickSensing={lineClickSensing}\n $showLineBorder={showLineBorder}\n onClick={() => lineClickCallback(lineSetId)}\n $styling={styling}\n strokeLinecap='round'\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n strokeWidth={4 * unit}\n />\n <HighlightLine $styling={styling} x1={x1} y1={y1} x2={x2} y2={y2} strokeWidth={2 * unit} />\n\n <GrabHandleGroup\n $styling={styling}\n $showIndex={handleFinderActive && revealSetIndex}\n $originalRadius={8 * unit}\n >\n <GrabHandleContrast\n $styling={styling}\n r={8 * unit}\n strokeWidth={4 * unit}\n cx={midpoint.x}\n cy={midpoint.y}\n $hide={hideGrabHandle}\n />\n <GrabHandle\n $styling={styling}\n textAnchor='middle'\n r={8 * unit}\n strokeWidth={1 * unit}\n cx={midpoint.x}\n cy={midpoint.y}\n $hide={hideGrabHandle}\n onTouchMove={grabTouchMove}\n onTouchStart={grabTouchStart}\n onMouseDown={handleMouseDown}\n />\n </GrabHandleGroup>\n\n <GrabHandleIndexGroup $showIndex={!hideGrabHandle && (handleFinderActive || revealSetIndex)}>\n <GrabHandleIndexText\n $styling={styling}\n fontSize={`${unit * 10}px`}\n x={midpoint.x - 3 * unit}\n y={midpoint.y + 4 * unit}\n $showIndex={revealSetIndex || handleFinderActive}\n >\n {lineSetId + setIndexOffset}\n </GrabHandleIndexText>\n </GrabHandleIndexGroup>\n\n {/* <circle r={1* unit} cx={x1} cy={y1} fill='white' /> */}\n {/* <circle r={1* unit} cx={x2} cy={y2} fill='white' /> */}\n\n {showDirectionMark\n ? getDirectionMarkLine()\n : label && (\n <LabelText\n $styling={styling}\n fontSize={`${unit * 14}px`}\n x={midpoint.x - 16 * unit}\n y={midpoint.y - 15 * unit}\n $showIndex={revealSetIndex || handleFinderActive}\n $showLabelShadow={showLabelShadow}\n >\n {label}\n </LabelText>\n )}\n </g>\n );\n};\n\nexport default LineUnit;\n","import update from 'immutability-helper';\nimport type React from 'react';\nimport { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { IBoundary, IDragLineUISharedOptions, IPointSet, IVector2 } from '.';\nimport { LineSetContext } from './Contexts';\nimport HandleUnit from './HandleUnit';\nimport LineUnit from './LineUnit';\n\nconst FilledPolygon = styled.polygon<{ $color: string; $opacity: number }>`\n fill: ${({ $color }) => $color};\n opacity: ${({ $opacity }) => $opacity};\n`;\n\nconst Point = styled.circle<{ $styling: string }>`\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].point.fill};\n`;\n\nconst AreaLabelText = styled.text<{ $styling: string; $showAreaLabelShadow: boolean }>`\n text-align: center;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].label.fill};\n font-weight: bold;\n transition: opacity 250ms ease;\n pointer-events: none;\n ${({ $showAreaLabelShadow }) =>\n $showAreaLabelShadow &&\n css`\n text-shadow:\n -1px -1px 0 #000,\n 1px -1px 0 #000,\n -1px 1px 0 #000,\n 1px 1px 0 #000;\n `}\n`;\n\ninterface ILineSetProps {\n lineSetId: number;\n boundaries: IBoundary;\n size: number;\n unit: number;\n lineData: IPointSet;\n options: IDragLineUISharedOptions;\n onLineMoveEnd: () => void;\n onLineClick: (lineSetId: number) => void;\n getCTM: () => DOMMatrix | null;\n lineClickSensingBorder?: string;\n hasClickSensingBorder?: boolean;\n}\n\ninterface AreaLabelProps {\n lineSetData: IPointSet;\n unit: number;\n showAreaLabelShadow: boolean;\n}\n\nconst AreaLabel: React.FC<AreaLabelProps> = ({ lineSetData, unit, showAreaLabelShadow }) => {\n const pointsLength = lineSetData.points.length;\n if (pointsLength < 3) return null;\n let midpoint = { x: 0, y: 0 };\n\n lineSetData.points.map(({ x, y }) => {\n midpoint.x += x;\n midpoint.y += y;\n return null;\n });\n\n midpoint = { x: midpoint.x / pointsLength, y: midpoint.y / pointsLength };\n const Textlen = lineSetData.areaName?.length || 1;\n return (\n <AreaLabelText\n fontSize={`${unit * 14}px`}\n $styling={lineSetData.styling || 'primary'}\n x={midpoint.x - 4 * Textlen * unit}\n y={midpoint.y + 6 * unit}\n $showAreaLabelShadow={showAreaLabelShadow}\n >\n {lineSetData.areaName}\n </AreaLabelText>\n );\n};\n\nconst LineSet: React.FC<ILineSetProps> = ({\n getCTM,\n boundaries,\n unit,\n size,\n lineSetId,\n options,\n onLineMoveEnd,\n onLineClick,\n lineClickSensingBorder,\n hasClickSensingBorder,\n}) => {\n // console.log(\"Unit \" + lineSetId + \", reporting in...\")\n\n const { state, dispatch } = useContext(LineSetContext);\n const lineSetData = state[lineSetId];\n const { showLabelShadow = false } = options;\n\n const [handleAngles, setHandleAngles] = useState<number[]>([]);\n\n const handleRelation = useRef<{ offsetX: number; offsetY: number }[]>([]);\n const handleRadius: number = size / 2;\n const handleUsesAngles: boolean = lineSetData.points.length === 2;\n\n /**\n * Ensure provided position vector is within the boundaries (of the container)\n * @param {IVector2} position Vector to be enforced.\n * @returns {IVector2} The position updated clamped to range.\n */\n const enforceBoundaries = useCallback(\n (position: IVector2) => {\n if (position.x < boundaries.x.min) {\n position.x = boundaries.x.min;\n } else if (position.x > boundaries.x.max) {\n position.x = boundaries.x.max;\n }\n\n if (position.y < boundaries.y.min) {\n position.y = boundaries.y.min;\n } else if (position.y > boundaries.y.max) {\n position.y = boundaries.y.max;\n }\n\n return position;\n },\n [boundaries]\n );\n\n const handleMoveCallback = useCallback(\n (pointerPosition: IVector2, index: number) => {\n const screenCTM = getCTM();\n if (!screenCTM) {\n return;\n }\n\n const pointer = enforceBoundaries({\n x: (pointerPosition.x - window.scrollX - screenCTM.e) / screenCTM.a,\n y: (pointerPosition.y - window.scrollY - screenCTM.f) / screenCTM.d,\n });\n const point = {\n x: Math.round(pointer.x),\n y: Math.round(pointer.y),\n };\n const newLineSetData = update(lineSetData, { points: { [index]: { $merge: point } } });\n\n dispatch({ type: 'UPDATE', index: lineSetId, data: newLineSetData });\n },\n [getCTM, enforceBoundaries, lineSetData, dispatch, lineSetId]\n );\n\n const lineDragStart = useCallback(\n (pointerPosition: IVector2) => {\n const screenCTM = getCTM();\n if (!screenCTM) {\n return;\n }\n\n const pointer = {\n x: (pointerPosition.x - window.scrollX - screenCTM.e) / screenCTM.a - handleRadius,\n y: (pointerPosition.y - window.scrollY - screenCTM.f) / screenCTM.d - handleRadius,\n };\n\n handleRelation.current = lineSetData.points.map((handle) => {\n const xDiff = pointer.x - handle.x;\n const yDiff = pointer.y - handle.y;\n return {\n offsetX: xDiff,\n offsetY: yDiff,\n };\n });\n },\n [handleRadius, lineSetData.points, getCTM]\n );\n\n const lineDragUpdate = useCallback(\n (pointerPosition: IVector2) => {\n const screenCTM = getCTM();\n if (!screenCTM) {\n return;\n }\n\n const { points } = lineSetData;\n\n const pointer = {\n x: (pointerPosition.x - window.scrollX - screenCTM.e) / screenCTM.a - handleRadius,\n y: (pointerPosition.y - window.scrollY - screenCTM.f) / screenCTM.d - handleRadius,\n };\n\n const newPoints = points.map((_handle, index) => {\n const { offsetX = 0, offsetY = 0 } = handleRelation.current[index] || {};\n\n return enforceBoundaries({\n x: Math.round(pointer.x - offsetX),\n y: Math.round(pointer.y - offsetY),\n });\n });\n\n dispatch({\n type: 'UPDATE',\n index: lineSetId,\n data: { ...lineSetData, points: [...newPoints] },\n });\n },\n [getCTM, lineSetData, handleRadius, dispatch, lineSetId, enforceBoundaries]\n );\n\n const calcAngle = useCallback(\n (originX: number, originY: number, towardsX: number, towardsY: number) => {\n const angle = Math.atan2(towardsY - originY, towardsX - originX);\n const degrees = (angle * 180) / Math.PI + 90;\n return degrees;\n },\n []\n );\n\n // useCallback maybe to reduce unchanged deals?\n const updateHandleAngles = useCallback(\n (inputHandleData: IPointSet) => {\n const { points } = inputHandleData;\n const outputData: number[] = [];\n\n // Update all handle angles in data set.\n inputHandleData.points.forEach((handle, index) => {\n const nextIndex = index + 2 > points.length ? 0 : index + 1;\n const nextHandle = points[nextIndex];\n const angle = calcAngle(handle.x, handle.y, nextHandle.x, nextHandle.y);\n outputData.push(angle);\n });\n\n setHandleAngles(outputData);\n },\n [calcAngle]\n );\n\n useEffect(() => {\n // Update angles when the line's data set has changed.\n if (handleUsesAngles) {\n updateHandleAngles(lineSetData);\n }\n }, [lineSetData, updateHandleAngles, handleUsesAngles]);\n\n const initialClampDone = useRef(false);\n useEffect(() => {\n // Clamp existing points to boundaries once when boundaries first become valid (video load)\n if (boundaries.x.max === 0 && boundaries.y.max === 0) {\n return;\n }\n if (initialClampDone.current) {\n return;\n }\n initialClampDone.current = true;\n\n const needsUpdate = lineSetData.points.some(\n ({ x, y }) =>\n x < boundaries.x.min || x > boundaries.x.max || y < boundaries.y.min || y > boundaries.y.max\n );\n\n if (needsUpdate) {\n const clampedPoints = lineSetData.points.map((point) => enforceBoundaries({ ...point }));\n dispatch({\n type: 'UPDATE',\n index: lineSetId,\n data: { ...lineSetData, points: clampedPoints },\n });\n }\n }, [\n boundaries,\n lineSetData.points.some,\n dispatch,\n lineSetData.points.map,\n lineSetId,\n lineSetData,\n enforceBoundaries,\n ]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handles =\n (lineSetData?.showPointHandle === undefined || lineSetData?.showPointHandle) &&\n lineSetData.points.map(({ x, y }, index) => (\n <HandleUnit\n // biome-ignore lint/suspicious/noArrayIndexKey: points have only {x,y} (no id) and index is meaningful — used to look up handleAngles[index] and as the index prop. #646.\n key={index + lineSetId}\n lineSetId={lineSetId}\n rotate={lineSetData.rotate}\n Icon={lineSetData.icon}\n index={index}\n unit={unit}\n size={size}\n useAngles={handleUsesAngles}\n angle={handleAngles[index]}\n x={x}\n y={y}\n moveEndCB={onLineMoveEnd}\n moveCallback={handleMoveCallback}\n options={options}\n styling={lineSetData.styling}\n readOnlyHandle={lineSetData.readOnly}\n />\n ));\n\n const points =\n options.showPoint &&\n lineSetData.points.map(({ x, y }, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: points have only {x,y} — index is the only stable identity. #646.\n <Point $styling={lineSetData.styling || 'primary'} key={index} r={unit} cx={x} cy={y} />\n ));\n\n const lines = lineSetData.points.map(({ x: x1, y: y1 }, index) => {\n const { points, name, styling = 'primary' } = lineSetData;\n //nextIndex index is next Point's index\n const nextIndex = index + 1 >= points.length ? 0 : index + 1;\n //in the case of a line don't draw line back from second point\n if (index === 1 && nextIndex === 0) {\n return null;\n }\n const { x: x2, y: y2 } = points[nextIndex];\n\n return (\n <LineUnit\n // biome-ignore lint/suspicious/noArrayIndexKey: lines connect adjacent points (via nextIndex math); index is structural. #646.\n key={index}\n moveEndCB={onLineMoveEnd}\n lineSetId={lineSetId}\n options={options}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n unit={unit}\n label={name}\n styling={styling}\n lineClickCallback={onLineClick}\n lineMoveCallback={lineDragUpdate}\n lineMoveStartCallback={lineDragStart}\n showSmallDirectionMark={lineSetData.showSmallDirectionMark}\n overrideShowMoveHandle={lineSetData.showMoveHandle}\n lineClickSensingBorder={lineClickSensingBorder}\n hasClickSensingBorder={hasClickSensingBorder}\n />\n );\n });\n\n const polygonPoints = lineSetData.points.map((point) => `${point.x},${point.y}`).join(' ');\n\n return (\n <g>\n <FilledPolygon\n points={polygonPoints}\n $color={lineSetData.areaFillColor ? lineSetData.areaFillColor : 'transparent'}\n $opacity={lineSetData.areaTransparencyLevel ? lineSetData.areaTransparencyLevel / 100 : 0}\n />\n {lines}\n {handles}\n {points}\n <AreaLabel lineSetData={lineSetData} unit={unit} showAreaLabelShadow={showLabelShadow} />\n </g>\n );\n};\n\nexport default LineSet;\n","import type React from 'react';\nimport { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\nimport Spinner from '../Indicators/Spinner';\nimport type { IBoundary, LineUIOptions, LineUIVideoOptions } from '.';\nimport { LineSetContext } from './Contexts';\nimport LineSet from './LineSet';\n\nconst Container = styled.div`\n position: relative;\n line-height: 0;\n user-select: none;\n touch-action: none;\n width: auto;\n`;\nconst Video = styled.video`\n width: 100%;\n height: 100%;\n border-radius: 3px;\n background-color: hsla(0deg, 0%, 0%, 35%);\n`;\nconst LoadingOverlay = styled.div`\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`;\n\nconst Frame = styled.svg<{ $transcalent?: boolean }>`\n touch-action: none;\n user-select: none;\n margin: 0;\n\n overflow: visible;\n\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n transition: background 250ms ease;\n background: hsla(0deg, 0%, 0%, 0%);\n\n ${(props) =>\n props.$transcalent &&\n css`\n background: hsla(0deg, 0%, 0%, 35%);\n `}\n`;\n\nexport interface LineUIProps {\n src: string;\n onSizeChange?: (size: { h: number; w: number }) => void;\n onLineMoveEnd?: () => void;\n onLineClick?: (lineSetId: number) => void;\n onLoaded?: (metadata: { height: number; width: number }) => void;\n options?: LineUIOptions;\n videoOptions: LineUIVideoOptions;\n lineClickSensingBorder?: string;\n hasClickSensingBorder?: boolean;\n}\n\nexport interface LineUIVideoBaseProps extends Omit<LineUIProps, 'src'> {\n videoRef: React.RefObject<HTMLVideoElement | null>;\n}\n\nconst LineUIVideoBase: React.FC<LineUIVideoBaseProps> = ({\n videoRef,\n onSizeChange = () => {},\n onLineMoveEnd = () => {},\n onLineClick = () => {},\n onLoaded = () => {},\n lineClickSensingBorder = '65',\n hasClickSensingBorder = true,\n videoOptions: { loop = false, autoPlay = false, controls = false, muted = true, ...videoOptions },\n options: {\n showHandleFinder,\n showSetIndex,\n showPointLabel = false,\n showPointHandle,\n showLabelShadow,\n showMoveHandle,\n showGrabHandle,\n setIndexOffset = 0,\n pointIndexOffset = 0,\n showPoint = false,\n boundaryOffset = 0,\n showDirectionMark = false,\n } = {},\n}) => {\n const frame = useRef<SVGSVGElement>(null);\n\n const [boundaries, setBoundaries] = useState<IBoundary>({\n x: { min: 0, max: 0 },\n y: { min: 0, max: 0 },\n });\n const { state } = useContext(LineSetContext);\n\n const [handleFinder, setHandleFinder] = useState<boolean>(false);\n\n const [videoSize, setVideoSize] = useState({ h: 768, w: 1024 });\n const [unit, setUnit] = useState(1);\n const [loaded, setLoaded] = useState(false);\n\n const initScaleAndBounds = useCallback(() => {\n if (!videoRef.current) {\n return;\n }\n const { videoHeight, videoWidth, clientHeight } = videoRef.current;\n\n if (videoHeight !== videoSize.h || videoWidth !== videoSize.w) {\n setVideoSize({ h: videoHeight, w: videoWidth });\n onSizeChange({ h: videoHeight, w: videoWidth });\n }\n\n if (videoHeight / clientHeight !== unit) {\n setUnit(videoHeight / clientHeight);\n }\n }, [videoSize.h, videoSize.w, unit, onSizeChange, videoRef]);\n\n const handlePositionTipShow = (e: React.PointerEvent<SVGSVGElement>) => {\n if (e.target === frame.current) {\n setHandleFinder(!handleFinder === false && true);\n }\n };\n\n const handlePositionTipHide = () => {\n setHandleFinder(showHandleFinder || false);\n };\n\n const calculateCTM = useCallback(() => {\n if (!frame.current) {\n return null;\n }\n return frame.current.getScreenCTM();\n }, []);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: videoSize is a trigger dep — flows into <Frame> viewBox attr, so the effect must re-run after React applies the new viewBox. Same pattern as LineUI's imgSize. See #645.\n useEffect(() => {\n if (!frame.current || !loaded) {\n return;\n }\n const { viewBox } = frame.current;\n const bounds = {\n x: {\n min: viewBox.baseVal.x + boundaryOffset,\n max: viewBox.baseVal.x + viewBox.baseVal.width - boundaryOffset,\n },\n y: {\n min: viewBox.baseVal.y + boundaryOffset,\n max: viewBox.baseVal.y + viewBox.baseVal.height - boundaryOffset,\n },\n };\n setBoundaries(bounds);\n }, [videoSize, loaded, boundaryOffset]);\n\n const onLoadedMetadata = useCallback(\n ({ target }: React.SyntheticEvent<HTMLVideoElement>) => {\n if (target) {\n setLoaded(true);\n initScaleAndBounds();\n const { videoHeight = 1, videoWidth = 1 } = target as HTMLVideoElement;\n onLoaded({ height: videoHeight, width: videoWidth });\n }\n },\n [initScaleAndBounds, onLoaded]\n );\n\n useEffect(() => {\n window.addEventListener('resize', initScaleAndBounds);\n return () => {\n window.removeEventListener('resize', initScaleAndBounds);\n };\n }, [initScaleAndBounds]);\n\n const options = {\n handleFinderActive: handleFinder,\n revealSetIndex: showSetIndex !== false && (showSetIndex || state.length > 1),\n showPointLabel,\n showLabelShadow,\n showPointHandle: showPointHandle || (showPointHandle !== false && showGrabHandle !== false),\n showMoveHandle: showMoveHandle || (showMoveHandle !== false && showGrabHandle !== false),\n setIndexOffset,\n pointIndexOffset,\n showPoint,\n showDirectionMark,\n };\n\n return (\n <Container>\n <Video\n ref={videoRef}\n controls={controls}\n muted={muted}\n autoPlay={autoPlay}\n loop={loop}\n {...videoOptions}\n onLoadedMetadata={onLoadedMetadata}\n id='1'\n >\n {' '}\n </Video>\n {!loaded && (\n <LoadingOverlay>\n <Spinner size='large' styling='primary' />\n </LoadingOverlay>\n )}\n {loaded && (\n <Frame\n ref={frame}\n viewBox={`0 0 ${videoSize.w} ${videoSize.h} `}\n version='1.1'\n xmlns='http://www.w3.org/2000/svg'\n onPointerDown={handlePositionTipShow}\n onPointerUp={handlePositionTipHide}\n onPointerLeave={handlePositionTipHide}\n $transcalent={handleFinder}\n >\n {state.map((lineSet, index) => (\n <LineSet\n // biome-ignore lint/suspicious/noArrayIndexKey: index IS the lineSetId, also passed to LineSet as the prop of the same name. #646.\n key={index}\n hasClickSensingBorder={hasClickSensingBorder}\n lineClickSensingBorder={lineClickSensingBorder}\n onLineMoveEnd={onLineMoveEnd}\n onLineClick={onLineClick}\n lineSetId={index}\n lineData={lineSet}\n getCTM={calculateCTM}\n boundaries={boundaries}\n unit={unit}\n size={30}\n options={options}\n />\n ))}\n </Frame>\n )}\n </Container>\n );\n};\n\nexport default LineUIVideoBase;\n"],"mappings":";;;;;;AAAA,IAAa,aAAa;CACxB,IAAI;CACJ,MAAM;AACR;AAEA,IAAa,aAAa;CACxB,OAAO,EACL,SAAS;EACP,OAAO;EACP,SAAS;EACT,OAAO;EACP,QAAQ;CACV,EACF;CACA,MAAM;EACJ,QAAQ;GACN,QAAQ;IACN,QAAQ;IACR,SAAS;IACT,UAAU;GACZ;GACA,OAAO;IACL,QAAQ;IACR,SAAS;IACT,UAAU;GACZ;GACA,QAAQ;IACN,QAAQ;IACR,SAAS;IACT,UAAU;GACZ;GACA,OAAO;IACL,QAAQ;IACR,SAAS;IACT,UAAU;GACZ;EACF;EACA,OAAO,EACL,QAAQ,OACV;EACA,QAAQ;GACN,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc;GAChB;GACA,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc;GAChB;GACA,WAAW;IACT,KAAK;IACL,KAAK;IACL,SAAS;IACT,QAAQ;IACR,IAAI;GACN;EACF;CACF;CACA,QAAQ,EACN,UAAU,EACR,OAAO;EACL,MAAM;EACN,QAAQ;CACV,EACF,EACF;AACF;AAEA,IAAa,cAAY;CACvB,QAAQ,EACN,SAAS;EACP,OAAO;EACP,KAAK;EACL,IAAI;CACN,EACF;CACA,OAAO;EACL,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,SAAS;CACX;AACF;AAEA,IAAa,aAAa;CACxB,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AAEA,IAAa,mBAAmB;CAC9B,OAAO,eAAe,WAAW,MAAM;CACvC,QAAQ,eAAe,WAAW,OAAO;CACzC,OA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AW,CAAA,EAC3B,CAAA;EAEjB,UACC,oBAAC,OAAD;GACE,KAAK;GACL,SAAS,OAAO,UAAU,EAAE,GAAG,UAAU,EAAE;GAC3C,SAAQ;GACR,OAAM;GACN,eAAe;GACf,aAAa;GACb,gBAAgB;GAChB,cAAc;aAEb,MAAM,KAAK,SAAS,UACnB,oBAAC,SAAD;IAGyB;IACC;IACT;IACF;IACb,WAAW;IACX,UAAU;IACV,QAAQ;IACI;IACN;IACN,MAAM;IACG;GACV,GAZM,KAYN,CACF;EACI,CAAA;CAEA,EAAA,CAAA;AAEf"}
1
+ {"version":3,"file":"LineUIVideoBase-Bo0pvCP-.mjs","names":[],"sources":["../src/theme/common.tsx","../src/Icons/Icon.tsx","../src/Indicators/Spinner.tsx","../src/LineUI/Contexts.tsx","../src/LineUI/HandleUnit.tsx","../src/LineUI/LineUnit.tsx","../src/LineUI/LineSet.tsx","../src/LineUI/LineUIVideoBase.tsx"],"sourcesContent":["export const fontFamily = {\n ui: 'Monorale, Hiragino Sans, \"ヒラギノ角ゴシック\", Hiragino Kaku Gothic ProN, \"ヒラギノ角ゴ ProN W3\", Roboto, YuGothic, \"游ゴシック\", Meiryo, \"メイリオ\", sans-serif;',\n data: 'Lato, Hiragino Sans, \"ヒラギノ角ゴシック\", Hiragino Kaku Gothic ProN, \"ヒラギノ角ゴ ProN W3\", Roboto, YuGothic, \"游ゴシック\", Meiryo, \"メイリオ\", sans-serif;',\n};\n\nexport const dimensions = {\n icons: {\n weights: {\n light: 1,\n regular: 1.5,\n heavy: 3,\n strong: 5,\n },\n },\n form: {\n button: {\n xsmall: {\n height: '20px',\n padding: '0 10px',\n iconSize: 12,\n },\n small: {\n height: '30px',\n padding: '0 20px',\n iconSize: 14,\n },\n normal: {\n height: '40px',\n padding: '0 20px',\n iconSize: 16,\n },\n large: {\n height: '60px',\n padding: '0 20px',\n iconSize: 20,\n },\n },\n input: {\n height: '40px',\n },\n switch: {\n outer: {\n width: '38px',\n height: '22px',\n borderRadius: '11px',\n },\n inner: {\n width: '16px',\n height: '16px',\n borderRadius: '8px',\n },\n positions: {\n top: '2px',\n off: '2px',\n neutral: '10px',\n locked: '2px',\n on: '18px',\n },\n },\n },\n global: {\n mainMenu: {\n width: {\n open: '280px',\n closed: '80px',\n },\n },\n },\n};\n\nexport const animation = {\n easing: {\n primary: {\n inOut: 'cubic-bezier(0.87, 0, 0.13, 1)',\n out: 'cubic-bezier(0.16, 1, 0.3, 1)',\n in: 'cubic-bezier(0.7, 0, 0.84, 0)',\n },\n },\n speed: {\n faster: '0.085s',\n fast: '0.175s',\n normal: '0.35s',\n slow: '0.7s',\n slower: '1.4s',\n slowest: '2.8s',\n },\n};\n\nexport const deviceSize = {\n small: 0,\n medium: 768,\n large: 1024,\n xlarge: 1280,\n xxlarge: 1536,\n};\n\nexport const deviceMediaQuery = {\n small: `(min-width: ${deviceSize.small}px)`,\n medium: `(min-width: ${deviceSize.medium}px)`,\n large: `(min-width: ${deviceSize.large}px)`,\n xlarge: `(min-width: ${deviceSize.xlarge}px)`,\n xxlarge: `(min-width: ${deviceSize.xxlarge}px)`,\n};\n","import { IconSVGs } from '@future-standard/icons';\nimport type React from 'react';\nimport styled, { css } from 'styled-components';\nimport type { IWeight } from '..';\nimport { dimensions } from '../theme/common';\n\nconst wrapperCss = css`\n\n line-height: 0;\n\n svg {\n overflow: visible;\n vector-effect: non-scaling-stroke;\n\n line, path, circle, ellipse, foreignObject, polygon, polyline, rect, text, textPath, tspan {\n vector-effect: non-scaling-stroke;\n transition: stroke var(--speed-normal) var(--easing-primary-out);\n }\n }\n`;\n\nconst IconWrapper = styled.div`\n ${wrapperCss};\n`;\n\nconst IconWrapperForSVG = styled.g`\n ${wrapperCss};\n`;\n\nexport { IconSVGs, IconWrapper, IconWrapperForSVG };\n\nexport interface IconProps {\n icon: string;\n size?: number;\n weight?: IWeight;\n color?: ISvgIcons['color'];\n forSvgUsage?: boolean;\n}\n\nconst Icon: React.FC<IconProps> = ({\n icon,\n size = 24,\n weight = 'regular',\n color = 'grey-12',\n forSvgUsage = false,\n}) => {\n // For later use in deprecation of aliases.\n // const legacyColors = ['mono', 'dimmed', 'subtle', 'inverse', 'primary', 'danger'];\n // if(legacyColors.indexOf(color) >= 0){\n // console.warn(\"Deprecation warning: The use of \" + color + \" is deprecated. Please replace it with theme color variable.\");\n // }\n\n const iconWeight: number = dimensions.icons.weights[weight];\n //@ts-expect-error\n const IconSVG = IconSVGs[icon];\n\n return IconSVG != null ? (\n forSvgUsage ? (\n <IconWrapperForSVG>\n {IconSVG({ size: size, weight: iconWeight, color: `var(--${color}, var(--grey-12))` })}\n </IconWrapperForSVG>\n ) : (\n <IconWrapper>\n {IconSVG({ size: size, weight: iconWeight, color: `var(--${color}, var(--grey-12))` })}\n </IconWrapper>\n )\n ) : null;\n};\n\nexport default Icon;\n","import type React from 'react';\nimport styled, { keyframes } from 'styled-components';\n\nconst circumference = (radius: number) => {\n return 2 * Math.PI * radius;\n};\n\nconst animation = (radius: number) => {\n const c = circumference(radius);\n\n return keyframes`\n 0% {\n stroke-dashoffset: -${c * 0.85};\n }\n 50% {\n stroke-dashoffset: -${c * 0.5};\n }\n 100% {\n stroke-dashoffset: -${c * 0.85};\n }\n `;\n};\n\nconst rotate = keyframes`\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n`;\n\nconst BaseCircle = styled.circle<{ $styling: string; $customColor?: string }>`\n stroke: ${({ $styling, $customColor }) => ($customColor ? $customColor : `var(--spinner-${$styling}-base, var(--grey-a8))`)};\n fill: none;\n`;\n\nconst RotatingCircle = styled.circle<{ r: number; $styling: string; $customColor?: string }>`\n stroke: ${({ $styling, $customColor }) => ($customColor ? $customColor : `var(--spinner-${$styling}-top, var(--white-1))`)};\n fill: none;\n stroke-dasharray: ${({ r }) => circumference(r)};\n stroke-dashoffset: ${({ r }) => (2 * Math.PI * r) / 2};\n animation:\n ${({ r }) => animation(r)} 4s linear infinite,\n ${rotate} 1s linear infinite;\n stroke-linecap: round;\n`;\n\nexport type SpinnerSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';\n\nexport const getButtonDesign = (value: string) => {\n if (value === 'primary' || value === 'secondary' || value === 'warning') {\n return value;\n } else if (value === 'danger') {\n console.warn(\n 'Button.tsx - Warning, the design prop value `danger` is being deprecated. Use `warning` instead.'\n );\n return 'danger';\n }\n\n return 'simple';\n};\n\nconst sizeGuide = {\n xsmall: 12,\n small: 16,\n medium: 24,\n large: 36,\n xlarge: 48,\n};\n\ninterface ICustomSpinner {\n size?: number;\n baseColor?: string;\n topColor?: string;\n}\n\ninterface IProps {\n size?: SpinnerSize;\n styling: string;\n custom?: ICustomSpinner;\n}\n\nconst Spinner: React.FC<IProps> = ({ size = 'medium', styling = 'primary', custom = {} }) => {\n const { baseColor, topColor } = custom;\n const sizeVal = custom?.size ? custom.size : sizeGuide[size];\n const strokeWidth = sizeVal / 5.333;\n const circleRadius = sizeVal / 2 - strokeWidth / 2;\n\n return (\n <svg\n viewBox={`-${sizeVal / 2} -${sizeVal / 2} ${sizeVal} ${sizeVal}`}\n width={sizeVal}\n height={sizeVal}\n xmlns='http://www.w3.org/2000/svg'\n role='img'\n aria-label='Loading'\n >\n <BaseCircle\n cx='0'\n cy='0'\n r={circleRadius}\n strokeWidth={strokeWidth}\n $styling={getButtonDesign(styling)}\n $customColor={baseColor}\n />\n <RotatingCircle\n cx='0'\n cy='0'\n r={circleRadius}\n strokeWidth={strokeWidth}\n $styling={getButtonDesign(styling)}\n $customColor={topColor}\n />\n </svg>\n );\n};\n\nexport default Spinner;\n","import { createContext, type Dispatch } from 'react';\nimport type { IPointSet } from '.';\nimport type { IReducerActions } from './LineReducer';\n\ninterface IContextProps {\n state: IPointSet[];\n dispatch: Dispatch<IReducerActions>;\n}\n\nexport const LineSetContext = createContext({} as IContextProps);\n","import type React from 'react';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { IDragLineUISharedOptions, IVector2 } from '.';\n\nconst HandleTouchReactionKeyframes = keyframes`\n 0% {\n transform: scale(1);\n }\n\n 75% {\n transform: scale(3);\n }\n\n 100% {\n transform: scale(1.75);\n }\n`;\n\nconst HandleMouseReactionKeyframes = keyframes`\n 0% {\n transform: scale(1);\n }\n\n 75% {\n transform: scale(0);\n }\n\n 100% {\n transform: scale(0.5);\n }\n`;\n\nconst HandleBase = styled.svg<{ $mouseDragging: boolean; $styling: string }>`\n touch-action: none;\n user-select: none;\n overflow: visible;\n cursor: pointer;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].handleBase.fill};\n appearance: none;\n`;\n\nconst HandleRingLayer = styled.circle<{ $maskID: string; $styling: string }>`\n fill: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].handleRingLayer.stroke};\n mask: url(#${(props) => props.$maskID});\n`;\nconst HandleReactiveGroup = styled.g<{ $touchDragging: boolean; $mouseDragging: boolean }>`\n opacity: 0.65;\n cursor: pointer;\n transform: scale(1);\n\n ${(props) =>\n props.$touchDragging &&\n css`\n animation: ${HandleTouchReactionKeyframes} 0.5s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275) 1;\n `}\n\n ${(props) =>\n props.$mouseDragging &&\n css`\n animation: ${HandleMouseReactionKeyframes} 0.25s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275) 1;\n `}\n\n`;\nconst HandleReactiveFill = styled.circle<{ $styling: string }>`\n mix-blend-mode: multiply;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].handleReactiveFill.fill};\n stroke: none;\n`;\nconst HandleReactiveRing = styled.circle<{ $styling: string }>`\n fill: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].handleReactiveRing.stroke};\n`;\n\nconst HandleContrastLayer = styled.circle<{ $styling: string }>`\n overflow: visible;\n mix-blend-mode: multiply;\n fill: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].handleContrastLayer.stroke};\n`;\nconst HandleShadowLayer = styled.circle<{ $fillID: string }>`\n mix-blend-mode: multiply;\n fill: url(#${(props) => props.$fillID});\n`;\n\nconst GrabHandleIndexGroup = styled.g<{ $showIndex: boolean }>`\n opacity: 0;\n pointer-events: none;\n ${(props) =>\n props.$showIndex &&\n css`\n opacity: 1;\n `};\n\n`;\n\nconst StopStart = styled.stop<{ $styling: string }>`\n stop-color: ${({ theme, $styling }) => theme.custom.lines[$styling].stopStart.stopColor};\n`;\nconst StopEnd = styled.stop<{ $styling: string }>`\n stop-color: ${({ theme, $styling }) => theme.custom.lines[$styling].stopEnd.stopColor};\n`;\n\nconst GrabHandleIndexText = styled.text<{ $showIndex: boolean; $styling: string }>`\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandleText.stroke};\n text-align: center;\n\n font-weight: bold;\n transition: opacity 250ms ease;\n pointer-events: none;\n\n\n`;\n\nconst IconGroup = styled.g`\n\n`;\n\ninterface IHandleUnitProps {\n lineSetId: number;\n index: number;\n angle: number | null;\n useAngles: boolean;\n unit: number;\n size: number;\n x: number;\n y: number;\n Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>> & { rotate?: number };\n rotate?: number;\n moveCallback: (pointerPosition: IVector2, index: number) => void;\n moveEndCB?: () => void;\n options: IDragLineUISharedOptions;\n readOnlyHandle?: boolean;\n styling?: string;\n}\n\nconst HandleUnit: React.FC<IHandleUnitProps> = (props) => {\n // console.log(props.lineSetId, typeof props.lineSetId)\n const {\n index,\n useAngles,\n angle,\n unit,\n size,\n lineSetId,\n x,\n y,\n moveCallback,\n moveEndCB = () => {},\n Icon,\n rotate = 0,\n options,\n readOnlyHandle = false,\n styling = 'primary',\n } = props;\n // console.log(\"Handle \"+ index +\" from set \"+ lineSetId + \" :: \" + x, \", \" + y)\n const handleInstance = useRef<SVGSVGElement>(null);\n\n const [touchDragging, setTouchDragging] = useState(false);\n const [mouseDragging, setMouseDragging] = useState(false);\n const [touchIndex, setTouchIndex] = useState<number | null>(null);\n\n /** --- Toucher Events Section --- */\n const handleTouchStart = useCallback(\n (e: React.TouchEvent<SVGSVGElement>) => {\n e.preventDefault();\n if (readOnlyHandle) {\n return;\n }\n // Remember what touch event index is for this handle.\n for (let i = 0; i < e.touches.length; i++) {\n const touchTarget = e.touches[i].target as Element;\n if (\n touchTarget.parentNode?.parentElement === handleInstance.current ||\n touchTarget.parentNode?.parentElement?.parentElement\n ) {\n setTouchDragging(true);\n setTouchIndex(i);\n }\n }\n },\n [readOnlyHandle]\n );\n\n const handleTouchEnd = useCallback(() => {\n if (readOnlyHandle) {\n return;\n }\n setTouchDragging(false);\n setTouchIndex(null);\n moveEndCB();\n }, [moveEndCB, readOnlyHandle]);\n\n const handleTouchMove = useCallback(\n (e: React.TouchEvent<SVGSVGElement>) => {\n if (readOnlyHandle) {\n return;\n }\n for (let i = 0; i < e.touches.length; i++) {\n if (i === touchIndex) {\n moveCallback({ x: e.touches[i].pageX, y: e.touches[i].pageY }, index);\n }\n }\n },\n [index, moveCallback, readOnlyHandle, touchIndex]\n );\n\n /** --- Mouse Events Section --- */\n\n const handleMouseMoveRef = useRef<((e: MouseEvent) => void) | null>(null);\n const handleMouseUpRef = useRef<((e: MouseEvent) => void) | null>(null);\n\n const cleanupMouseListeners = useCallback(() => {\n if (handleMouseMoveRef.current) {\n window.removeEventListener('mousemove', handleMouseMoveRef.current);\n handleMouseMoveRef.current = null;\n }\n if (handleMouseUpRef.current) {\n window.removeEventListener('mouseup', handleMouseUpRef.current);\n handleMouseUpRef.current = null;\n }\n }, []);\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n e.preventDefault();\n if (readOnlyHandle) {\n return;\n }\n moveCallback({ x: e.pageX, y: e.pageY }, index);\n },\n [index, moveCallback, readOnlyHandle]\n );\n\n const handleMouseUp = useCallback(\n (e: MouseEvent) => {\n e.preventDefault();\n if (readOnlyHandle) {\n return;\n }\n setMouseDragging(false);\n cleanupMouseListeners();\n moveCallback({ x: e.pageX, y: e.pageY }, index);\n setTimeout(moveEndCB);\n },\n [cleanupMouseListeners, index, moveCallback, moveEndCB, readOnlyHandle]\n );\n\n const handleMouseDown = useCallback(\n (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n e.preventDefault();\n if (readOnlyHandle) {\n return;\n }\n cleanupMouseListeners();\n setMouseDragging(true);\n handleMouseMoveRef.current = handleMouseMove;\n handleMouseUpRef.current = handleMouseUp;\n window.addEventListener('mousemove', handleMouseMove);\n window.addEventListener('mouseup', handleMouseUp);\n },\n [cleanupMouseListeners, handleMouseMove, handleMouseUp, readOnlyHandle]\n );\n\n useEffect(() => {\n return cleanupMouseListeners;\n }, [cleanupMouseListeners]);\n\n const maskID = useAngles ? `mask-${lineSetId}-${index}` : '';\n const shadowGradientID = `shadowGradient-${lineSetId}-${index}`;\n const {\n showPointHandle = true,\n showPointLabel = false,\n pointIndexOffset,\n } = options as IDragLineUISharedOptions;\n\n return (\n <HandleBase\n ref={handleInstance}\n $styling={styling}\n x={x}\n y={y}\n $mouseDragging={mouseDragging}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n onTouchMove={handleTouchMove}\n onMouseDown={handleMouseDown}\n >\n <defs>\n <mask id={maskID}>\n <rect width='100%' height='100%' x='-50%' y='-50%' fill='white' />\n <rect\n width={size / 3}\n height={size / 0.9}\n x={-(size / 3 / 2)}\n y={-(size / 0.9 + 5)}\n fill='black'\n transform={`rotate(${angle || 0} 0 0)`}\n />\n </mask>\n <radialGradient id={shadowGradientID}>\n <StopStart $styling={styling} offset='0%' />\n <StopEnd $styling={styling} offset='80%' />\n </radialGradient>\n </defs>\n\n {Icon ? (\n <IconGroup transform={`scale(${unit * 1.5}) translate(-21 -21) rotate(${rotate}, 21, 21 )`}>\n <Icon height='42' width='42' />\n </IconGroup>\n ) : (\n showPointHandle && (\n <g transform={`scale(${unit})`}>\n <HandleShadowLayer r={size * 1} $fillID={shadowGradientID} />\n <HandleContrastLayer $styling={styling} r={size / 2.4} strokeWidth={size / 3} />\n\n <HandleReactiveGroup $touchDragging={touchDragging} $mouseDragging={mouseDragging}>\n <HandleReactiveFill $styling={styling} r={size / 1.8} />\n <HandleReactiveRing $styling={styling} r={size / 2.25} strokeWidth={size / 3} />\n </HandleReactiveGroup>\n\n <HandleRingLayer\n $styling={styling}\n r={size / 2}\n strokeWidth={size / 6}\n $maskID={maskID}\n />\n\n {showPointLabel && (\n <GrabHandleIndexGroup $showIndex>\n <GrabHandleIndexText\n $styling={styling}\n transform='translate(-5,6)'\n fontSize='20px'\n $showIndex\n >\n {index + pointIndexOffset}\n </GrabHandleIndexText>\n </GrabHandleIndexGroup>\n )}\n </g>\n )\n )}\n </HandleBase>\n );\n};\n\nexport default HandleUnit;\n","import type React from 'react';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\nimport Icon from '../Icons/Icon';\nimport type { IDragLineUISharedOptions, IVector2 } from '.';\n\nconst ContrastLine = styled.line<{\n $styling: string;\n $lineClickSensing?: number;\n $showLineBorder?: boolean;\n}>`\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].contrastLine.stroke};\n mix-blend-mode: multiply;\n stroke-width: ${({ $lineClickSensing }) => $lineClickSensing}px;\n stroke-opacity: ${({ $showLineBorder }) => ($showLineBorder ? '0.35' : '0')};\n cursor: pointer;\n`;\n\nconst HighlightLine = styled.line<{ $styling: string }>`\n pointer-events: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].highlightLineBorder.stroke};\n`;\n\nconst GrabHandle = styled.circle<{ $hide: boolean; $styling: string }>`\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandle.fill};\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandle.stroke};\n opacity: 1;\n transition: opacity 250ms ease;\n cursor: grab;\n\n ${(props) =>\n props.$hide &&\n css`\n pointer-events: none;\n opacity: 0;\n `};\n`;\n\nconst GrabHandleIndexGroup = styled.g<{ $showIndex: boolean }>`\n opacity: 0;\n pointer-events: none;\n ${(props) =>\n props.$showIndex &&\n css`\n opacity: 1;\n `};\n\n`;\n\nconst GrabHandleIndexText = styled.text<{ $showIndex: boolean; $styling: string }>`\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n text-align: center;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandleText.stroke};\n font-weight: bold;\n transition: opacity 250ms ease;\n pointer-events: none;\n`;\n\nconst LabelText = styled.text<{ $showIndex: boolean; $styling: string; $showLabelShadow: boolean }>`\n text-align: center;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].label.fill};\n font-weight: bold;\n transition: opacity 250ms ease;\n cursor: pointer;\n ${({ $showLabelShadow }) =>\n $showLabelShadow &&\n css`\n text-shadow:\n -1px -1px 0 #000,\n 1px -1px 0 #000,\n -1px 1px 0 #000,\n 1px 1px 0 #000;\n `}\n`;\n\nconst GrabHandleContrast = styled(GrabHandle)`\n fill: none;\n stroke: ${({ theme, $styling }) => theme.custom.lines[$styling].grabHandleContrast.stroke};\n`;\n\nconst GrabHandleGroup = styled.g<{\n $showIndex: boolean;\n $originalRadius: number;\n $styling: string;\n}>`\n\n ${GrabHandle}, ${GrabHandleContrast} {\n transition: r 250ms ease;\n }\n\n ${(props) =>\n props.$showIndex &&\n css`\n ${GrabHandle}, ${GrabHandleContrast} {\n pointer-events: none;\n r: ${props.$originalRadius * 1.75};\n }\n `};\n`;\n\nconst DMCircle = styled.circle`\n fill: hsla(203, 100%, 35%, 0.49);\n cursor: pointer;\n`;\n\nconst IconFormat = styled(Icon)`\n cursor: pointer;\n`;\n\ninterface ILineUnitProps {\n lineSetId: number;\n options: IDragLineUISharedOptions;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n unit: number;\n lineClickCallback?: (lineSetId: number) => void;\n lineMoveCallback: (position: IVector2) => void;\n lineMoveStartCallback: (position: IVector2) => void;\n moveEndCB?: () => void;\n label?: string;\n styling?: string;\n showSmallDirectionMark?: boolean;\n overrideShowMoveHandle?: boolean;\n lineClickSensingBorder?: string;\n hasClickSensingBorder?: boolean;\n}\n\nconst LineUnit: React.FC<ILineUnitProps> = (props) => {\n const {\n x1,\n y1,\n x2,\n y2,\n unit,\n lineMoveCallback,\n lineMoveStartCallback,\n options,\n lineSetId,\n label,\n styling = 'primary',\n moveEndCB = () => {},\n lineClickCallback = () => {},\n showSmallDirectionMark = false,\n overrideShowMoveHandle = true,\n } = props;\n const {\n handleFinderActive,\n revealSetIndex,\n showMoveHandle,\n setIndexOffset,\n showDirectionMark,\n showLabelShadow = false,\n } = options;\n const [showLineBorder, setShowLineBorder] = useState<boolean>();\n\n // const a = x1 - x2;\n // const b = y1 - y2;\n // const distance = Math.sqrt( a*a + b*b );\n //this distance 60 doesn't work now...\n // const hideGrabHandle = showMoveHandle === false || (showMoveHandle !== true && distance < 60);\n\n const hideGrabHandle = !showMoveHandle || !overrideShowMoveHandle;\n const lineClickSensing = parseInt(props.lineClickSensingBorder as string, 10);\n\n /** --- Toucher Events Section --- */\n const grabTouchMove = (e: React.TouchEvent<SVGCircleElement>) => {\n for (let i = 0; i < e.touches.length; i++) {\n // if(i === touchIndex){\n lineMoveCallback({ x: e.touches[i].pageX, y: e.touches[i].pageY });\n // }\n }\n moveEndCB();\n };\n\n const grabTouchStart = (e: React.TouchEvent<SVGCircleElement>) => {\n for (let i = 0; i < e.touches.length; i++) {\n // if(i === touchIndex){\n lineMoveStartCallback({ x: e.touches[i].pageX, y: e.touches[i].pageY });\n // }\n }\n };\n\n /** --- Mouse Events Section --- */\n const mouseMoveRef = useRef<((e: MouseEvent) => void) | null>(null);\n const mouseUpRef = useRef<((e: MouseEvent) => void) | null>(null);\n\n const cleanupMouseListeners = useCallback(() => {\n if (mouseMoveRef.current) {\n window.removeEventListener('mousemove', mouseMoveRef.current);\n mouseMoveRef.current = null;\n }\n if (mouseUpRef.current) {\n window.removeEventListener('mouseup', mouseUpRef.current);\n mouseUpRef.current = null;\n }\n }, []);\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n lineMoveCallback({ x: e.pageX, y: e.pageY });\n e.preventDefault();\n },\n [lineMoveCallback]\n );\n\n const handleMouseUp = useCallback(\n (e: MouseEvent) => {\n cleanupMouseListeners();\n lineMoveCallback({ x: e.pageX, y: e.pageY });\n moveEndCB();\n e.preventDefault();\n },\n [cleanupMouseListeners, lineMoveCallback, moveEndCB]\n );\n\n const handleMouseDown = useCallback(\n (e: React.MouseEvent<SVGCircleElement, MouseEvent>) => {\n cleanupMouseListeners();\n lineMoveStartCallback({ x: e.pageX, y: e.pageY });\n mouseMoveRef.current = handleMouseMove;\n mouseUpRef.current = handleMouseUp;\n window.addEventListener('mousemove', handleMouseMove);\n window.addEventListener('mouseup', handleMouseUp);\n e.preventDefault();\n },\n [cleanupMouseListeners, lineMoveStartCallback, handleMouseMove, handleMouseUp]\n );\n\n useEffect(() => {\n return cleanupMouseListeners;\n }, [cleanupMouseListeners]);\n const midpoint = {\n x: (x2 + x1) / 2,\n y: (y2 + y1) / 2,\n };\n\n const directionMarkCoordinate = () => {\n const angle = Math.atan2(y2 - y1, x2 - x1);\n const angleMode = Math.PI / 2 - angle;\n const x = midpoint.x + Math.sin(angleMode) - 5;\n const y = midpoint.y + Math.cos(angleMode);\n const rotate = (180 / Math.PI) * Math.atan2(y2 - y1, x2 - x1);\n const labelRotate = -rotate;\n return { x, y, rotate, labelRotate };\n };\n\n const getDirectionMarkLine = () => {\n const dmCoordinate = directionMarkCoordinate();\n return (\n <g\n transform={`translate(${dmCoordinate.x},${dmCoordinate.y}) rotate(${dmCoordinate.rotate}) scale(${unit * 1})`}\n style={{ cursor: 'pointer' }}\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions: SVG group element in canvas drawing context */}\n <g onClick={() => lineClickCallback(lineSetId)} transform='translate(-3,-30) scale(0.8)'>\n <DMCircle r={12} cx={6} cy={7} />\n <IconFormat color='inverse' icon='Up' size={12} weight='heavy' forSvgUsage />\n </g>\n {showSmallDirectionMark && (\n // biome-ignore lint/a11y/noStaticElementInteractions: SVG group element in canvas drawing context\n <g\n onClick={() => lineClickCallback(lineSetId)}\n transform='translate(5,25) rotate(-180) scale(0.8)'\n >\n <DMCircle r={8} cx={3.5} cy={4.5} />\n <IconFormat color='inverse' icon='Up' size={7} weight='heavy' forSvgUsage />\n </g>\n )}\n {label && (\n <g\n transform={`translate(0,${showSmallDirectionMark ? 45 : 30}) rotate(${dmCoordinate.labelRotate})`}\n >\n <LabelText\n onClick={() => lineClickCallback(lineSetId)}\n textAnchor={\n showSmallDirectionMark ? (dmCoordinate.labelRotate < 0 ? 'end' : 'start') : 'middle'\n }\n dominantBaseline='middle'\n $styling={styling}\n fontSize={`${14}px`}\n x={0}\n y={0}\n $showIndex={revealSetIndex || handleFinderActive}\n $showLabelShadow={showLabelShadow}\n >\n {label}\n </LabelText>\n </g>\n )}\n </g>\n );\n };\n\n //hover on line show border\n const getMouseOver = useCallback(() => {\n if (props.hasClickSensingBorder) {\n setShowLineBorder(true);\n }\n }, [props.hasClickSensingBorder]);\n\n const getMouseOut = useCallback(() => {\n if (props.hasClickSensingBorder) {\n setShowLineBorder(false);\n }\n }, [props.hasClickSensingBorder]);\n\n return (\n <g>\n <ContrastLine\n onMouseOver={getMouseOver}\n onMouseOut={getMouseOut}\n $lineClickSensing={lineClickSensing}\n $showLineBorder={showLineBorder}\n onClick={() => lineClickCallback(lineSetId)}\n $styling={styling}\n strokeLinecap='round'\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n strokeWidth={4 * unit}\n />\n <HighlightLine $styling={styling} x1={x1} y1={y1} x2={x2} y2={y2} strokeWidth={2 * unit} />\n\n <GrabHandleGroup\n $styling={styling}\n $showIndex={handleFinderActive && revealSetIndex}\n $originalRadius={8 * unit}\n >\n <GrabHandleContrast\n $styling={styling}\n r={8 * unit}\n strokeWidth={4 * unit}\n cx={midpoint.x}\n cy={midpoint.y}\n $hide={hideGrabHandle}\n />\n <GrabHandle\n $styling={styling}\n textAnchor='middle'\n r={8 * unit}\n strokeWidth={1 * unit}\n cx={midpoint.x}\n cy={midpoint.y}\n $hide={hideGrabHandle}\n onTouchMove={grabTouchMove}\n onTouchStart={grabTouchStart}\n onMouseDown={handleMouseDown}\n />\n </GrabHandleGroup>\n\n <GrabHandleIndexGroup $showIndex={!hideGrabHandle && (handleFinderActive || revealSetIndex)}>\n <GrabHandleIndexText\n $styling={styling}\n fontSize={`${unit * 10}px`}\n x={midpoint.x - 3 * unit}\n y={midpoint.y + 4 * unit}\n $showIndex={revealSetIndex || handleFinderActive}\n >\n {lineSetId + setIndexOffset}\n </GrabHandleIndexText>\n </GrabHandleIndexGroup>\n\n {/* <circle r={1* unit} cx={x1} cy={y1} fill='white' /> */}\n {/* <circle r={1* unit} cx={x2} cy={y2} fill='white' /> */}\n\n {showDirectionMark\n ? getDirectionMarkLine()\n : label && (\n <LabelText\n $styling={styling}\n fontSize={`${unit * 14}px`}\n x={midpoint.x - 16 * unit}\n y={midpoint.y - 15 * unit}\n $showIndex={revealSetIndex || handleFinderActive}\n $showLabelShadow={showLabelShadow}\n >\n {label}\n </LabelText>\n )}\n </g>\n );\n};\n\nexport default LineUnit;\n","import update from 'immutability-helper';\nimport type React from 'react';\nimport { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { IBoundary, IDragLineUISharedOptions, IPointSet, IVector2 } from '.';\nimport { LineSetContext } from './Contexts';\nimport HandleUnit from './HandleUnit';\nimport LineUnit from './LineUnit';\n\nconst FilledPolygon = styled.polygon<{ $color: string; $opacity: number }>`\n fill: ${({ $color }) => $color};\n opacity: ${({ $opacity }) => $opacity};\n`;\n\nconst Point = styled.circle<{ $styling: string }>`\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].point.fill};\n`;\n\nconst AreaLabelText = styled.text<{ $styling: string; $showAreaLabelShadow: boolean }>`\n text-align: center;\n fill: ${({ theme, $styling }) => theme.custom.lines[$styling].label.fill};\n font-weight: bold;\n transition: opacity 250ms ease;\n pointer-events: none;\n ${({ $showAreaLabelShadow }) =>\n $showAreaLabelShadow &&\n css`\n text-shadow:\n -1px -1px 0 #000,\n 1px -1px 0 #000,\n -1px 1px 0 #000,\n 1px 1px 0 #000;\n `}\n`;\n\ninterface ILineSetProps {\n lineSetId: number;\n boundaries: IBoundary;\n size: number;\n unit: number;\n lineData: IPointSet;\n options: IDragLineUISharedOptions;\n onLineMoveEnd: () => void;\n onLineClick: (lineSetId: number) => void;\n getCTM: () => DOMMatrix | null;\n lineClickSensingBorder?: string;\n hasClickSensingBorder?: boolean;\n}\n\ninterface AreaLabelProps {\n lineSetData: IPointSet;\n unit: number;\n showAreaLabelShadow: boolean;\n}\n\nconst AreaLabel: React.FC<AreaLabelProps> = ({ lineSetData, unit, showAreaLabelShadow }) => {\n const pointsLength = lineSetData.points.length;\n if (pointsLength < 3) return null;\n let midpoint = { x: 0, y: 0 };\n\n lineSetData.points.map(({ x, y }) => {\n midpoint.x += x;\n midpoint.y += y;\n return null;\n });\n\n midpoint = { x: midpoint.x / pointsLength, y: midpoint.y / pointsLength };\n const Textlen = lineSetData.areaName?.length || 1;\n return (\n <AreaLabelText\n fontSize={`${unit * 14}px`}\n $styling={lineSetData.styling || 'primary'}\n x={midpoint.x - 4 * Textlen * unit}\n y={midpoint.y + 6 * unit}\n $showAreaLabelShadow={showAreaLabelShadow}\n >\n {lineSetData.areaName}\n </AreaLabelText>\n );\n};\n\nconst LineSet: React.FC<ILineSetProps> = ({\n getCTM,\n boundaries,\n unit,\n size,\n lineSetId,\n options,\n onLineMoveEnd,\n onLineClick,\n lineClickSensingBorder,\n hasClickSensingBorder,\n}) => {\n // console.log(\"Unit \" + lineSetId + \", reporting in...\")\n\n const { state, dispatch } = useContext(LineSetContext);\n const lineSetData = state[lineSetId];\n const { showLabelShadow = false } = options;\n\n const [handleAngles, setHandleAngles] = useState<number[]>([]);\n\n const handleRelation = useRef<{ offsetX: number; offsetY: number }[]>([]);\n const handleRadius: number = size / 2;\n const handleUsesAngles: boolean = lineSetData.points.length === 2;\n\n /**\n * Ensure provided position vector is within the boundaries (of the container)\n * @param {IVector2} position Vector to be enforced.\n * @returns {IVector2} The position updated clamped to range.\n */\n const enforceBoundaries = useCallback(\n (position: IVector2) => {\n if (position.x < boundaries.x.min) {\n position.x = boundaries.x.min;\n } else if (position.x > boundaries.x.max) {\n position.x = boundaries.x.max;\n }\n\n if (position.y < boundaries.y.min) {\n position.y = boundaries.y.min;\n } else if (position.y > boundaries.y.max) {\n position.y = boundaries.y.max;\n }\n\n return position;\n },\n [boundaries]\n );\n\n const handleMoveCallback = useCallback(\n (pointerPosition: IVector2, index: number) => {\n const screenCTM = getCTM();\n if (!screenCTM) {\n return;\n }\n\n const pointer = enforceBoundaries({\n x: (pointerPosition.x - window.scrollX - screenCTM.e) / screenCTM.a,\n y: (pointerPosition.y - window.scrollY - screenCTM.f) / screenCTM.d,\n });\n const point = {\n x: Math.round(pointer.x),\n y: Math.round(pointer.y),\n };\n const newLineSetData = update(lineSetData, { points: { [index]: { $merge: point } } });\n\n dispatch({ type: 'UPDATE', index: lineSetId, data: newLineSetData });\n },\n [getCTM, enforceBoundaries, lineSetData, dispatch, lineSetId]\n );\n\n const lineDragStart = useCallback(\n (pointerPosition: IVector2) => {\n const screenCTM = getCTM();\n if (!screenCTM) {\n return;\n }\n\n const pointer = {\n x: (pointerPosition.x - window.scrollX - screenCTM.e) / screenCTM.a - handleRadius,\n y: (pointerPosition.y - window.scrollY - screenCTM.f) / screenCTM.d - handleRadius,\n };\n\n handleRelation.current = lineSetData.points.map((handle) => {\n const xDiff = pointer.x - handle.x;\n const yDiff = pointer.y - handle.y;\n return {\n offsetX: xDiff,\n offsetY: yDiff,\n };\n });\n },\n [handleRadius, lineSetData.points, getCTM]\n );\n\n const lineDragUpdate = useCallback(\n (pointerPosition: IVector2) => {\n const screenCTM = getCTM();\n if (!screenCTM) {\n return;\n }\n\n const { points } = lineSetData;\n\n const pointer = {\n x: (pointerPosition.x - window.scrollX - screenCTM.e) / screenCTM.a - handleRadius,\n y: (pointerPosition.y - window.scrollY - screenCTM.f) / screenCTM.d - handleRadius,\n };\n\n const newPoints = points.map((_handle, index) => {\n const { offsetX = 0, offsetY = 0 } = handleRelation.current[index] || {};\n\n return enforceBoundaries({\n x: Math.round(pointer.x - offsetX),\n y: Math.round(pointer.y - offsetY),\n });\n });\n\n dispatch({\n type: 'UPDATE',\n index: lineSetId,\n data: { ...lineSetData, points: [...newPoints] },\n });\n },\n [getCTM, lineSetData, handleRadius, dispatch, lineSetId, enforceBoundaries]\n );\n\n const calcAngle = useCallback(\n (originX: number, originY: number, towardsX: number, towardsY: number) => {\n const angle = Math.atan2(towardsY - originY, towardsX - originX);\n const degrees = (angle * 180) / Math.PI + 90;\n return degrees;\n },\n []\n );\n\n // useCallback maybe to reduce unchanged deals?\n const updateHandleAngles = useCallback(\n (inputHandleData: IPointSet) => {\n const { points } = inputHandleData;\n const outputData: number[] = [];\n\n // Update all handle angles in data set.\n inputHandleData.points.forEach((handle, index) => {\n const nextIndex = index + 2 > points.length ? 0 : index + 1;\n const nextHandle = points[nextIndex];\n const angle = calcAngle(handle.x, handle.y, nextHandle.x, nextHandle.y);\n outputData.push(angle);\n });\n\n setHandleAngles(outputData);\n },\n [calcAngle]\n );\n\n useEffect(() => {\n // Update angles when the line's data set has changed.\n if (handleUsesAngles) {\n updateHandleAngles(lineSetData);\n }\n }, [lineSetData, updateHandleAngles, handleUsesAngles]);\n\n const initialClampDone = useRef(false);\n useEffect(() => {\n // Clamp existing points to boundaries once when boundaries first become valid (video load)\n if (boundaries.x.max === 0 && boundaries.y.max === 0) {\n return;\n }\n if (initialClampDone.current) {\n return;\n }\n initialClampDone.current = true;\n\n const needsUpdate = lineSetData.points.some(\n ({ x, y }) =>\n x < boundaries.x.min || x > boundaries.x.max || y < boundaries.y.min || y > boundaries.y.max\n );\n\n if (needsUpdate) {\n const clampedPoints = lineSetData.points.map((point) => enforceBoundaries({ ...point }));\n dispatch({\n type: 'UPDATE',\n index: lineSetId,\n data: { ...lineSetData, points: clampedPoints },\n });\n }\n }, [\n boundaries,\n lineSetData.points.some,\n dispatch,\n lineSetData.points.map,\n lineSetId,\n lineSetData,\n enforceBoundaries,\n ]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handles =\n (lineSetData?.showPointHandle === undefined || lineSetData?.showPointHandle) &&\n lineSetData.points.map(({ x, y }, index) => (\n <HandleUnit\n // biome-ignore lint/suspicious/noArrayIndexKey: points have only {x,y} (no id) and index is meaningful — used to look up handleAngles[index] and as the index prop. #646.\n key={index + lineSetId}\n lineSetId={lineSetId}\n rotate={lineSetData.rotate}\n Icon={lineSetData.icon}\n index={index}\n unit={unit}\n size={size}\n useAngles={handleUsesAngles}\n angle={handleAngles[index]}\n x={x}\n y={y}\n moveEndCB={onLineMoveEnd}\n moveCallback={handleMoveCallback}\n options={options}\n styling={lineSetData.styling}\n readOnlyHandle={lineSetData.readOnly}\n />\n ));\n\n const points =\n options.showPoint &&\n lineSetData.points.map(({ x, y }, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: points have only {x,y} — index is the only stable identity. #646.\n <Point $styling={lineSetData.styling || 'primary'} key={index} r={unit} cx={x} cy={y} />\n ));\n\n const lines = lineSetData.points.map(({ x: x1, y: y1 }, index) => {\n const { points, name, styling = 'primary' } = lineSetData;\n //nextIndex index is next Point's index\n const nextIndex = index + 1 >= points.length ? 0 : index + 1;\n //in the case of a line don't draw line back from second point\n if (index === 1 && nextIndex === 0) {\n return null;\n }\n const { x: x2, y: y2 } = points[nextIndex];\n\n return (\n <LineUnit\n // biome-ignore lint/suspicious/noArrayIndexKey: lines connect adjacent points (via nextIndex math); index is structural. #646.\n key={index}\n moveEndCB={onLineMoveEnd}\n lineSetId={lineSetId}\n options={options}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n unit={unit}\n label={name}\n styling={styling}\n lineClickCallback={onLineClick}\n lineMoveCallback={lineDragUpdate}\n lineMoveStartCallback={lineDragStart}\n showSmallDirectionMark={lineSetData.showSmallDirectionMark}\n overrideShowMoveHandle={lineSetData.showMoveHandle}\n lineClickSensingBorder={lineClickSensingBorder}\n hasClickSensingBorder={hasClickSensingBorder}\n />\n );\n });\n\n const polygonPoints = lineSetData.points.map((point) => `${point.x},${point.y}`).join(' ');\n\n return (\n <g>\n <FilledPolygon\n points={polygonPoints}\n $color={lineSetData.areaFillColor ? lineSetData.areaFillColor : 'transparent'}\n $opacity={lineSetData.areaTransparencyLevel ? lineSetData.areaTransparencyLevel / 100 : 0}\n />\n {lines}\n {handles}\n {points}\n <AreaLabel lineSetData={lineSetData} unit={unit} showAreaLabelShadow={showLabelShadow} />\n </g>\n );\n};\n\nexport default LineSet;\n","import type React from 'react';\nimport { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\nimport Spinner from '../Indicators/Spinner';\nimport type { IBoundary, LineUIOptions, LineUIVideoOptions } from '.';\nimport { LineSetContext } from './Contexts';\nimport LineSet from './LineSet';\n\nconst Container = styled.div`\n position: relative;\n line-height: 0;\n user-select: none;\n touch-action: none;\n width: auto;\n`;\nconst Video = styled.video`\n width: 100%;\n height: 100%;\n border-radius: 3px;\n background-color: hsla(0deg, 0%, 0%, 35%);\n`;\nconst LoadingOverlay = styled.div`\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`;\n\nconst Frame = styled.svg<{ $transcalent?: boolean }>`\n touch-action: none;\n user-select: none;\n margin: 0;\n\n overflow: visible;\n\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n transition: background 250ms ease;\n background: hsla(0deg, 0%, 0%, 0%);\n\n ${(props) =>\n props.$transcalent &&\n css`\n background: hsla(0deg, 0%, 0%, 35%);\n `}\n`;\n\nexport interface LineUIProps {\n src: string;\n onSizeChange?: (size: { h: number; w: number }) => void;\n onLineMoveEnd?: () => void;\n onLineClick?: (lineSetId: number) => void;\n onLoaded?: (metadata: { height: number; width: number }) => void;\n options?: LineUIOptions;\n videoOptions: LineUIVideoOptions;\n lineClickSensingBorder?: string;\n hasClickSensingBorder?: boolean;\n}\n\nexport interface LineUIVideoBaseProps extends Omit<LineUIProps, 'src'> {\n videoRef: React.RefObject<HTMLVideoElement | null>;\n}\n\nconst LineUIVideoBase: React.FC<LineUIVideoBaseProps> = ({\n videoRef,\n onSizeChange = () => {},\n onLineMoveEnd = () => {},\n onLineClick = () => {},\n onLoaded = () => {},\n lineClickSensingBorder = '65',\n hasClickSensingBorder = true,\n videoOptions: { loop = false, autoPlay = false, controls = false, muted = true, ...videoOptions },\n options: {\n showHandleFinder,\n showSetIndex,\n showPointLabel = false,\n showPointHandle,\n showLabelShadow,\n showMoveHandle,\n showGrabHandle,\n setIndexOffset = 0,\n pointIndexOffset = 0,\n showPoint = false,\n boundaryOffset = 0,\n showDirectionMark = false,\n } = {},\n}) => {\n const frame = useRef<SVGSVGElement>(null);\n\n const [boundaries, setBoundaries] = useState<IBoundary>({\n x: { min: 0, max: 0 },\n y: { min: 0, max: 0 },\n });\n const { state } = useContext(LineSetContext);\n\n const [handleFinder, setHandleFinder] = useState<boolean>(false);\n\n const [videoSize, setVideoSize] = useState({ h: 768, w: 1024 });\n const [unit, setUnit] = useState(1);\n const [loaded, setLoaded] = useState(false);\n\n const initScaleAndBounds = useCallback(() => {\n if (!videoRef.current) {\n return;\n }\n const { videoHeight, videoWidth, clientHeight } = videoRef.current;\n\n if (videoHeight !== videoSize.h || videoWidth !== videoSize.w) {\n setVideoSize({ h: videoHeight, w: videoWidth });\n onSizeChange({ h: videoHeight, w: videoWidth });\n }\n\n if (videoHeight / clientHeight !== unit) {\n setUnit(videoHeight / clientHeight);\n }\n }, [videoSize.h, videoSize.w, unit, onSizeChange, videoRef]);\n\n const handlePositionTipShow = (e: React.PointerEvent<SVGSVGElement>) => {\n if (e.target === frame.current) {\n setHandleFinder(!handleFinder === false && true);\n }\n };\n\n const handlePositionTipHide = () => {\n setHandleFinder(showHandleFinder || false);\n };\n\n const calculateCTM = useCallback(() => {\n if (!frame.current) {\n return null;\n }\n return frame.current.getScreenCTM();\n }, []);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: videoSize is a trigger dep — flows into <Frame> viewBox attr, so the effect must re-run after React applies the new viewBox. Same pattern as LineUI's imgSize. See #645.\n useEffect(() => {\n if (!frame.current || !loaded) {\n return;\n }\n const { viewBox } = frame.current;\n const bounds = {\n x: {\n min: viewBox.baseVal.x + boundaryOffset,\n max: viewBox.baseVal.x + viewBox.baseVal.width - boundaryOffset,\n },\n y: {\n min: viewBox.baseVal.y + boundaryOffset,\n max: viewBox.baseVal.y + viewBox.baseVal.height - boundaryOffset,\n },\n };\n setBoundaries(bounds);\n }, [videoSize, loaded, boundaryOffset]);\n\n const onLoadedMetadata = useCallback(\n ({ target }: React.SyntheticEvent<HTMLVideoElement>) => {\n if (target) {\n setLoaded(true);\n initScaleAndBounds();\n const { videoHeight = 1, videoWidth = 1 } = target as HTMLVideoElement;\n onLoaded({ height: videoHeight, width: videoWidth });\n }\n },\n [initScaleAndBounds, onLoaded]\n );\n\n useEffect(() => {\n window.addEventListener('resize', initScaleAndBounds);\n return () => {\n window.removeEventListener('resize', initScaleAndBounds);\n };\n }, [initScaleAndBounds]);\n\n const options = {\n handleFinderActive: handleFinder,\n revealSetIndex: showSetIndex !== false && (showSetIndex || state.length > 1),\n showPointLabel,\n showLabelShadow,\n showPointHandle: showPointHandle || (showPointHandle !== false && showGrabHandle !== false),\n showMoveHandle: showMoveHandle || (showMoveHandle !== false && showGrabHandle !== false),\n setIndexOffset,\n pointIndexOffset,\n showPoint,\n showDirectionMark,\n };\n\n return (\n <Container>\n <Video\n ref={videoRef}\n controls={controls}\n muted={muted}\n autoPlay={autoPlay}\n loop={loop}\n {...videoOptions}\n onLoadedMetadata={onLoadedMetadata}\n id='1'\n >\n {' '}\n </Video>\n {!loaded && (\n <LoadingOverlay>\n <Spinner size='large' styling='primary' />\n </LoadingOverlay>\n )}\n {loaded && (\n <Frame\n ref={frame}\n viewBox={`0 0 ${videoSize.w} ${videoSize.h} `}\n version='1.1'\n xmlns='http://www.w3.org/2000/svg'\n onPointerDown={handlePositionTipShow}\n onPointerUp={handlePositionTipHide}\n onPointerLeave={handlePositionTipHide}\n $transcalent={handleFinder}\n >\n {state.map((lineSet, index) => (\n <LineSet\n // biome-ignore lint/suspicious/noArrayIndexKey: index IS the lineSetId, also passed to LineSet as the prop of the same name. #646.\n key={index}\n hasClickSensingBorder={hasClickSensingBorder}\n lineClickSensingBorder={lineClickSensingBorder}\n onLineMoveEnd={onLineMoveEnd}\n onLineClick={onLineClick}\n lineSetId={index}\n lineData={lineSet}\n getCTM={calculateCTM}\n boundaries={boundaries}\n unit={unit}\n size={30}\n options={options}\n />\n ))}\n </Frame>\n )}\n </Container>\n );\n};\n\nexport default LineUIVideoBase;\n"],"mappings":";;;;;;AAAA,IAAa,aAAa;CACxB,IAAI;CACJ,MAAM;AACR;AAEA,IAAa,aAAa;CACxB,OAAO,EACL,SAAS;EACP,OAAO;EACP,SAAS;EACT,OAAO;EACP,QAAQ;CACV,EACF;CACA,MAAM;EACJ,QAAQ;GACN,QAAQ;IACN,QAAQ;IACR,SAAS;IACT,UAAU;GACZ;GACA,OAAO;IACL,QAAQ;IACR,SAAS;IACT,UAAU;GACZ;GACA,QAAQ;IACN,QAAQ;IACR,SAAS;IACT,UAAU;GACZ;GACA,OAAO;IACL,QAAQ;IACR,SAAS;IACT,UAAU;GACZ;EACF;EACA,OAAO,EACL,QAAQ,OACV;EACA,QAAQ;GACN,OAAO;IACL,OAAO;IACP,QAAQ;IACR,cAAc;GAChB;GACA,OAAO;IACL,OAAO;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IACN;IACN,MAAM;IACG;GACV,GAZM,KAYN,CACF;EACI,CAAA;CAEA,EAAA,CAAA;AAEf"}
@@ -15,7 +15,7 @@ var __copyProps = (to, from, except, desc) => {
15
15
  }
16
16
  return to;
17
17
  };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
19
  value: mod,
20
20
  enumerable: true
21
21
  }) : target, mod));
@@ -749,14 +749,16 @@ var LineUnit = (props) => {
749
749
  ]
750
750
  });
751
751
  };
752
+ const getMouseOver = (0, react.useCallback)(() => {
753
+ if (props.hasClickSensingBorder) setShowLineBorder(true);
754
+ }, [props.hasClickSensingBorder]);
755
+ const getMouseOut = (0, react.useCallback)(() => {
756
+ if (props.hasClickSensingBorder) setShowLineBorder(false);
757
+ }, [props.hasClickSensingBorder]);
752
758
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("g", { children: [
753
759
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContrastLine, {
754
- onMouseOver: (0, react.useCallback)(() => {
755
- if (props.hasClickSensingBorder) setShowLineBorder(true);
756
- }, [props.hasClickSensingBorder]),
757
- onMouseOut: (0, react.useCallback)(() => {
758
- if (props.hasClickSensingBorder) setShowLineBorder(false);
759
- }, [props.hasClickSensingBorder]),
760
+ onMouseOver: getMouseOver,
761
+ onMouseOut: getMouseOut,
760
762
  $lineClickSensing: lineClickSensing,
761
763
  $showLineBorder: showLineBorder,
762
764
  onClick: () => lineClickCallback(lineSetId),
@@ -902,10 +904,11 @@ var LineSet = ({ getCTM, boundaries, unit, size, lineSetId, options, onLineMoveE
902
904
  x: Math.round(pointer.x),
903
905
  y: Math.round(pointer.y)
904
906
  };
907
+ const newLineSetData = (0, immutability_helper.default)(lineSetData, { points: { [index]: { $merge: point } } });
905
908
  dispatch({
906
909
  type: "UPDATE",
907
910
  index: lineSetId,
908
- data: (0, immutability_helper.default)(lineSetData, { points: { [index]: { $merge: point } } })
911
+ data: newLineSetData
909
912
  });
910
913
  }, [
911
914
  getCTM,
@@ -970,7 +973,8 @@ var LineSet = ({ getCTM, boundaries, unit, size, lineSetId, options, onLineMoveE
970
973
  const { points } = inputHandleData;
971
974
  const outputData = [];
972
975
  inputHandleData.points.forEach((handle, index) => {
973
- const nextHandle = points[index + 2 > points.length ? 0 : index + 1];
976
+ const nextIndex = index + 2 > points.length ? 0 : index + 1;
977
+ const nextHandle = points[nextIndex];
974
978
  const angle = calcAngle(handle.x, handle.y, nextHandle.x, nextHandle.y);
975
979
  outputData.push(angle);
976
980
  });
@@ -1056,9 +1060,10 @@ var LineSet = ({ getCTM, boundaries, unit, size, lineSetId, options, onLineMoveE
1056
1060
  hasClickSensingBorder
1057
1061
  }, index);
1058
1062
  });
1063
+ const polygonPoints = lineSetData.points.map((point) => `${point.x},${point.y}`).join(" ");
1059
1064
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("g", { children: [
1060
1065
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilledPolygon, {
1061
- points: lineSetData.points.map((point) => `${point.x},${point.y}`).join(" "),
1066
+ points: polygonPoints,
1062
1067
  $color: lineSetData.areaFillColor ? lineSetData.areaFillColor : "transparent",
1063
1068
  $opacity: lineSetData.areaTransparencyLevel ? lineSetData.areaTransparencyLevel / 100 : 0
1064
1069
  }),
@@ -1173,7 +1178,7 @@ var LineUIVideoBase = ({ videoRef, onSizeChange = () => {}, onLineMoveEnd = () =
1173
1178
  (0, react.useEffect)(() => {
1174
1179
  if (!frame.current || !loaded) return;
1175
1180
  const { viewBox } = frame.current;
1176
- setBoundaries({
1181
+ const bounds = {
1177
1182
  x: {
1178
1183
  min: viewBox.baseVal.x + boundaryOffset,
1179
1184
  max: viewBox.baseVal.x + viewBox.baseVal.width - boundaryOffset
@@ -1182,7 +1187,8 @@ var LineUIVideoBase = ({ videoRef, onSizeChange = () => {}, onLineMoveEnd = () =
1182
1187
  min: viewBox.baseVal.y + boundaryOffset,
1183
1188
  max: viewBox.baseVal.y + viewBox.baseVal.height - boundaryOffset
1184
1189
  }
1185
- });
1190
+ };
1191
+ setBoundaries(bounds);
1186
1192
  }, [
1187
1193
  videoSize,
1188
1194
  loaded,
@@ -1332,4 +1338,4 @@ Object.defineProperty(exports, "fontFamily", {
1332
1338
  }
1333
1339
  });
1334
1340
 
1335
- //# sourceMappingURL=LineUIVideoBase-VxlYHeJG.js.map
1341
+ //# sourceMappingURL=LineUIVideoBase-DmQtfhyc.js.map