scorer-ui-kit 3.0.0-beta.2 → 3.0.0-beta.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"HandleUnit.d.ts","sourceRoot":"","sources":["../../src/LineUI/HandleUnit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,wBAAwB,EAAE,MAAM,GAAG,CAAC;AAkH7C,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,GAAG;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IAClF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC;IAClB,SAAS,CAAC,EAAE,MAAI,IAAI,CAAC;IACrB,OAAO,EAAE,wBAAwB,CAAC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,UAAU,EAAG,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwH3C,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"HandleUnit.d.ts","sourceRoot":"","sources":["../../src/LineUI/HandleUnit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,wBAAwB,EAAE,MAAM,GAAG,CAAC;AAkH7C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C,MAAM,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAwBD,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAwMpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"LineSet.d.ts","sourceRoot":"","sources":["../../src/LineUI/LineSet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAKpF,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAY,MAAM,GAAG,CAAC;AA2BlE,UAAU,aAAa;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,wBAAwB,CAAC;IAClC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,MAAM,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAwBD,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0NpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LineUnit.d.ts","sourceRoot":"","sources":["../../src/LineUI/LineUnit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,wBAAwB,EAAE,MAAM,GAAG,CAAC;AA8F7C,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,wBAAwB,CAAC;IAClC,EAAE,EAAE,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AE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAID,QAAA,MAAM,QAAQ,EAAG,KAAK,CAAC,EAAE,CAAC,cAAc,CA0JvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"WebRTCClient.d.ts","sourceRoot":"","sources":["../src/WebRTCClient.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA+B,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAUhF,UAAU,QAAQ;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C;AACD,KAAK,KAAK,GAAG,QAAQ,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAA;AAE7D,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAoQjC,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"WebRTCClient.d.ts","sourceRoot":"","sources":["../src/WebRTCClient.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqB,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAUtE,UAAU,QAAQ;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C;AACD,KAAK,KAAK,GAAG,QAAQ,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAA;AAE7D,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAuSjC,CAAC;AAEF,eAAe,YAAY,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,13 +2,13 @@ import { default as defaultTheme } from './theme';
2
2
  import { default as ThemeVariables } from './theme/ThemeVariables';
3
3
  import { BaseStyles } from './theme/ThemeHelpers';
4
4
  import { AlertBar, Notification, INotificationProps, AlertWrapper, Tooltip, ITooltipPosition, AlertType, ITooltipType } from './Alerts';
5
- import { Form, Button, ButtonWithIcon, ButtonWithLoading, IconButton, IconButtonData, ActionButtons, SmallInput, Input, Label, Switch, Checkbox, PasswordField, TextField, TextArea, TextAreaField, SliderInput, ISliderMark, DurationSlider, PercentageSlider, InputFileButton, DropArea, CropTool, AvatarUploader, SelectField, SelectWrapper, AreaUploadManager, RadioButton, SplitButton, ISplitButtonProps, ButtonsStack, IButtonsStack, IButtonStack, TypeSwitchState } from './Form';
5
+ import { Form, Button, ButtonWithIcon, ButtonWithLoading, IconButton, IconButtonData, ActionButtons, SmallInput, Input, Label, Switch, Checkbox, PasswordField, TextField, TextArea, TextAreaField, SliderInput, ISliderMark, DurationSlider, PercentageSlider, InputFileButton, DropArea, CropTool, AvatarUploader, SelectField, SelectWrapper, AreaUploadManager, RadioButton, SplitButton, ISplitButtonProps, ButtonsStack, IButtonsStack, IButtonStack, TypeSwitchState, TypeFieldState, TypeButtonDesigns, TypeButtonSizes, ISelectSizes, IInputOptionsType, TypeLabelDirection, IButtonProps } from './Form';
6
6
  import { DatePicker, isDateInterval, IFilterDatePicker, FilterDropdownContainer, FilterButton, FilterDropdown, SortDropdown, FilterLayout, FilterInputs, ISearchFilter, IFilterDropdownExt, FiltersResults, IFilterLabel, FilterBar, IFilterDropdownConfig, IFilterType, IFilterItem, IFilterValue, IFilterResult, isFilterItem, FilterButtonDesign, ToggleButton, IToggleOption, IDateInterval, IDateRange } from './Filters';
7
7
  import { default as Icon, IconSVGs } from './Icons/Icon';
8
8
  import { default as StatusIcon } from './Icons/StatusIcon';
9
- import { LineUI, LineUIVideo, LineUIRTC, LineSetContext, LineReducer } from './LineUI';
9
+ import { LineUI, LineUIVideo, LineUIRTC, LineSetContext, LineReducer, IVector2, IPointSet, IMinMax, IBoundary, IDragLineUISharedOptions, LineUIOptions, LineUIVideoOptions } from './LineUI';
10
10
  import { IntroductionText, PageHeader, PageTitle, MultilineContent, IHeaderTag } from './Pages';
11
- import { TypeTable, TableRowThumbnail, TableHeaderTitle, EditCell } from './Tables';
11
+ import { TypeTable, TableRowThumbnail, TableHeaderTitle, EditCell, TypeCellStyle, TypeCellAlignment, TableHeaders, TableHeaderItem, ITableColumnConfig, IDeviceStatus, ICellData, IRowHeader, IRowData, ITypeTableData } from './Tables';
12
12
  import { Controls, PTZProvider, PTZReducer, usePTZ, PTZContext } from './PTZControl';
13
13
  import { CameraPanels, CameraPanelWrapper, ICameraPanel, IMediaStream, IPanelMetaData } from './CameraPanels';
14
14
  import { Tag, TagList, ITag, ITagList, TagListWrapper, MediaBox, BasicSearchInput, DebouncedSearcher, ActionsBar, IActionsButton, Pagination, IItemsOption, IPagination } from './Misc';
@@ -19,7 +19,7 @@ import { resetButtonStyles, FlexContentPlaceholder } from './common';
19
19
  import { default as Spinner } from './Indicators/Spinner';
20
20
  import { default as WebRTCClient } from './WebRTCClient';
21
21
  import { ContentLayout, FullWidthContentBlock, UtilityHeader, SplitLayout, IHeaderContent, IUtilityHeader, ISplitLayoutHandles } from './Layouts';
22
- import { MainMenu, TopBar, Content, Layout, MainContainer, SidebarBox, SidebarLink, SidebarHeading, Logo, SidebarLinkHeading, BackLink, Sidebar, GlobalUI, INotificationItem, INotificationsHistory, ICustomDrawer } from './Global';
22
+ import { MainMenu, TopBar, Content, Layout, MainContainer, SidebarBox, SidebarLink, SidebarHeading, Logo, SidebarLinkHeading, BackLink, Sidebar, GlobalUI, INotificationItem, INotificationsHistory, ICustomDrawer, IMenuTop, IMenuItemTop, IMenuItemSubmenu, IMenu, IUserDrawerMeta, IUserDrawerFooter, IUserSubmenuItem, ITopBar, ITopBarBadge } from './Global';
23
23
  import { Tabs, TabContext, Tab, TabList, TabContent, TabWithIcon, TabsWithIconBar, ITabIcon } from './Tabs';
24
24
  export { defaultTheme, ThemeVariables, BaseStyles, AlertBar, Notification, AlertWrapper, Tooltip, LineUI, LineUIVideo, LineUIRTC, LineSetContext, LineReducer, Form, Button, ButtonWithIcon, ButtonWithLoading, IconButton, ActionButtons, Input, SmallInput, Label, Switch, Checkbox, PasswordField, TextField, TextArea, TextAreaField, SliderInput, DurationSlider, PercentageSlider, InputFileButton, DropArea, CropTool, AvatarUploader, SelectField, SelectWrapper, AreaUploadManager, RadioButton, SplitButton, ButtonsStack, ConfirmationModal, DatePicker, FilterDropdownContainer, FilterButton, FilterDropdown, SortDropdown, FilterLayout, FilterInputs, FiltersResults, FilterBar, ToggleButton, isFilterItem, isDateInterval, Icon, IconSVGs, StatusIcon, IntroductionText, PageHeader, PageTitle, MultilineContent, Controls, PTZProvider, PTZContext, PTZReducer, usePTZ, TypeTable, TableRowThumbnail, TableHeaderTitle, EditCell, useInterval, useTo, useTitle, useCopyToClipboard, useClickOutside, usePoll, useMediaModal, useThemeToggle, resetButtonStyles, FlexContentPlaceholder, Spinner, WebRTCClient, MainMenu, TopBar, MainContainer, Layout, Content, SidebarBox, SidebarLink, SidebarHeading, Logo, SidebarLinkHeading, BackLink, Sidebar, GlobalUI, ContentLayout, FullWidthContentBlock, UtilityHeader, SplitLayout, Tabs, TabContext, Tab, TabList, TabContent, TabWithIcon, TabsWithIconBar, CameraPanels, CameraPanelWrapper, Tag, TagList, TagListWrapper, MediaBox, BasicSearchInput, DebouncedSearcher, ActionsBar, Pagination, NotificationProvider, useNotification, ModalContext, ModalProvider, useModal };
25
25
  /**
@@ -30,5 +30,5 @@ export type ITimeUnit = 'seconds' | 'minutes' | 'hours';
30
30
  export type IMediaType = 'img' | 'video';
31
31
  export type IStatusDot = 'caution' | 'danger' | 'good' | 'neutral' | 'highlight';
32
32
  export type IWeight = 'light' | 'regular' | 'heavy' | 'strong';
33
- export type { IModal, INotificationProps, IconButtonData, ITag, ITagList, ISliderMark, INotificationItem, INotificationsHistory, ICustomDrawer, ISearchFilter, IFilterDropdownExt, IFilterLabel, IFilterDropdownConfig, ITabIcon, IFilterType, IFilterItem, IFilterValue, IFilterResult, IFilterDatePicker, ICameraPanel, IMediaStream, IPanelMetaData, IActionsButton, ISplitButtonProps, IHeaderTag, IItemsOption, IPagination, IHeaderContent, IUtilityHeader, ITooltipPosition, IButtonsStack, IButtonStack, ISplitLayoutHandles, AlertType, ITooltipType, FilterButtonDesign, IToggleOption, IDateInterval, IDateRange, TypeSwitchState };
33
+ export type { IModal, INotificationProps, IconButtonData, ITag, ITagList, ISliderMark, INotificationItem, INotificationsHistory, ICustomDrawer, ISearchFilter, IFilterDropdownExt, IFilterLabel, IFilterDropdownConfig, ITabIcon, IFilterType, IFilterItem, IFilterValue, IFilterResult, IFilterDatePicker, ICameraPanel, IMediaStream, IPanelMetaData, IActionsButton, ISplitButtonProps, IHeaderTag, IItemsOption, IPagination, IHeaderContent, IUtilityHeader, ITooltipPosition, IButtonsStack, IButtonStack, ISplitLayoutHandles, AlertType, ITooltipType, FilterButtonDesign, IToggleOption, IDateInterval, IDateRange, TypeSwitchState, IVector2, IPointSet, IMinMax, IBoundary, IDragLineUISharedOptions, LineUIOptions, LineUIVideoOptions, TypeCellStyle, TypeCellAlignment, TableHeaders, TableHeaderItem, ITableColumnConfig, IDeviceStatus, ICellData, IRowHeader, IRowData, ITypeTableData, IMenuTop, IMenuItemTop, IMenuItemSubmenu, IMenu, IUserDrawerMeta, IUserDrawerFooter, IUserSubmenuItem, ITopBar, ITopBarBadge, TypeFieldState, TypeButtonDesigns, TypeButtonSizes, ISelectSizes, IInputOptionsType, TypeLabelDirection, IButtonProps, };
34
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,YAAY,EACb,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,IAAI,EACJ,MAAM,EACN,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,aAAa,EACb,UAAU,EACV,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,SAAS,EACT,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,eAAe,EAChB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,qB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d,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,QAAQ,EACR,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,EAChB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,YAAY,EACb,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,IAAI,EACJ,MAAM,EACN,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,aAAa,EACb,UAAU,EACV,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,SAAS,EACT,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,eAAe,EAChB,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EACV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B,EACxB,aAAa,EACb,kBAAkB,EAGlB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,UAAU,EACV,QAAQ,EACR,cAAc,EAGd,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,KAAK,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,YAAY,EAGZ,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,GACb,CAAC"}
package/dist/index.js CHANGED
@@ -10582,7 +10582,7 @@ const IconGroup = styled.g`
10582
10582
  const HandleUnit = (props) => {
10583
10583
  const { index: index2, useAngles, angle, unit, size, lineSetId, x, y, moveCallback, moveEndCB = () => {
10584
10584
  }, Icon: Icon2, rotate: rotate2 = 0, options, readOnlyHandle = false, styling = "primary" } = props;
10585
- const handleInstance = React.createRef();
10585
+ const handleInstance = React.useRef(null);
10586
10586
  const [touchDragging, setTouchDragging] = React.useState(false);
10587
10587
  const [mouseDragging, setMouseDragging] = React.useState(false);
10588
10588
  const [touchIndex, setTouchIndex] = React.useState(null);
@@ -10593,12 +10593,12 @@ const HandleUnit = (props) => {
10593
10593
  }
10594
10594
  for (let i = 0; i < e.touches.length; i++) {
10595
10595
  const touch = e.touches[i];
10596
- if (touch.target.parentNode.parentElement === handleInstance || touch.target.parentNode.parentElement.parentElement) {
10596
+ if (touch.target.parentNode.parentElement === handleInstance.current || touch.target.parentNode.parentElement.parentElement) {
10597
10597
  setTouchDragging(true);
10598
10598
  setTouchIndex(i);
10599
10599
  }
10600
10600
  }
10601
- }, [handleInstance, readOnlyHandle]);
10601
+ }, [readOnlyHandle]);
10602
10602
  const handleTouchEnd = React.useCallback(() => {
10603
10603
  if (readOnlyHandle) {
10604
10604
  return;
@@ -10617,6 +10617,18 @@ const HandleUnit = (props) => {
10617
10617
  }
10618
10618
  }
10619
10619
  }, [index2, moveCallback, readOnlyHandle, touchIndex]);
10620
+ const handleMouseMoveRef = React.useRef(null);
10621
+ const handleMouseUpRef = React.useRef(null);
10622
+ const cleanupMouseListeners = React.useCallback(() => {
10623
+ if (handleMouseMoveRef.current) {
10624
+ window.removeEventListener("mousemove", handleMouseMoveRef.current);
10625
+ handleMouseMoveRef.current = null;
10626
+ }
10627
+ if (handleMouseUpRef.current) {
10628
+ window.removeEventListener("mouseup", handleMouseUpRef.current);
10629
+ handleMouseUpRef.current = null;
10630
+ }
10631
+ }, []);
10620
10632
  const handleMouseMove = React.useCallback((e) => {
10621
10633
  e.preventDefault();
10622
10634
  if (readOnlyHandle) {
@@ -10630,20 +10642,25 @@ const HandleUnit = (props) => {
10630
10642
  return;
10631
10643
  }
10632
10644
  setMouseDragging(false);
10633
- window.removeEventListener("mousemove", handleMouseMove);
10634
- window.removeEventListener("mouseup", handleMouseUp);
10645
+ cleanupMouseListeners();
10635
10646
  moveCallback({ x: e.pageX, y: e.pageY }, index2);
10636
10647
  setTimeout(moveEndCB);
10637
- }, [handleMouseMove, index2, moveCallback, moveEndCB, readOnlyHandle]);
10648
+ }, [cleanupMouseListeners, index2, moveCallback, moveEndCB, readOnlyHandle]);
10638
10649
  const handleMouseDown = React.useCallback((e) => {
10639
10650
  e.preventDefault();
10640
10651
  if (readOnlyHandle) {
10641
10652
  return;
10642
10653
  }
10654
+ cleanupMouseListeners();
10643
10655
  setMouseDragging(true);
10656
+ handleMouseMoveRef.current = handleMouseMove;
10657
+ handleMouseUpRef.current = handleMouseUp;
10644
10658
  window.addEventListener("mousemove", handleMouseMove);
10645
10659
  window.addEventListener("mouseup", handleMouseUp);
10646
- }, [handleMouseMove, handleMouseUp, readOnlyHandle]);
10660
+ }, [cleanupMouseListeners, handleMouseMove, handleMouseUp, readOnlyHandle]);
10661
+ React.useEffect(() => {
10662
+ return cleanupMouseListeners;
10663
+ }, [cleanupMouseListeners]);
10647
10664
  const maskID = useAngles ? "mask-" + lineSetId + "-" + index2 : "";
10648
10665
  const shadowGradientID = "shadowGradient-" + lineSetId + "-" + index2;
10649
10666
  const { showPointHandle = true, showPointLabel = false, pointIndexOffset } = options;
@@ -10766,23 +10783,40 @@ const LineUnit = (props) => {
10766
10783
  lineMoveStartCallback({ x: e.touches[i].pageX, y: e.touches[i].pageY });
10767
10784
  }
10768
10785
  };
10769
- const handleMouseDown = (e) => {
10770
- lineMoveStartCallback({ x: e.pageX, y: e.pageY });
10771
- window.addEventListener("mousemove", handleMouseMove);
10772
- window.addEventListener("mouseup", handleMouseUp);
10786
+ const mouseMoveRef = React.useRef(null);
10787
+ const mouseUpRef = React.useRef(null);
10788
+ const cleanupMouseListeners = React.useCallback(() => {
10789
+ if (mouseMoveRef.current) {
10790
+ window.removeEventListener("mousemove", mouseMoveRef.current);
10791
+ mouseMoveRef.current = null;
10792
+ }
10793
+ if (mouseUpRef.current) {
10794
+ window.removeEventListener("mouseup", mouseUpRef.current);
10795
+ mouseUpRef.current = null;
10796
+ }
10797
+ }, []);
10798
+ const handleMouseMove = React.useCallback((e) => {
10799
+ lineMoveCallback({ x: e.pageX, y: e.pageY });
10773
10800
  e.preventDefault();
10774
- };
10775
- const handleMouseUp = (e) => {
10776
- window.removeEventListener("mousemove", handleMouseMove);
10777
- window.removeEventListener("mouseup", handleMouseUp);
10801
+ }, [lineMoveCallback]);
10802
+ const handleMouseUp = React.useCallback((e) => {
10803
+ cleanupMouseListeners();
10778
10804
  lineMoveCallback({ x: e.pageX, y: e.pageY });
10779
10805
  moveEndCB();
10780
10806
  e.preventDefault();
10781
- };
10782
- const handleMouseMove = (e) => {
10783
- lineMoveCallback({ x: e.pageX, y: e.pageY });
10807
+ }, [cleanupMouseListeners, lineMoveCallback, moveEndCB]);
10808
+ const handleMouseDown = React.useCallback((e) => {
10809
+ cleanupMouseListeners();
10810
+ lineMoveStartCallback({ x: e.pageX, y: e.pageY });
10811
+ mouseMoveRef.current = handleMouseMove;
10812
+ mouseUpRef.current = handleMouseUp;
10813
+ window.addEventListener("mousemove", handleMouseMove);
10814
+ window.addEventListener("mouseup", handleMouseUp);
10784
10815
  e.preventDefault();
10785
- };
10816
+ }, [cleanupMouseListeners, lineMoveStartCallback, handleMouseMove, handleMouseUp]);
10817
+ React.useEffect(() => {
10818
+ return cleanupMouseListeners;
10819
+ }, [cleanupMouseListeners]);
10786
10820
  const midpoint = {
10787
10821
  x: (x2 + x1) / 2,
10788
10822
  y: (y2 + y1) / 2
@@ -10961,6 +10995,23 @@ const LineSet = ({ getCTM, boundaries, unit, size, lineSetId, options, onLineMov
10961
10995
  updateHandleAngles(lineSetData);
10962
10996
  }
10963
10997
  }, [lineSetData, updateHandleAngles, handleUsesAngles]);
10998
+ const initialClampDone = React.useRef(false);
10999
+ React.useEffect(() => {
11000
+ if (boundaries.x.max === 0 && boundaries.y.max === 0) {
11001
+ return;
11002
+ }
11003
+ if (initialClampDone.current) {
11004
+ return;
11005
+ }
11006
+ initialClampDone.current = true;
11007
+ const needsUpdate = lineSetData.points.some(
11008
+ ({ x, y }) => x < boundaries.x.min || x > boundaries.x.max || y < boundaries.y.min || y > boundaries.y.max
11009
+ );
11010
+ if (needsUpdate) {
11011
+ const clampedPoints = lineSetData.points.map((point) => enforceBoundaries({ ...point }));
11012
+ dispatch({ type: "UPDATE", index: lineSetId, data: { ...lineSetData, points: clampedPoints } });
11013
+ }
11014
+ }, [boundaries]);
10964
11015
  const handles = (lineSetData?.showPointHandle === void 0 || lineSetData?.showPointHandle) && lineSetData.points.map(
10965
11016
  ({ x, y }, index2) => /* @__PURE__ */ jsxRuntime.jsx(
10966
11017
  HandleUnit,
@@ -11372,10 +11423,14 @@ const WebRTCPlayer = ({
11372
11423
  children,
11373
11424
  ...props
11374
11425
  }) => {
11375
- const [connectionAttempts, setConnectionAttempts] = React.useState(0);
11426
+ const connectionAttemptsRef = React.useRef(0);
11376
11427
  const videoRef = React.useRef(null);
11377
11428
  const webSocket = React.useRef(null);
11378
11429
  const peerConnection = React.useRef(null);
11430
+ const mountedRef = React.useRef(false);
11431
+ const reconnectTimeoutRef = React.useRef(null);
11432
+ const helloIntervalRef = React.useRef(null);
11433
+ const enabledRef = React.useRef(enabled);
11379
11434
  function handleIncomingError(error) {
11380
11435
  setError(error);
11381
11436
  closeWebSocket();
@@ -11422,7 +11477,7 @@ const WebRTCPlayer = ({
11422
11477
  };
11423
11478
  setStatus("Sending Local Description");
11424
11479
  try {
11425
- await webSocket.current.send(JSON.stringify(message));
11480
+ webSocket.current.send(JSON.stringify(message));
11426
11481
  setStatus("Connected");
11427
11482
  } catch (error) {
11428
11483
  console.error(error);
@@ -11474,22 +11529,32 @@ const WebRTCPlayer = ({
11474
11529
  };
11475
11530
  function onServerClose(event) {
11476
11531
  console.debug("serverClose");
11477
- if (webSocket.current) {
11478
- setStatus("Disconnected from server");
11479
- closePeerConnection();
11480
- if (event !== null && event.code !== 1e3 && enabled) {
11481
- window.setTimeout(connectToPeer, 3e3);
11532
+ if (!webSocket.current || event.target !== webSocket.current) {
11533
+ return;
11534
+ }
11535
+ setStatus("Disconnected from server");
11536
+ closePeerConnection();
11537
+ if (event.code !== 1e3 && enabledRef.current && mountedRef.current) {
11538
+ if (reconnectTimeoutRef.current !== null) {
11539
+ clearTimeout(reconnectTimeoutRef.current);
11482
11540
  }
11541
+ reconnectTimeoutRef.current = setTimeout(connectToPeer, 3e3);
11483
11542
  }
11484
11543
  }
11485
11544
  function onServerError(event) {
11545
+ if (event.target !== webSocket.current) {
11546
+ return;
11547
+ }
11486
11548
  console.debug(event);
11487
11549
  setError("Unable to connect to server");
11488
11550
  closeWebSocket();
11489
11551
  }
11490
11552
  function connectToPeer() {
11491
- console.debug("connectToPeer", connectionAttempts);
11492
- if (connectionAttempts >= maxConnectionAttempts) {
11553
+ if (!mountedRef.current) {
11554
+ return;
11555
+ }
11556
+ console.debug("connectToPeer", connectionAttemptsRef.current);
11557
+ if (connectionAttemptsRef.current >= maxConnectionAttempts) {
11493
11558
  setError("Too many connection attempts, aborting. Refresh page to try again");
11494
11559
  return;
11495
11560
  }
@@ -11499,10 +11564,16 @@ const WebRTCPlayer = ({
11499
11564
  const ws = new WebSocket(peerAddress);
11500
11565
  webSocket.current = ws;
11501
11566
  ws.addEventListener("open", () => {
11502
- const interval = setInterval(() => {
11567
+ if (helloIntervalRef.current !== null) {
11568
+ clearInterval(helloIntervalRef.current);
11569
+ }
11570
+ helloIntervalRef.current = setInterval(() => {
11503
11571
  try {
11504
11572
  ws.send("HELLO " + peerId);
11505
- clearInterval(interval);
11573
+ if (helloIntervalRef.current !== null) {
11574
+ clearInterval(helloIntervalRef.current);
11575
+ helloIntervalRef.current = null;
11576
+ }
11506
11577
  setStatus("Registering with server (sent HELLO) for peer id: " + peerId);
11507
11578
  } catch (error) {
11508
11579
  console.debug(error);
@@ -11512,7 +11583,7 @@ const WebRTCPlayer = ({
11512
11583
  ws.addEventListener("error", onServerError);
11513
11584
  ws.addEventListener("message", onServerMessage);
11514
11585
  ws.addEventListener("close", onServerClose);
11515
- setConnectionAttempts(connectionAttempts + 1);
11586
+ connectionAttemptsRef.current += 1;
11516
11587
  }
11517
11588
  function onRemoteTrack(event) {
11518
11589
  if (videoRef.current && videoRef.current.srcObject !== event.streams[0]) {
@@ -11522,7 +11593,7 @@ const WebRTCPlayer = ({
11522
11593
  }
11523
11594
  }
11524
11595
  function createCall(msg) {
11525
- setConnectionAttempts(0);
11596
+ connectionAttemptsRef.current = 0;
11526
11597
  console.debug("Creating RTCPeerConnection");
11527
11598
  if (!msg.sdp) {
11528
11599
  console.debug("WARNING: First message wasn't an SDP message!?");
@@ -11544,22 +11615,26 @@ const WebRTCPlayer = ({
11544
11615
  });
11545
11616
  setStatus("RTCPeerConnection created, waiting for SDP");
11546
11617
  }
11547
- const closeWebSocket = async () => {
11618
+ const closeWebSocket = () => {
11548
11619
  console.debug("closeWebSocket");
11549
- await closePeerConnection();
11620
+ closePeerConnection();
11550
11621
  if (webSocket.current) {
11551
- await webSocket.current.close();
11622
+ webSocket.current.close();
11552
11623
  webSocket.current = null;
11553
11624
  }
11554
11625
  };
11555
- const closePeerConnection = async () => {
11626
+ const closePeerConnection = () => {
11556
11627
  console.debug("closePeerConnection");
11557
11628
  if (peerConnection.current) {
11558
- await peerConnection.current.close();
11629
+ peerConnection.current.close();
11559
11630
  peerConnection.current = null;
11560
11631
  }
11561
11632
  };
11562
11633
  React.useEffect(() => {
11634
+ enabledRef.current = enabled;
11635
+ }, [enabled]);
11636
+ React.useEffect(() => {
11637
+ mountedRef.current = true;
11563
11638
  if (enabled === true) {
11564
11639
  connectToPeer();
11565
11640
  } else {
@@ -11569,6 +11644,15 @@ const WebRTCPlayer = ({
11569
11644
  }
11570
11645
  return () => {
11571
11646
  console.debug("cleanup");
11647
+ mountedRef.current = false;
11648
+ if (reconnectTimeoutRef.current !== null) {
11649
+ clearTimeout(reconnectTimeoutRef.current);
11650
+ reconnectTimeoutRef.current = null;
11651
+ }
11652
+ if (helloIntervalRef.current !== null) {
11653
+ clearInterval(helloIntervalRef.current);
11654
+ helloIntervalRef.current = null;
11655
+ }
11572
11656
  closeWebSocket();
11573
11657
  };
11574
11658
  }, [enabled]);