agvmap-react 0.1.42 → 0.1.47

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 CHANGED
@@ -44,45 +44,8 @@ VITE_AGV_API_PASSWORD=your_password
44
44
  }}
45
45
 
46
46
  >
47
-
48
- ```
49
-
50
- > **Important**: The wrapper element must have class `agv-map-container` for scoped CSS to apply correctly. The component itself renders a `<div className="agv-map-container">` root — just place `<AgvMap>` inside your app's layout where the map should appear.
51
-
52
- ---
53
-
54
- ## Package Consumption (for host apps)
55
-
56
- When installing `agvmap-react` in another application, follow these steps:
57
-
58
- ### 1. Peer dependencies
59
-
60
- `react` and `react-dom` are **peer dependencies**. Your host app must provide them:
61
-
62
- ```json
63
- // Your host app's package.json
64
- "dependencies": {
65
- "react": "^18.0.0 || ^19.0.0",
66
- "react-dom": "^18.0.0 || ^19.0.0",
67
- "agvmap-react": "<version>"
68
- }
69
- ```
70
-
71
- ### 2. Import the CSS manually
72
-
73
- The package no longer injects CSS via a side-effect import. You must import `style.css` in your app's entry point:
74
-
75
- ```js
76
- // In your app's entry file (e.g., main.jsx, App.jsx, or layout.jsx)
77
- import 'agvmap-react/style.css';
78
47
  ```
79
48
 
80
- ### 3. All styles are scoped
81
-
82
- All CSS selectors are scoped under `.agv-map-container`. The map component's root element already has this class, so no additional wrapper is needed — just place `<AgvMap />` in your JSX.
83
-
84
- ---
85
-
86
49
  ## Project Goal
87
50
 
88
51
  Implement a map component with custom layers fetched from a REST API, to be integrated into a dashboard for visualization and analysis.
@@ -1,6 +1,6 @@
1
1
  import { jsxs as l, jsx as e, Fragment as A } from "react/jsx-runtime";
2
- import { useState as g, useContext as H, useCallback as d, useRef as P, useMemo as w, useEffect as U } from "react";
3
- import { M as V, u as W, a as O, B as q, T as y, b as G, C as J, c as K, d as Q, t as X, S as Y, e as Z, I as $, f as D, g as L, h as ee } from "./index-CUMxOelU.js";
2
+ import { useState as g, useContext as H, useCallback as d, useRef as P, useMemo as b, useEffect as U } from "react";
3
+ import { M as V, u as W, a as O, B as q, T as y, b as G, C as J, c as K, d as Q, t as X, S as Y, e as Z, I as $, f as D, g as L, h as ee } from "./index-Df_WMhdb.js";
4
4
  const ae = (a) => /* @__PURE__ */ l(
5
5
  "svg",
6
6
  {
@@ -74,10 +74,10 @@ const ae = (a) => /* @__PURE__ */ l(
74
74
  );
75
75
  }, se = ({ marker: a, onMarkerClick: v, onDeleteMarker: u, markersData: c, intl: i }) => /* @__PURE__ */ e("div", { className: "marker-item rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 p-2 mb-2", children: /* @__PURE__ */ e("div", { className: "marker-item-info", children: /* @__PURE__ */ l("div", { className: "flex justify-between items-center gap-2", children: [
76
76
  /* @__PURE__ */ l("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
77
- /* @__PURE__ */ e(D, { className: "h-4 w-4 text-primary flex-shrink-0" }),
78
- /* @__PURE__ */ e("h5", { className: "text-sm font-medium text-gray-800 dark:text-gray-200 break-words leading-tight", children: a == null ? void 0 : a.title })
77
+ /* @__PURE__ */ e(D, { className: "h-4 w-4 text-primary shrink-0" }),
78
+ /* @__PURE__ */ e("h5", { className: "text-sm font-medium text-gray-800 dark:text-gray-200 wrap-break-word leading-tight", children: a == null ? void 0 : a.title })
79
79
  ] }),
80
- /* @__PURE__ */ l("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
80
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-1 shrink-0", children: [
81
81
  /* @__PURE__ */ e(y, { text: i.formatMessage({ id: "app.agviewer_map.focus_marker", defaultMessage: "Focus on the marker" }), children: /* @__PURE__ */ e(
82
82
  L,
83
83
  {
@@ -122,16 +122,16 @@ function oe({
122
122
  ), B = d((t) => {
123
123
  const r = t.target.value;
124
124
  M(r), k(!0), S(r);
125
- }, [S]), b = w(() => !a || a.length === 0 ? [] : a.map((t) => X(t)), [a]), n = w(() => {
126
- if (!m) return b;
125
+ }, [S]), w = b(() => !a || a.length === 0 ? [] : a.map((t) => X(t)), [a]), n = b(() => {
126
+ if (!m) return w;
127
127
  const t = m.toLowerCase();
128
- return b.filter(
128
+ return w.filter(
129
129
  (r) => {
130
130
  var x, N;
131
131
  return (N = (x = r == null ? void 0 : r.title) == null ? void 0 : x.toLowerCase()) == null ? void 0 : N.includes(t);
132
132
  }
133
133
  );
134
- }, [b, m]), E = w(() => n.slice(0, o), [n, o]);
134
+ }, [w, m]), E = b(() => n.slice(0, o), [n, o]);
135
135
  U(() => {
136
136
  _(20);
137
137
  }, [m]);
@@ -1,4 +1,4 @@
1
- import { A as p } from "./index-CUMxOelU.js";
1
+ import { A as p } from "./index-Df_WMhdb.js";
2
2
  export {
3
3
  p as AgvMap
4
4
  };