@bpd-library/components 1.2.6 → 1.2.7

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.
@@ -1,3 +1,4 @@
1
- import { MapData, MapTheme } from '@bpd-library/types';
2
- declare const addData: (map: mapboxgl.Map, data: MapData, theme: MapTheme) => Promise<void>;
1
+ import { MapDataItem, MapOptions, MapTheme } from '@bpd-library/types';
2
+ import mapboxgl from 'mapbox-gl';
3
+ declare const addData: (map: mapboxgl.Map, data: MapDataItem[], theme: MapTheme, options: MapOptions) => Promise<void>;
3
4
  export default addData;
@@ -1,10 +1,9 @@
1
+ import { Fragment, h } from '@atomify/jsx';
1
2
  import { calculateCenter, functionIsTrue } from '@bpd-library/utilities';
3
+ import mapboxgl from 'mapbox-gl';
2
4
  const variants = [];
3
- const isPointerVariant = (variant, theme) => {
4
- var _a;
5
- return !!((_a = theme.pointer) === null || _a === void 0 ? void 0 : _a.settings.find((pointerTheme) => pointerTheme.variant === variant));
6
- };
7
- const addData = async (map, data, theme) => {
5
+ const debugMarkers = [];
6
+ const addData = async (map, data, theme, options) => {
8
7
  const features = {};
9
8
  variants.forEach((variant) => (features[variant] = []));
10
9
  data.forEach((item) => {
@@ -47,6 +46,39 @@ const addData = async (map, data, theme) => {
47
46
  });
48
47
  }
49
48
  });
49
+ if (options.debugMode) {
50
+ addDebugMarkers(map, data, options);
51
+ }
52
+ };
53
+ const isPointerVariant = (variant, theme) => {
54
+ var _a;
55
+ return !!((_a = theme.pointer) === null || _a === void 0 ? void 0 : _a.settings.find((pointerTheme) => pointerTheme.variant === variant));
56
+ };
57
+ const addDebugMarkers = (map, mapData, options) => {
58
+ const debugProperties = options.debugProperties || ['id'];
59
+ debugMarkers.forEach((marker) => marker.remove());
60
+ mapData.forEach((mapDataItem) => {
61
+ const center = calculateCenter(mapDataItem.coordinates);
62
+ const marker = new mapboxgl.Popup({
63
+ closeOnMove: false,
64
+ closeOnClick: false,
65
+ closeButton: false,
66
+ focusAfterOpen: false,
67
+ })
68
+ .setDOMContent(h("div", { style: {
69
+ backgroundColor: 'rgba(0,0,0,0.5)',
70
+ color: '#fff',
71
+ fontSize: '10px',
72
+ } }, debugProperties
73
+ .map((property) => mapDataItem[property])
74
+ .filter(Boolean)
75
+ .map((value, i) => (h(Fragment, null,
76
+ i > 0 && h("br", null),
77
+ value)))))
78
+ .setLngLat(center)
79
+ .addTo(map);
80
+ debugMarkers.push(marker);
81
+ });
50
82
  };
51
83
  export default addData;
52
84
  //# sourceMappingURL=add-data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-data.js","sourceRoot":"","sources":["../../../../../src/molecules/map/utilities/mapbox/add-data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEzE,MAAM,QAAQ,GAAa,EAAE,CAAC;AAE9B,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,KAAe,EAAE,EAAE;;IAC1D,OAAO,CAAC,QAAC,KAAK,CAAC,OAAO,0CAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,KAAK,OAAO,EAAC,CAAC;AAC9F,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,KAAK,EAAE,GAAiB,EAAE,IAAa,EAAE,KAAe,EAAE,EAAE;IACxE,MAAM,QAAQ,GAA6C,EAAE,CAAC;IAM9D,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAKxD,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAClB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEzB,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC/B,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,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import { calculateCenter, functionIsTrue } from '@bpd-library/utilities';\n\nconst variants: string[] = [];\n\nconst isPointerVariant = (variant: string, theme: MapTheme) => {\n return !!theme.pointer?.settings.find((pointerTheme) => pointerTheme.variant === variant);\n};\n\nconst addData = async (map: mapboxgl.Map, data: MapData, theme: MapTheme) => {\n const features: { [variant: string]: GeoJSON.Feature[] } = {};\n\n /*\n Create empty arrays for previously set variants,\n this will make sure old variants will be removed.\n */\n variants.forEach((variant) => (features[variant] = []));\n\n /*\n Construct GeoJSON Features\n */\n data.forEach((item) => {\n const { variant } = item;\n\n if (variants.indexOf(variant) < 0) {\n variants.push(variant);\n features[variant] = [];\n }\n\n if (isPointerVariant(variant, theme)) {\n features[variant].push({\n type: 'Feature',\n geometry: {\n coordinates: calculateCenter(item.coordinates),\n type: 'Point',\n },\n properties: {\n ...item,\n },\n });\n } else {\n item.coordinates.forEach((coordinate) => {\n features[variant].push({\n type: 'Feature',\n geometry: {\n coordinates: [coordinate],\n type: 'Polygon',\n },\n properties: {\n ...item,\n },\n });\n });\n }\n });\n\n /*\n Update layer with features\n */\n await functionIsTrue(() => map.isStyleLoaded() && map.isSourceLoaded);\n\n Object.keys(features).forEach((variant) => {\n const variantFeatures = features[variant];\n\n const source = map.getSource(variant) as mapboxgl.GeoJSONSource | undefined;\n\n if (source) {\n source.setData({\n type: 'FeatureCollection',\n features: variantFeatures,\n });\n }\n });\n};\n\nexport default addData;\n"]}
1
+ {"version":3,"file":"add-data.js","sourceRoot":"","sources":["../../../../../src/molecules/map/utilities/mapbox/add-data.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,QAAQ,GAAa,EAAE,CAAC;AAC9B,MAAM,YAAY,GAAqB,EAAE,CAAC;AAE1C,MAAM,O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c,EAAE,KAAK;SACxB,CAAC;aACG,aAAa,CACV,WACI,KAAK,EAAE;gBACH,eAAe,EAAE,iBAAiB;gBAClC,KAAK,EAAE,MAAM;gBACb,QAAQ,EAAE,MAAM;aACnB,IACA,eAAe;aACX,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;aACxC,MAAM,CAAC,OAAO,CAAC;aACf,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CACf,EAAC,QAAQ;YACJ,CAAC,GAAG,CAAC,IAAI,aAAM;YACf,KAAK,CACC,CACd,CAAC,CACJ,CACT;aACA,SAAS,CAAC,MAAM,CAAC;aACjB,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhB,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { Fragment, h } from '@atomify/jsx';\nimport { MapDataItem, MapOptions, MapTheme } from '@bpd-library/types';\nimport { calculateCenter, functionIsTrue } from '@bpd-library/utilities';\nimport mapboxgl from 'mapbox-gl';\n\nconst variants: string[] = [];\nconst debugMarkers: mapboxgl.Popup[] = [];\n\nconst addData = async (\n map: mapboxgl.Map,\n data: MapDataItem[],\n theme: MapTheme,\n options: MapOptions,\n) => {\n const features: { [variant: string]: GeoJSON.Feature[] } = {};\n\n /*\n Create empty arrays for previously set variants,\n this will make sure old variants will be removed.\n */\n variants.forEach((variant) => (features[variant] = []));\n\n /*\n Construct GeoJSON Features\n */\n data.forEach((item) => {\n const { variant } = item;\n\n if (variants.indexOf(variant) < 0) {\n variants.push(variant);\n features[variant] = [];\n }\n\n if (isPointerVariant(variant, theme)) {\n features[variant].push({\n type: 'Feature',\n geometry: {\n coordinates: calculateCenter(item.coordinates),\n type: 'Point',\n },\n properties: {\n ...item,\n },\n });\n } else {\n item.coordinates.forEach((coordinate) => {\n features[variant].push({\n type: 'Feature',\n geometry: {\n coordinates: [coordinate],\n type: 'Polygon',\n },\n properties: {\n ...item,\n },\n });\n });\n }\n });\n\n /*\n Update layer with features\n */\n await functionIsTrue(() => map.isStyleLoaded() && map.isSourceLoaded);\n\n Object.keys(features).forEach((variant) => {\n const variantFeatures = features[variant];\n\n const source = map.getSource(variant) as mapboxgl.GeoJSONSource | undefined;\n\n if (source) {\n source.setData({\n type: 'FeatureCollection',\n features: variantFeatures,\n });\n }\n });\n\n if (options.debugMode) {\n addDebugMarkers(map, data, options);\n }\n};\n\n/**\n * @description Checks if the theme variant is a pointer theme\n * @param {string} variant\n * @param {MapTheme} theme\n * @return {*}\n */\nconst isPointerVariant = (variant: string, theme: MapTheme) => {\n return !!theme.pointer?.settings.find((pointerTheme) => pointerTheme.variant === variant);\n};\n\n/**\n * @description Adds debug markers to the map, based on the mapdata\n * @param {mapboxgl.Map} map\n * @param {MapDataItem[]} mapData\n * @param {MapOptions} options\n */\nconst addDebugMarkers = (map: mapboxgl.Map, mapData: MapDataItem[], options: MapOptions) => {\n const debugProperties = options.debugProperties || ['id'];\n\n // Remove all markers\n debugMarkers.forEach((marker) => marker.remove());\n\n mapData.forEach((mapDataItem) => {\n const center = calculateCenter(mapDataItem.coordinates);\n\n const marker = new mapboxgl.Popup({\n closeOnMove: false,\n closeOnClick: false,\n closeButton: false,\n focusAfterOpen: false,\n })\n .setDOMContent(\n <div\n style={{\n backgroundColor: 'rgba(0,0,0,0.5)',\n color: '#fff',\n fontSize: '10px',\n }}>\n {debugProperties\n .map((property) => mapDataItem[property])\n .filter(Boolean)\n .map((value, i) => (\n <Fragment>\n {i > 0 && <br />}\n {value}\n </Fragment>\n ))}\n </div>,\n )\n .setLngLat(center)\n .addTo(map);\n\n debugMarkers.push(marker);\n });\n};\n\nexport default addData;\n"]}
@@ -16,7 +16,7 @@ const mapbox = (map, options, theme) => ({
16
16
  interaction: (setting) => interaction(map, setting),
17
17
  center: (coordinates) => center(map, coordinates),
18
18
  setupPointers: (element) => setupPointers(map, theme, element),
19
- addData: (data) => addData(map, data, theme),
19
+ addData: (data) => addData(map, data, theme, options),
20
20
  setFeatureState: (variant, id, type, hover) => setFeatureState(map, variant, id, type, hover),
21
21
  search: (searchOptions) => search(map, searchOptions, options),
22
22
  addIsochrone: (isochroneSetting) => addIsochrone(map, isochroneSetting),
@@ -1 +1 @@
1
- {"version":3,"file":"mapbox.js","sourceRoot":"","sources":["../../../../../src/molecules/map/utilities/mapbox/mapbox.ts"],"names":[],"mappings":"AAYA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,eAAe,MAAM,0BAA0B,CAAC;AACvD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,MAAM,GAAG,CAAC,GAAiB,EAAE,OAAmB,EAAE,KAAe,EAAE,EAAE,CAAC,CAAC;IACzE,MAAM,EAAE,CAAC,QAAgC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC;IACnE,OAAO,EAAE,CAAC,OAA4B,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC;IAChE,KAAK,EAAE,CAAC,OAA4B,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC;IAC5D,WAAW,EAAE,CAAC,OAA4B,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC;IACxE,MAAM,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC;IAC9D,aAAa,EAAE,CAAC,OAAoB,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC;IAC3E,OAAO,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC;IACrD,eAAe,EAAE,CAAC,OAAe,EAAE,EAAU,EAAE,IAAuB,EAAE,KAAc,EAAE,EAAE,CACtF,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;IAClD,MAAM,EAAE,CAAC,aAA+B,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC;IAChF,YAAY,EAAE,CAAC,gBAAqC,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,gBAAgB,CAAC;IAC5F,eAAe,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC;IAC3C,aAAa,EAAE,CAAC,iBAAuC,EAAE,EAAE,CACvD,aAAa,CAAC,GAAG,EAAE,iBAAiB,CAAC;IACzC,gBAAgB,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC;CAChD,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import {\n Coordinates,\n MapData,\n MapDirectionsSetting,\n MapIsochroneSetting,\n MapOptions,\n MapSearchOptions,\n MapTheme,\n PolygonThemeSetting,\n} from '@bpd-library/types';\n\nimport { MapLayerRasterSettings } from '../../store';\nimport addData from './add-data';\nimport center from './center';\nimport { addDirections, removeDirections } from './directions/directions';\nimport { addIsochrone, removeIsochrone } from './isochrone';\nimport setupPointers from './pointers/setup-pointers';\nimport setFeatureState from './polygons/feature-state';\nimport geojson from './polygons/geojson';\nimport interaction from './polygons/interaction';\nimport layer from './polygons/layer';\nimport raster from './raster';\nimport search from './search/search';\n\nconst mapbox = (map: mapboxgl.Map, options: MapOptions, theme: MapTheme) => ({\n raster: (settings: MapLayerRasterSettings) => raster(map, settings),\n geojson: (setting: PolygonThemeSetting) => geojson(map, setting),\n layer: (setting: PolygonThemeSetting) => layer(map, setting),\n interaction: (setting: PolygonThemeSetting) => interaction(map, setting),\n center: (coordinates: Coordinates) => center(map, coordinates),\n setupPointers: (element: HTMLElement) => setupPointers(map, theme, element),\n addData: (data: MapData) => addData(map, data, theme),\n setFeatureState: (variant: string, id: string, type: 'hover' | 'focus', hover: boolean) =>\n setFeatureState(map, variant, id, type, hover),\n search: (searchOptions: MapSearchOptions) => search(map, searchOptions, options),\n addIsochrone: (isochroneSetting: MapIsochroneSetting) => addIsochrone(map, isochroneSetting),\n removeIsochrone: () => removeIsochrone(map),\n addDirections: (directionsSetting: MapDirectionsSetting) =>\n addDirections(map, directionsSetting),\n removeDirections: () => removeDirections(map),\n});\n\nexport default mapbox;\n"]}
1
+ {"version":3,"file":"mapbox.js","sourceRoot":"","sources":["../../../../../src/molecules/map/utilities/mapbox/mapbox.ts"],"names":[],"mappings":"AAYA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,eAAe,MAAM,0BAA0B,CAAC;AACvD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,MAAM,GAAG,CAAC,GAAiB,EAAE,OAAmB,EAA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CAChD,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import {\n Coordinates,\n MapData,\n MapDirectionsSetting,\n MapIsochroneSetting,\n MapOptions,\n MapSearchOptions,\n MapTheme,\n PolygonThemeSetting,\n} from '@bpd-library/types';\n\nimport { MapLayerRasterSettings } from '../../store';\nimport addData from './add-data';\nimport center from './center';\nimport { addDirections, removeDirections } from './directions/directions';\nimport { addIsochrone, removeIsochrone } from './isochrone';\nimport setupPointers from './pointers/setup-pointers';\nimport setFeatureState from './polygons/feature-state';\nimport geojson from './polygons/geojson';\nimport interaction from './polygons/interaction';\nimport layer from './polygons/layer';\nimport raster from './raster';\nimport search from './search/search';\n\nconst mapbox = (map: mapboxgl.Map, options: MapOptions, theme: MapTheme) => ({\n raster: (settings: MapLayerRasterSettings) => raster(map, settings),\n geojson: (setting: PolygonThemeSetting) => geojson(map, setting),\n layer: (setting: PolygonThemeSetting) => layer(map, setting),\n interaction: (setting: PolygonThemeSetting) => interaction(map, setting),\n center: (coordinates: Coordinates) => center(map, coordinates),\n setupPointers: (element: HTMLElement) => setupPointers(map, theme, element),\n addData: (data: MapData) => addData(map, data, theme, options),\n setFeatureState: (variant: string, id: string, type: 'hover' | 'focus', hover: boolean) =>\n setFeatureState(map, variant, id, type, hover),\n search: (searchOptions: MapSearchOptions) => search(map, searchOptions, options),\n addIsochrone: (isochroneSetting: MapIsochroneSetting) => addIsochrone(map, isochroneSetting),\n removeIsochrone: () => removeIsochrone(map),\n addDirections: (directionsSetting: MapDirectionsSetting) =>\n addDirections(map, directionsSetting),\n removeDirections: () => removeDirections(map),\n});\n\nexport default mapbox;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpd-library/components",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "Description",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",
@@ -46,14 +46,14 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "60695b9f3c91493163c6be7d43fd3fa6777b2bdb",
49
+ "gitHead": "4752f5561476642d4322dc09fe752a25f73cb925",
50
50
  "dependencies": {
51
51
  "@atomify/core": "2.4.1",
52
52
  "@atomify/hooks": "1.1.11",
53
53
  "@atomify/jsx": "1.7.1",
54
54
  "@atomify/kit": "1.1.11",
55
- "@bpd-library/types": "^1.2.6",
56
- "@bpd-library/utilities": "^1.2.6",
55
+ "@bpd-library/types": "^1.2.7",
56
+ "@bpd-library/utilities": "^1.2.7",
57
57
  "@mapbox/mapbox-gl-geocoder": "^4.7.0",
58
58
  "@mapbox/mapbox-gl-language": "^0.10.1",
59
59
  "@turf/helpers": "^6.5.0",