UNPKG

geostyler

Version:
38 lines (37 loc) 1.07 kB
import { isSymbolizer as u } from "geostyler-style"; import i, { useContext as e } from "react"; import c from "../../Util/UnsupportedPropertiesUtil.js"; import m from "../../locale/en_US.js"; const r = i.createContext({}), d = (o) => { const t = e(r); return !t.composition || !t.composition[o] ? {} : t.composition[o]; }, x = (o) => { const t = e(r); return t.locale ? t.locale[o] : m[o]; }, f = () => e(r).data, y = (o) => { const t = e(r); if (!t.unsupportedProperties || !u(o)) return { unsupportedProperties: t.unsupportedProperties, getFormItemSupportProps: () => ({}) }; const p = (s) => { const n = `${o.kind}Symbolizer`; return c.getFormItemSupportProps({ propName: s, symbolizerName: n, context: t.unsupportedProperties }); }; return { unsupportedProperties: t.unsupportedProperties, getFormItemSupportProps: p }; }; export { r as GeoStylerContext, d as useGeoStylerComposition, f as useGeoStylerData, x as useGeoStylerLocale, y as useGeoStylerUnsupportedProperties };