UNPKG

@devgateway/dvz-ui-react

Version:

A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.

2 lines (1 loc) 742 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),o={blogname:"name",custom_logo:"site_logo"},c=n=>{const[u,m]=s.useState(n.settings),r=s.useRef({}),a=i=>{const e=i.data;if(e.messageType&&e.messageType==="partial-update"){const t=r.current;o[e.property]?t[o[e.property]]=e.value:e.property.indexOf("menu")>-1&&(t.menu_settings||(t.menu_settings={}),t.menu_settings[e.property]=e.value),r.current=t,m({...r.current,random:Math.random()})}};return s.useEffect(()=>(window.addEventListener("message",a,!1),()=>{window.removeEventListener("message",a)}),[]),s.Children.map(n.children,(i,e)=>s.cloneElement(i,{...n,settings:{...u},key:`customizer-child-${e}`}))};exports.CustomizerWrapper=c;