andoncloud-map-widget 1.1.10 → 1.1.12

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/index.d.ts CHANGED
@@ -25,7 +25,7 @@ declare const getDisplayName: (lang: string) => string;
25
25
  declare const getTitle: (data: WidgetData | undefined, settings: WidgetSettings | undefined, _filters: FilterValues | undefined, lang: string) => string;
26
26
  //#endregion
27
27
  //#region src/version.d.ts
28
- declare const LIBRARY_VERSION = "1.1.10";
28
+ declare const LIBRARY_VERSION = "1.1.12";
29
29
  //#endregion
30
30
  //#region src/index.d.ts
31
31
  declare const thumbnail: string | undefined;
package/dist/index.js CHANGED
@@ -7,6 +7,8 @@ import { useTranslation } from "react-i18next";
7
7
  import { TabContext, TabList, TabPanel } from "@mui/lab";
8
8
  import { Box, Button, FormControl, InputLabel, MenuItem, Select, Tab, TextField } from "@mui/material";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
+ import "leaflet/dist/leaflet.css";
11
+ import "leaflet-draw/dist/leaflet.draw.css";
10
12
  import "leaflet-contextmenu/dist/leaflet.contextmenu.css";
11
13
  import { FeatureGroup, ImageOverlay, MapContainer, ZoomControl } from "react-leaflet";
12
14
  import { EditControl } from "react-leaflet-draw";
@@ -123,7 +125,7 @@ const resources = {
123
125
  };
124
126
  //#endregion
125
127
  //#region src/version.ts
126
- const LIBRARY_VERSION = "1.1.10";
128
+ const LIBRARY_VERSION = "1.1.12";
127
129
  //#endregion
128
130
  //#region src/components/SettingsFormContent/index.tsx
129
131
  const SettingsFormContent = ({ data, formProps }) => {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["en","pl","uuidv4","Map","Map","locales","locales"],"sources":["../src/locales/en/translation.json","../src/locales/pl/translation.json","../src/locales/index.ts","../src/version.ts","../src/components/SettingsFormContent/index.tsx","../src/components/Map/Control/index.tsx","../src/components/Map/leafletLocale.ts","../src/components/Map/LayerSettings/index.tsx","../src/components/Map/utils.ts","../src/components/Map/useMap.tsx","../src/components/Map/styles.ts","../src/components/Map/index.tsx","../src/components/WidgetView/index.tsx","../src/components/Widget/utils.ts","../src/components/Widget/index.tsx","../src/core/title.ts","../src/index.tsx"],"sourcesContent":["","","import en from './en/translation.json';\nimport pl from './pl/translation.json';\n\nconst resources = {\n en: {\n translation: en,\n },\n pl: {\n translation: pl,\n },\n};\n\nexport default resources;\n","export const LIBRARY_VERSION = '1.1.10';\n","import { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { TabContext, TabList, TabPanel } from '@mui/lab';\nimport { FormControl, InputLabel, MenuItem, Select, Tab, TextField } from '@mui/material';\nimport { SettingsFormContentProps } from 'andoncloud-widget-base';\n\nimport { WidgetData, WidgetSettings } from '@/types';\n\nconst SettingsFormContent: React.FC<SettingsFormContentProps<WidgetData, WidgetSettings>> = ({ data, formProps }) => {\n // -- Local state --\n const [selectedTab, setSelectedTab] = useState('filters');\n\n // -- Translation --\n const { t } = useTranslation();\n\n return (\n <TabContext value={selectedTab}>\n <TabList onChange={(_, value) => setSelectedTab(value)} centered>\n <Tab label={t('mapWidget.filters')} value=\"filters\" />\n <Tab label={t('mapWidget.advanced')} value=\"advanced\" />\n </TabList>\n\n <TabPanel value=\"filters\">\n <FormControl sx={{ mt: 2 }} fullWidth>\n <InputLabel id=\"floor-plan-label\">{t('mapWidget.floorPlan')}</InputLabel>\n <Select\n name=\"floorPlanId\"\n labelId=\"floor-plan-label\"\n variant=\"outlined\"\n value={formProps.values.floorPlanId || ''}\n onChange={formProps.handleChange}\n fullWidth\n data-testid=\"settings.floor-plan-select\"\n >\n {data.floorPlans?.map((floorPlan) => (\n <MenuItem key={floorPlan.id} value={floorPlan.id}>\n {floorPlan.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </TabPanel>\n\n <TabPanel value=\"advanced\">\n <TextField\n name=\"customTitle\"\n label={t('mapWidget.customTitle')}\n value={formProps.values.customTitle}\n onChange={formProps.handleChange}\n fullWidth\n />\n </TabPanel>\n </TabContext>\n );\n};\n\nexport default SettingsFormContent;\n","import { JSX, createRef, useEffect, useState } from 'react';\n\nimport L from 'leaflet';\n\ninterface Props {\n mapRef: React.RefObject<L.Map | null>;\n position: L.ControlPosition;\n children?: React.ReactNode;\n container?: React.HTMLAttributes<HTMLDivElement>;\n prepend?: boolean;\n}\n\nconst POSITION_CLASSES = {\n bottomleft: 'leaflet-bottom leaflet-left',\n bottomright: 'leaflet-bottom leaflet-right',\n topleft: 'leaflet-top leaflet-left',\n topright: 'leaflet-top leaflet-right',\n};\n\nconst Control = (props: Props): JSX.Element => {\n const [portalRoot, setPortalRoot] = useState<any>(document.createElement('div'));\n const positionClass = (props.position && POSITION_CLASSES[props.position]) || POSITION_CLASSES.topright;\n const controlsContainer = props.mapRef.current?.getContainer().getElementsByClassName(positionClass);\n const controlContainerRef = createRef<HTMLDivElement>();\n\n useEffect(() => {\n if (controlsContainer) {\n setPortalRoot(controlsContainer[0]);\n }\n }, [controlsContainer]);\n\n useEffect(() => {\n if (portalRoot !== null) {\n if (props.prepend !== undefined && props.prepend === true) {\n portalRoot.prepend(controlContainerRef.current);\n } else {\n portalRoot.append(controlContainerRef.current);\n }\n }\n }, [portalRoot, props.prepend, controlContainerRef]);\n\n const className = (props.container?.className?.concat(' ') || '') + 'leaflet-control';\n return (\n <div {...props.container} ref={controlContainerRef} className={className}>\n {props.children}\n </div>\n );\n};\n\nexport default Control;\n","import L from 'leaflet';\n\nexport const setLeafletLocale = (t: (key: string) => string) => {\n // leaflet-draw extends L with drawLocal but has no @types package.\n // Must access inside the function — at module load time leaflet-draw may not be evaluated yet.\n const drawLocal = (L as any).drawLocal;\n if (!drawLocal) return;\n\n drawLocal.draw.toolbar.actions.text = t('mapWidget.leaflet.draw.toolbar.actions.text');\n drawLocal.draw.toolbar.finish.text = t('mapWidget.leaflet.draw.toolbar.finish.text');\n drawLocal.draw.toolbar.undo.text = t('mapWidget.leaflet.draw.toolbar.undo.text');\n\n drawLocal.draw.handlers.polygon.tooltip.start = t('mapWidget.leaflet.draw.handlers.polygon.tooltip.start');\n drawLocal.draw.handlers.polygon.tooltip.cont = t('mapWidget.leaflet.draw.handlers.polygon.tooltip.cont');\n drawLocal.draw.handlers.polygon.tooltip.end = t('mapWidget.leaflet.draw.handlers.polygon.tooltip.end');\n\n drawLocal.edit.toolbar.actions.save.text = t('mapWidget.leaflet.edit.toolbar.actions.save.text');\n drawLocal.edit.toolbar.actions.cancel.text = t('mapWidget.leaflet.edit.toolbar.actions.cancel.text');\n drawLocal.edit.toolbar.actions.clearAll.text = t('mapWidget.leaflet.edit.toolbar.actions.clearAll.text');\n\n drawLocal.edit.toolbar.buttons.edit = t('mapWidget.leaflet.edit.toolbar.buttons.edit');\n drawLocal.edit.toolbar.buttons.editDisabled = t('mapWidget.leaflet.edit.toolbar.buttons.editDisabled');\n drawLocal.edit.toolbar.buttons.remove = t('mapWidget.leaflet.edit.toolbar.buttons.remove');\n drawLocal.edit.toolbar.buttons.removeDisabled = t('mapWidget.leaflet.edit.toolbar.buttons.removeDisabled');\n};\n","import { useTranslation } from 'react-i18next';\n\nimport { FormControl, InputLabel, MenuItem, Select } from '@mui/material';\n\nimport { WidgetViewData } from '@/types';\n\nimport { ShapeLayer } from '../types';\n\ninterface LayerSettingsProps {\n data: WidgetViewData;\n layer: ShapeLayer;\n updateFeature: (feature: GeoJSON.Feature) => Promise<void>;\n}\n\nexport const LayerSettings: React.FC<LayerSettingsProps> = ({ data, layer, updateFeature }) => {\n const { t } = useTranslation();\n const assignWorkplace = async (workplaceId: string) => {\n const feature = layer?.feature;\n\n if (feature) {\n feature.properties.workplaceId = workplaceId;\n\n await updateFeature(feature);\n }\n };\n\n return (\n <FormControl fullWidth>\n <InputLabel id=\"workplace-label\">{t('mapWidget.workplace')}</InputLabel>\n <Select\n labelId=\"workplace-label\"\n variant=\"outlined\"\n value={layer.feature?.properties.workplaceId || ''}\n onChange={(e) => assignWorkplace(e.target.value)}\n data-testid=\"layer-settings.workplace-select\"\n >\n {data.workplaces?.map((workplace) => (\n <MenuItem key={workplace.id} value={workplace.id}>\n {workplace.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n};\n","import { Dimensions } from 'react-image-size';\n\nimport { AndonLightColor } from 'andoncloud-dashboard-toolkit';\nimport L, { Content } from 'leaflet';\n\nimport { ShapeLayer } from './types';\n\nexport const DEFAULT_STYLE = { fillColor: '#cccccc', fillOpacity: 0.65, color: '#cccccc' };\n\nexport const mapStatusColorToHex = (color: AndonLightColor): string => {\n switch (color) {\n case 'green':\n return '#2ACB42';\n case 'red':\n return '#FF453A';\n case 'yellow':\n return '#FFC12F';\n default:\n return '#525860';\n }\n};\n\nexport const calcImageBounds = (map: L.Map, imageDimensions: Dimensions) => {\n const topLeftLatLng = map.unproject([0, 0], map.getMaxZoom());\n const bottomRightLatLng = map.unproject([imageDimensions.width, imageDimensions.height], map.getMaxZoom());\n\n return new L.LatLngBounds(topLeftLatLng, bottomRightLatLng);\n};\n\nexport const makeDraggable = (layer: ShapeLayer) => {\n // @ts-ignore no typings\n layer.makeDraggable();\n};\n\nexport const setInitialStyles = (layer: ShapeLayer) => {\n layer.setStyle(DEFAULT_STYLE);\n};\n\nexport const bindTooltip = (content: Content, layer: ShapeLayer) => {\n layer.bindTooltip(content, {\n permanent: true,\n direction: 'center',\n });\n};\n\nexport const centerTooltip = (layer: ShapeLayer) => {\n layer.getTooltip()?.setLatLng(layer.getCenter());\n};\n\nconst DUPLICATE_OFFSET = 30;\n\nexport const offsetLatLngs = (latLngs: L.LatLng[][] | L.LatLng[]): L.LatLng[][] | L.LatLng[] =>\n latLngs.map((item: L.LatLng | L.LatLng[]) => {\n if (Array.isArray(item)) {\n return item.map((ll) => L.latLng(ll.lat + DUPLICATE_OFFSET, ll.lng + DUPLICATE_OFFSET));\n }\n return L.latLng(item.lat + DUPLICATE_OFFSET, item.lng + DUPLICATE_OFFSET);\n }) as L.LatLng[][] | L.LatLng[];\n","import 'leaflet-contextmenu';\nimport 'leaflet-path-drag';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Dimensions, getImageSize } from 'react-image-size';\n\nimport L, { Content } from 'leaflet';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { MapProps } from '@/types';\n\nimport { LayerSettings } from './LayerSettings';\nimport { ShapeLayer } from './types';\nimport {\n bindTooltip,\n centerTooltip,\n makeDraggable,\n mapStatusColorToHex,\n offsetLatLngs,\n setInitialStyles,\n} from './utils';\n\nconst useMap = ({ data, settings, updateSettings, updateSidePanelProps, editMode }: MapProps) => {\n // Refs\n const containerRef = useRef(null);\n const mapRef = useRef<L.Map>(null);\n const prevActiveLayerRef = useRef<ShapeLayer | null>(null);\n const updateFeatureRef = useRef<typeof updateFeature>(null);\n const onDrawCreatedRef = useRef<typeof onDrawCreated>(null);\n const onDrawEditedRef = useRef<typeof onDrawEdited>(null);\n const onDrawDeletedRef = useRef<typeof onDrawDeleted>(null);\n const featureGroupRef = useRef<L.FeatureGroup | null>(null);\n const editModeRef = useRef<boolean>(!!editMode);\n\n // State\n const [imageUrl, setImageUrl] = useState<string>();\n const [imageDimensions, setImageDimensions] = useState<Dimensions | null>(null);\n const [featureGroup, setFeatureGroup] = useState<L.FeatureGroup | null>(null);\n const [activeLayer, setActiveLayer] = useState<ShapeLayer | null>(null);\n const [viewChanged, setViewChanged] = useState(false);\n\n const { t } = useTranslation();\n\n // --- Callbacks: tooltip/popup helpers (need mapRef) ---\n\n const openTooltip = useCallback((layer: ShapeLayer) => {\n const tooltip = layer.getTooltip();\n\n if (tooltip) {\n mapRef.current?.openTooltip(tooltip);\n }\n }, []);\n\n const closeTooltip = useCallback((layer: ShapeLayer) => {\n const tooltip = layer.getTooltip();\n\n if (tooltip) {\n mapRef.current?.closeTooltip(tooltip);\n }\n }, []);\n\n const bindPopup = useCallback((content: Content, layer: ShapeLayer) => {\n const currentPopup = layer.getPopup();\n\n if (currentPopup) {\n currentPopup.setContent(content);\n mapRef.current?.openPopup(currentPopup);\n } else {\n layer\n .bindPopup(content, {\n closeButton: false,\n closeOnClick: false,\n closeOnEscapeKey: false,\n autoClose: false,\n offset: L.point(0, -2),\n })\n .openPopup();\n\n // @ts-expect-error private method\n layer.off('click', layer._openPopup);\n }\n }, []);\n\n // --- Callbacks: settings mutations ---\n\n const createFeature = useCallback(\n async (feature: GeoJSON.Feature) => {\n if (updateSettings) {\n await updateSettings({\n features: [...(settings?.features || []), feature],\n });\n }\n },\n [settings?.features, updateSettings],\n );\n\n const updateFeature = useCallback(\n async (updatedFeature: GeoJSON.Feature) => {\n if (updateSettings) {\n await updateSettings({\n features: settings?.features.map((feature) => {\n if (feature.properties?.id === updatedFeature.properties?.id) {\n return updatedFeature;\n }\n return feature;\n }),\n });\n }\n },\n [settings?.features, updateSettings],\n );\n\n const updateFeatures = useCallback(\n async (updatedLayers: ShapeLayer[]) => {\n if (updateSettings) {\n const updatedMapping = updatedLayers.reduce((acc, layer) => {\n const feature = layer.toGeoJSON();\n\n return { ...acc, [feature.properties?.id]: feature };\n }, {});\n\n await updateSettings({\n features: settings?.features.map((feature) => {\n const featureId = feature.properties?.id;\n\n if (featureId in updatedMapping) {\n // @ts-expect-error no typings\n return updatedMapping[featureId];\n }\n return feature;\n }),\n });\n }\n },\n [settings?.features, updateSettings],\n );\n\n const removeFeatures = useCallback(\n async (removedLayers: ShapeLayer[]) => {\n if (updateSettings) {\n const removedIds = removedLayers.map((layer) => (layer.feature as GeoJSON.Feature).properties?.id);\n\n await updateSettings({\n features: settings?.features.filter((feature) => {\n return !removedIds.includes(feature.properties?.id);\n }),\n });\n }\n },\n [settings?.features, updateSettings],\n );\n\n const getWorkplaceName = useCallback(\n (workplaceId: string) => {\n return data.workplaces?.find((workplace) => workplace.id === workplaceId)?.name || '';\n },\n [data?.workplaces],\n );\n\n // --- Callbacks: layer event binding ---\n\n const bindEvents = useCallback(\n (layer: ShapeLayer) => {\n layer.on('click', () => {\n if (editModeRef.current) {\n setActiveLayer(layer);\n }\n });\n // @ts-ignore no typings\n if (layer?._events?.dragstart) {\n layer.off('dragstart');\n }\n // @ts-ignore no typings\n if (layer?._events?.dragend) {\n layer.off('dragend');\n }\n layer.on('dragstart', () => {\n closeTooltip(layer);\n });\n layer.on('dragend', () => {\n const _updateFeature = updateFeatureRef.current;\n\n if (_updateFeature) {\n _updateFeature(layer.toGeoJSON());\n }\n centerTooltip(layer);\n openTooltip(layer);\n\n const popup = layer.getPopup();\n\n if (popup) {\n popup.setLatLng(layer.getCenter());\n mapRef.current?.openPopup(popup);\n }\n });\n },\n [closeTooltip, openTooltip],\n );\n\n const bindContextMenu = useCallback(\n (layer: ShapeLayer) => {\n // @ts-ignore no typings\n layer.bindContextMenu({\n contextmenuItems: [\n {\n text: t('mapWidget.duplicate'),\n callback: async () => {\n const originalLatLngs = layer.getLatLngs() as L.LatLng[][];\n const duplicatedLayer = L.polygon(\n offsetLatLngs(originalLatLngs) as L.LatLng[][],\n ) as unknown as ShapeLayer;\n\n const _onDrawCreated = onDrawCreatedRef.current;\n\n if (_onDrawCreated) {\n await _onDrawCreated(duplicatedLayer);\n }\n setActiveLayer(duplicatedLayer);\n // @ts-ignore no typings\n duplicatedLayer.dragging.enable();\n featureGroupRef.current?.addLayer(duplicatedLayer);\n },\n },\n ],\n });\n },\n [t],\n );\n\n // --- Callbacks: feature loading ---\n\n const loadFeatures = useCallback(\n (fg: L.FeatureGroup, features: GeoJSON.Feature[]) => {\n fg.clearLayers();\n\n const geoJSON = new L.GeoJSON({ type: 'FeatureCollection', features } as GeoJSON.FeatureCollection, {\n onEachFeature: (_, layer: ShapeLayer) => {\n bindEvents(layer);\n bindContextMenu(layer);\n makeDraggable(layer);\n setInitialStyles(layer);\n },\n });\n\n geoJSON.eachLayer((layer: ShapeLayer) => {\n fg.addLayer(layer);\n });\n },\n [bindEvents, bindContextMenu],\n );\n\n const setControlsDisplay = useCallback(\n (value: boolean) => {\n if (featureGroup) {\n const containers = document.getElementsByClassName('leaflet-control-container');\n\n Array.from(containers).forEach((container: HTMLDivElement) => {\n container.style['display'] = value ? 'block' : 'none';\n });\n }\n },\n [featureGroup],\n );\n\n // --- Callbacks: draw event handlers ---\n\n const onDrawCreated = useCallback(\n async (layer: ShapeLayer) => {\n const feature = layer.toGeoJSON();\n\n feature.properties = { ...(feature.properties || {}), id: uuidv4() };\n\n if (!layer.feature) {\n layer.feature = feature;\n }\n await createFeature(feature);\n\n bindEvents(layer);\n bindContextMenu(layer);\n makeDraggable(layer);\n setInitialStyles(layer);\n },\n [createFeature, bindEvents, bindContextMenu],\n );\n\n const onDrawEdited = useCallback(\n async (layers: ShapeLayer[]) => {\n await updateFeatures(layers);\n\n layers.forEach((layer: ShapeLayer) => {\n centerTooltip(layer);\n });\n },\n [updateFeatures],\n );\n\n const onDrawDeleted = useCallback(\n async (layers: ShapeLayer[]) => {\n await removeFeatures(layers);\n setActiveLayer(null);\n },\n [removeFeatures],\n );\n\n const onFeatureGroupReady = (_featureGroup: L.FeatureGroup) => {\n if (!featureGroup) {\n loadFeatures(_featureGroup, settings?.features || []);\n setFeatureGroup(_featureGroup);\n }\n };\n\n const saveMapView = async () => {\n const map = mapRef.current;\n\n if (map && updateSettings) {\n await updateSettings({\n zoom: map.getZoom(),\n center: map.getCenter(),\n });\n setActiveLayer(null);\n setViewChanged(false);\n }\n };\n\n // --- Effects ---\n\n // Track map view changes via zoom/move events.\n // Uses featureGroup as trigger — when it's set, the map is guaranteed to be ready.\n useEffect(() => {\n const map = mapRef.current;\n\n if (!map) return;\n\n const onViewChange = () => setViewChanged(true);\n\n map.on('zoomend', onViewChange);\n map.on('moveend', onViewChange);\n\n return () => {\n map.off('zoomend', onViewChange);\n map.off('moveend', onViewChange);\n };\n }, [featureGroup]);\n\n // MapContainer ignores center/zoom prop changes after initial render.\n // Sync the map view when settings arrive (e.g. after API response).\n useEffect(() => {\n const map = mapRef.current;\n\n if (map && settings?.center && settings?.zoom) {\n map.setView(settings.center, settings.zoom, { animate: false });\n }\n }, [settings?.center, settings?.zoom]);\n\n useEffect(() => {\n const map = mapRef.current;\n\n setControlsDisplay(!!editMode);\n editModeRef.current = !!editMode;\n\n if (map) {\n if (editMode) {\n map.scrollWheelZoom.enable();\n map.dragging.enable();\n } else {\n map.scrollWheelZoom.disable();\n map.dragging.disable();\n setActiveLayer(null);\n }\n }\n }, [editMode, setControlsDisplay]);\n\n // Sync refs for stable callbacks used by Leaflet event handlers\n useEffect(() => {\n updateFeatureRef.current = updateFeature;\n }, [updateFeature]);\n\n useEffect(() => {\n onDrawCreatedRef.current = onDrawCreated;\n onDrawEditedRef.current = onDrawEdited;\n onDrawDeletedRef.current = onDrawDeleted;\n }, [onDrawCreated, onDrawEdited, onDrawDeleted]);\n\n useEffect(() => {\n featureGroupRef.current = featureGroup;\n }, [featureGroup]);\n\n // Side panel for layer settings\n useEffect(() => {\n if (activeLayer && activeLayer !== prevActiveLayerRef.current) {\n updateSidePanelProps({\n open: true,\n width: '25%',\n title: t('mapWidget.areaSettings'),\n mainContent: <LayerSettings data={data} layer={activeLayer} updateFeature={updateFeature} />,\n onClose: () => setActiveLayer(null),\n });\n } else if (!activeLayer && prevActiveLayerRef.current) {\n updateSidePanelProps({ open: false });\n }\n prevActiveLayerRef.current = activeLayer;\n }, [data, activeLayer, updateFeature, updateSidePanelProps, t]);\n\n // Toggle dragging on active layer\n useEffect(() => {\n featureGroup?.eachLayer((layer: ShapeLayer) => {\n const tooltip = layer.getTooltip();\n\n if (layer === activeLayer) {\n // @ts-ignore no typings\n layer.dragging.enable();\n } else {\n // @ts-ignore no typings\n layer.dragging.disable();\n\n if (tooltip) {\n mapRef.current?.openTooltip(tooltip);\n }\n }\n });\n }, [activeLayer, featureGroup]);\n\n // Load floor plan image\n useEffect(() => {\n const floorPlanUrl = data.floorPlans?.find((floorPlan) => floorPlan.id === settings?.floorPlanId)?.imageUrl;\n\n if (floorPlanUrl) {\n setImageUrl(floorPlanUrl);\n\n getImageSize(floorPlanUrl)\n .then((dimensions) => setImageDimensions(dimensions))\n .catch(() => {});\n }\n }, [data?.floorPlans, settings?.floorPlanId]);\n\n // Reload features when settings arrive after initial render (race condition fix).\n // Only fires when featureGroup is empty — avoids clearing user-drawn layers.\n // Must run BEFORE the tooltip/status effect below so layers exist when tooltips are bound.\n useEffect(() => {\n if (featureGroup && settings?.features?.length && featureGroup.getLayers().length === 0) {\n loadFeatures(featureGroup, settings.features);\n }\n }, [featureGroup, settings?.features, loadFeatures]);\n\n // Apply status colors, tooltips, and popups to feature layers\n useEffect(() => {\n const getCurrentStatusChange = (workplaceId: string) =>\n (data?.statusChanges || [])\n .filter((statusChange) => statusChange.workplaceId === workplaceId)\n .sort((a, b) => new Date(a.startedAt).getTime() - new Date(b.startedAt).getTime())\n .pop();\n\n featureGroup?.getLayers().forEach((layer: ShapeLayer) => {\n const workplaceId = layer.feature?.properties.workplaceId;\n\n if (workplaceId) {\n const statusChange = getCurrentStatusChange(workplaceId);\n const statusColor = statusChange?.reason.statusColor;\n\n if (statusColor) {\n const color = mapStatusColorToHex(statusColor);\n\n layer.setStyle({ fillColor: color, fillOpacity: 0.65, color });\n } else {\n setInitialStyles(layer);\n }\n bindTooltip(getWorkplaceName(workplaceId), layer);\n\n if (statusChange?.order || statusChange?.product) {\n const orderNumberLabel = t('mapWidget.orderNumber');\n const productNumberLabel = t('mapWidget.productNumber');\n\n bindPopup(\n `\n <div>\n <p>${orderNumberLabel}: ${statusChange.order?.number || '-'}</p>\n <p>${productNumberLabel}: ${statusChange.product?.number || '-'}</p>\n <div>\n `,\n layer,\n );\n } else {\n mapRef.current?.closePopup(layer.getPopup());\n }\n }\n });\n }, [data, settings, featureGroup, getWorkplaceName, bindPopup, t]);\n\n return {\n containerRef,\n mapRef,\n imageUrl,\n imageDimensions,\n viewChanged,\n onFeatureGroupReady,\n onDrawCreatedRef,\n onDrawEditedRef,\n onDrawDeletedRef,\n saveMapView,\n };\n};\n\nexport default useMap;\n","import { SxProps, Theme } from '@mui/material/styles';\n\nconst styles: Record<string, SxProps<Theme>> = {\n saveButton: {\n padding: (theme) => theme.spacing(0.25, 3),\n fontSize: (theme) => theme.typography.pxToRem(14),\n '&.Mui-disabled': {\n color: 'rgba(255, 255, 255, 0.25)',\n },\n },\n};\n\nexport default styles;\n","import 'leaflet-contextmenu/dist/leaflet.contextmenu.css';\n\nimport { useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { FeatureGroup, ImageOverlay, MapContainer, ZoomControl } from 'react-leaflet';\nimport { EditControl } from 'react-leaflet-draw';\n\nimport { Box, Button } from '@mui/material';\nimport useSize from '@react-hook/size';\n\nimport { MapProps } from '@/types';\n\nimport Control from './Control';\nimport { setLeafletLocale } from './leafletLocale';\nimport useMap from './useMap';\nimport { calcImageBounds } from './utils';\n\nimport styles from './styles';\n\nconst Map: React.FC<MapProps> = ({ settings, ...props }) => {\n const { t } = useTranslation();\n\n useEffect(() => {\n setLeafletLocale(t);\n }, [t]);\n\n const {\n containerRef,\n mapRef,\n imageUrl,\n imageDimensions,\n viewChanged,\n onFeatureGroupReady,\n onDrawCreatedRef,\n onDrawEditedRef,\n onDrawDeletedRef,\n saveMapView,\n } = useMap({ settings, ...props });\n\n const [width, height] = useSize(containerRef.current);\n\n useEffect(() => {\n mapRef.current?.invalidateSize();\n }, [width, height]);\n\n return (\n <Box\n ref={containerRef}\n width=\"100%\"\n height=\"100%\"\n zIndex=\"0\"\n sx={{ position: 'relative' }}\n data-testid=\"map.container\"\n >\n <MapContainer\n ref={mapRef}\n center={settings?.center || [width / 2, height / 2]}\n minZoom={1}\n maxZoom={5}\n zoom={settings?.zoom || 1}\n zoomSnap={0.1}\n zoomDelta={0.1}\n wheelPxPerZoomLevel={600}\n zoomControl={false}\n doubleClickZoom={false}\n touchZoom={false}\n // @ts-expect-error leaflet-contextmenu extends MapOptions\n contextmenu\n >\n {mapRef.current && imageUrl && imageDimensions && (\n <ImageOverlay url={imageUrl} bounds={calcImageBounds(mapRef.current, imageDimensions)} />\n )}\n <FeatureGroup\n ref={(featureGroup) => {\n if (featureGroup) onFeatureGroupReady(featureGroup);\n }}\n >\n <EditControl\n draw={{\n polyline: false,\n polygon: true,\n rectangle: false,\n circle: false,\n marker: false,\n circlemarker: false,\n }}\n onCreated={async ({ layer }) => {\n const _onDrawCreated = onDrawCreatedRef.current;\n\n if (_onDrawCreated) {\n await _onDrawCreated(layer);\n }\n }}\n onEdited={async ({ layers }) => {\n const _onDrawEdited = onDrawEditedRef.current;\n\n if (_onDrawEdited) {\n await _onDrawEdited(layers.getLayers());\n }\n }}\n onDeleted={async ({ layers }) => {\n const _onDrawDeleted = onDrawDeletedRef.current;\n\n if (_onDrawDeleted) {\n await _onDrawDeleted(layers.getLayers());\n }\n }}\n position=\"topleft\"\n />\n </FeatureGroup>\n <ZoomControl position=\"topright\" />\n <Control mapRef={mapRef} position=\"topright\">\n <Button\n onClick={() => saveMapView()}\n disabled={!viewChanged}\n sx={styles.saveButton}\n data-testid=\"map.freeze-button\"\n >\n {t('mapWidget.freeze')}\n </Button>\n </Control>\n </MapContainer>\n </Box>\n );\n};\n\nexport default Map;\n","import { WidgetViewProps } from '@/types';\n\nimport Map from '../Map';\n\nconst WidgetView: React.FC<WidgetViewProps> = (props) => {\n return <Map {...props} />;\n};\n\nexport default WidgetView;\n","import { TFunction } from 'i18next';\nimport * as yup from 'yup';\n\nexport const getSettingsFormProps = (t: TFunction) => {\n yup.setLocale({\n mixed: {\n required: t('mapWidget.thisFieldIsRequired'),\n },\n });\n return {\n initialValues: {\n customTitle: '',\n floorPlanId: '',\n },\n validationSchema: yup.object({\n floorPlanId: yup.string().required(),\n }),\n };\n};\n","import { useEffect, useState } from 'react';\n\nimport {\n StatusChange,\n useGqlClients,\n WidgetProps,\n WorkplaceEvent,\n WorkplaceEventDocument,\n WorkplaceEventSubscriptionPayload,\n} from 'andoncloud-dashboard-toolkit';\nimport { BaseWidget } from 'andoncloud-widget-base';\nimport { print } from 'graphql';\n\nimport locales from '@/locales';\nimport { WidgetData, WidgetSettings } from '@/types';\nimport { LIBRARY_VERSION } from '@/version';\n\nimport SettingsFormContent from '../SettingsFormContent';\nimport WidgetView from '../WidgetView';\n\nimport { getSettingsFormProps } from './utils';\n\nconst Widget: React.FC<WidgetProps<WidgetData, WidgetSettings>> = ({ url, wsUrl, lang, data, ...widgetProps }) => {\n const { graphqlSdk, gqlWsClient } = useGqlClients({ url, wsUrl, lang });\n const [gqlWsSubscribed, setGqlWsSubscribed] = useState<boolean>(false);\n const [widgetData, setWidgetData] = useState<WidgetData | undefined>(data);\n\n useEffect(() => {\n if (!widgetData && graphqlSdk) {\n graphqlSdk\n .listWorkplaces()\n .then(({ workplaces }) => {\n return setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n workplaces,\n }));\n })\n .catch(() => {});\n\n graphqlSdk\n .listStatusChanges()\n .then(({ statusChanges }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges,\n })),\n )\n .catch(() => {});\n\n graphqlSdk\n .listFloorPlans()\n .then(({ floorPlans }) => {\n return setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n floorPlans,\n }));\n })\n .catch(() => {});\n }\n if (widgetData?.workplaces && gqlWsClient && !gqlWsSubscribed) {\n widgetData.workplaces.forEach(({ id }) => {\n gqlWsClient.subscribe<WorkplaceEventSubscriptionPayload>(\n print(WorkplaceEventDocument),\n { id },\n ({ event, subject }) => {\n if (event === WorkplaceEvent.StatusChangeCreated) {\n const statusChange = subject as StatusChange;\n\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges: [statusChange, ...current.statusChanges],\n }));\n } else if (event === WorkplaceEvent.StatusChangeUpdated) {\n const updatedStatusChange = subject as StatusChange;\n\n setWidgetData((current: WidgetData) => {\n const statusChanges = current.statusChanges.map((statusChange) =>\n statusChange.id === updatedStatusChange.id ? updatedStatusChange : statusChange,\n );\n return {\n ...(current || {}),\n statusChanges,\n };\n });\n }\n },\n );\n setGqlWsSubscribed(true);\n });\n }\n }, [data, graphqlSdk, gqlWsClient, gqlWsSubscribed, widgetData]);\n\n return (\n <BaseWidget\n {...widgetProps}\n lang={lang}\n locales={locales}\n data={widgetData}\n gqlClients={{ graphqlSdk, gqlWsClient }}\n WidgetView={WidgetView}\n getSettingsFormProps={getSettingsFormProps}\n SettingsFormContent={SettingsFormContent}\n version={LIBRARY_VERSION}\n data-testid=\"map-widget\"\n />\n );\n};\n\nexport default Widget;\n","import type { FilterValues } from 'andoncloud-dashboard-toolkit';\nimport i18n from 'i18next';\n\nimport type { WidgetData, WidgetSettings } from '../types';\n\nconst ns = 'mapWidget';\n\nconst t = (key: string, lng: string, options?: Record<string, unknown>) => i18n.t(`${ns}.${key}`, { lng, ...options });\n\nexport const getDisplayName = (lang: string) => t('displayName', lang);\n\nexport const getTitle = (\n data: WidgetData | undefined,\n settings: WidgetSettings | undefined,\n _filters: FilterValues | undefined,\n lang: string,\n): string => {\n const name = getDisplayName(lang);\n\n const features = settings?.features;\n if (!features?.length) return name;\n\n const mapped = features.filter((f) => f.properties?.workplaceId).length;\n if (mapped === 0) return name;\n\n const statusChanges = data?.statusChanges ?? [];\n\n const latestByWorkplace = new Map<string, { startedAt: string; color: string }>();\n for (const sc of statusChanges) {\n const existing = latestByWorkplace.get(sc.workplaceId);\n if (!existing || sc.startedAt > existing.startedAt) {\n latestByWorkplace.set(sc.workplaceId, { startedAt: sc.startedAt, color: sc.reason?.statusColor ?? '' });\n }\n }\n\n let working = 0;\n let down = 0;\n for (const { color } of latestByWorkplace.values()) {\n if (color === 'green') working++;\n else if (color === 'red') down++;\n }\n\n const parts = [\n t('titleWorkplaces', lang, { count: mapped }),\n t('titleWorking', lang, { count: working }),\n t('titleDown', lang, { count: down }),\n ];\n\n return `${name} — ${parts.join(', ')}`;\n};\n","import './index.css';\n\nimport { registerTranslations } from 'andoncloud-sdk';\n\nimport locales from './locales';\n\nregisterTranslations(locales);\n\nexport { default as Widget } from './components/Widget';\nexport { getDisplayName, getTitle } from './core/title';\n\nexport const thumbnail: string | undefined = undefined;\n\nexport const requiredFeatures: string[] = ['feature.map-widget'];\nexport const extraPermissions: string[] = [];\n\nexport { LIBRARY_VERSION as version } from './version';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AEGA,MAAM,YAAY;CAChB,IAAI,EACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MACD;CACD,IAAI,EACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MACD;CACF;;;ACVD,MAAa,kBAAkB;;;ACS/B,MAAM,uBAAuF,EAAE,MAAM,gBAAgB;CAEnH,MAAM,CAAC,aAAa,kBAAkB,SAAS,UAAU;CAGzD,MAAM,EAAE,MAAM,gBAAgB;AAE9B,QACE,qBAAC,YAAD;EAAY,OAAO;YAAnB;GACE,qBAAC,SAAD;IAAS,WAAW,GAAG,UAAU,eAAe,MAAM;IAAE,UAAA;cAAxD,CACE,oBAAC,KAAD;KAAK,OAAO,EAAE,oBAAoB;KAAE,OAAM;KAAY,CAAA,EACtD,oBAAC,KAAD;KAAK,OAAO,EAAE,qBAAqB;KAAE,OAAM;KAAa,CAAA,CAChD;;GAEV,oBAAC,UAAD;IAAU,OAAM;cACd,qBAAC,aAAD;KAAa,IAAI,EAAE,IAAI,GAAG;KAAE,WAAA;eAA5B,CACE,oBAAC,YAAD;MAAY,IAAG;gBAAoB,EAAE,sBAAsB;MAAc,CAAA,EACzE,oBAAC,QAAD;MACE,MAAK;MACL,SAAQ;MACR,SAAQ;MACR,OAAO,UAAU,OAAO,eAAe;MACvC,UAAU,UAAU;MACpB,WAAA;MACA,eAAY;gBAEX,KAAK,YAAY,KAAK,cACrB,oBAAC,UAAD;OAA6B,OAAO,UAAU;iBAC3C,UAAU;OACF,EAFI,UAAU,GAEd,CACX;MACK,CAAA,CACG;;IACL,CAAA;GAEX,oBAAC,UAAD;IAAU,OAAM;cACd,oBAAC,WAAD;KACE,MAAK;KACL,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,iBAAiB,EAAE;CAE/C,MAAM,oCAAoB,IAAI,KAAmD;AACjF,MAAK,MAAM,MAAM,eAAe;EAC9B,MAAM,WAAW,kBAAkB,IAAI,GAAG,YAAY;AACtD,MAAI,CAAC,YAAY,GAAG,YAAY,SAAS,UACvC,mBAAkB,IAAI,GAAG,aAAa;GAAE,WAAW,GAAG;GAAW,OAAO,GAAG,QAAQ,eAAe;GAAI,CAAC;;CAI3G,IAAI,UAAU;CACd,IAAI,OAAO;AACX,MAAK,MAAM,EAAE,WAAW,kBAAkB,QAAQ,CAChD,KAAI,UAAU,QAAS;UACd,UAAU,MAAO;AAS5B,QAAO,GAAG,KAAK,KAND;EACZ,EAAE,mBAAmB,MAAM,EAAE,OAAO,QAAQ,CAAC;EAC7C,EAAE,gBAAgB,MAAM,EAAE,OAAO,SAAS,CAAC;EAC3C,EAAE,aAAa,MAAM,EAAE,OAAO,MAAM,CAAC;EACtC,CAEyB,KAAK,KAAK;;;;AC1CtC,qBAAqBC,UAAQ;AAK7B,MAAa,YAAgC,KAAA;AAE7C,MAAa,mBAA6B,CAAC,qBAAqB;AAChE,MAAa,mBAA6B,EAAE"}
1
+ {"version":3,"file":"index.js","names":["en","pl","uuidv4","Map","Map","locales","locales"],"sources":["../src/locales/en/translation.json","../src/locales/pl/translation.json","../src/locales/index.ts","../src/version.ts","../src/components/SettingsFormContent/index.tsx","../src/components/Map/Control/index.tsx","../src/components/Map/leafletLocale.ts","../src/components/Map/LayerSettings/index.tsx","../src/components/Map/utils.ts","../src/components/Map/useMap.tsx","../src/components/Map/styles.ts","../src/components/Map/index.tsx","../src/components/WidgetView/index.tsx","../src/components/Widget/utils.ts","../src/components/Widget/index.tsx","../src/core/title.ts","../src/index.tsx"],"sourcesContent":["","","import en from './en/translation.json';\nimport pl from './pl/translation.json';\n\nconst resources = {\n en: {\n translation: en,\n },\n pl: {\n translation: pl,\n },\n};\n\nexport default resources;\n","export const LIBRARY_VERSION = '1.1.12';\n","import { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { TabContext, TabList, TabPanel } from '@mui/lab';\nimport { FormControl, InputLabel, MenuItem, Select, Tab, TextField } from '@mui/material';\nimport { SettingsFormContentProps } from 'andoncloud-widget-base';\n\nimport { WidgetData, WidgetSettings } from '@/types';\n\nconst SettingsFormContent: React.FC<SettingsFormContentProps<WidgetData, WidgetSettings>> = ({ data, formProps }) => {\n // -- Local state --\n const [selectedTab, setSelectedTab] = useState('filters');\n\n // -- Translation --\n const { t } = useTranslation();\n\n return (\n <TabContext value={selectedTab}>\n <TabList onChange={(_, value) => setSelectedTab(value)} centered>\n <Tab label={t('mapWidget.filters')} value=\"filters\" />\n <Tab label={t('mapWidget.advanced')} value=\"advanced\" />\n </TabList>\n\n <TabPanel value=\"filters\">\n <FormControl sx={{ mt: 2 }} fullWidth>\n <InputLabel id=\"floor-plan-label\">{t('mapWidget.floorPlan')}</InputLabel>\n <Select\n name=\"floorPlanId\"\n labelId=\"floor-plan-label\"\n variant=\"outlined\"\n value={formProps.values.floorPlanId || ''}\n onChange={formProps.handleChange}\n fullWidth\n data-testid=\"settings.floor-plan-select\"\n >\n {data.floorPlans?.map((floorPlan) => (\n <MenuItem key={floorPlan.id} value={floorPlan.id}>\n {floorPlan.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </TabPanel>\n\n <TabPanel value=\"advanced\">\n <TextField\n name=\"customTitle\"\n label={t('mapWidget.customTitle')}\n value={formProps.values.customTitle}\n onChange={formProps.handleChange}\n fullWidth\n />\n </TabPanel>\n </TabContext>\n );\n};\n\nexport default SettingsFormContent;\n","import { JSX, createRef, useEffect, useState } from 'react';\n\nimport L from 'leaflet';\n\ninterface Props {\n mapRef: React.RefObject<L.Map | null>;\n position: L.ControlPosition;\n children?: React.ReactNode;\n container?: React.HTMLAttributes<HTMLDivElement>;\n prepend?: boolean;\n}\n\nconst POSITION_CLASSES = {\n bottomleft: 'leaflet-bottom leaflet-left',\n bottomright: 'leaflet-bottom leaflet-right',\n topleft: 'leaflet-top leaflet-left',\n topright: 'leaflet-top leaflet-right',\n};\n\nconst Control = (props: Props): JSX.Element => {\n const [portalRoot, setPortalRoot] = useState<any>(document.createElement('div'));\n const positionClass = (props.position && POSITION_CLASSES[props.position]) || POSITION_CLASSES.topright;\n const controlsContainer = props.mapRef.current?.getContainer().getElementsByClassName(positionClass);\n const controlContainerRef = createRef<HTMLDivElement>();\n\n useEffect(() => {\n if (controlsContainer) {\n setPortalRoot(controlsContainer[0]);\n }\n }, [controlsContainer]);\n\n useEffect(() => {\n if (portalRoot !== null) {\n if (props.prepend !== undefined && props.prepend === true) {\n portalRoot.prepend(controlContainerRef.current);\n } else {\n portalRoot.append(controlContainerRef.current);\n }\n }\n }, [portalRoot, props.prepend, controlContainerRef]);\n\n const className = (props.container?.className?.concat(' ') || '') + 'leaflet-control';\n return (\n <div {...props.container} ref={controlContainerRef} className={className}>\n {props.children}\n </div>\n );\n};\n\nexport default Control;\n","import L from 'leaflet';\n\nexport const setLeafletLocale = (t: (key: string) => string) => {\n // leaflet-draw extends L with drawLocal but has no @types package.\n // Must access inside the function — at module load time leaflet-draw may not be evaluated yet.\n const drawLocal = (L as any).drawLocal;\n if (!drawLocal) return;\n\n drawLocal.draw.toolbar.actions.text = t('mapWidget.leaflet.draw.toolbar.actions.text');\n drawLocal.draw.toolbar.finish.text = t('mapWidget.leaflet.draw.toolbar.finish.text');\n drawLocal.draw.toolbar.undo.text = t('mapWidget.leaflet.draw.toolbar.undo.text');\n\n drawLocal.draw.handlers.polygon.tooltip.start = t('mapWidget.leaflet.draw.handlers.polygon.tooltip.start');\n drawLocal.draw.handlers.polygon.tooltip.cont = t('mapWidget.leaflet.draw.handlers.polygon.tooltip.cont');\n drawLocal.draw.handlers.polygon.tooltip.end = t('mapWidget.leaflet.draw.handlers.polygon.tooltip.end');\n\n drawLocal.edit.toolbar.actions.save.text = t('mapWidget.leaflet.edit.toolbar.actions.save.text');\n drawLocal.edit.toolbar.actions.cancel.text = t('mapWidget.leaflet.edit.toolbar.actions.cancel.text');\n drawLocal.edit.toolbar.actions.clearAll.text = t('mapWidget.leaflet.edit.toolbar.actions.clearAll.text');\n\n drawLocal.edit.toolbar.buttons.edit = t('mapWidget.leaflet.edit.toolbar.buttons.edit');\n drawLocal.edit.toolbar.buttons.editDisabled = t('mapWidget.leaflet.edit.toolbar.buttons.editDisabled');\n drawLocal.edit.toolbar.buttons.remove = t('mapWidget.leaflet.edit.toolbar.buttons.remove');\n drawLocal.edit.toolbar.buttons.removeDisabled = t('mapWidget.leaflet.edit.toolbar.buttons.removeDisabled');\n};\n","import { useTranslation } from 'react-i18next';\n\nimport { FormControl, InputLabel, MenuItem, Select } from '@mui/material';\n\nimport { WidgetViewData } from '@/types';\n\nimport { ShapeLayer } from '../types';\n\ninterface LayerSettingsProps {\n data: WidgetViewData;\n layer: ShapeLayer;\n updateFeature: (feature: GeoJSON.Feature) => Promise<void>;\n}\n\nexport const LayerSettings: React.FC<LayerSettingsProps> = ({ data, layer, updateFeature }) => {\n const { t } = useTranslation();\n const assignWorkplace = async (workplaceId: string) => {\n const feature = layer?.feature;\n\n if (feature) {\n feature.properties.workplaceId = workplaceId;\n\n await updateFeature(feature);\n }\n };\n\n return (\n <FormControl fullWidth>\n <InputLabel id=\"workplace-label\">{t('mapWidget.workplace')}</InputLabel>\n <Select\n labelId=\"workplace-label\"\n variant=\"outlined\"\n value={layer.feature?.properties.workplaceId || ''}\n onChange={(e) => assignWorkplace(e.target.value)}\n data-testid=\"layer-settings.workplace-select\"\n >\n {data.workplaces?.map((workplace) => (\n <MenuItem key={workplace.id} value={workplace.id}>\n {workplace.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n};\n","import { Dimensions } from 'react-image-size';\n\nimport { AndonLightColor } from 'andoncloud-dashboard-toolkit';\nimport L, { Content } from 'leaflet';\n\nimport { ShapeLayer } from './types';\n\nexport const DEFAULT_STYLE = { fillColor: '#cccccc', fillOpacity: 0.65, color: '#cccccc' };\n\nexport const mapStatusColorToHex = (color: AndonLightColor): string => {\n switch (color) {\n case 'green':\n return '#2ACB42';\n case 'red':\n return '#FF453A';\n case 'yellow':\n return '#FFC12F';\n default:\n return '#525860';\n }\n};\n\nexport const calcImageBounds = (map: L.Map, imageDimensions: Dimensions) => {\n const topLeftLatLng = map.unproject([0, 0], map.getMaxZoom());\n const bottomRightLatLng = map.unproject([imageDimensions.width, imageDimensions.height], map.getMaxZoom());\n\n return new L.LatLngBounds(topLeftLatLng, bottomRightLatLng);\n};\n\nexport const makeDraggable = (layer: ShapeLayer) => {\n // @ts-ignore no typings\n layer.makeDraggable();\n};\n\nexport const setInitialStyles = (layer: ShapeLayer) => {\n layer.setStyle(DEFAULT_STYLE);\n};\n\nexport const bindTooltip = (content: Content, layer: ShapeLayer) => {\n layer.bindTooltip(content, {\n permanent: true,\n direction: 'center',\n });\n};\n\nexport const centerTooltip = (layer: ShapeLayer) => {\n layer.getTooltip()?.setLatLng(layer.getCenter());\n};\n\nconst DUPLICATE_OFFSET = 30;\n\nexport const offsetLatLngs = (latLngs: L.LatLng[][] | L.LatLng[]): L.LatLng[][] | L.LatLng[] =>\n latLngs.map((item: L.LatLng | L.LatLng[]) => {\n if (Array.isArray(item)) {\n return item.map((ll) => L.latLng(ll.lat + DUPLICATE_OFFSET, ll.lng + DUPLICATE_OFFSET));\n }\n return L.latLng(item.lat + DUPLICATE_OFFSET, item.lng + DUPLICATE_OFFSET);\n }) as L.LatLng[][] | L.LatLng[];\n","import 'leaflet-contextmenu';\nimport 'leaflet-path-drag';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Dimensions, getImageSize } from 'react-image-size';\n\nimport L, { Content } from 'leaflet';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { MapProps } from '@/types';\n\nimport { LayerSettings } from './LayerSettings';\nimport { ShapeLayer } from './types';\nimport {\n bindTooltip,\n centerTooltip,\n makeDraggable,\n mapStatusColorToHex,\n offsetLatLngs,\n setInitialStyles,\n} from './utils';\n\nconst useMap = ({ data, settings, updateSettings, updateSidePanelProps, editMode }: MapProps) => {\n // Refs\n const containerRef = useRef(null);\n const mapRef = useRef<L.Map>(null);\n const prevActiveLayerRef = useRef<ShapeLayer | null>(null);\n const updateFeatureRef = useRef<typeof updateFeature>(null);\n const onDrawCreatedRef = useRef<typeof onDrawCreated>(null);\n const onDrawEditedRef = useRef<typeof onDrawEdited>(null);\n const onDrawDeletedRef = useRef<typeof onDrawDeleted>(null);\n const featureGroupRef = useRef<L.FeatureGroup | null>(null);\n const editModeRef = useRef<boolean>(!!editMode);\n\n // State\n const [imageUrl, setImageUrl] = useState<string>();\n const [imageDimensions, setImageDimensions] = useState<Dimensions | null>(null);\n const [featureGroup, setFeatureGroup] = useState<L.FeatureGroup | null>(null);\n const [activeLayer, setActiveLayer] = useState<ShapeLayer | null>(null);\n const [viewChanged, setViewChanged] = useState(false);\n\n const { t } = useTranslation();\n\n // --- Callbacks: tooltip/popup helpers (need mapRef) ---\n\n const openTooltip = useCallback((layer: ShapeLayer) => {\n const tooltip = layer.getTooltip();\n\n if (tooltip) {\n mapRef.current?.openTooltip(tooltip);\n }\n }, []);\n\n const closeTooltip = useCallback((layer: ShapeLayer) => {\n const tooltip = layer.getTooltip();\n\n if (tooltip) {\n mapRef.current?.closeTooltip(tooltip);\n }\n }, []);\n\n const bindPopup = useCallback((content: Content, layer: ShapeLayer) => {\n const currentPopup = layer.getPopup();\n\n if (currentPopup) {\n currentPopup.setContent(content);\n mapRef.current?.openPopup(currentPopup);\n } else {\n layer\n .bindPopup(content, {\n closeButton: false,\n closeOnClick: false,\n closeOnEscapeKey: false,\n autoClose: false,\n offset: L.point(0, -2),\n })\n .openPopup();\n\n // @ts-expect-error private method\n layer.off('click', layer._openPopup);\n }\n }, []);\n\n // --- Callbacks: settings mutations ---\n\n const createFeature = useCallback(\n async (feature: GeoJSON.Feature) => {\n if (updateSettings) {\n await updateSettings({\n features: [...(settings?.features || []), feature],\n });\n }\n },\n [settings?.features, updateSettings],\n );\n\n const updateFeature = useCallback(\n async (updatedFeature: GeoJSON.Feature) => {\n if (updateSettings) {\n await updateSettings({\n features: settings?.features.map((feature) => {\n if (feature.properties?.id === updatedFeature.properties?.id) {\n return updatedFeature;\n }\n return feature;\n }),\n });\n }\n },\n [settings?.features, updateSettings],\n );\n\n const updateFeatures = useCallback(\n async (updatedLayers: ShapeLayer[]) => {\n if (updateSettings) {\n const updatedMapping = updatedLayers.reduce((acc, layer) => {\n const feature = layer.toGeoJSON();\n\n return { ...acc, [feature.properties?.id]: feature };\n }, {});\n\n await updateSettings({\n features: settings?.features.map((feature) => {\n const featureId = feature.properties?.id;\n\n if (featureId in updatedMapping) {\n // @ts-expect-error no typings\n return updatedMapping[featureId];\n }\n return feature;\n }),\n });\n }\n },\n [settings?.features, updateSettings],\n );\n\n const removeFeatures = useCallback(\n async (removedLayers: ShapeLayer[]) => {\n if (updateSettings) {\n const removedIds = removedLayers.map((layer) => (layer.feature as GeoJSON.Feature).properties?.id);\n\n await updateSettings({\n features: settings?.features.filter((feature) => {\n return !removedIds.includes(feature.properties?.id);\n }),\n });\n }\n },\n [settings?.features, updateSettings],\n );\n\n const getWorkplaceName = useCallback(\n (workplaceId: string) => {\n return data.workplaces?.find((workplace) => workplace.id === workplaceId)?.name || '';\n },\n [data?.workplaces],\n );\n\n // --- Callbacks: layer event binding ---\n\n const bindEvents = useCallback(\n (layer: ShapeLayer) => {\n layer.on('click', () => {\n if (editModeRef.current) {\n setActiveLayer(layer);\n }\n });\n // @ts-ignore no typings\n if (layer?._events?.dragstart) {\n layer.off('dragstart');\n }\n // @ts-ignore no typings\n if (layer?._events?.dragend) {\n layer.off('dragend');\n }\n layer.on('dragstart', () => {\n closeTooltip(layer);\n });\n layer.on('dragend', () => {\n const _updateFeature = updateFeatureRef.current;\n\n if (_updateFeature) {\n _updateFeature(layer.toGeoJSON());\n }\n centerTooltip(layer);\n openTooltip(layer);\n\n const popup = layer.getPopup();\n\n if (popup) {\n popup.setLatLng(layer.getCenter());\n mapRef.current?.openPopup(popup);\n }\n });\n },\n [closeTooltip, openTooltip],\n );\n\n const bindContextMenu = useCallback(\n (layer: ShapeLayer) => {\n // @ts-ignore no typings\n layer.bindContextMenu({\n contextmenuItems: [\n {\n text: t('mapWidget.duplicate'),\n callback: async () => {\n const originalLatLngs = layer.getLatLngs() as L.LatLng[][];\n const duplicatedLayer = L.polygon(\n offsetLatLngs(originalLatLngs) as L.LatLng[][],\n ) as unknown as ShapeLayer;\n\n const _onDrawCreated = onDrawCreatedRef.current;\n\n if (_onDrawCreated) {\n await _onDrawCreated(duplicatedLayer);\n }\n setActiveLayer(duplicatedLayer);\n // @ts-ignore no typings\n duplicatedLayer.dragging.enable();\n featureGroupRef.current?.addLayer(duplicatedLayer);\n },\n },\n ],\n });\n },\n [t],\n );\n\n // --- Callbacks: feature loading ---\n\n const loadFeatures = useCallback(\n (fg: L.FeatureGroup, features: GeoJSON.Feature[]) => {\n fg.clearLayers();\n\n const geoJSON = new L.GeoJSON({ type: 'FeatureCollection', features } as GeoJSON.FeatureCollection, {\n onEachFeature: (_, layer: ShapeLayer) => {\n bindEvents(layer);\n bindContextMenu(layer);\n makeDraggable(layer);\n setInitialStyles(layer);\n },\n });\n\n geoJSON.eachLayer((layer: ShapeLayer) => {\n fg.addLayer(layer);\n });\n },\n [bindEvents, bindContextMenu],\n );\n\n const setControlsDisplay = useCallback(\n (value: boolean) => {\n if (featureGroup) {\n const containers = document.getElementsByClassName('leaflet-control-container');\n\n Array.from(containers).forEach((container: HTMLDivElement) => {\n container.style['display'] = value ? 'block' : 'none';\n });\n }\n },\n [featureGroup],\n );\n\n // --- Callbacks: draw event handlers ---\n\n const onDrawCreated = useCallback(\n async (layer: ShapeLayer) => {\n const feature = layer.toGeoJSON();\n\n feature.properties = { ...(feature.properties || {}), id: uuidv4() };\n\n if (!layer.feature) {\n layer.feature = feature;\n }\n await createFeature(feature);\n\n bindEvents(layer);\n bindContextMenu(layer);\n makeDraggable(layer);\n setInitialStyles(layer);\n },\n [createFeature, bindEvents, bindContextMenu],\n );\n\n const onDrawEdited = useCallback(\n async (layers: ShapeLayer[]) => {\n await updateFeatures(layers);\n\n layers.forEach((layer: ShapeLayer) => {\n centerTooltip(layer);\n });\n },\n [updateFeatures],\n );\n\n const onDrawDeleted = useCallback(\n async (layers: ShapeLayer[]) => {\n await removeFeatures(layers);\n setActiveLayer(null);\n },\n [removeFeatures],\n );\n\n const onFeatureGroupReady = (_featureGroup: L.FeatureGroup) => {\n if (!featureGroup) {\n loadFeatures(_featureGroup, settings?.features || []);\n setFeatureGroup(_featureGroup);\n }\n };\n\n const saveMapView = async () => {\n const map = mapRef.current;\n\n if (map && updateSettings) {\n await updateSettings({\n zoom: map.getZoom(),\n center: map.getCenter(),\n });\n setActiveLayer(null);\n setViewChanged(false);\n }\n };\n\n // --- Effects ---\n\n // Track map view changes via zoom/move events.\n // Uses featureGroup as trigger — when it's set, the map is guaranteed to be ready.\n useEffect(() => {\n const map = mapRef.current;\n\n if (!map) return;\n\n const onViewChange = () => setViewChanged(true);\n\n map.on('zoomend', onViewChange);\n map.on('moveend', onViewChange);\n\n return () => {\n map.off('zoomend', onViewChange);\n map.off('moveend', onViewChange);\n };\n }, [featureGroup]);\n\n // MapContainer ignores center/zoom prop changes after initial render.\n // Sync the map view when settings arrive (e.g. after API response).\n useEffect(() => {\n const map = mapRef.current;\n\n if (map && settings?.center && settings?.zoom) {\n map.setView(settings.center, settings.zoom, { animate: false });\n }\n }, [settings?.center, settings?.zoom]);\n\n useEffect(() => {\n const map = mapRef.current;\n\n setControlsDisplay(!!editMode);\n editModeRef.current = !!editMode;\n\n if (map) {\n if (editMode) {\n map.scrollWheelZoom.enable();\n map.dragging.enable();\n } else {\n map.scrollWheelZoom.disable();\n map.dragging.disable();\n setActiveLayer(null);\n }\n }\n }, [editMode, setControlsDisplay]);\n\n // Sync refs for stable callbacks used by Leaflet event handlers\n useEffect(() => {\n updateFeatureRef.current = updateFeature;\n }, [updateFeature]);\n\n useEffect(() => {\n onDrawCreatedRef.current = onDrawCreated;\n onDrawEditedRef.current = onDrawEdited;\n onDrawDeletedRef.current = onDrawDeleted;\n }, [onDrawCreated, onDrawEdited, onDrawDeleted]);\n\n useEffect(() => {\n featureGroupRef.current = featureGroup;\n }, [featureGroup]);\n\n // Side panel for layer settings\n useEffect(() => {\n if (activeLayer && activeLayer !== prevActiveLayerRef.current) {\n updateSidePanelProps({\n open: true,\n width: '25%',\n title: t('mapWidget.areaSettings'),\n mainContent: <LayerSettings data={data} layer={activeLayer} updateFeature={updateFeature} />,\n onClose: () => setActiveLayer(null),\n });\n } else if (!activeLayer && prevActiveLayerRef.current) {\n updateSidePanelProps({ open: false });\n }\n prevActiveLayerRef.current = activeLayer;\n }, [data, activeLayer, updateFeature, updateSidePanelProps, t]);\n\n // Toggle dragging on active layer\n useEffect(() => {\n featureGroup?.eachLayer((layer: ShapeLayer) => {\n const tooltip = layer.getTooltip();\n\n if (layer === activeLayer) {\n // @ts-ignore no typings\n layer.dragging.enable();\n } else {\n // @ts-ignore no typings\n layer.dragging.disable();\n\n if (tooltip) {\n mapRef.current?.openTooltip(tooltip);\n }\n }\n });\n }, [activeLayer, featureGroup]);\n\n // Load floor plan image\n useEffect(() => {\n const floorPlanUrl = data.floorPlans?.find((floorPlan) => floorPlan.id === settings?.floorPlanId)?.imageUrl;\n\n if (floorPlanUrl) {\n setImageUrl(floorPlanUrl);\n\n getImageSize(floorPlanUrl)\n .then((dimensions) => setImageDimensions(dimensions))\n .catch(() => {});\n }\n }, [data?.floorPlans, settings?.floorPlanId]);\n\n // Reload features when settings arrive after initial render (race condition fix).\n // Only fires when featureGroup is empty — avoids clearing user-drawn layers.\n // Must run BEFORE the tooltip/status effect below so layers exist when tooltips are bound.\n useEffect(() => {\n if (featureGroup && settings?.features?.length && featureGroup.getLayers().length === 0) {\n loadFeatures(featureGroup, settings.features);\n }\n }, [featureGroup, settings?.features, loadFeatures]);\n\n // Apply status colors, tooltips, and popups to feature layers\n useEffect(() => {\n const getCurrentStatusChange = (workplaceId: string) =>\n (data?.statusChanges || [])\n .filter((statusChange) => statusChange.workplaceId === workplaceId)\n .sort((a, b) => new Date(a.startedAt).getTime() - new Date(b.startedAt).getTime())\n .pop();\n\n featureGroup?.getLayers().forEach((layer: ShapeLayer) => {\n const workplaceId = layer.feature?.properties.workplaceId;\n\n if (workplaceId) {\n const statusChange = getCurrentStatusChange(workplaceId);\n const statusColor = statusChange?.reason.statusColor;\n\n if (statusColor) {\n const color = mapStatusColorToHex(statusColor);\n\n layer.setStyle({ fillColor: color, fillOpacity: 0.65, color });\n } else {\n setInitialStyles(layer);\n }\n bindTooltip(getWorkplaceName(workplaceId), layer);\n\n if (statusChange?.order || statusChange?.product) {\n const orderNumberLabel = t('mapWidget.orderNumber');\n const productNumberLabel = t('mapWidget.productNumber');\n\n bindPopup(\n `\n <div>\n <p>${orderNumberLabel}: ${statusChange.order?.number || '-'}</p>\n <p>${productNumberLabel}: ${statusChange.product?.number || '-'}</p>\n <div>\n `,\n layer,\n );\n } else {\n mapRef.current?.closePopup(layer.getPopup());\n }\n }\n });\n }, [data, settings, featureGroup, getWorkplaceName, bindPopup, t]);\n\n return {\n containerRef,\n mapRef,\n imageUrl,\n imageDimensions,\n viewChanged,\n onFeatureGroupReady,\n onDrawCreatedRef,\n onDrawEditedRef,\n onDrawDeletedRef,\n saveMapView,\n };\n};\n\nexport default useMap;\n","import { SxProps, Theme } from '@mui/material/styles';\n\nconst styles: Record<string, SxProps<Theme>> = {\n saveButton: {\n padding: (theme) => theme.spacing(0.25, 3),\n fontSize: (theme) => theme.typography.pxToRem(14),\n '&.Mui-disabled': {\n color: 'rgba(255, 255, 255, 0.25)',\n },\n },\n};\n\nexport default styles;\n","import 'leaflet/dist/leaflet.css';\nimport 'leaflet-draw/dist/leaflet.draw.css';\nimport 'leaflet-contextmenu/dist/leaflet.contextmenu.css';\n\nimport { useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { FeatureGroup, ImageOverlay, MapContainer, ZoomControl } from 'react-leaflet';\nimport { EditControl } from 'react-leaflet-draw';\n\nimport { Box, Button } from '@mui/material';\nimport useSize from '@react-hook/size';\n\nimport { MapProps } from '@/types';\n\nimport Control from './Control';\nimport { setLeafletLocale } from './leafletLocale';\nimport useMap from './useMap';\nimport { calcImageBounds } from './utils';\n\nimport styles from './styles';\n\nconst Map: React.FC<MapProps> = ({ settings, ...props }) => {\n const { t } = useTranslation();\n\n useEffect(() => {\n setLeafletLocale(t);\n }, [t]);\n\n const {\n containerRef,\n mapRef,\n imageUrl,\n imageDimensions,\n viewChanged,\n onFeatureGroupReady,\n onDrawCreatedRef,\n onDrawEditedRef,\n onDrawDeletedRef,\n saveMapView,\n } = useMap({ settings, ...props });\n\n const [width, height] = useSize(containerRef.current);\n\n useEffect(() => {\n mapRef.current?.invalidateSize();\n }, [width, height]);\n\n return (\n <Box\n ref={containerRef}\n width=\"100%\"\n height=\"100%\"\n zIndex=\"0\"\n sx={{ position: 'relative' }}\n data-testid=\"map.container\"\n >\n <MapContainer\n ref={mapRef}\n center={settings?.center || [width / 2, height / 2]}\n minZoom={1}\n maxZoom={5}\n zoom={settings?.zoom || 1}\n zoomSnap={0.1}\n zoomDelta={0.1}\n wheelPxPerZoomLevel={600}\n zoomControl={false}\n doubleClickZoom={false}\n touchZoom={false}\n // @ts-expect-error leaflet-contextmenu extends MapOptions\n contextmenu\n >\n {mapRef.current && imageUrl && imageDimensions && (\n <ImageOverlay url={imageUrl} bounds={calcImageBounds(mapRef.current, imageDimensions)} />\n )}\n <FeatureGroup\n ref={(featureGroup) => {\n if (featureGroup) onFeatureGroupReady(featureGroup);\n }}\n >\n <EditControl\n draw={{\n polyline: false,\n polygon: true,\n rectangle: false,\n circle: false,\n marker: false,\n circlemarker: false,\n }}\n onCreated={async ({ layer }) => {\n const _onDrawCreated = onDrawCreatedRef.current;\n\n if (_onDrawCreated) {\n await _onDrawCreated(layer);\n }\n }}\n onEdited={async ({ layers }) => {\n const _onDrawEdited = onDrawEditedRef.current;\n\n if (_onDrawEdited) {\n await _onDrawEdited(layers.getLayers());\n }\n }}\n onDeleted={async ({ layers }) => {\n const _onDrawDeleted = onDrawDeletedRef.current;\n\n if (_onDrawDeleted) {\n await _onDrawDeleted(layers.getLayers());\n }\n }}\n position=\"topleft\"\n />\n </FeatureGroup>\n <ZoomControl position=\"topright\" />\n <Control mapRef={mapRef} position=\"topright\">\n <Button\n onClick={() => saveMapView()}\n disabled={!viewChanged}\n sx={styles.saveButton}\n data-testid=\"map.freeze-button\"\n >\n {t('mapWidget.freeze')}\n </Button>\n </Control>\n </MapContainer>\n </Box>\n );\n};\n\nexport default Map;\n","import { WidgetViewProps } from '@/types';\n\nimport Map from '../Map';\n\nconst WidgetView: React.FC<WidgetViewProps> = (props) => {\n return <Map {...props} />;\n};\n\nexport default WidgetView;\n","import { TFunction } from 'i18next';\nimport * as yup from 'yup';\n\nexport const getSettingsFormProps = (t: TFunction) => {\n yup.setLocale({\n mixed: {\n required: t('mapWidget.thisFieldIsRequired'),\n },\n });\n return {\n initialValues: {\n customTitle: '',\n floorPlanId: '',\n },\n validationSchema: yup.object({\n floorPlanId: yup.string().required(),\n }),\n };\n};\n","import { useEffect, useState } from 'react';\n\nimport {\n StatusChange,\n useGqlClients,\n WidgetProps,\n WorkplaceEvent,\n WorkplaceEventDocument,\n WorkplaceEventSubscriptionPayload,\n} from 'andoncloud-dashboard-toolkit';\nimport { BaseWidget } from 'andoncloud-widget-base';\nimport { print } from 'graphql';\n\nimport locales from '@/locales';\nimport { WidgetData, WidgetSettings } from '@/types';\nimport { LIBRARY_VERSION } from '@/version';\n\nimport SettingsFormContent from '../SettingsFormContent';\nimport WidgetView from '../WidgetView';\n\nimport { getSettingsFormProps } from './utils';\n\nconst Widget: React.FC<WidgetProps<WidgetData, WidgetSettings>> = ({ url, wsUrl, lang, data, ...widgetProps }) => {\n const { graphqlSdk, gqlWsClient } = useGqlClients({ url, wsUrl, lang });\n const [gqlWsSubscribed, setGqlWsSubscribed] = useState<boolean>(false);\n const [widgetData, setWidgetData] = useState<WidgetData | undefined>(data);\n\n useEffect(() => {\n if (!widgetData && graphqlSdk) {\n graphqlSdk\n .listWorkplaces()\n .then(({ workplaces }) => {\n return setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n workplaces,\n }));\n })\n .catch(() => {});\n\n graphqlSdk\n .listStatusChanges()\n .then(({ statusChanges }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges,\n })),\n )\n .catch(() => {});\n\n graphqlSdk\n .listFloorPlans()\n .then(({ floorPlans }) => {\n return setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n floorPlans,\n }));\n })\n .catch(() => {});\n }\n if (widgetData?.workplaces && gqlWsClient && !gqlWsSubscribed) {\n widgetData.workplaces.forEach(({ id }) => {\n gqlWsClient.subscribe<WorkplaceEventSubscriptionPayload>(\n print(WorkplaceEventDocument),\n { id },\n ({ event, subject }) => {\n if (event === WorkplaceEvent.StatusChangeCreated) {\n const statusChange = subject as StatusChange;\n\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges: [statusChange, ...current.statusChanges],\n }));\n } else if (event === WorkplaceEvent.StatusChangeUpdated) {\n const updatedStatusChange = subject as StatusChange;\n\n setWidgetData((current: WidgetData) => {\n const statusChanges = current.statusChanges.map((statusChange) =>\n statusChange.id === updatedStatusChange.id ? updatedStatusChange : statusChange,\n );\n return {\n ...(current || {}),\n statusChanges,\n };\n });\n }\n },\n );\n setGqlWsSubscribed(true);\n });\n }\n }, [data, graphqlSdk, gqlWsClient, gqlWsSubscribed, widgetData]);\n\n return (\n <BaseWidget\n {...widgetProps}\n lang={lang}\n locales={locales}\n data={widgetData}\n gqlClients={{ graphqlSdk, gqlWsClient }}\n WidgetView={WidgetView}\n getSettingsFormProps={getSettingsFormProps}\n SettingsFormContent={SettingsFormContent}\n version={LIBRARY_VERSION}\n data-testid=\"map-widget\"\n />\n );\n};\n\nexport default Widget;\n","import type { FilterValues } from 'andoncloud-dashboard-toolkit';\nimport i18n from 'i18next';\n\nimport type { WidgetData, WidgetSettings } from '../types';\n\nconst ns = 'mapWidget';\n\nconst t = (key: string, lng: string, options?: Record<string, unknown>) => i18n.t(`${ns}.${key}`, { lng, ...options });\n\nexport const getDisplayName = (lang: string) => t('displayName', lang);\n\nexport const getTitle = (\n data: WidgetData | undefined,\n settings: WidgetSettings | undefined,\n _filters: FilterValues | undefined,\n lang: string,\n): string => {\n const name = getDisplayName(lang);\n\n const features = settings?.features;\n if (!features?.length) return name;\n\n const mapped = features.filter((f) => f.properties?.workplaceId).length;\n if (mapped === 0) return name;\n\n const statusChanges = data?.statusChanges ?? [];\n\n const latestByWorkplace = new Map<string, { startedAt: string; color: string }>();\n for (const sc of statusChanges) {\n const existing = latestByWorkplace.get(sc.workplaceId);\n if (!existing || sc.startedAt > existing.startedAt) {\n latestByWorkplace.set(sc.workplaceId, { startedAt: sc.startedAt, color: sc.reason?.statusColor ?? '' });\n }\n }\n\n let working = 0;\n let down = 0;\n for (const { color } of latestByWorkplace.values()) {\n if (color === 'green') working++;\n else if (color === 'red') down++;\n }\n\n const parts = [\n t('titleWorkplaces', lang, { count: mapped }),\n t('titleWorking', lang, { count: working }),\n t('titleDown', lang, { count: down }),\n ];\n\n return `${name} — ${parts.join(', ')}`;\n};\n","import './index.css';\n\nimport { registerTranslations } from 'andoncloud-sdk';\n\nimport locales from './locales';\n\nregisterTranslations(locales);\n\nexport { default as Widget } from './components/Widget';\nexport { getDisplayName, getTitle } from './core/title';\n\nexport const thumbnail: string | undefined = undefined;\n\nexport const requiredFeatures: string[] = ['feature.map-widget'];\nexport const extraPermissions: string[] = [];\n\nexport { LIBRARY_VERSION as version } from './version';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AEGA,MAAM,YAAY;CAChB,IAAI,EACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MACD;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AAI,CAAC;;CAI3G,IAAI,UAAU;CACd,IAAI,OAAO;AACX,MAAK,MAAM,EAAE,WAAW,kBAAkB,QAAQ,CAChD,KAAI,UAAU,QAAS;UACd,UAAU,MAAO;AAS5B,QAAO,GAAG,KAAK,KAND;EACZ,EAAE,mBAAmB,MAAM,EAAE,OAAO,QAAQ,CAAC;EAC7C,EAAE,gBAAgB,MAAM,EAAE,OAAO,SAAS,CAAC;EAC3C,EAAE,aAAa,MAAM,EAAE,OAAO,MAAM,CAAC;EACtC,CAEyB,KAAK,KAAK;;;;AC1CtC,qBAAqBC,UAAQ;AAK7B,MAAa,YAAgC,KAAA;AAE7C,MAAa,mBAA6B,CAAC,qBAAqB;AAChE,MAAa,mBAA6B,EAAE"}
package/dist/style.css CHANGED
@@ -1,961 +1,3 @@
1
- .leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-tile-container, .leaflet-pane > svg, .leaflet-pane > canvas, .leaflet-zoom-box, .leaflet-image-layer, .leaflet-layer {
2
- position: absolute;
3
- top: 0;
4
- left: 0;
5
- }
6
-
7
- .leaflet-container {
8
- overflow: hidden;
9
- }
10
-
11
- .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow {
12
- -webkit-user-select: none;
13
- -moz-user-select: none;
14
- user-select: none;
15
- -webkit-user-drag: none;
16
- }
17
-
18
- .leaflet-tile::selection {
19
- background: none;
20
- }
21
-
22
- .leaflet-safari .leaflet-tile {
23
- image-rendering: -webkit-optimize-contrast;
24
- }
25
-
26
- .leaflet-safari .leaflet-tile-container {
27
- -webkit-transform-origin: 0 0;
28
- width: 1600px;
29
- height: 1600px;
30
- }
31
-
32
- .leaflet-marker-icon, .leaflet-marker-shadow {
33
- display: block;
34
- }
35
-
36
- .leaflet-container .leaflet-overlay-pane svg {
37
- max-width: none !important;
38
- max-height: none !important;
39
- }
40
-
41
- .leaflet-container .leaflet-marker-pane img, .leaflet-container .leaflet-shadow-pane img, .leaflet-container .leaflet-tile-pane img, .leaflet-container img.leaflet-image-layer, .leaflet-container .leaflet-tile {
42
- width: auto;
43
- padding: 0;
44
- max-width: none !important;
45
- max-height: none !important;
46
- }
47
-
48
- .leaflet-container img.leaflet-tile {
49
- mix-blend-mode: plus-lighter;
50
- }
51
-
52
- .leaflet-container.leaflet-touch-zoom {
53
- -ms-touch-action: pan-x pan-y;
54
- touch-action: pan-x pan-y;
55
- }
56
-
57
- .leaflet-container.leaflet-touch-drag {
58
- -ms-touch-action: pinch-zoom;
59
- touch-action: none;
60
- touch-action: pinch-zoom;
61
- }
62
-
63
- .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
64
- -ms-touch-action: none;
65
- touch-action: none;
66
- }
67
-
68
- .leaflet-container {
69
- -webkit-tap-highlight-color: transparent;
70
- }
71
-
72
- .leaflet-container a {
73
- -webkit-tap-highlight-color: #33b5e566;
74
- }
75
-
76
- .leaflet-tile {
77
- filter: inherit;
78
- visibility: hidden;
79
- }
80
-
81
- .leaflet-tile-loaded {
82
- visibility: inherit;
83
- }
84
-
85
- .leaflet-zoom-box {
86
- -moz-box-sizing: border-box;
87
- box-sizing: border-box;
88
- z-index: 800;
89
- width: 0;
90
- height: 0;
91
- }
92
-
93
- .leaflet-overlay-pane svg {
94
- -moz-user-select: none;
95
- }
96
-
97
- .leaflet-pane {
98
- z-index: 400;
99
- }
100
-
101
- .leaflet-tile-pane {
102
- z-index: 200;
103
- }
104
-
105
- .leaflet-overlay-pane {
106
- z-index: 400;
107
- }
108
-
109
- .leaflet-shadow-pane {
110
- z-index: 500;
111
- }
112
-
113
- .leaflet-marker-pane {
114
- z-index: 600;
115
- }
116
-
117
- .leaflet-tooltip-pane {
118
- z-index: 650;
119
- }
120
-
121
- .leaflet-popup-pane {
122
- z-index: 700;
123
- }
124
-
125
- .leaflet-map-pane canvas {
126
- z-index: 100;
127
- }
128
-
129
- .leaflet-map-pane svg {
130
- z-index: 200;
131
- }
132
-
133
- .leaflet-vml-shape {
134
- width: 1px;
135
- height: 1px;
136
- }
137
-
138
- .lvml {
139
- behavior: url("#default#VML");
140
- display: inline-block;
141
- position: absolute;
142
- }
143
-
144
- .leaflet-control {
145
- z-index: 800;
146
- pointer-events: visiblePainted;
147
- pointer-events: auto;
148
- position: relative;
149
- }
150
-
151
- .leaflet-top, .leaflet-bottom {
152
- z-index: 1000;
153
- pointer-events: none;
154
- position: absolute;
155
- }
156
-
157
- .leaflet-top {
158
- top: 0;
159
- }
160
-
161
- .leaflet-right {
162
- right: 0;
163
- }
164
-
165
- .leaflet-bottom {
166
- bottom: 0;
167
- }
168
-
169
- .leaflet-left {
170
- left: 0;
171
- }
172
-
173
- .leaflet-control {
174
- float: left;
175
- clear: both;
176
- }
177
-
178
- .leaflet-right .leaflet-control {
179
- float: right;
180
- }
181
-
182
- .leaflet-top .leaflet-control {
183
- margin-top: 10px;
184
- }
185
-
186
- .leaflet-bottom .leaflet-control {
187
- margin-bottom: 10px;
188
- }
189
-
190
- .leaflet-left .leaflet-control {
191
- margin-left: 10px;
192
- }
193
-
194
- .leaflet-right .leaflet-control {
195
- margin-right: 10px;
196
- }
197
-
198
- .leaflet-fade-anim .leaflet-popup {
199
- opacity: 0;
200
- -webkit-transition: opacity .2s linear;
201
- -moz-transition: opacity .2s linear;
202
- transition: opacity .2s linear;
203
- }
204
-
205
- .leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
206
- opacity: 1;
207
- }
208
-
209
- .leaflet-zoom-animated {
210
- -webkit-transform-origin: 0 0;
211
- -ms-transform-origin: 0 0;
212
- transform-origin: 0 0;
213
- }
214
-
215
- svg.leaflet-zoom-animated {
216
- will-change: transform;
217
- }
218
-
219
- .leaflet-zoom-anim .leaflet-zoom-animated {
220
- -webkit-transition: -webkit-transform .25s cubic-bezier(0, 0, .25, 1);
221
- -moz-transition: -moz-transform .25s cubic-bezier(0, 0, .25, 1);
222
- transition: transform .25s cubic-bezier(0, 0, .25, 1);
223
- }
224
-
225
- .leaflet-zoom-anim .leaflet-tile, .leaflet-pan-anim .leaflet-tile {
226
- -webkit-transition: none;
227
- -moz-transition: none;
228
- transition: none;
229
- }
230
-
231
- .leaflet-zoom-anim .leaflet-zoom-hide {
232
- visibility: hidden;
233
- }
234
-
235
- .leaflet-interactive {
236
- cursor: pointer;
237
- }
238
-
239
- .leaflet-grab {
240
- cursor: -webkit-grab;
241
- cursor: -moz-grab;
242
- cursor: grab;
243
- }
244
-
245
- .leaflet-crosshair, .leaflet-crosshair .leaflet-interactive {
246
- cursor: crosshair;
247
- }
248
-
249
- .leaflet-popup-pane, .leaflet-control {
250
- cursor: auto;
251
- }
252
-
253
- .leaflet-dragging .leaflet-grab, .leaflet-dragging .leaflet-grab .leaflet-interactive, .leaflet-dragging .leaflet-marker-draggable {
254
- cursor: move;
255
- cursor: -webkit-grabbing;
256
- cursor: -moz-grabbing;
257
- cursor: grabbing;
258
- }
259
-
260
- .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-image-layer, .leaflet-pane > svg path, .leaflet-tile-container {
261
- pointer-events: none;
262
- }
263
-
264
- .leaflet-marker-icon.leaflet-interactive, .leaflet-image-layer.leaflet-interactive, .leaflet-pane > svg path.leaflet-interactive, svg.leaflet-image-layer.leaflet-interactive path {
265
- pointer-events: visiblePainted;
266
- pointer-events: auto;
267
- }
268
-
269
- .leaflet-container {
270
- outline-offset: 1px;
271
- background: #ddd;
272
- }
273
-
274
- .leaflet-container a {
275
- color: #0078a8;
276
- }
277
-
278
- .leaflet-zoom-box {
279
- background: #ffffff80;
280
- border: 2px dotted #38f;
281
- }
282
-
283
- .leaflet-container {
284
- font-family: Helvetica Neue, Arial, Helvetica, sans-serif;
285
- font-size: .75rem;
286
- line-height: 1.5;
287
- }
288
-
289
- .leaflet-bar {
290
- border-radius: 4px;
291
- box-shadow: 0 1px 5px #000000a6;
292
- }
293
-
294
- .leaflet-bar a {
295
- text-align: center;
296
- color: #000;
297
- background-color: #fff;
298
- border-bottom: 1px solid #ccc;
299
- width: 26px;
300
- height: 26px;
301
- line-height: 26px;
302
- text-decoration: none;
303
- display: block;
304
- }
305
-
306
- .leaflet-bar a, .leaflet-control-layers-toggle {
307
- background-position: 50%;
308
- background-repeat: no-repeat;
309
- display: block;
310
- }
311
-
312
- .leaflet-bar a:hover, .leaflet-bar a:focus {
313
- background-color: #f4f4f4;
314
- }
315
-
316
- .leaflet-bar a:first-child {
317
- border-top-left-radius: 4px;
318
- border-top-right-radius: 4px;
319
- }
320
-
321
- .leaflet-bar a:last-child {
322
- border-bottom: none;
323
- border-bottom-right-radius: 4px;
324
- border-bottom-left-radius: 4px;
325
- }
326
-
327
- .leaflet-bar a.leaflet-disabled {
328
- cursor: default;
329
- color: #bbb;
330
- background-color: #f4f4f4;
331
- }
332
-
333
- .leaflet-touch .leaflet-bar a {
334
- width: 30px;
335
- height: 30px;
336
- line-height: 30px;
337
- }
338
-
339
- .leaflet-touch .leaflet-bar a:first-child {
340
- border-top-left-radius: 2px;
341
- border-top-right-radius: 2px;
342
- }
343
-
344
- .leaflet-touch .leaflet-bar a:last-child {
345
- border-bottom-right-radius: 2px;
346
- border-bottom-left-radius: 2px;
347
- }
348
-
349
- .leaflet-control-zoom-in, .leaflet-control-zoom-out {
350
- text-indent: 1px;
351
- font: bold 18px Lucida Console, Monaco, monospace;
352
- }
353
-
354
- .leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
355
- font-size: 22px;
356
- }
357
-
358
- .leaflet-control-layers {
359
- background: #fff;
360
- border-radius: 5px;
361
- box-shadow: 0 1px 5px #0006;
362
- }
363
-
364
- .leaflet-control-layers-toggle {
365
- background-image: url("images/layers.png");
366
- width: 36px;
367
- height: 36px;
368
- }
369
-
370
- .leaflet-retina .leaflet-control-layers-toggle {
371
- background-image: url("images/layers-2x.png");
372
- background-size: 26px 26px;
373
- }
374
-
375
- .leaflet-touch .leaflet-control-layers-toggle {
376
- width: 44px;
377
- height: 44px;
378
- }
379
-
380
- .leaflet-control-layers .leaflet-control-layers-list, .leaflet-control-layers-expanded .leaflet-control-layers-toggle {
381
- display: none;
382
- }
383
-
384
- .leaflet-control-layers-expanded .leaflet-control-layers-list {
385
- display: block;
386
- position: relative;
387
- }
388
-
389
- .leaflet-control-layers-expanded {
390
- color: #333;
391
- background: #fff;
392
- padding: 6px 10px 6px 6px;
393
- }
394
-
395
- .leaflet-control-layers-scrollbar {
396
- padding-right: 5px;
397
- overflow: hidden scroll;
398
- }
399
-
400
- .leaflet-control-layers-selector {
401
- margin-top: 2px;
402
- position: relative;
403
- top: 1px;
404
- }
405
-
406
- .leaflet-control-layers label {
407
- font-size: 1.08333em;
408
- display: block;
409
- }
410
-
411
- .leaflet-control-layers-separator {
412
- border-top: 1px solid #ddd;
413
- height: 0;
414
- margin: 5px -10px 5px -6px;
415
- }
416
-
417
- .leaflet-default-icon-path {
418
- background-image: url("images/marker-icon.png");
419
- }
420
-
421
- .leaflet-container .leaflet-control-attribution {
422
- background: #fffc;
423
- margin: 0;
424
- }
425
-
426
- .leaflet-control-attribution, .leaflet-control-scale-line {
427
- color: #333;
428
- padding: 0 5px;
429
- line-height: 1.4;
430
- }
431
-
432
- .leaflet-control-attribution a {
433
- text-decoration: none;
434
- }
435
-
436
- .leaflet-control-attribution a:hover, .leaflet-control-attribution a:focus {
437
- text-decoration: underline;
438
- }
439
-
440
- .leaflet-attribution-flag {
441
- width: 1em;
442
- height: .6669em;
443
- vertical-align: baseline !important;
444
- display: inline !important;
445
- }
446
-
447
- .leaflet-left .leaflet-control-scale {
448
- margin-left: 5px;
449
- }
450
-
451
- .leaflet-bottom .leaflet-control-scale {
452
- margin-bottom: 5px;
453
- }
454
-
455
- .leaflet-control-scale-line {
456
- white-space: nowrap;
457
- -moz-box-sizing: border-box;
458
- box-sizing: border-box;
459
- text-shadow: 1px 1px #fff;
460
- background: #fffc;
461
- border: 2px solid #777;
462
- border-top: none;
463
- padding: 2px 5px 1px;
464
- line-height: 1.1;
465
- }
466
-
467
- .leaflet-control-scale-line:not(:first-child) {
468
- border-top: 2px solid #777;
469
- border-bottom: none;
470
- margin-top: -2px;
471
- }
472
-
473
- .leaflet-control-scale-line:not(:first-child):not(:last-child) {
474
- border-bottom: 2px solid #777;
475
- }
476
-
477
- .leaflet-touch .leaflet-control-attribution, .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar {
478
- box-shadow: none;
479
- }
480
-
481
- .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar {
482
- background-clip: padding-box;
483
- border: 2px solid #0003;
484
- }
485
-
486
- .leaflet-popup {
487
- text-align: center;
488
- margin-bottom: 20px;
489
- position: absolute;
490
- }
491
-
492
- .leaflet-popup-content-wrapper {
493
- text-align: left;
494
- border-radius: 12px;
495
- padding: 1px;
496
- }
497
-
498
- .leaflet-popup-content {
499
- min-height: 1px;
500
- margin: 13px 24px 13px 20px;
501
- font-size: 1.08333em;
502
- line-height: 1.3;
503
- }
504
-
505
- .leaflet-popup-content p {
506
- margin: 1.3em 0;
507
- }
508
-
509
- .leaflet-popup-tip-container {
510
- pointer-events: none;
511
- width: 40px;
512
- height: 20px;
513
- margin-top: -1px;
514
- margin-left: -20px;
515
- position: absolute;
516
- left: 50%;
517
- overflow: hidden;
518
- }
519
-
520
- .leaflet-popup-tip {
521
- pointer-events: auto;
522
- width: 17px;
523
- height: 17px;
524
- margin: -10px auto 0;
525
- padding: 1px;
526
- -webkit-transform: rotate(45deg);
527
- -moz-transform: rotate(45deg);
528
- -ms-transform: rotate(45deg);
529
- transform: rotate(45deg);
530
- }
531
-
532
- .leaflet-popup-content-wrapper, .leaflet-popup-tip {
533
- color: #333;
534
- background: #fff;
535
- box-shadow: 0 3px 14px #0006;
536
- }
537
-
538
- .leaflet-container a.leaflet-popup-close-button {
539
- text-align: center;
540
- color: #757575;
541
- background: none;
542
- border: none;
543
- width: 24px;
544
- height: 24px;
545
- font: 16px / 24px Tahoma, Verdana, sans-serif;
546
- text-decoration: none;
547
- position: absolute;
548
- top: 0;
549
- right: 0;
550
- }
551
-
552
- .leaflet-container a.leaflet-popup-close-button:hover, .leaflet-container a.leaflet-popup-close-button:focus {
553
- color: #585858;
554
- }
555
-
556
- .leaflet-popup-scrolled {
557
- overflow: auto;
558
- }
559
-
560
- .leaflet-oldie .leaflet-popup-content-wrapper {
561
- -ms-zoom: 1;
562
- }
563
-
564
- .leaflet-oldie .leaflet-popup-tip {
565
- -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
566
- width: 24px;
567
- filter: progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);
568
- margin: 0 auto;
569
- }
570
-
571
- .leaflet-oldie .leaflet-control-zoom, .leaflet-oldie .leaflet-control-layers, .leaflet-oldie .leaflet-popup-content-wrapper, .leaflet-oldie .leaflet-popup-tip {
572
- border: 1px solid #999;
573
- }
574
-
575
- .leaflet-div-icon {
576
- background: #fff;
577
- border: 1px solid #666;
578
- }
579
-
580
- .leaflet-tooltip {
581
- color: #222;
582
- white-space: nowrap;
583
- -webkit-user-select: none;
584
- -moz-user-select: none;
585
- -ms-user-select: none;
586
- user-select: none;
587
- pointer-events: none;
588
- background-color: #fff;
589
- border: 1px solid #fff;
590
- border-radius: 3px;
591
- padding: 6px;
592
- position: absolute;
593
- box-shadow: 0 1px 3px #0006;
594
- }
595
-
596
- .leaflet-tooltip.leaflet-interactive {
597
- cursor: pointer;
598
- pointer-events: auto;
599
- }
600
-
601
- .leaflet-tooltip-top:before, .leaflet-tooltip-bottom:before, .leaflet-tooltip-left:before, .leaflet-tooltip-right:before {
602
- pointer-events: none;
603
- content: "";
604
- background: none;
605
- border: 6px solid #0000;
606
- position: absolute;
607
- }
608
-
609
- .leaflet-tooltip-bottom {
610
- margin-top: 6px;
611
- }
612
-
613
- .leaflet-tooltip-top {
614
- margin-top: -6px;
615
- }
616
-
617
- .leaflet-tooltip-bottom:before, .leaflet-tooltip-top:before {
618
- margin-left: -6px;
619
- left: 50%;
620
- }
621
-
622
- .leaflet-tooltip-top:before {
623
- border-top-color: #fff;
624
- margin-bottom: -12px;
625
- bottom: 0;
626
- }
627
-
628
- .leaflet-tooltip-bottom:before {
629
- border-bottom-color: #fff;
630
- margin-top: -12px;
631
- margin-left: -6px;
632
- top: 0;
633
- }
634
-
635
- .leaflet-tooltip-left {
636
- margin-left: -6px;
637
- }
638
-
639
- .leaflet-tooltip-right {
640
- margin-left: 6px;
641
- }
642
-
643
- .leaflet-tooltip-left:before, .leaflet-tooltip-right:before {
644
- margin-top: -6px;
645
- top: 50%;
646
- }
647
-
648
- .leaflet-tooltip-left:before {
649
- border-left-color: #fff;
650
- margin-right: -12px;
651
- right: 0;
652
- }
653
-
654
- .leaflet-tooltip-right:before {
655
- border-right-color: #fff;
656
- margin-left: -12px;
657
- left: 0;
658
- }
659
-
660
- @media print {
661
- .leaflet-control {
662
- -webkit-print-color-adjust: exact;
663
- print-color-adjust: exact;
664
- }
665
- }
666
-
667
- .leaflet-draw-section {
668
- position: relative;
669
- }
670
-
671
- .leaflet-draw-toolbar {
672
- margin-top: 12px;
673
- }
674
-
675
- .leaflet-draw-toolbar-top {
676
- margin-top: 0;
677
- }
678
-
679
- .leaflet-draw-toolbar-notop a:first-child {
680
- border-top-right-radius: 0;
681
- }
682
-
683
- .leaflet-draw-toolbar-nobottom a:last-child {
684
- border-bottom-right-radius: 0;
685
- }
686
-
687
- .leaflet-draw-toolbar a {
688
- background-image: linear-gradient(#0000, #0000), url("images/spritesheet.svg");
689
- background-repeat: no-repeat;
690
- background-size: 300px 30px;
691
- background-clip: padding-box;
692
- }
693
-
694
- .leaflet-retina .leaflet-draw-toolbar a {
695
- background-image: linear-gradient(#0000, #0000), url("images/spritesheet.svg");
696
- }
697
-
698
- .leaflet-draw a {
699
- text-align: center;
700
- text-decoration: none;
701
- display: block;
702
- }
703
-
704
- .leaflet-draw a .sr-only {
705
- clip: rect(0,0,0,0);
706
- border: 0;
707
- width: 1px;
708
- height: 1px;
709
- margin: -1px;
710
- padding: 0;
711
- position: absolute;
712
- overflow: hidden;
713
- }
714
-
715
- .leaflet-draw-actions {
716
- white-space: nowrap;
717
- margin: 0;
718
- padding: 0;
719
- list-style: none;
720
- display: none;
721
- position: absolute;
722
- top: 0;
723
- left: 26px;
724
- }
725
-
726
- .leaflet-touch .leaflet-draw-actions {
727
- left: 32px;
728
- }
729
-
730
- .leaflet-right .leaflet-draw-actions {
731
- left: auto;
732
- right: 26px;
733
- }
734
-
735
- .leaflet-touch .leaflet-right .leaflet-draw-actions {
736
- left: auto;
737
- right: 32px;
738
- }
739
-
740
- .leaflet-draw-actions li {
741
- display: inline-block;
742
- }
743
-
744
- .leaflet-draw-actions li:first-child a {
745
- border-left: 0;
746
- }
747
-
748
- .leaflet-draw-actions li:last-child a {
749
- -webkit-border-radius: 0 4px 4px 0;
750
- border-radius: 0 4px 4px 0;
751
- }
752
-
753
- .leaflet-right .leaflet-draw-actions li:last-child a {
754
- -webkit-border-radius: 0;
755
- border-radius: 0;
756
- }
757
-
758
- .leaflet-right .leaflet-draw-actions li:first-child a {
759
- -webkit-border-radius: 4px 0 0 4px;
760
- border-radius: 4px 0 0 4px;
761
- }
762
-
763
- .leaflet-draw-actions a {
764
- color: #fff;
765
- background-color: #919187;
766
- border-left: 1px solid #aaa;
767
- height: 28px;
768
- padding-left: 10px;
769
- padding-right: 10px;
770
- font: 11px / 28px Helvetica Neue, Arial, Helvetica, sans-serif;
771
- text-decoration: none;
772
- }
773
-
774
- .leaflet-touch .leaflet-draw-actions a {
775
- height: 30px;
776
- font-size: 12px;
777
- line-height: 30px;
778
- }
779
-
780
- .leaflet-draw-actions-bottom {
781
- margin-top: 0;
782
- }
783
-
784
- .leaflet-draw-actions-top {
785
- margin-top: 1px;
786
- }
787
-
788
- .leaflet-draw-actions-top a, .leaflet-draw-actions-bottom a {
789
- height: 27px;
790
- line-height: 27px;
791
- }
792
-
793
- .leaflet-draw-actions a:hover {
794
- background-color: #a0a098;
795
- }
796
-
797
- .leaflet-draw-actions-top.leaflet-draw-actions-bottom a {
798
- height: 26px;
799
- line-height: 26px;
800
- }
801
-
802
- .leaflet-draw-toolbar .leaflet-draw-draw-polyline {
803
- background-position: -2px -2px;
804
- }
805
-
806
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-polyline {
807
- background-position: 0 -1px;
808
- }
809
-
810
- .leaflet-draw-toolbar .leaflet-draw-draw-polygon {
811
- background-position: -31px -2px;
812
- }
813
-
814
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-polygon {
815
- background-position: -29px -1px;
816
- }
817
-
818
- .leaflet-draw-toolbar .leaflet-draw-draw-rectangle {
819
- background-position: -62px -2px;
820
- }
821
-
822
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-rectangle {
823
- background-position: -60px -1px;
824
- }
825
-
826
- .leaflet-draw-toolbar .leaflet-draw-draw-circle {
827
- background-position: -92px -2px;
828
- }
829
-
830
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-circle {
831
- background-position: -90px -1px;
832
- }
833
-
834
- .leaflet-draw-toolbar .leaflet-draw-draw-marker {
835
- background-position: -122px -2px;
836
- }
837
-
838
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-marker {
839
- background-position: -120px -1px;
840
- }
841
-
842
- .leaflet-draw-toolbar .leaflet-draw-draw-circlemarker {
843
- background-position: -273px -2px;
844
- }
845
-
846
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-circlemarker {
847
- background-position: -271px -1px;
848
- }
849
-
850
- .leaflet-draw-toolbar .leaflet-draw-edit-edit {
851
- background-position: -152px -2px;
852
- }
853
-
854
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit {
855
- background-position: -150px -1px;
856
- }
857
-
858
- .leaflet-draw-toolbar .leaflet-draw-edit-remove {
859
- background-position: -182px -2px;
860
- }
861
-
862
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove {
863
- background-position: -180px -1px;
864
- }
865
-
866
- .leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled {
867
- background-position: -212px -2px;
868
- }
869
-
870
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled {
871
- background-position: -210px -1px;
872
- }
873
-
874
- .leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled {
875
- background-position: -242px -2px;
876
- }
877
-
878
- .leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled {
879
- background-position: -240px -2px;
880
- }
881
-
882
- .leaflet-mouse-marker {
883
- cursor: crosshair;
884
- background-color: #fff;
885
- }
886
-
887
- .leaflet-draw-tooltip {
888
- color: #fff;
889
- visibility: hidden;
890
- white-space: nowrap;
891
- z-index: 6;
892
- background: #00000080;
893
- border: 1px solid #0000;
894
- -webkit-border-radius: 4px;
895
- border-radius: 4px;
896
- margin-top: -21px;
897
- margin-left: 20px;
898
- padding: 4px 8px;
899
- font: 12px / 18px Helvetica Neue, Arial, Helvetica, sans-serif;
900
- position: absolute;
901
- }
902
-
903
- .leaflet-draw-tooltip:before {
904
- content: "";
905
- border-top: 6px solid #0000;
906
- border-bottom: 6px solid #0000;
907
- border-right: 6px solid #00000080;
908
- position: absolute;
909
- top: 7px;
910
- left: -7px;
911
- }
912
-
913
- .leaflet-error-draw-tooltip {
914
- color: #b94a48;
915
- background-color: #f2dede;
916
- border: 1px solid #e6b6bd;
917
- }
918
-
919
- .leaflet-error-draw-tooltip:before {
920
- border-right-color: #e6b6bd;
921
- }
922
-
923
- .leaflet-draw-tooltip-single {
924
- margin-top: -12px;
925
- }
926
-
927
- .leaflet-draw-tooltip-subtext {
928
- color: #f8d5e4;
929
- }
930
-
931
- .leaflet-draw-guide-dash {
932
- opacity: .6;
933
- width: 5px;
934
- height: 5px;
935
- font-size: 1%;
936
- position: absolute;
937
- }
938
-
939
- .leaflet-edit-marker-selected {
940
- box-sizing: content-box;
941
- background-color: #fe57a11a;
942
- border: 4px dashed #fe57a199;
943
- -webkit-border-radius: 4px;
944
- border-radius: 4px;
945
- }
946
-
947
- .leaflet-edit-move {
948
- cursor: move;
949
- }
950
-
951
- .leaflet-edit-resize {
952
- cursor: pointer;
953
- }
954
-
955
- .leaflet-oldie .leaflet-draw-toolbar {
956
- border: 1px solid #999;
957
- }
958
-
959
1
  @keyframes pulse {
960
2
  0% {
961
3
  stroke: #155ed1;
@@ -970,7 +12,7 @@ svg.leaflet-zoom-animated {
970
12
  }
971
13
  }
972
14
 
973
- .leaflet-container {
15
+ .leaflet-container.leaflet-container {
974
16
  background: #e0e0e0;
975
17
  height: 100%;
976
18
  }
@@ -994,7 +36,7 @@ svg.leaflet-zoom-animated {
994
36
  background-color: #ffffffbf;
995
37
  }
996
38
 
997
- .leaflet-top {
39
+ .leaflet-top.leaflet-top {
998
40
  background: #484a4ef2;
999
41
  border-bottom: 1px solid #717171;
1000
42
  width: 50%;
@@ -1002,7 +44,7 @@ svg.leaflet-zoom-animated {
1002
44
  display: flex;
1003
45
  }
1004
46
 
1005
- .leaflet-right {
47
+ .leaflet-right.leaflet-right {
1006
48
  justify-content: flex-end;
1007
49
  display: inline-flex;
1008
50
  }
@@ -1011,7 +53,7 @@ svg.leaflet-zoom-animated {
1011
53
  display: none;
1012
54
  }
1013
55
 
1014
- .leaflet-draw {
56
+ .leaflet-draw.leaflet-draw {
1015
57
  background: #484a4ef2;
1016
58
  height: 100vh;
1017
59
  }
@@ -1032,7 +74,7 @@ svg.leaflet-zoom-animated {
1032
74
  background-color: #ffffffd9;
1033
75
  }
1034
76
 
1035
- .leaflet-control-zoom {
77
+ .leaflet-control-zoom.leaflet-control-zoom {
1036
78
  display: inline-flex;
1037
79
  }
1038
80
 
@@ -1045,7 +87,7 @@ svg.leaflet-zoom-animated {
1045
87
  border-radius: 2px !important;
1046
88
  }
1047
89
 
1048
- .leaflet-tooltip {
90
+ .leaflet-tooltip.leaflet-tooltip {
1049
91
  color: #fff;
1050
92
  box-shadow: none;
1051
93
  text-shadow: 0 0 6px #000;
@@ -1060,7 +102,7 @@ svg.leaflet-zoom-animated {
1060
102
  animation: 2s infinite pulse;
1061
103
  }
1062
104
 
1063
- .leaflet-popup-content-wrapper {
105
+ .leaflet-popup-content-wrapper.leaflet-popup-content-wrapper {
1064
106
  color: #e0e0e0;
1065
107
  background: #0e1013f2;
1066
108
  font-weight: 600;
@@ -1071,7 +113,7 @@ svg.leaflet-zoom-animated {
1071
113
  margin: .5rem 0;
1072
114
  }
1073
115
 
1074
- .leaflet-popup-tip {
116
+ .leaflet-popup-tip.leaflet-popup-tip {
1075
117
  background: #333333f2;
1076
118
  box-shadow: 0 0 6px #fff;
1077
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "andoncloud-map-widget",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Made with create-andoncloud-widget",
5
5
  "author": "Adrian Olszewski",
6
6
  "license": "MIT",