@ogc-maps/storybook-components 0.2.2 → 0.3.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/README.md +22 -48
- package/dist/ExportButton-D2xn4G74.js +77 -0
- package/dist/FeatureDetailPanel-DpcaTS9I.js +50 -0
- package/dist/FeatureTooltip-CM0ZTudi.js +45 -0
- package/dist/PropertyList-BH_DTkcU.js +32 -0
- package/dist/components/ExportButton/ExportButton.d.ts +14 -0
- package/dist/components/ExportButton/ExportButton.d.ts.map +1 -0
- package/dist/components/ExportButton/index.d.ts +3 -0
- package/dist/components/ExportButton/index.d.ts.map +1 -0
- package/dist/components/ExportButton/index.js +4 -0
- package/dist/components/FeatureDetailPanel/FeatureDetailPanel.d.ts +11 -0
- package/dist/components/FeatureDetailPanel/FeatureDetailPanel.d.ts.map +1 -0
- package/dist/components/FeatureDetailPanel/index.d.ts +3 -0
- package/dist/components/FeatureDetailPanel/index.d.ts.map +1 -0
- package/dist/components/FeatureDetailPanel/index.js +4 -0
- package/dist/components/FeatureTooltip/FeatureTooltip.d.ts +9 -0
- package/dist/components/FeatureTooltip/FeatureTooltip.d.ts.map +1 -0
- package/dist/components/FeatureTooltip/index.d.ts +3 -0
- package/dist/components/FeatureTooltip/index.d.ts.map +1 -0
- package/dist/components/FeatureTooltip/index.js +4 -0
- package/dist/components/_shared/PropertyList.d.ts +12 -0
- package/dist/components/_shared/PropertyList.d.ts.map +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +8 -7
- package/dist/hooks/useCsvExport.d.ts +13 -0
- package/dist/hooks/useCsvExport.d.ts.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +49 -40
- package/dist/schemas/config.d.ts +33 -0
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/index.js +77 -74
- package/dist/style.css +1 -0
- package/dist/useCsvExport-wr7hy0P-.js +101 -0
- package/dist/utils/csvExport.d.ts +9 -0
- package/dist/utils/csvExport.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +14 -1
- package/dist/useOgcFeatures-CmJxErv4.js +0 -44
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @ogc-maps/storybook-components
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A reusable, config-driven map component library built on OGC API standards. Designed for building interactive web maps with React, MapLibre GL JS, and `tipg`.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -20,69 +20,43 @@ npm install @ogc-maps/storybook-components
|
|
|
20
20
|
yarn add @ogc-maps/storybook-components
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Peer dependencies: `react`, `react-dom`, `react-icons`
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Import the library's CSS in your main entry point (e.g., `main.tsx` or `App.tsx`):
|
|
25
|
+
## Quick Start
|
|
28
26
|
|
|
29
27
|
```tsx
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
// 1. Import styles in your entry point (default styles use the mapui: prefix; you can override with your own Tailwind/CSS)
|
|
29
|
+
import '@ogc-maps/storybook-components/style.css';
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
// 2. Define and validate your config
|
|
32
|
+
import { safeValidateMapConfig } from '@ogc-maps/storybook-components/schemas';
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
const result = safeValidateMapConfig(myConfig);
|
|
35
|
+
if (!result.success) throw new Error('Invalid config');
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// 3. Render components with your state
|
|
38
38
|
import { LayerPanel } from '@ogc-maps/storybook-components/components/LayerPanel';
|
|
39
|
+
import { Legend } from '@ogc-maps/storybook-components/components/Legend';
|
|
39
40
|
|
|
40
|
-
function
|
|
41
|
-
const [activeLayers, setActiveLayers] = useState<string[]>(['my-layer-1']);
|
|
42
|
-
|
|
41
|
+
function MapUI({ layers, visibleIds, onToggle }) {
|
|
43
42
|
return (
|
|
44
|
-
|
|
45
|
-
<LayerPanel
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
onToggleVisibility={(layerId) => {
|
|
49
|
-
// toggle logic
|
|
50
|
-
}}
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
43
|
+
<>
|
|
44
|
+
<LayerPanel layers={layers} activeLayerIds={visibleIds} onToggleVisibility={onToggle} />
|
|
45
|
+
<Legend layers={layers} visibleLayerIds={visibleIds} />
|
|
46
|
+
</>
|
|
53
47
|
);
|
|
54
48
|
}
|
|
55
49
|
```
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Data fetching hooks for OGC API endpoints:
|
|
60
|
-
|
|
61
|
-
```tsx
|
|
62
|
-
import { useOgcFeatures } from '@ogc-maps/storybook-components/hooks';
|
|
63
|
-
|
|
64
|
-
function FeatureList() {
|
|
65
|
-
const { data, loading } = useOgcFeatures({
|
|
66
|
-
collectionId: 'public.my_collection',
|
|
67
|
-
limit: 10
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
if (loading) return <div>Loading...</div>;
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<ul>
|
|
74
|
-
{data.features.map(f => (
|
|
75
|
-
<li key={f.id}>{f.properties.name}</li>
|
|
76
|
-
))}
|
|
77
|
-
</ul>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
```
|
|
51
|
+
Default styles use the `mapui:` Tailwind prefix so they won't clash with your app's utility classes; override them with your own CSS or Tailwind as needed.
|
|
81
52
|
|
|
82
53
|
## Documentation
|
|
83
54
|
|
|
84
|
-
|
|
85
|
-
[
|
|
55
|
+
- [Getting Started](../../docs/GETTING-STARTED.md) — Installation, minimal config, first render
|
|
56
|
+
- [Configuration](../../docs/CONFIGURATION.md) — Full `MapConfig` schema reference
|
|
57
|
+
- [Components](../../docs/COMPONENTS.md) — All 9 component APIs with props tables and examples
|
|
58
|
+
- [Hooks & Utilities](../../docs/HOOKS.md) — OGC API hooks and utility functions
|
|
59
|
+
- [Publishing](../../docs/PUBLISHING.md) — Versioning and release guide
|
|
86
60
|
|
|
87
61
|
## License
|
|
88
62
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as p, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useRef as y, useEffect as E } from "react";
|
|
3
|
+
function H({
|
|
4
|
+
layers: i,
|
|
5
|
+
onExport: s,
|
|
6
|
+
loading: o = !1,
|
|
7
|
+
disabled: g = !1,
|
|
8
|
+
className: l = ""
|
|
9
|
+
}) {
|
|
10
|
+
const [n, u] = m(!1), [h, x] = m(!1), [w, v] = m(void 0), t = y(null);
|
|
11
|
+
E(() => {
|
|
12
|
+
if (!n) return;
|
|
13
|
+
if (t.current) {
|
|
14
|
+
const r = t.current.getBoundingClientRect(), d = r.bottom > window.innerHeight / 2;
|
|
15
|
+
x(d);
|
|
16
|
+
const b = 12;
|
|
17
|
+
v(d ? r.top - b : window.innerHeight - r.bottom - b);
|
|
18
|
+
}
|
|
19
|
+
function e(r) {
|
|
20
|
+
t.current && !t.current.contains(r.target) && u(!1);
|
|
21
|
+
}
|
|
22
|
+
return document.addEventListener("click", e), () => document.removeEventListener("click", e);
|
|
23
|
+
}, [n]);
|
|
24
|
+
const a = g || o || i.length === 0, c = [
|
|
25
|
+
"mapui:inline-flex mapui:items-center mapui:gap-1.5 mapui:rounded mapui:border mapui:border-gray-300",
|
|
26
|
+
"mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:text-gray-700 mapui:transition-colors",
|
|
27
|
+
a ? "mapui:cursor-not-allowed mapui:opacity-50" : "mapui:cursor-pointer hover:mapui:bg-gray-50 hover:mapui:border-gray-400"
|
|
28
|
+
].join(" ");
|
|
29
|
+
return i.length === 1 ? /* @__PURE__ */ p(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
className: `${c} ${l}`.trim(),
|
|
33
|
+
disabled: a,
|
|
34
|
+
onClick: () => !a && s(i[0]),
|
|
35
|
+
children: o ? "Exporting..." : `Export ${i[0].label}`
|
|
36
|
+
}
|
|
37
|
+
) : /* @__PURE__ */ f("div", { ref: t, className: `mapui:relative mapui:inline-block ${l}`.trim(), children: [
|
|
38
|
+
/* @__PURE__ */ f(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
className: c,
|
|
42
|
+
disabled: a,
|
|
43
|
+
onClick: () => !a && u((e) => !e),
|
|
44
|
+
"aria-haspopup": "listbox",
|
|
45
|
+
"aria-expanded": n,
|
|
46
|
+
children: [
|
|
47
|
+
o ? "Exporting..." : "Export",
|
|
48
|
+
!o && /* @__PURE__ */ p("span", { "aria-hidden": "true", className: "mapui:text-gray-400", children: "▾" })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
n && /* @__PURE__ */ p(
|
|
53
|
+
"ul",
|
|
54
|
+
{
|
|
55
|
+
role: "listbox",
|
|
56
|
+
className: `mapui:absolute mapui:left-0 mapui:z-10 mapui:min-w-[160px] mapui:overflow-y-auto mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:py-1 mapui:shadow-lg ${h ? "mapui:bottom-full mapui:mb-1" : "mapui:top-full mapui:mt-1"}`,
|
|
57
|
+
style: { maxHeight: w },
|
|
58
|
+
children: i.map((e) => /* @__PURE__ */ p(
|
|
59
|
+
"li",
|
|
60
|
+
{
|
|
61
|
+
role: "option",
|
|
62
|
+
"aria-selected": !1,
|
|
63
|
+
className: "mapui:cursor-pointer mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:text-gray-700 hover:mapui:bg-gray-100",
|
|
64
|
+
onClick: () => {
|
|
65
|
+
s(e), u(!1);
|
|
66
|
+
},
|
|
67
|
+
children: e.label
|
|
68
|
+
},
|
|
69
|
+
e.id
|
|
70
|
+
))
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
H as E
|
|
77
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { P as s } from "./PropertyList-BH_DTkcU.js";
|
|
3
|
+
function x({
|
|
4
|
+
isOpen: r,
|
|
5
|
+
onClose: m,
|
|
6
|
+
properties: i,
|
|
7
|
+
title: t = "Feature Properties",
|
|
8
|
+
fields: l,
|
|
9
|
+
variant: e = "panel",
|
|
10
|
+
className: o = ""
|
|
11
|
+
}) {
|
|
12
|
+
if (!r) return null;
|
|
13
|
+
const u = /* @__PURE__ */ p(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: [
|
|
17
|
+
"mapui:flex mapui:flex-col mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:shadow-md",
|
|
18
|
+
e === "modal" ? "mapui:max-h-[80vh] mapui:w-full mapui:max-w-lg" : "mapui:max-h-[calc(100vh-4rem)] mapui:w-72",
|
|
19
|
+
o
|
|
20
|
+
].filter(Boolean).join(" ").trim(),
|
|
21
|
+
onClick: e === "modal" ? (n) => n.stopPropagation() : void 0,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ p("div", { className: "mapui:flex mapui:shrink-0 mapui:items-center mapui:justify-between mapui:border-b mapui:border-gray-200 mapui:px-4 mapui:py-3", children: [
|
|
24
|
+
/* @__PURE__ */ a("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: t }),
|
|
25
|
+
/* @__PURE__ */ a(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
onClick: m,
|
|
29
|
+
className: "mapui:flex mapui:h-6 mapui:w-6 mapui:cursor-pointer mapui:items-center mapui:justify-center mapui:rounded mapui:border-0 mapui:bg-transparent mapui:text-lg mapui:leading-none mapui:text-gray-400 mapui:transition-colors hover:mapui:bg-gray-100 hover:mapui:text-gray-700",
|
|
30
|
+
"aria-label": "Close",
|
|
31
|
+
children: "×"
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ a("div", { className: "mapui:overflow-y-auto mapui:px-4 mapui:py-3", children: i && Object.keys(i).length > 0 ? /* @__PURE__ */ a(s, { properties: i, fields: l, density: "default" }) : /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-400", children: "No properties available." }) })
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
return e === "modal" ? /* @__PURE__ */ a(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: "mapui:fixed mapui:inset-0 mapui:z-50 mapui:flex mapui:items-center mapui:justify-center mapui:bg-black/40 mapui:p-4",
|
|
43
|
+
onClick: m,
|
|
44
|
+
children: u
|
|
45
|
+
}
|
|
46
|
+
) : u;
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
x as F
|
|
50
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as a, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { P as s } from "./PropertyList-BH_DTkcU.js";
|
|
3
|
+
function x({
|
|
4
|
+
title: p,
|
|
5
|
+
properties: m,
|
|
6
|
+
fields: t,
|
|
7
|
+
maxItems: i = 4,
|
|
8
|
+
className: u = ""
|
|
9
|
+
}) {
|
|
10
|
+
if (!m)
|
|
11
|
+
return /* @__PURE__ */ a(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: `mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-3 mapui:py-2 mapui:shadow-md ${u}`.trim(),
|
|
15
|
+
children: /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:text-gray-400", children: "No data" })
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
const r = t ?? Object.keys(m), o = r.length > i, d = r.length - i;
|
|
19
|
+
return /* @__PURE__ */ e(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: `mapui:min-w-[140px] mapui:max-w-[240px] mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-3 mapui:py-2 mapui:shadow-md ${u}`.trim(),
|
|
23
|
+
children: [
|
|
24
|
+
p && /* @__PURE__ */ a("p", { className: "mapui:mb-1.5 mapui:mt-0 mapui:text-xs mapui:font-semibold mapui:text-gray-700", children: p }),
|
|
25
|
+
/* @__PURE__ */ a(
|
|
26
|
+
s,
|
|
27
|
+
{
|
|
28
|
+
properties: m,
|
|
29
|
+
fields: t,
|
|
30
|
+
maxItems: i,
|
|
31
|
+
density: "compact"
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
o && /* @__PURE__ */ e("p", { className: "mapui:mb-0 mapui:mt-1 mapui:text-xs mapui:text-gray-400", children: [
|
|
35
|
+
"+",
|
|
36
|
+
d,
|
|
37
|
+
" more"
|
|
38
|
+
] })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
x as F
|
|
45
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as m, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
function t(i) {
|
|
3
|
+
return i == null ? "--" : typeof i == "boolean" ? i ? "Yes" : "No" : Array.isArray(i) ? i.map(t).join(", ") : typeof i == "object" ? JSON.stringify(i) : String(i);
|
|
4
|
+
}
|
|
5
|
+
function o({
|
|
6
|
+
properties: i,
|
|
7
|
+
fields: u,
|
|
8
|
+
maxItems: p,
|
|
9
|
+
density: c = "default",
|
|
10
|
+
className: e = ""
|
|
11
|
+
}) {
|
|
12
|
+
const n = u ?? Object.keys(i), s = p != null ? n.slice(0, p) : n;
|
|
13
|
+
return c === "compact" ? /* @__PURE__ */ m("dl", { className: `mapui:m-0 mapui:text-xs ${e}`.trim(), children: s.map((a) => /* @__PURE__ */ r("div", { className: "mapui:flex mapui:gap-1 mapui:py-0.5", children: [
|
|
14
|
+
/* @__PURE__ */ r("dt", { className: "mapui:shrink-0 mapui:font-medium mapui:text-gray-500", children: [
|
|
15
|
+
a,
|
|
16
|
+
":"
|
|
17
|
+
] }),
|
|
18
|
+
/* @__PURE__ */ m("dd", { className: "mapui:m-0 mapui:truncate mapui:text-gray-800", children: t(i[a]) })
|
|
19
|
+
] }, a)) }) : /* @__PURE__ */ m(
|
|
20
|
+
"dl",
|
|
21
|
+
{
|
|
22
|
+
className: `mapui:m-0 mapui:grid mapui:grid-cols-2 mapui:gap-x-4 mapui:gap-y-2 mapui:text-sm ${e}`.trim(),
|
|
23
|
+
children: s.map((a) => /* @__PURE__ */ r("div", { className: "mapui:contents", children: [
|
|
24
|
+
/* @__PURE__ */ m("dt", { className: "mapui:break-words mapui:font-medium mapui:text-gray-500", children: a }),
|
|
25
|
+
/* @__PURE__ */ m("dd", { className: "mapui:m-0 mapui:break-words mapui:text-gray-800", children: t(i[a]) })
|
|
26
|
+
] }, a))
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
o as P
|
|
32
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ExportableLayer {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
collection: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ExportButtonProps {
|
|
7
|
+
layers: ExportableLayer[];
|
|
8
|
+
onExport: (layer: ExportableLayer) => void;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function ExportButton({ layers, onExport, loading, disabled, className, }: ExportButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=ExportButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportButton.d.ts","sourceRoot":"","sources":["../../../src/components/ExportButton/ExportButton.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,QAAQ,EACR,OAAe,EACf,QAAgB,EAChB,SAAc,GACf,EAAE,iBAAiB,2CAsFnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ExportButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface FeatureDetailPanelProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
properties: Record<string, unknown> | null;
|
|
5
|
+
title?: string;
|
|
6
|
+
fields?: string[];
|
|
7
|
+
variant?: 'panel' | 'modal';
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function FeatureDetailPanel({ isOpen, onClose, properties, title, fields, variant, className, }: FeatureDetailPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
//# sourceMappingURL=FeatureDetailPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureDetailPanel.d.ts","sourceRoot":"","sources":["../../../src/components/FeatureDetailPanel/FeatureDetailPanel.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAA4B,EAC5B,MAAM,EACN,OAAiB,EACjB,SAAc,GACf,EAAE,uBAAuB,kDAmDzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FeatureDetailPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface FeatureTooltipProps {
|
|
2
|
+
title?: string;
|
|
3
|
+
properties: Record<string, unknown> | null;
|
|
4
|
+
fields?: string[];
|
|
5
|
+
maxItems?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function FeatureTooltip({ title, properties, fields, maxItems, className, }: FeatureTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=FeatureTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/FeatureTooltip/FeatureTooltip.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,UAAU,EACV,MAAM,EACN,QAAY,EACZ,SAAc,GACf,EAAE,mBAAmB,2CAmCrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FeatureTooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type PropertyListDensity = 'compact' | 'default';
|
|
2
|
+
interface PropertyListProps {
|
|
3
|
+
properties: Record<string, unknown>;
|
|
4
|
+
fields?: string[];
|
|
5
|
+
maxItems?: number;
|
|
6
|
+
density?: PropertyListDensity;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function formatPropertyValue(value: unknown): string;
|
|
10
|
+
export declare function PropertyList({ properties, fields, maxItems, density, className, }: PropertyListProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=PropertyList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyList.d.ts","sourceRoot":"","sources":["../../../src/components/_shared/PropertyList.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM1D;AAED,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,MAAM,EACN,QAAQ,EACR,OAAmB,EACnB,SAAc,GACf,EAAE,iBAAiB,2CAiCnB"}
|
|
@@ -4,6 +4,12 @@ export { CollapsibleControl } from './CollapsibleControl';
|
|
|
4
4
|
export type { CollapsibleControlProps } from './CollapsibleControl';
|
|
5
5
|
export { CoordinateDisplay, formatDecimal, formatDMS, } from './CoordinateDisplay';
|
|
6
6
|
export type { CoordinateDisplayProps, CoordinateFormatOption, } from './CoordinateDisplay';
|
|
7
|
+
export { ExportButton } from './ExportButton';
|
|
8
|
+
export type { ExportButtonProps, ExportableLayer } from './ExportButton';
|
|
9
|
+
export { FeatureDetailPanel } from './FeatureDetailPanel';
|
|
10
|
+
export type { FeatureDetailPanelProps } from './FeatureDetailPanel';
|
|
11
|
+
export { FeatureTooltip } from './FeatureTooltip';
|
|
12
|
+
export type { FeatureTooltipProps } from './FeatureTooltip';
|
|
7
13
|
export { LayerPanel } from './LayerPanel';
|
|
8
14
|
export type { LayerPanelProps } from './LayerPanel';
|
|
9
15
|
export { Legend } from './Legend';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SearchField } from '../types';
|
|
2
2
|
export { useOgcCollections, type UseOgcCollectionsResult } from './useOgcCollections';
|
|
3
3
|
export { useOgcFeatures, type UseOgcFeaturesResult } from './useOgcFeatures';
|
|
4
|
+
export { useCsvExport, type UseCsvExportOptions, type UseCsvExportResult } from './useCsvExport';
|
|
4
5
|
export type { OgcApiSource, LayerConfig, MapConfig, UIConfig, ViewConfig, StyleConfig, FilterConfig, LegendConfig, SearchConfig, SearchField, } from '../types';
|
|
5
6
|
export type SearchFieldType = SearchField['type'];
|
|
6
7
|
export { fetchCollections, fetchFeatures, fetchQueryables, getFilteredVectorTileUrl, getTileJsonUrl, getVectorTileUrl, type OgcCollection, type OgcCollectionsResponse, type GeoJsonFeature, type OgcFeatureCollection, type OgcQueryables, type QueryableProperty, type FetchFeaturesOptions, } from '../utils/ogcApi';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEjG,YAAY,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,UAAU,CAAC;AAClB,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,cAAc,EACd,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { u as t, a } from "../
|
|
2
|
-
import { f as
|
|
1
|
+
import { u as t, a, b as r } from "../useCsvExport-wr7hy0P-.js";
|
|
2
|
+
import { f as o, a as c, b as u, g as f, c as g, d as i } from "../ogcApi-BuXSs9i0.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
o as fetchCollections,
|
|
5
|
+
c as fetchFeatures,
|
|
6
|
+
u as fetchQueryables,
|
|
7
7
|
f as getFilteredVectorTileUrl,
|
|
8
8
|
g as getTileJsonUrl,
|
|
9
9
|
i as getVectorTileUrl,
|
|
10
|
-
t as
|
|
11
|
-
a as
|
|
10
|
+
t as useCsvExport,
|
|
11
|
+
a as useOgcCollections,
|
|
12
|
+
r as useOgcFeatures
|
|
12
13
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CsvExportOptions } from '../utils/csvExport';
|
|
2
|
+
export interface UseCsvExportOptions {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
limit?: number;
|
|
5
|
+
csvOptions?: CsvExportOptions;
|
|
6
|
+
}
|
|
7
|
+
export interface UseCsvExportResult {
|
|
8
|
+
exportCsv: (collectionId: string, filename?: string) => Promise<void>;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
error: Error | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function useCsvExport({ baseUrl, limit, csvOptions, }: UseCsvExportOptions): UseCsvExportResult;
|
|
13
|
+
//# sourceMappingURL=useCsvExport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCsvExport.d.ts","sourceRoot":"","sources":["../../src/hooks/useCsvExport.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEvF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,KAAY,EACZ,UAAU,GACX,EAAE,mBAAmB,GAAG,kBAAkB,CA2C1C"}
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,CAAC;AAGzB,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC"}
|
package/dist/main.js
CHANGED
|
@@ -1,47 +1,56 @@
|
|
|
1
1
|
import { B as o } from "./BasemapSwitcher-BW7lyZ2Y.js";
|
|
2
2
|
import { C as t } from "./CollapsibleControl-Dz11KBrL.js";
|
|
3
|
-
import { C as i, f as l, a as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { C as i, f as l, a as c } from "./CoordinateDisplay-PxPmVjpm.js";
|
|
4
|
+
import { E as f } from "./ExportButton-D2xn4G74.js";
|
|
5
|
+
import { F as S } from "./FeatureDetailPanel-DpcaTS9I.js";
|
|
6
|
+
import { F as p } from "./FeatureTooltip-CM0ZTudi.js";
|
|
7
|
+
import { L as g } from "./LayerPanel-K00X2QUj.js";
|
|
8
|
+
import { L as d } from "./Legend-D4cc1JzQ.js";
|
|
9
|
+
import { S as F } from "./SearchPanel-CFVQV6JJ.js";
|
|
10
|
+
import { d as L, f as P, u as T, a as b, b as v } from "./useCsvExport-wr7hy0P-.js";
|
|
11
|
+
import { f as D, a as E, b as M, g as U, c as V, d as w } from "./ogcApi-BuXSs9i0.js";
|
|
12
|
+
import { BasemapConfigSchema as A, CirclePaintSchema as I, CircleStyleSchema as J, FillPaintSchema as Q, FillStyleSchema as j, FilterConfigSchema as k, LayerConfigSchema as q, LegendConfigSchema as z, LegendEntrySchema as G, LinePaintSchema as H, LineStyleSchema as K, MapConfigSchema as N, OgcApiSourceSchema as R, SearchConfigSchema as W, SearchFieldSchema as X, StyleConfigSchema as Y, UIConfigSchema as Z, ViewConfigSchema as _, safeValidateMapConfig as $, validateMapConfig as ee } from "./schemas/index.js";
|
|
13
|
+
import './style.css';export {
|
|
14
|
+
A as BasemapConfigSchema,
|
|
12
15
|
o as BasemapSwitcher,
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
I as CirclePaintSchema,
|
|
17
|
+
J as CircleStyleSchema,
|
|
15
18
|
t as CollapsibleControl,
|
|
16
19
|
i as CoordinateDisplay,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
f as ExportButton,
|
|
21
|
+
S as FeatureDetailPanel,
|
|
22
|
+
p as FeatureTooltip,
|
|
23
|
+
Q as FillPaintSchema,
|
|
24
|
+
j as FillStyleSchema,
|
|
25
|
+
k as FilterConfigSchema,
|
|
26
|
+
q as LayerConfigSchema,
|
|
27
|
+
g as LayerPanel,
|
|
28
|
+
d as Legend,
|
|
29
|
+
z as LegendConfigSchema,
|
|
30
|
+
G as LegendEntrySchema,
|
|
31
|
+
H as LinePaintSchema,
|
|
32
|
+
K as LineStyleSchema,
|
|
33
|
+
N as MapConfigSchema,
|
|
34
|
+
R as OgcApiSourceSchema,
|
|
35
|
+
W as SearchConfigSchema,
|
|
36
|
+
X as SearchFieldSchema,
|
|
37
|
+
F as SearchPanel,
|
|
38
|
+
Y as StyleConfigSchema,
|
|
39
|
+
Z as UIConfigSchema,
|
|
40
|
+
_ as ViewConfigSchema,
|
|
41
|
+
L as downloadCsv,
|
|
42
|
+
P as featuresToCsv,
|
|
43
|
+
D as fetchCollections,
|
|
44
|
+
E as fetchFeatures,
|
|
45
|
+
M as fetchQueryables,
|
|
38
46
|
l as formatDMS,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
c as formatDecimal,
|
|
48
|
+
U as getFilteredVectorTileUrl,
|
|
49
|
+
V as getTileJsonUrl,
|
|
50
|
+
w as getVectorTileUrl,
|
|
51
|
+
$ as safeValidateMapConfig,
|
|
52
|
+
T as useCsvExport,
|
|
53
|
+
b as useOgcCollections,
|
|
54
|
+
v as useOgcFeatures,
|
|
55
|
+
ee as validateMapConfig
|
|
47
56
|
};
|