+ {
+ setSelected(true);
+ }}
+ onKeyDown={() => {}}
+ >
+ {
+ onChange(id, newValue);
+ }}
+ block={block}
+ selected={selected}
+ properties={properties}
+ placeholder={placeholder}
+ />
+
+
+ );
+};
+
+export default SlateRichTextWidget;
diff --git a/src/StatisticBlock/View.jsx b/src/StatisticBlock/View.jsx
index 87286a7..73f6c49 100644
--- a/src/StatisticBlock/View.jsx
+++ b/src/StatisticBlock/View.jsx
@@ -1,11 +1,20 @@
import React from 'react';
+import isNumber from 'lodash/isNumber';
+import isNaN from 'lodash/isNaN';
import cx from 'classnames';
import CountUp from 'react-countup';
import VisibilitySensor from 'react-visibility-sensor';
import { Statistic } from 'semantic-ui-react';
import { UniversalLink } from '@plone/volto/components';
-import { serializeText } from '@eeacms/volto-statistic-block/helpers';
-import { getFieldURL } from '@eeacms/volto-statistic-block/helpers';
+import {
+ serializeNodes as _serializeNodes,
+ serializeNodesToText,
+} from '@plone/volto-slate/editor/render';
+import {
+ getFieldURL,
+ serializeToNodes,
+ serializeNodes,
+} from '@eeacms/volto-statistic-block/helpers';
import './styles.less';
@@ -65,16 +74,19 @@ const View = ({ data, mode }) => {
>
{items.map((item, index) => {
const href = getFieldURL(item.href);
- const StatisticWrapper = href ? UniversalLink : Statistic;
+ const StatisticWrapper = item.href ? UniversalLink : Statistic;
+ const valueNodes = serializeToNodes(item.value);
+ const valueNo = Number(serializeNodesToText(valueNodes));
+
return (