@evergis/react 4.0.12 → 4.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,9 @@
1
1
  import { FC } from 'react';
2
- import { ContainerProps } from '../../types';
3
- export declare const ElementSvg: FC<ContainerProps>;
2
+ import { QueryLayerServiceInfoDc } from '@evergis/api';
3
+ import { ClientFeatureAttribute, ContainerProps } from '../../types';
4
+ interface ElementSvgProps extends ContainerProps {
5
+ layerInfo?: QueryLayerServiceInfoDc;
6
+ attributes?: ClientFeatureAttribute[];
7
+ }
8
+ export declare const ElementSvg: FC<ElementSvgProps>;
9
+ export {};
package/dist/index.js CHANGED
@@ -8842,8 +8842,10 @@ const ElementSlideshow = ({ elementConfig, type, renderElement }) => {
8842
8842
  isOpen: isOpenGallery, onClose: toggleGallery }))] }))] }));
8843
8843
  };
8844
8844
 
8845
- const ElementSvg = React.memo(({ type, elementConfig }) => {
8846
- const { layerInfo, attributes } = useWidgetContext(type);
8845
+ const ElementSvg = React.memo(({ type, elementConfig, ...rest }) => {
8846
+ const ctx = useWidgetContext(type);
8847
+ const layerInfo = rest.layerInfo || ctx.layerInfo;
8848
+ const attributes = rest.attributes || ctx.attributes;
8847
8849
  const { options } = elementConfig || {};
8848
8850
  const { width, height, fontColor } = options || {};
8849
8851
  return (jsxRuntime.jsx(SvgImage, { url: getSvgUrl({ elementConfig, layerInfo, attributes }), width: width, height: height, fontColor: fontColor }));