@carto/ps-react-ui 4.12.2 → 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.
- package/dist/{category-Dnd2_j0x.js → category-CGS_eHr4.js} +2 -2
- package/dist/{category-Dnd2_j0x.js.map → category-CGS_eHr4.js.map} +1 -1
- package/dist/{change-column-DjjwoPt1.js → change-column-CiVAjOUB.js} +2 -2
- package/dist/{change-column-DjjwoPt1.js.map → change-column-CiVAjOUB.js.map} +1 -1
- package/dist/components.js +1232 -777
- package/dist/components.js.map +1 -1
- package/dist/{data-zoom-layout-CkVnm6ej.js → data-zoom-layout-D_FYdnap.js} +2 -2
- package/dist/{data-zoom-layout-CkVnm6ej.js.map → data-zoom-layout-D_FYdnap.js.map} +1 -1
- package/dist/{download-config-oJIFZ2WC.js → download-config-OKlLLSW_.js} +2 -2
- package/dist/{download-config-oJIFZ2WC.js.map → download-config-OKlLLSW_.js.map} +1 -1
- package/dist/{lasso-tool-CDFj4zKY.js → lasso-tool-YLFRgb-S.js} +182 -154
- package/dist/lasso-tool-YLFRgb-S.js.map +1 -0
- package/dist/legend/stores.js +20 -0
- package/dist/legend/stores.js.map +1 -0
- package/dist/legend.js +1536 -0
- package/dist/legend.js.map +1 -0
- package/dist/selectors-DwHj6mE2.js +388 -0
- package/dist/selectors-DwHj6mE2.js.map +1 -0
- package/dist/{spread-DYNpzgh_.js → spread-4MYPOntd.js} +2 -2
- package/dist/{spread-DYNpzgh_.js.map → spread-4MYPOntd.js.map} +1 -1
- package/dist/{table-B3ZWWhJt.js → table-CTcLOycx.js} +2 -2
- package/dist/{table-B3ZWWhJt.js.map → table-CTcLOycx.js.map} +1 -1
- package/dist/types/components/index.d.ts +5 -2
- package/dist/types/components/lasso-tool/geometry-toolbar.d.ts +13 -0
- package/dist/types/components/lasso-tool/icons.d.ts +6 -0
- package/dist/types/components/lasso-tool/lasso-tool.d.ts +1 -1
- package/dist/types/components/lasso-tool/layer-filters.d.ts +10 -0
- package/dist/types/components/lasso-tool/styles.d.ts +1 -1
- package/dist/types/components/lasso-tool/types.d.ts +62 -1
- package/dist/types/components/responsive-drawer/responsive-drawer.d.ts +35 -3
- package/dist/types/legend/components/contexts.d.ts +20 -0
- package/dist/types/legend/components/icons.d.ts +12 -0
- package/dist/types/legend/components/index.d.ts +26 -0
- package/dist/types/legend/components/legend-actions/legend-actions.d.ts +24 -0
- package/dist/types/legend/components/legend-actions/styles.d.ts +7 -0
- package/dist/types/legend/components/legend-category/legend-category-ui.d.ts +13 -0
- package/dist/types/legend/components/legend-category/styles.d.ts +52 -0
- package/dist/types/legend/components/legend-config-select/legend-config-select.d.ts +14 -0
- package/dist/types/legend/components/legend-config-select/styles.d.ts +44 -0
- package/dist/types/legend/components/legend-group/legend-group.d.ts +21 -0
- package/dist/types/legend/components/legend-group/styles.d.ts +63 -0
- package/dist/types/legend/components/legend-icon/legend-icon-ui.d.ts +10 -0
- package/dist/types/legend/components/legend-icon/styles.d.ts +52 -0
- package/dist/types/legend/components/legend-item/legend-item-ui.d.ts +14 -0
- package/dist/types/legend/components/legend-item/legend-item.d.ts +10 -0
- package/dist/types/legend/components/legend-item/styles.d.ts +7 -0
- package/dist/types/legend/components/legend-opacity/legend-opacity.d.ts +32 -0
- package/dist/types/legend/components/legend-opacity/styles.d.ts +23 -0
- package/dist/types/legend/components/legend-proportion/legend-proportion-ui.d.ts +16 -0
- package/dist/types/legend/components/legend-proportion/styles.d.ts +37 -0
- package/dist/types/legend/components/legend-ramp/legend-ramp-ui.d.ts +20 -0
- package/dist/types/legend/components/legend-ramp/styles.d.ts +53 -0
- package/dist/types/legend/components/legend-row/legend-row.d.ts +23 -0
- package/dist/types/legend/components/legend-row/styles.d.ts +77 -0
- package/dist/types/legend/components/legend-row-menu/legend-row-menu.d.ts +18 -0
- package/dist/types/legend/components/legend-row-menu/legend-zoom-to.d.ts +15 -0
- package/dist/types/legend/components/legend-swatch/legend-swatch.d.ts +26 -0
- package/dist/types/legend/components/legend-visibility-toggle/legend-visibility-toggle.d.ts +35 -0
- package/dist/types/legend/index.d.ts +88 -0
- package/dist/types/legend/provider/index.d.ts +6 -0
- package/dist/types/legend/provider/labels.d.ts +27 -0
- package/dist/types/legend/provider/legend-config-context.d.ts +7 -0
- package/dist/types/legend/provider/legend-provider.d.ts +38 -0
- package/dist/types/legend/stores/index.d.ts +5 -0
- package/dist/types/legend/stores/legend-context.d.ts +4 -0
- package/dist/types/legend/stores/legend-store-registry.d.ts +39 -0
- package/dist/types/legend/stores/legend-store.test.d.ts +1 -0
- package/dist/types/legend/stores/selectors.d.ts +33 -0
- package/dist/types/legend/stores/types.d.ts +275 -0
- package/dist/widgets/actions.js +1 -1
- package/dist/widgets/bar.js +1 -1
- package/dist/widgets/category.js +1 -1
- package/dist/widgets/formula.js +1 -1
- package/dist/widgets/histogram.js +1 -1
- package/dist/widgets/markdown.js +1 -1
- package/dist/widgets/pie.js +1 -1
- package/dist/widgets/scatterplot.js +1 -1
- package/dist/widgets/spread.js +1 -1
- package/dist/widgets/table.js +1 -1
- package/dist/widgets/timeseries.js +1 -1
- package/dist/widgets/utils.js +1 -1
- package/dist/widgets/wrapper.js +1 -1
- package/dist/widgets-v2/actions.js +1 -1
- package/dist/widgets-v2/bar.js +2 -2
- package/dist/widgets-v2/category.js +2 -2
- package/dist/widgets-v2/formula.js +1 -1
- package/dist/widgets-v2/histogram.js +2 -2
- package/dist/widgets-v2/markdown.js +1 -1
- package/dist/widgets-v2/pie.js +1 -1
- package/dist/widgets-v2/scatterplot.js +1 -1
- package/dist/widgets-v2/spread.js +2 -2
- package/dist/widgets-v2/table.js +3 -3
- package/dist/widgets-v2/timeseries.js +2 -2
- package/dist/widgets-v2/utils.js +1 -1
- package/dist/widgets-v2.js +5 -5
- package/package.json +11 -3
- package/src/components/geolocation-controls/geolocation-controls.test.tsx +15 -0
- package/src/components/geolocation-controls/geolocation-controls.tsx +19 -3
- package/src/components/index.ts +10 -0
- package/src/components/lasso-tool/const.tsx +1 -0
- package/src/components/lasso-tool/geometry-toolbar.test.tsx +138 -0
- package/src/components/lasso-tool/geometry-toolbar.tsx +258 -0
- package/src/components/lasso-tool/icons.tsx +40 -0
- package/src/components/lasso-tool/lasso-tool.tsx +25 -1
- package/src/components/lasso-tool/layer-filters.test.tsx +90 -0
- package/src/components/lasso-tool/layer-filters.tsx +236 -0
- package/src/components/lasso-tool/styles.ts +1 -1
- package/src/components/lasso-tool/types.ts +66 -1
- package/src/components/responsive-drawer/responsive-drawer.test.tsx +129 -25
- package/src/components/responsive-drawer/responsive-drawer.tsx +149 -16
- package/src/legend/components/contexts.ts +32 -0
- package/src/legend/components/icons.tsx +22 -0
- package/src/legend/components/index.ts +39 -0
- package/src/legend/components/legend-actions/legend-actions.tsx +57 -0
- package/src/legend/components/legend-actions/styles.ts +9 -0
- package/src/legend/components/legend-category/legend-category-ui.tsx +91 -0
- package/src/legend/components/legend-category/styles.ts +61 -0
- package/src/legend/components/legend-config-select/legend-config-select.tsx +96 -0
- package/src/legend/components/legend-config-select/styles.ts +48 -0
- package/src/legend/components/legend-group/legend-group.test.tsx +115 -0
- package/src/legend/components/legend-group/legend-group.tsx +88 -0
- package/src/legend/components/legend-group/styles.ts +82 -0
- package/src/legend/components/legend-icon/legend-icon-ui.tsx +56 -0
- package/src/legend/components/legend-icon/styles.ts +56 -0
- package/src/legend/components/legend-item/legend-item-ui.test.tsx +362 -0
- package/src/legend/components/legend-item/legend-item-ui.tsx +43 -0
- package/src/legend/components/legend-item/legend-item.tsx +34 -0
- package/src/legend/components/legend-item/styles.ts +11 -0
- package/src/legend/components/legend-opacity/legend-opacity.tsx +179 -0
- package/src/legend/components/legend-opacity/styles.ts +28 -0
- package/src/legend/components/legend-proportion/legend-proportion-ui.tsx +122 -0
- package/src/legend/components/legend-proportion/styles.ts +43 -0
- package/src/legend/components/legend-ramp/legend-ramp-ui.tsx +159 -0
- package/src/legend/components/legend-ramp/styles.ts +62 -0
- package/src/legend/components/legend-row/legend-row.test.tsx +498 -0
- package/src/legend/components/legend-row/legend-row.tsx +129 -0
- package/src/legend/components/legend-row/styles.ts +111 -0
- package/src/legend/components/legend-row-menu/legend-row-menu.tsx +68 -0
- package/src/legend/components/legend-row-menu/legend-zoom-to.tsx +35 -0
- package/src/legend/components/legend-swatch/legend-swatch.test.tsx +109 -0
- package/src/legend/components/legend-swatch/legend-swatch.tsx +237 -0
- package/src/legend/components/legend-visibility-toggle/legend-visibility-toggle.tsx +127 -0
- package/src/legend/index.ts +121 -0
- package/src/legend/provider/index.ts +6 -0
- package/src/legend/provider/labels.ts +59 -0
- package/src/legend/provider/legend-config-context.ts +15 -0
- package/src/legend/provider/legend-provider.tsx +102 -0
- package/src/legend/stores/index.ts +46 -0
- package/src/legend/stores/legend-context.ts +17 -0
- package/src/legend/stores/legend-store-registry.ts +639 -0
- package/src/legend/stores/legend-store.test.ts +457 -0
- package/src/legend/stores/selectors.ts +65 -0
- package/src/legend/stores/types.ts +347 -0
- package/dist/lasso-tool-CDFj4zKY.js.map +0 -1
package/dist/widgets/utils.js
CHANGED
|
@@ -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-
|
|
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({
|
package/dist/widgets/wrapper.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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";
|
package/dist/widgets-v2/bar.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
7
|
+
import "../lasso-tool-YLFRgb-S.js";
|
|
8
8
|
import "../cjs-D4KH3azB.js";
|
|
9
9
|
import "@carto/ps-utils";
|
|
10
10
|
import "html2canvas";
|
package/dist/widgets-v2/pie.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
7
|
+
import "../lasso-tool-YLFRgb-S.js";
|
|
8
8
|
import "../cjs-D4KH3azB.js";
|
|
9
9
|
import "@carto/ps-utils";
|
|
10
10
|
import "html2canvas";
|
package/dist/widgets-v2/table.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { s, t as g } from "../table-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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({
|
package/dist/widgets-v2/utils.js
CHANGED
package/dist/widgets-v2.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
26
|
-
import { c as vt, T as St } from "./table-
|
|
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.
|
|
3
|
+
"version": "4.14.0",
|
|
4
4
|
"description": "CARTO's Professional Service React Material library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devDependencies": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"@mui/x-date-pickers": "^7.0.0",
|
|
32
32
|
"echarts": "^6.0.0",
|
|
33
33
|
"html2canvas": "^1.4.1",
|
|
34
|
-
"react": "^
|
|
35
|
-
"react-dom": "^
|
|
34
|
+
"react": "^19.2.0",
|
|
35
|
+
"react-dom": "^19.2.0",
|
|
36
36
|
"react-markdown": "^10.0.0",
|
|
37
37
|
"zustand": "^5.0.0",
|
|
38
38
|
"@carto/ps-utils": "2.0.1"
|
|
@@ -46,6 +46,14 @@
|
|
|
46
46
|
"import": "./dist/components.js",
|
|
47
47
|
"types": "./dist/types/components/index.d.ts"
|
|
48
48
|
},
|
|
49
|
+
"./legend": {
|
|
50
|
+
"import": "./dist/legend.js",
|
|
51
|
+
"types": "./dist/types/legend/index.d.ts"
|
|
52
|
+
},
|
|
53
|
+
"./legend/stores": {
|
|
54
|
+
"import": "./dist/legend/stores.js",
|
|
55
|
+
"types": "./dist/types/legend/stores/index.d.ts"
|
|
56
|
+
},
|
|
49
57
|
"./widgets/actions": {
|
|
50
58
|
"import": "./dist/widgets/actions.js",
|
|
51
59
|
"types": "./dist/types/widgets/actions/index.d.ts"
|
|
@@ -111,6 +111,21 @@ describe('GeolocationControls', () => {
|
|
|
111
111
|
expect(mockOnChange).toHaveBeenCalledWith(mockPosition.coords)
|
|
112
112
|
})
|
|
113
113
|
|
|
114
|
+
test('does not re-query permissions when only the onError identity changes', () => {
|
|
115
|
+
mockPermissions.query.mockResolvedValue(mockPermissions)
|
|
116
|
+
|
|
117
|
+
const { rerender } = render(
|
|
118
|
+
<GeolocationControls onChange={mockOnChange} onError={vi.fn()} />,
|
|
119
|
+
)
|
|
120
|
+
expect(mockPermissions.query).toHaveBeenCalledTimes(1)
|
|
121
|
+
|
|
122
|
+
// `onError` is read through an Effect Event, so the permission-query
|
|
123
|
+
// effect depends on `hasGeolocation` alone. A fresh callback identity
|
|
124
|
+
// must NOT re-run the query or re-register the permission listener.
|
|
125
|
+
rerender(<GeolocationControls onChange={mockOnChange} onError={vi.fn()} />)
|
|
126
|
+
expect(mockPermissions.query).toHaveBeenCalledTimes(1)
|
|
127
|
+
})
|
|
128
|
+
|
|
114
129
|
test('handles geolocation errors', () => {
|
|
115
130
|
mockPermissions.query.mockResolvedValue(mockPermissions)
|
|
116
131
|
|
|
@@ -4,7 +4,14 @@ import {
|
|
|
4
4
|
LocationDisabledOutlined,
|
|
5
5
|
} from '@mui/icons-material'
|
|
6
6
|
import type { GeolocationControlProps } from './types'
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
useCallback,
|
|
9
|
+
useEffect,
|
|
10
|
+
useEffectEvent,
|
|
11
|
+
useReducer,
|
|
12
|
+
useRef,
|
|
13
|
+
type JSX,
|
|
14
|
+
} from 'react'
|
|
8
15
|
import { ariaLabel, tooltipLabelsDefault } from './const'
|
|
9
16
|
import { Tooltip } from '../tooltip/tooltip'
|
|
10
17
|
|
|
@@ -36,6 +43,15 @@ export function GeolocationControls({
|
|
|
36
43
|
hasGeolocation,
|
|
37
44
|
)
|
|
38
45
|
|
|
46
|
+
// Read the latest `onError` without making the permission-query effect
|
|
47
|
+
// re-run (and re-register the `result.onchange` permission listener)
|
|
48
|
+
// whenever the consumer passes a fresh callback identity.
|
|
49
|
+
const notifyError = useEffectEvent(
|
|
50
|
+
(error: Parameters<PositionErrorCallback>[0]): void => {
|
|
51
|
+
onError?.(error)
|
|
52
|
+
},
|
|
53
|
+
)
|
|
54
|
+
|
|
39
55
|
useEffect(() => {
|
|
40
56
|
if (hasGeolocation) {
|
|
41
57
|
navigator.permissions
|
|
@@ -48,7 +64,7 @@ export function GeolocationControls({
|
|
|
48
64
|
})
|
|
49
65
|
.catch((error: Parameters<PositionErrorCallback>[0]) => {
|
|
50
66
|
dispatch('denied')
|
|
51
|
-
|
|
67
|
+
notifyError(error)
|
|
52
68
|
})
|
|
53
69
|
}
|
|
54
70
|
|
|
@@ -57,7 +73,7 @@ export function GeolocationControls({
|
|
|
57
73
|
navigator.geolocation.clearWatch(watchRef.current)
|
|
58
74
|
}
|
|
59
75
|
}
|
|
60
|
-
}, [hasGeolocation
|
|
76
|
+
}, [hasGeolocation])
|
|
61
77
|
|
|
62
78
|
const success = useCallback(
|
|
63
79
|
(position: Parameters<PositionCallback>[0]) => {
|
package/src/components/index.ts
CHANGED
|
@@ -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'
|
|
@@ -63,5 +71,7 @@ export type { BasemapsUIProps } from './basemaps/types'
|
|
|
63
71
|
export { Tooltip, setTooltipEnterDelay } from './tooltip/tooltip'
|
|
64
72
|
export { SmartTooltip } from './smart-tooltip/smart-tooltip'
|
|
65
73
|
|
|
74
|
+
export { ResponsiveDrawer } from './responsive-drawer/responsive-drawer'
|
|
75
|
+
|
|
66
76
|
export type { CopyButtonProps } from './copy-button/types'
|
|
67
77
|
export { CopyButton } from './copy-button/copy-button'
|
|
@@ -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
|
+
})
|