@carto/ps-react-ui 4.13.0 → 4.14.0

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 (61) hide show
  1. package/dist/{category-Dnd2_j0x.js → category-CGS_eHr4.js} +2 -2
  2. package/dist/{category-Dnd2_j0x.js.map → category-CGS_eHr4.js.map} +1 -1
  3. package/dist/{change-column-DjjwoPt1.js → change-column-CiVAjOUB.js} +2 -2
  4. package/dist/{change-column-DjjwoPt1.js.map → change-column-CiVAjOUB.js.map} +1 -1
  5. package/dist/components.js +1160 -753
  6. package/dist/components.js.map +1 -1
  7. package/dist/{data-zoom-layout-CkVnm6ej.js → data-zoom-layout-D_FYdnap.js} +2 -2
  8. package/dist/{data-zoom-layout-CkVnm6ej.js.map → data-zoom-layout-D_FYdnap.js.map} +1 -1
  9. package/dist/{download-config-oJIFZ2WC.js → download-config-OKlLLSW_.js} +2 -2
  10. package/dist/{download-config-oJIFZ2WC.js.map → download-config-OKlLLSW_.js.map} +1 -1
  11. package/dist/{lasso-tool-CDFj4zKY.js → lasso-tool-YLFRgb-S.js} +182 -154
  12. package/dist/lasso-tool-YLFRgb-S.js.map +1 -0
  13. package/dist/{spread-DYNpzgh_.js → spread-4MYPOntd.js} +2 -2
  14. package/dist/{spread-DYNpzgh_.js.map → spread-4MYPOntd.js.map} +1 -1
  15. package/dist/{table-B3ZWWhJt.js → table-CTcLOycx.js} +2 -2
  16. package/dist/{table-B3ZWWhJt.js.map → table-CTcLOycx.js.map} +1 -1
  17. package/dist/types/components/index.d.ts +4 -2
  18. package/dist/types/components/lasso-tool/geometry-toolbar.d.ts +13 -0
  19. package/dist/types/components/lasso-tool/icons.d.ts +6 -0
  20. package/dist/types/components/lasso-tool/lasso-tool.d.ts +1 -1
  21. package/dist/types/components/lasso-tool/layer-filters.d.ts +10 -0
  22. package/dist/types/components/lasso-tool/styles.d.ts +1 -1
  23. package/dist/types/components/lasso-tool/types.d.ts +62 -1
  24. package/dist/widgets/actions.js +1 -1
  25. package/dist/widgets/bar.js +1 -1
  26. package/dist/widgets/category.js +1 -1
  27. package/dist/widgets/formula.js +1 -1
  28. package/dist/widgets/histogram.js +1 -1
  29. package/dist/widgets/markdown.js +1 -1
  30. package/dist/widgets/pie.js +1 -1
  31. package/dist/widgets/scatterplot.js +1 -1
  32. package/dist/widgets/spread.js +1 -1
  33. package/dist/widgets/table.js +1 -1
  34. package/dist/widgets/timeseries.js +1 -1
  35. package/dist/widgets/utils.js +1 -1
  36. package/dist/widgets/wrapper.js +1 -1
  37. package/dist/widgets-v2/actions.js +1 -1
  38. package/dist/widgets-v2/bar.js +2 -2
  39. package/dist/widgets-v2/category.js +2 -2
  40. package/dist/widgets-v2/formula.js +1 -1
  41. package/dist/widgets-v2/histogram.js +2 -2
  42. package/dist/widgets-v2/markdown.js +1 -1
  43. package/dist/widgets-v2/pie.js +1 -1
  44. package/dist/widgets-v2/scatterplot.js +1 -1
  45. package/dist/widgets-v2/spread.js +2 -2
  46. package/dist/widgets-v2/table.js +3 -3
  47. package/dist/widgets-v2/timeseries.js +2 -2
  48. package/dist/widgets-v2/utils.js +1 -1
  49. package/dist/widgets-v2.js +5 -5
  50. package/package.json +1 -1
  51. package/src/components/index.ts +8 -0
  52. package/src/components/lasso-tool/const.tsx +1 -0
  53. package/src/components/lasso-tool/geometry-toolbar.test.tsx +138 -0
  54. package/src/components/lasso-tool/geometry-toolbar.tsx +258 -0
  55. package/src/components/lasso-tool/icons.tsx +40 -0
  56. package/src/components/lasso-tool/lasso-tool.tsx +25 -1
  57. package/src/components/lasso-tool/layer-filters.test.tsx +90 -0
  58. package/src/components/lasso-tool/layer-filters.tsx +236 -0
  59. package/src/components/lasso-tool/styles.ts +1 -1
  60. package/src/components/lasso-tool/types.ts +66 -1
  61. package/dist/lasso-tool-CDFj4zKY.js.map +0 -1
@@ -6,7 +6,7 @@ import { u as ne } from "../use-widget-selector-DFl2hW0R.js";
6
6
  import { FullscreenOutlined as je, Close as Ue, FileDownloadOutlined as Xe, PercentOutlined as Ye, SubdirectoryArrowLeftOutlined as Ke, ZoomInOutlined as qe, CheckBoxOutlined as Je, SearchOutlined as ze, ClearOutlined as Qe, HighlightAltOutlined as et } from "@mui/icons-material";
7
7
  import { useState as ie, useRef as le, useEffect as H, useSyncExternalStore as ve } from "react";
8
8
  import { a as Rn, d as Dn } from "../exports-Cr43OCul.js";
9
- import "../lasso-tool-CDFj4zKY.js";
9
+ import "../lasso-tool-YLFRgb-S.js";
10
10
  import "../cjs-D4KH3azB.js";
11
11
  import { T as re } from "../tooltip-BDnrRKrp.js";
12
12
  import "@carto/ps-utils";
@@ -6,7 +6,7 @@ import "../widget-store-Bw5zRUGg.js";
6
6
  import "zustand/shallow";
7
7
  import { g as w } from "../options-CthfUJDz.js";
8
8
  import { m as v } from "../utils-BOhInag6.js";
9
- import { c as L, f as S } from "../download-config-oJIFZ2WC.js";
9
+ import { c as L, f as S } from "../download-config-OKlLLSW_.js";
10
10
  import { i as _, f as C, g as M, n as u, a as A, c as I, d as N } from "../option-builders-DPeoyQaM.js";
11
11
  import { Box as l, Skeleton as o } from "@mui/material";
12
12
  import { b as T } from "../styles-cohnxh9F.js";
@@ -9,7 +9,7 @@ import "../widget-store-Bw5zRUGg.js";
9
9
  import "zustand/shallow";
10
10
  import "@mui/icons-material";
11
11
  import { d as U, a as N } from "../exports-Cr43OCul.js";
12
- import "../lasso-tool-CDFj4zKY.js";
12
+ import "../lasso-tool-YLFRgb-S.js";
13
13
  import "../cjs-D4KH3azB.js";
14
14
  import "@carto/ps-utils";
15
15
  import "@dnd-kit/core";
@@ -10,7 +10,7 @@ import "zustand/shallow";
10
10
  import "@mui/icons-material";
11
11
  import "react";
12
12
  import { d as h, a as S } from "../exports-Cr43OCul.js";
13
- import "../lasso-tool-CDFj4zKY.js";
13
+ import "../lasso-tool-YLFRgb-S.js";
14
14
  import "../cjs-D4KH3azB.js";
15
15
  import "@carto/ps-utils";
16
16
  import "@dnd-kit/core";
@@ -10,7 +10,7 @@ import { j as v, f as $, g as A, n as u, c as M, d as T } from "../option-builde
10
10
  import { Box as f, Skeleton as y } from "@mui/material";
11
11
  import "@mui/icons-material";
12
12
  import { d as h, a as d } from "../exports-Cr43OCul.js";
13
- import "../lasso-tool-CDFj4zKY.js";
13
+ import "../lasso-tool-YLFRgb-S.js";
14
14
  import "../cjs-D4KH3azB.js";
15
15
  import "@carto/ps-utils";
16
16
  import "@dnd-kit/core";
@@ -7,7 +7,7 @@ import "../widget-store-Bw5zRUGg.js";
7
7
  import "@mui/icons-material";
8
8
  import "react";
9
9
  import "html2canvas";
10
- import "../lasso-tool-CDFj4zKY.js";
10
+ import "../lasso-tool-YLFRgb-S.js";
11
11
  import "../cjs-D4KH3azB.js";
12
12
  import "@carto/ps-utils";
13
13
  import "@dnd-kit/core";
@@ -6,7 +6,7 @@ import "../widget-store-Bw5zRUGg.js";
6
6
  import "zustand/shallow";
7
7
  import { g as L } from "../options-CthfUJDz.js";
8
8
  import { m as N } from "../utils-BOhInag6.js";
9
- import { c as j, f as A } from "../download-config-oJIFZ2WC.js";
9
+ import { c as j, f as A } from "../download-config-OKlLLSW_.js";
10
10
  import { i as O, f as b, g as T, n as v, c as S, d as _ } from "../option-builders-DPeoyQaM.js";
11
11
  import { Box as h, Skeleton as f } from "@mui/material";
12
12
  import { b as z } from "../styles-cohnxh9F.js";
@@ -6,7 +6,7 @@ import "../widget-store-Bw5zRUGg.js";
6
6
  import "zustand/shallow";
7
7
  import { g as h } from "../options-CthfUJDz.js";
8
8
  import { m as S } from "../utils-BOhInag6.js";
9
- import { c as v, s as k } from "../download-config-oJIFZ2WC.js";
9
+ import { c as v, s as k } from "../download-config-OKlLLSW_.js";
10
10
  import { i as w, f as L, b as I, a as _, d as C } from "../option-builders-DPeoyQaM.js";
11
11
  import { Box as p, Skeleton as c } from "@mui/material";
12
12
  import { b as A } from "../styles-cohnxh9F.js";
@@ -10,7 +10,7 @@ import { R as b } from "../row-DZSP99LW.js";
10
10
  import "@mui/icons-material";
11
11
  import "react";
12
12
  import "html2canvas";
13
- import "../lasso-tool-CDFj4zKY.js";
13
+ import "../lasso-tool-YLFRgb-S.js";
14
14
  import "../cjs-D4KH3azB.js";
15
15
  import "@carto/ps-utils";
16
16
  import "@dnd-kit/core";
@@ -13,7 +13,7 @@ import { u as B } from "../use-widget-selector-DFl2hW0R.js";
13
13
  import "zustand/shallow";
14
14
  import "@mui/icons-material";
15
15
  import { d as J, a as F } from "../exports-Cr43OCul.js";
16
- import "../lasso-tool-CDFj4zKY.js";
16
+ import "../lasso-tool-YLFRgb-S.js";
17
17
  import "../cjs-D4KH3azB.js";
18
18
  import "@carto/ps-utils";
19
19
  import "@dnd-kit/core";
@@ -6,7 +6,7 @@ import "../widget-store-Bw5zRUGg.js";
6
6
  import "zustand/shallow";
7
7
  import { g as b } from "../options-CthfUJDz.js";
8
8
  import { m as k } from "../utils-BOhInag6.js";
9
- import { c as v, f as w } from "../download-config-oJIFZ2WC.js";
9
+ import { c as v, f as w } from "../download-config-OKlLLSW_.js";
10
10
  import { i as L, f as C, b as I, a as S, c as _, d as A } from "../option-builders-DPeoyQaM.js";
11
11
  import { Box as l, Skeleton as r } from "@mui/material";
12
12
  import { b as j } from "../styles-cohnxh9F.js";
@@ -1,5 +1,5 @@
1
1
  import { d as i, a as n } from "../formatter-B9Bxn1k7.js";
2
- import { c as f, f as p, s as c } from "../download-config-oJIFZ2WC.js";
2
+ import { c as f, f as p, s as c } from "../download-config-OKlLLSW_.js";
3
3
  import { a as d, b as u, c as b, d as x, e as C, f as g, g as F, n as y } from "../option-builders-DPeoyQaM.js";
4
4
  import { b as S } from "../styles-cohnxh9F.js";
5
5
  function r({
@@ -3,7 +3,7 @@ import { c as w } from "react/compiler-runtime";
3
3
  import { Box as E, IconButton as _, MenuItem as W, ListItemIcon as $, ListItemText as B, Menu as L, Typography as N, LinearProgress as j, AccordionSummary as z, AccordionDetails as F, Accordion as Y } from "@mui/material";
4
4
  import { MoreVert as D } from "@mui/icons-material";
5
5
  import { useState as H, useLayoutEffect as G } from "react";
6
- import "../lasso-tool-CDFj4zKY.js";
6
+ import "../lasso-tool-YLFRgb-S.js";
7
7
  import "../cjs-D4KH3azB.js";
8
8
  import { S as U } from "../smart-tooltip-D4vwQpFf.js";
9
9
  import "@carto/ps-utils";
@@ -1,4 +1,4 @@
1
- import { B as L, C as o, D as e, a as A, b as E, c as r, d as t, e as S, f as _, g as T, h as l, i as D, j as d, F as n, L as c, R as O, S as g, k as B, l as C, m, n as F, Z as U, o as i, p as I, q as h, r as w, s as G, t as f, u as N, v as R } from "../change-column-DjjwoPt1.js";
1
+ import { B as L, C as o, D as e, a as A, b as E, c as r, d as t, e as S, f as _, g as T, h as l, i as D, j as d, F as n, L as c, R as O, S as g, k as B, l as C, m, n as F, Z as U, o as i, p as I, q as h, r as w, s as G, t as f, u as N, v as R } from "../change-column-CiVAjOUB.js";
2
2
  import { Z as u, a as x, c as M } from "../transforms-Cdx4fkU5.js";
3
3
  import { d as b, a as p, t as v, b as H } from "../exports-Cx-f6m6U.js";
4
4
  import { C as W, D as V, M as y, P as K, b as j } from "../png-item-9dNbB37T.js";
@@ -8,7 +8,7 @@ import "zustand/shallow";
8
8
  import "@mui/icons-material";
9
9
  import "react";
10
10
  import "html2canvas";
11
- import "../lasso-tool-CDFj4zKY.js";
11
+ import "../lasso-tool-YLFRgb-S.js";
12
12
  import "../cjs-D4KH3azB.js";
13
13
  import "@carto/ps-utils";
14
14
  import "@dnd-kit/core";
@@ -22,7 +22,7 @@ import "zustand/middleware";
22
22
  import "zustand/react/shallow";
23
23
  import { Z as O } from "../transforms-Cdx4fkU5.js";
24
24
  import { m as z, r as U } from "../resolve-theme-color-BdojIw0K.js";
25
- import { p as V } from "../data-zoom-layout-CkVnm6ej.js";
25
+ import { p as V } from "../data-zoom-layout-D_FYdnap.js";
26
26
  import { b as J } from "../png-item-9dNbB37T.js";
27
27
  import { b as K } from "../csv-item-hH_Gt7ur.js";
28
28
  function Q({
@@ -1,10 +1,10 @@
1
- import { C as N, a as P, b as $, c as z, d as G, e as L, f as M } from "../category-Dnd2_j0x.js";
1
+ import { C as N, a as P, b as $, c as z, d as G, e as L, f as M } from "../category-CGS_eHr4.js";
2
2
  import { jsx as m, jsxs as g } from "react/jsx-runtime";
3
3
  import { c as d } from "react/compiler-runtime";
4
4
  import { Box as c, Skeleton as p } from "@mui/material";
5
5
  import "react";
6
6
  import "@mui/icons-material";
7
- import "../lasso-tool-CDFj4zKY.js";
7
+ import "../lasso-tool-YLFRgb-S.js";
8
8
  import "../cjs-D4KH3azB.js";
9
9
  import "@carto/ps-utils";
10
10
  import "html2canvas";
@@ -5,7 +5,7 @@ import { c as l } from "react/compiler-runtime";
5
5
  import { Box as m, Skeleton as s } from "@mui/material";
6
6
  import "react";
7
7
  import "@mui/icons-material";
8
- import "../lasso-tool-CDFj4zKY.js";
8
+ import "../lasso-tool-YLFRgb-S.js";
9
9
  import "../cjs-D4KH3azB.js";
10
10
  import "@carto/ps-utils";
11
11
  import "html2canvas";
@@ -8,7 +8,7 @@ import "zustand/shallow";
8
8
  import "@mui/icons-material";
9
9
  import "react";
10
10
  import "html2canvas";
11
- import "../lasso-tool-CDFj4zKY.js";
11
+ import "../lasso-tool-YLFRgb-S.js";
12
12
  import "../cjs-D4KH3azB.js";
13
13
  import "@carto/ps-utils";
14
14
  import "@dnd-kit/core";
@@ -22,7 +22,7 @@ import "zustand/middleware";
22
22
  import "zustand/react/shallow";
23
23
  import { Z as _ } from "../transforms-Cdx4fkU5.js";
24
24
  import { m as V, r as J } from "../resolve-theme-color-BdojIw0K.js";
25
- import { p as K } from "../data-zoom-layout-CkVnm6ej.js";
25
+ import { p as K } from "../data-zoom-layout-D_FYdnap.js";
26
26
  import { b as Q } from "../png-item-9dNbB37T.js";
27
27
  import { b as X } from "../csv-item-hH_Gt7ur.js";
28
28
  function tt({
@@ -4,7 +4,7 @@ import { c as s } from "react/compiler-runtime";
4
4
  import { Box as c, Skeleton as p } from "@mui/material";
5
5
  import "react";
6
6
  import "@mui/icons-material";
7
- import "../lasso-tool-CDFj4zKY.js";
7
+ import "../lasso-tool-YLFRgb-S.js";
8
8
  import "../cjs-D4KH3azB.js";
9
9
  import "@carto/ps-utils";
10
10
  import "html2canvas";
@@ -8,7 +8,7 @@ import "zustand/shallow";
8
8
  import "@mui/icons-material";
9
9
  import "react";
10
10
  import "html2canvas";
11
- import "../lasso-tool-CDFj4zKY.js";
11
+ import "../lasso-tool-YLFRgb-S.js";
12
12
  import "../cjs-D4KH3azB.js";
13
13
  import "@carto/ps-utils";
14
14
  import "@dnd-kit/core";
@@ -8,7 +8,7 @@ import "zustand/shallow";
8
8
  import "@mui/icons-material";
9
9
  import "react";
10
10
  import "html2canvas";
11
- import "../lasso-tool-CDFj4zKY.js";
11
+ import "../lasso-tool-YLFRgb-S.js";
12
12
  import "../cjs-D4KH3azB.js";
13
13
  import "@carto/ps-utils";
14
14
  import "@dnd-kit/core";
@@ -1,10 +1,10 @@
1
- import { S as R, a as B, b as P } from "../spread-DYNpzgh_.js";
1
+ import { S as R, a as B, b as P } from "../spread-4MYPOntd.js";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
3
  import { c as m } from "react/compiler-runtime";
4
4
  import { Box as p, Skeleton as l } from "@mui/material";
5
5
  import "react";
6
6
  import "@mui/icons-material";
7
- import "../lasso-tool-CDFj4zKY.js";
7
+ import "../lasso-tool-YLFRgb-S.js";
8
8
  import "../cjs-D4KH3azB.js";
9
9
  import "@carto/ps-utils";
10
10
  import "html2canvas";
@@ -1,11 +1,11 @@
1
- import { s, t as g } from "../table-B3ZWWhJt.js";
2
- import { D as q, a as J, b as K, T as M, c as Q, d as W, e as X, p as Y, r as ee, f as te } from "../table-B3ZWWhJt.js";
1
+ import { s, t as g } from "../table-CTcLOycx.js";
2
+ import { D as q, a as J, b as K, T as M, c as Q, d as W, e as X, p as Y, r as ee, f as te } from "../table-CTcLOycx.js";
3
3
  import { jsx as a, jsxs as _ } from "react/jsx-runtime";
4
4
  import { c as E } from "react/compiler-runtime";
5
5
  import { TableHead as w, TableRow as h, TableBody as x, TableCell as u, Skeleton as b, Box as A, Table as C } from "@mui/material";
6
6
  import "react";
7
7
  import "@mui/icons-material";
8
- import "../lasso-tool-CDFj4zKY.js";
8
+ import "../lasso-tool-YLFRgb-S.js";
9
9
  import "../cjs-D4KH3azB.js";
10
10
  import "@carto/ps-utils";
11
11
  import "html2canvas";
@@ -8,7 +8,7 @@ import "zustand/shallow";
8
8
  import "@mui/icons-material";
9
9
  import "react";
10
10
  import "html2canvas";
11
- import "../lasso-tool-CDFj4zKY.js";
11
+ import "../lasso-tool-YLFRgb-S.js";
12
12
  import "../cjs-D4KH3azB.js";
13
13
  import "@carto/ps-utils";
14
14
  import "@dnd-kit/core";
@@ -22,7 +22,7 @@ import "zustand/middleware";
22
22
  import "zustand/react/shallow";
23
23
  import { Z as B } from "../transforms-Cdx4fkU5.js";
24
24
  import { m as V, r as W } from "../resolve-theme-color-BdojIw0K.js";
25
- import { p as J } from "../data-zoom-layout-CkVnm6ej.js";
25
+ import { p as J } from "../data-zoom-layout-D_FYdnap.js";
26
26
  import { b as Q } from "../png-item-9dNbB37T.js";
27
27
  import { b as X } from "../csv-item-hH_Gt7ur.js";
28
28
  function ee({
@@ -1,5 +1,5 @@
1
1
  import { m as r, r as m } from "../resolve-theme-color-BdojIw0K.js";
2
- import { p as a } from "../data-zoom-layout-CkVnm6ej.js";
2
+ import { p as a } from "../data-zoom-layout-D_FYdnap.js";
3
3
  export {
4
4
  r as mergeOptions,
5
5
  a as positionDataZoomForLegend,
@@ -9,21 +9,21 @@ import { ExpandMore as ze, Close as He } from "@mui/icons-material";
9
9
  import { S as Ve } from "./smart-tooltip-D4vwQpFf.js";
10
10
  import { createPortal as Ge } from "react-dom";
11
11
  import { WidgetOptions as qe } from "@carto/meridian-ds/custom-icons";
12
- import "./lasso-tool-CDFj4zKY.js";
12
+ import "./lasso-tool-YLFRgb-S.js";
13
13
  import "./cjs-D4KH3azB.js";
14
14
  import { T as Xe } from "./tooltip-BDnrRKrp.js";
15
15
  import "@carto/ps-utils";
16
16
  import { o as Ze, a as Ke, E as Ye } from "./echart-Bdvbfx9s.js";
17
17
  import { D as Wn } from "./echart-Bdvbfx9s.js";
18
18
  import { a as Je, b as Qe, M as et } from "./markdown-BD1jcknS.js";
19
- import { C as tt, L as nt, F as ot, j as rt, R as it, B as lt, Z as st, m as at, n as ct, l as dt, k as ft } from "./change-column-DjjwoPt1.js";
19
+ import { C as tt, L as nt, F as ot, j as rt, R as it, B as lt, Z as st, m as at, n as ct, l as dt, k as ft } from "./change-column-CiVAjOUB.js";
20
20
  import "html2canvas";
21
21
  import { a as pt, F as mt } from "./formula-DuC0NQLH.js";
22
22
  import "react-markdown";
23
- import { b as ut, a as gt } from "./spread-DYNpzgh_.js";
23
+ import { b as ut, a as gt } from "./spread-4MYPOntd.js";
24
24
  import { a as ht, R as yt } from "./range-l4fNHLEg.js";
25
- import { f as xt, C as bt } from "./category-Dnd2_j0x.js";
26
- import { c as vt, T as St } from "./table-B3ZWWhJt.js";
25
+ import { f as xt, C as bt } from "./category-CGS_eHr4.js";
26
+ import { c as vt, T as St } from "./table-CTcLOycx.js";
27
27
  function wt(t) {
28
28
  const e = T(31), {
29
29
  id: n,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-ui",
3
- "version": "4.13.0",
3
+ "version": "4.14.0",
4
4
  "description": "CARTO's Professional Service React Material library",
5
5
  "type": "module",
6
6
  "devDependencies": {
@@ -24,9 +24,15 @@ export type {
24
24
  export type {
25
25
  LassoToolsComponentProps,
26
26
  LassoToolsInlineComponentProps,
27
+ LassoGeometryToolbarUIProps,
28
+ LassoGeometryType,
29
+ LassoLayerFiltersUIProps,
30
+ LassoLayerFilterItem,
27
31
  } from './lasso-tool/types'
28
32
  export { LassoToolsUI } from './lasso-tool/lasso-tool'
29
33
  export { LassoToolsInlineUI } from './lasso-tool/lasso-tool-inline'
34
+ export { LassoGeometryToolbarUI } from './lasso-tool/geometry-toolbar'
35
+ export { LassoLayerFiltersUI } from './lasso-tool/layer-filters'
30
36
  export {
31
37
  DEFAULT_LASSO_TOOLS_MODES_MAPPING,
32
38
  LASSO_TOOLS_LABELS,
@@ -37,6 +43,8 @@ export {
37
43
  DrawPolygonIcon,
38
44
  DrawSquareIcon,
39
45
  SelectToolIcon,
46
+ SpatialMaskIcon,
47
+ TextAaIcon,
40
48
  } from './lasso-tool/icons'
41
49
 
42
50
  export type { MeasurementToolsComponentProps } from './measurement-tools/types'
@@ -35,6 +35,7 @@ export const LASSO_TOOLS_LABELS: NonNullable<
35
35
  edit: 'Edit feature',
36
36
  },
37
37
  },
38
+ layerFilters: 'Layer filters',
38
39
  },
39
40
  noData: {
40
41
  title: 'Spatial filter not applied',
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Tests for LassoGeometryToolbarUI — type toggle, rename popover (Enter/blur
3
+ * commit, no-op on empty/unchanged), lock toggle, delete, and the locked
4
+ * read-only behavior (every action but unlock disabled).
5
+ */
6
+ import { describe, it, expect, vi } from 'vitest'
7
+ import { render, fireEvent, screen } from '@testing-library/react'
8
+ import { LassoGeometryToolbarUI } from './geometry-toolbar'
9
+
10
+ function setup(
11
+ props: Partial<Parameters<typeof LassoGeometryToolbarUI>[0]> = {},
12
+ ) {
13
+ const handlers = {
14
+ onToggleType: vi.fn(),
15
+ onRename: vi.fn(),
16
+ onToggleLock: vi.fn(),
17
+ onDelete: vi.fn(),
18
+ }
19
+ render(
20
+ <LassoGeometryToolbarUI
21
+ type='mask'
22
+ label='Mask 1'
23
+ {...handlers}
24
+ {...props}
25
+ />,
26
+ )
27
+ return handlers
28
+ }
29
+
30
+ describe('LassoGeometryToolbarUI', () => {
31
+ it('toggles mask -> draw', () => {
32
+ const { onToggleType } = setup({ type: 'mask' })
33
+ fireEvent.click(screen.getByRole('button', { name: 'Switch to drawing' }))
34
+ expect(onToggleType).toHaveBeenCalledWith('draw')
35
+ })
36
+
37
+ it('toggles draw -> mask', () => {
38
+ const { onToggleType } = setup({ type: 'draw' })
39
+ fireEvent.click(screen.getByRole('button', { name: 'Switch to mask' }))
40
+ expect(onToggleType).toHaveBeenCalledWith('mask')
41
+ })
42
+
43
+ it('marks the mask button pressed when type is mask', () => {
44
+ setup({ type: 'mask' })
45
+ expect(
46
+ screen
47
+ .getByRole('button', { name: 'Switch to drawing' })
48
+ .getAttribute('aria-pressed'),
49
+ ).toBe('true')
50
+ })
51
+
52
+ it('marks the mask button not-pressed when type is draw', () => {
53
+ setup({ type: 'draw' })
54
+ expect(
55
+ screen
56
+ .getByRole('button', { name: 'Switch to mask' })
57
+ .getAttribute('aria-pressed'),
58
+ ).toBe('false')
59
+ })
60
+
61
+ it('marks the lock button pressed when locked', () => {
62
+ setup({ locked: true })
63
+ expect(
64
+ screen
65
+ .getByRole('button', { name: 'Unlock' })
66
+ .getAttribute('aria-pressed'),
67
+ ).toBe('true')
68
+ })
69
+
70
+ it('commits a new label on Enter', () => {
71
+ const { onRename } = setup({ label: 'Mask 1' })
72
+ fireEvent.click(screen.getByRole('button', { name: 'Rename' }))
73
+ const input = screen.getByRole('textbox')
74
+ fireEvent.change(input, { target: { value: 'Downtown' } })
75
+ fireEvent.keyDown(input, { key: 'Enter' })
76
+ expect(onRename).toHaveBeenCalledWith('Downtown')
77
+ })
78
+
79
+ it('does not call onRename when the label is unchanged', () => {
80
+ const { onRename } = setup({ label: 'Mask 1' })
81
+ fireEvent.click(screen.getByRole('button', { name: 'Rename' }))
82
+ const input = screen.getByRole('textbox')
83
+ fireEvent.keyDown(input, { key: 'Enter' })
84
+ expect(onRename).not.toHaveBeenCalled()
85
+ })
86
+
87
+ it('commits the rename only once (blur after Enter does not double-fire)', () => {
88
+ const { onRename } = setup({ label: 'Mask 1' })
89
+ fireEvent.click(screen.getByRole('button', { name: 'Rename' }))
90
+ const input = screen.getByRole('textbox')
91
+ fireEvent.change(input, { target: { value: 'Downtown' } })
92
+ fireEvent.keyDown(input, { key: 'Enter' })
93
+ fireEvent.blur(input)
94
+ expect(onRename).toHaveBeenCalledTimes(1)
95
+ })
96
+
97
+ it('discards the rename on Escape (does not call onRename)', () => {
98
+ const { onRename } = setup({ label: 'Mask 1' })
99
+ fireEvent.click(screen.getByRole('button', { name: 'Rename' }))
100
+ const input = screen.getByRole('textbox')
101
+ fireEvent.change(input, { target: { value: 'Downtown' } })
102
+ fireEvent.keyDown(input, { key: 'Escape' })
103
+ fireEvent.blur(input)
104
+ expect(onRename).not.toHaveBeenCalled()
105
+ })
106
+
107
+ it('locks an unlocked geometry', () => {
108
+ const { onToggleLock } = setup({ locked: false })
109
+ fireEvent.click(screen.getByRole('button', { name: 'Lock' }))
110
+ expect(onToggleLock).toHaveBeenCalledWith(true)
111
+ })
112
+
113
+ it('unlocks a locked geometry', () => {
114
+ const { onToggleLock } = setup({ locked: true })
115
+ fireEvent.click(screen.getByRole('button', { name: 'Unlock' }))
116
+ expect(onToggleLock).toHaveBeenCalledWith(false)
117
+ })
118
+
119
+ it('deletes the geometry', () => {
120
+ const { onDelete } = setup()
121
+ fireEvent.click(screen.getByRole('button', { name: 'Delete' }))
122
+ expect(onDelete).toHaveBeenCalledTimes(1)
123
+ })
124
+
125
+ it('disables every action but unlock when locked', () => {
126
+ const handlers = setup({ locked: true })
127
+ const disabled = (name: string) =>
128
+ screen.getByRole('button', { name }).hasAttribute('disabled')
129
+ expect(disabled('Switch to drawing')).toBe(true)
130
+ expect(disabled('Rename')).toBe(true)
131
+ expect(disabled('Delete')).toBe(true)
132
+ // Unlock stays enabled.
133
+ const unlock = screen.getByRole('button', { name: 'Unlock' })
134
+ expect(unlock.hasAttribute('disabled')).toBe(false)
135
+ fireEvent.click(unlock)
136
+ expect(handlers.onToggleLock).toHaveBeenCalledWith(false)
137
+ })
138
+ })