You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
3.4 KiB
1 lines
3.4 KiB
{"ast":null,"code":"import { useEffect, useRef } from 'react';\nimport { useLeafletContext } from './context.js';\nimport { useEventHandlers } from './events.js';\nimport { useLayerLifecycle } from './layer.js';\nimport { withPane } from './pane.js';\nexport function usePathOptions(element, props) {\n const optionsRef = useRef();\n useEffect(function updatePathOptions() {\n if (props.pathOptions !== optionsRef.current) {\n const options = props.pathOptions ?? {};\n element.instance.setStyle(options);\n optionsRef.current = options;\n }\n }, [element, props]);\n}\nexport function createPathHook(useElement) {\n return function usePath(props) {\n const context = useLeafletContext();\n const elementRef = useElement(withPane(props, context), context);\n useEventHandlers(elementRef.current, props.eventHandlers);\n useLayerLifecycle(elementRef.current, context);\n usePathOptions(elementRef.current, props);\n return elementRef;\n };\n}","map":{"version":3,"names":["useEffect","useRef","useLeafletContext","useEventHandlers","useLayerLifecycle","withPane","usePathOptions","element","props","optionsRef","updatePathOptions","pathOptions","current","options","instance","setStyle","createPathHook","useElement","usePath","context","elementRef","eventHandlers"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/@react-leaflet/core/lib/path.js"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useLeafletContext } from './context.js';\nimport { useEventHandlers } from './events.js';\nimport { useLayerLifecycle } from './layer.js';\nimport { withPane } from './pane.js';\nexport function usePathOptions(element, props) {\n const optionsRef = useRef();\n useEffect(function updatePathOptions() {\n if (props.pathOptions !== optionsRef.current) {\n const options = props.pathOptions ?? {};\n element.instance.setStyle(options);\n optionsRef.current = options;\n }\n }, [\n element,\n props\n ]);\n}\nexport function createPathHook(useElement) {\n return function usePath(props) {\n const context = useLeafletContext();\n const elementRef = useElement(withPane(props, context), context);\n useEventHandlers(elementRef.current, props.eventHandlers);\n useLayerLifecycle(elementRef.current, context);\n usePathOptions(elementRef.current, props);\n return elementRef;\n };\n}\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,MAApB,QAAkC,OAAlC;AACA,SAASC,iBAAT,QAAkC,cAAlC;AACA,SAASC,gBAAT,QAAiC,aAAjC;AACA,SAASC,iBAAT,QAAkC,YAAlC;AACA,SAASC,QAAT,QAAyB,WAAzB;AACA,OAAO,SAASC,cAAT,CAAwBC,OAAxB,EAAiCC,KAAjC,EAAwC;EAC3C,MAAMC,UAAU,GAAGR,MAAM,EAAzB;EACAD,SAAS,CAAC,SAASU,iBAAT,GAA6B;IACnC,IAAIF,KAAK,CAACG,WAAN,KAAsBF,UAAU,CAACG,OAArC,EAA8C;MAC1C,MAAMC,OAAO,GAAGL,KAAK,CAACG,WAAN,IAAqB,EAArC;MACAJ,OAAO,CAACO,QAAR,CAAiBC,QAAjB,CAA0BF,OAA1B;MACAJ,UAAU,CAACG,OAAX,GAAqBC,OAArB;IACH;EACJ,CANQ,EAMN,CACCN,OADD,EAECC,KAFD,CANM,CAAT;AAUH;AACD,OAAO,SAASQ,cAAT,CAAwBC,UAAxB,EAAoC;EACvC,OAAO,SAASC,OAAT,CAAiBV,KAAjB,EAAwB;IAC3B,MAAMW,OAAO,GAAGjB,iBAAiB,EAAjC;IACA,MAAMkB,UAAU,GAAGH,UAAU,CAACZ,QAAQ,CAACG,KAAD,EAAQW,OAAR,CAAT,EAA2BA,OAA3B,CAA7B;IACAhB,gBAAgB,CAACiB,UAAU,CAACR,OAAZ,EAAqBJ,KAAK,CAACa,aAA3B,CAAhB;IACAjB,iBAAiB,CAACgB,UAAU,CAACR,OAAZ,EAAqBO,OAArB,CAAjB;IACAb,cAAc,CAACc,UAAU,CAACR,OAAZ,EAAqBJ,KAArB,CAAd;IACA,OAAOY,UAAP;EACH,CAPD;AAQH"},"metadata":{},"sourceType":"module"} |