@geowiki/recodo 0.16.9-dev.4 → 0.16.9-dev.6
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/{cluster-map-LVG5YKOI.mjs → cluster-map-GEOLKUZK.mjs} +5 -46
- package/dist/index.d.mts +3 -10
- package/dist/index.d.ts +3 -10
- package/dist/index.js +573 -642
- package/dist/index.mjs +319 -344
- package/dist/styles.css +1 -1
- package/package.json +9 -11
|
@@ -4,56 +4,15 @@
|
|
|
4
4
|
import { MapContainer, TileLayer, Marker as Marker2, useMapEvents } from "react-leaflet";
|
|
5
5
|
import "leaflet/dist/leaflet.css";
|
|
6
6
|
import { LatLng as LatLng2 } from "leaflet";
|
|
7
|
-
import
|
|
7
|
+
import L from "leaflet";
|
|
8
8
|
|
|
9
9
|
// src/components/ClusterMap/cluster-markers.tsx
|
|
10
10
|
import { DivIcon, LatLng } from "leaflet";
|
|
11
11
|
import { Marker, Popup } from "react-leaflet";
|
|
12
12
|
import { useClusterMapInfo } from "@geowiki/core";
|
|
13
13
|
import { LoaderFull } from "@geowiki/ui";
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
// src/components/ClusterMap/MarkerClusterGroup.tsx
|
|
17
|
-
import {
|
|
18
|
-
extendContext,
|
|
19
|
-
createElementObject,
|
|
20
|
-
createPathComponent
|
|
21
|
-
} from "@react-leaflet/core";
|
|
22
|
-
import * as L from "leaflet";
|
|
23
|
-
import "leaflet.markercluster";
|
|
24
|
-
function getPropsAndEvents(props) {
|
|
25
|
-
let clusterProps = {};
|
|
26
|
-
let clusterEvents = {};
|
|
27
|
-
const { children, ...rest } = props;
|
|
28
|
-
Object.entries(rest).forEach(([propName, prop]) => {
|
|
29
|
-
if (propName.startsWith("on")) {
|
|
30
|
-
clusterEvents = { ...clusterEvents, [propName]: prop };
|
|
31
|
-
} else {
|
|
32
|
-
clusterProps = { ...clusterProps, [propName]: prop };
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return { clusterProps, clusterEvents };
|
|
36
|
-
}
|
|
37
|
-
function createMarkerClusterGroup(props, context) {
|
|
38
|
-
const { clusterProps, clusterEvents } = getPropsAndEvents(props);
|
|
39
|
-
const markerClusterGroup = new L.MarkerClusterGroup(clusterProps);
|
|
40
|
-
Object.entries(clusterEvents).forEach(([eventAsProp, callback]) => {
|
|
41
|
-
const clusterEvent = `cluster${eventAsProp.substring(2).toLowerCase()}`;
|
|
42
|
-
markerClusterGroup.on(clusterEvent, callback);
|
|
43
|
-
});
|
|
44
|
-
return createElementObject(
|
|
45
|
-
markerClusterGroup,
|
|
46
|
-
extendContext(context, { layerContainer: markerClusterGroup })
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
var updateMarkerCluster = () => {
|
|
50
|
-
};
|
|
51
|
-
var MarkerClusterGroup2 = createPathComponent(
|
|
52
|
-
createMarkerClusterGroup,
|
|
53
|
-
updateMarkerCluster
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
// src/components/ClusterMap/cluster-markers.tsx
|
|
14
|
+
import { MarkerClusterGroup } from "@geowiki/map";
|
|
15
|
+
import { Image } from "@geowiki/core";
|
|
57
16
|
import { useFileUrl } from "@geowiki/core";
|
|
58
17
|
import InformationCircleIcon from "@heroicons/react/24/solid/InformationCircleIcon";
|
|
59
18
|
import { renderToString } from "react-dom/server";
|
|
@@ -72,7 +31,7 @@ var ClusterMarkers = (_props) => {
|
|
|
72
31
|
if (isLoading || IsConfigSettingsLoaded)
|
|
73
32
|
return /* @__PURE__ */ jsx(LoaderFull, {});
|
|
74
33
|
if (ConfigSettings?.ConfigSettings?.FeaturesFarmerCluster?.Text) {
|
|
75
|
-
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
34
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(MarkerClusterGroup, { children: data?.map((cluster) => /* @__PURE__ */ jsx(
|
|
76
35
|
Marker,
|
|
77
36
|
{
|
|
78
37
|
icon: new DivIcon({
|
|
@@ -125,7 +84,7 @@ function getIcon2() {
|
|
|
125
84
|
return renderToString2(/* @__PURE__ */ jsx2(FarmerClusterPin, { height: 40, width: 40 }));
|
|
126
85
|
}
|
|
127
86
|
var icon = () => {
|
|
128
|
-
return new
|
|
87
|
+
return new L.DivIcon({
|
|
129
88
|
iconSize: [40, 40],
|
|
130
89
|
iconAnchor: [28, 15],
|
|
131
90
|
html: `<i style="margin: 0px; margin-left: 7.5px; margin-top: -22px;">${getIcon2()}</i>`,
|
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ViewStatus, DefaultSettings } from '@geowiki/core';
|
|
3
3
|
import { ClusterDto, ResourceFilterInput, ResourceDto, CreateUpdateResourceDto } from '@geowiki/api-proxy';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import React$1 from 'react';
|
|
6
|
-
import { NextPage } from 'next';
|
|
5
|
+
import React$1, { FC } from 'react';
|
|
7
6
|
|
|
8
7
|
interface Props$9 {
|
|
9
8
|
clusterId: any;
|
|
@@ -164,12 +163,6 @@ declare const ResourceEdit: (_props: ResourceEditProps) => react_jsx_runtime.JSX
|
|
|
164
163
|
|
|
165
164
|
declare const ResourceList: () => react_jsx_runtime.JSX.Element;
|
|
166
165
|
|
|
167
|
-
interface ResourceTagProps {
|
|
168
|
-
tag: string;
|
|
169
|
-
type: "language" | "audience" | "topic" | "keyword" | "resourceType";
|
|
170
|
-
}
|
|
171
|
-
declare const ResourceTag: React.FC<ResourceTagProps>;
|
|
172
|
-
|
|
173
166
|
interface ResourceProps {
|
|
174
167
|
resource: ResourceDto;
|
|
175
168
|
}
|
|
@@ -228,7 +221,7 @@ declare const SubtitleH3KeyResources: ({ title, subtitle, keyResources, }: Props
|
|
|
228
221
|
|
|
229
222
|
interface Props$2 {
|
|
230
223
|
}
|
|
231
|
-
declare const UserInfoPage:
|
|
224
|
+
declare const UserInfoPage: FC<Props$2>;
|
|
232
225
|
|
|
233
226
|
declare const UpdateUser: () => react_jsx_runtime.JSX.Element;
|
|
234
227
|
|
|
@@ -259,4 +252,4 @@ interface Props {
|
|
|
259
252
|
}
|
|
260
253
|
declare const SubtitleH3BodySpecialFeatureResourceCollections: ({ title, subtitle, description, featureResources, }: Props) => react_jsx_runtime.JSX.Element;
|
|
261
254
|
|
|
262
|
-
export { ClusterEditNews, ClusterNewsItem, ClusterNewsList, ClusterViewNews, FarmerClusterBasicInfo, FarmerClusterCreate, FarmerClusterDescription, type FarmerClusterFilterInput, FarmerClusterFinder, FarmerClusterImages, FarmerClusterLinkPartner, FarmerClusterList, FarmerClusterMembers, FarmerClusterNews, FeatureResources, FeatureResourcesList, type FeatureResourcesProps, KeyResourceItem, KeyResourceItemList, type KeyResourceItemProps, LinkPartnerSchema, RecodoViewFarmerCluster, ResourceCard, ResourceCreate, ResourceDisplayList, ResourceEdit, ResourceIcon, ResourceItem, ResourceList, type ResourceProps,
|
|
255
|
+
export { ClusterEditNews, ClusterNewsItem, ClusterNewsList, ClusterViewNews, FarmerClusterBasicInfo, FarmerClusterCreate, FarmerClusterDescription, type FarmerClusterFilterInput, FarmerClusterFinder, FarmerClusterImages, FarmerClusterLinkPartner, FarmerClusterList, FarmerClusterMembers, FarmerClusterNews, FeatureResources, FeatureResourcesList, type FeatureResourcesProps, KeyResourceItem, KeyResourceItemList, type KeyResourceItemProps, LinkPartnerSchema, RecodoViewFarmerCluster, ResourceCard, ResourceCreate, ResourceDisplayList, ResourceEdit, ResourceIcon, ResourceItem, ResourceList, type ResourceProps, ResourcesQuickFind, ResourcesSelectedTags, SearchFilter, SubtitleH3BodySpecialFeatureResourceCollections, SubtitleH3KeyResources, SubtitleH3ResourceCollections, UpdateUser, UserInfoPage, ViewFarmerCluster };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ViewStatus, DefaultSettings } from '@geowiki/core';
|
|
3
3
|
import { ClusterDto, ResourceFilterInput, ResourceDto, CreateUpdateResourceDto } from '@geowiki/api-proxy';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import React$1 from 'react';
|
|
6
|
-
import { NextPage } from 'next';
|
|
5
|
+
import React$1, { FC } from 'react';
|
|
7
6
|
|
|
8
7
|
interface Props$9 {
|
|
9
8
|
clusterId: any;
|
|
@@ -164,12 +163,6 @@ declare const ResourceEdit: (_props: ResourceEditProps) => react_jsx_runtime.JSX
|
|
|
164
163
|
|
|
165
164
|
declare const ResourceList: () => react_jsx_runtime.JSX.Element;
|
|
166
165
|
|
|
167
|
-
interface ResourceTagProps {
|
|
168
|
-
tag: string;
|
|
169
|
-
type: "language" | "audience" | "topic" | "keyword" | "resourceType";
|
|
170
|
-
}
|
|
171
|
-
declare const ResourceTag: React.FC<ResourceTagProps>;
|
|
172
|
-
|
|
173
166
|
interface ResourceProps {
|
|
174
167
|
resource: ResourceDto;
|
|
175
168
|
}
|
|
@@ -228,7 +221,7 @@ declare const SubtitleH3KeyResources: ({ title, subtitle, keyResources, }: Props
|
|
|
228
221
|
|
|
229
222
|
interface Props$2 {
|
|
230
223
|
}
|
|
231
|
-
declare const UserInfoPage:
|
|
224
|
+
declare const UserInfoPage: FC<Props$2>;
|
|
232
225
|
|
|
233
226
|
declare const UpdateUser: () => react_jsx_runtime.JSX.Element;
|
|
234
227
|
|
|
@@ -259,4 +252,4 @@ interface Props {
|
|
|
259
252
|
}
|
|
260
253
|
declare const SubtitleH3BodySpecialFeatureResourceCollections: ({ title, subtitle, description, featureResources, }: Props) => react_jsx_runtime.JSX.Element;
|
|
261
254
|
|
|
262
|
-
export { ClusterEditNews, ClusterNewsItem, ClusterNewsList, ClusterViewNews, FarmerClusterBasicInfo, FarmerClusterCreate, FarmerClusterDescription, type FarmerClusterFilterInput, FarmerClusterFinder, FarmerClusterImages, FarmerClusterLinkPartner, FarmerClusterList, FarmerClusterMembers, FarmerClusterNews, FeatureResources, FeatureResourcesList, type FeatureResourcesProps, KeyResourceItem, KeyResourceItemList, type KeyResourceItemProps, LinkPartnerSchema, RecodoViewFarmerCluster, ResourceCard, ResourceCreate, ResourceDisplayList, ResourceEdit, ResourceIcon, ResourceItem, ResourceList, type ResourceProps,
|
|
255
|
+
export { ClusterEditNews, ClusterNewsItem, ClusterNewsList, ClusterViewNews, FarmerClusterBasicInfo, FarmerClusterCreate, FarmerClusterDescription, type FarmerClusterFilterInput, FarmerClusterFinder, FarmerClusterImages, FarmerClusterLinkPartner, FarmerClusterList, FarmerClusterMembers, FarmerClusterNews, FeatureResources, FeatureResourcesList, type FeatureResourcesProps, KeyResourceItem, KeyResourceItemList, type KeyResourceItemProps, LinkPartnerSchema, RecodoViewFarmerCluster, ResourceCard, ResourceCreate, ResourceDisplayList, ResourceEdit, ResourceIcon, ResourceItem, ResourceList, type ResourceProps, ResourcesQuickFind, ResourcesSelectedTags, SearchFilter, SubtitleH3BodySpecialFeatureResourceCollections, SubtitleH3KeyResources, SubtitleH3ResourceCollections, UpdateUser, UserInfoPage, ViewFarmerCluster };
|