@eeacms/volto-embed 9.0.1 → 9.0.2

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,5 +1,5 @@
1
1
  import React, { useMemo, useState } from 'react';
2
- import { useIntl, FormattedMessage } from 'react-intl';
2
+ import { useIntl, FormattedMessage, defineMessages } from 'react-intl';
3
3
  import { Icon } from '@plone/volto/components';
4
4
  import { Button, Modal, Grid, Label, Input, Message } from 'semantic-ui-react';
5
5
  import { map } from 'lodash';
@@ -12,6 +12,13 @@ import clearSVG from '@plone/volto/icons/clear.svg';
12
12
  import aheadSVG from '@plone/volto/icons/ahead.svg';
13
13
  import mapsBlockSVG from '@plone/volto/components/manage/Blocks/Maps/block-maps.svg';
14
14
 
15
+ const messages = defineMessages({
16
+ MapsBlockInputPlaceholder: {
17
+ id: 'Enter map Embed Code',
18
+ defaultMessage: 'Enter map Embed Code',
19
+ },
20
+ });
21
+
15
22
  function MapEditorModal({ id, onClose, onChange, ...rest }) {
16
23
  const intl = useIntl();
17
24
  const [value, setValue] = useState(rest.value);
@@ -24,7 +31,9 @@ function MapEditorModal({ id, onClose, onChange, ...rest }) {
24
31
  );
25
32
 
26
33
  const placeholder = useMemo(
27
- () => value.placeholder || intl.messages?.['Enter map Embed Code'],
34
+ () =>
35
+ value.placeholder ||
36
+ intl.formatMessage(messages.MapsBlockInputPlaceholder),
28
37
  [value.placeholder, intl],
29
38
  );
30
39