react-easy-wall 3.5.6 → 3.5.7
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.
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var GifOutlined = require('../../../node_modules/@mui/icons-material/esm/GifOutlined.js');
|
|
7
|
-
var ReactGiphySearchBox = require('react-giphy-searchbox');
|
|
8
7
|
var theme = require('../../mui/theme.js');
|
|
9
8
|
var Box = require('../../../node_modules/@mui/material/esm/Box/Box.js');
|
|
10
9
|
var Popover = require('../../../node_modules/@mui/material/esm/Popover/Popover.js');
|
|
@@ -12,6 +11,15 @@ var Paper = require('../../../node_modules/@mui/material/esm/Paper/Paper.js');
|
|
|
12
11
|
|
|
13
12
|
const BtnGif = ({ onClick }) => {
|
|
14
13
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
14
|
+
const [GiphySearchBox, setGiphySearchBox] = React.useState(null);
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
//@ts-ignore
|
|
17
|
+
import('react-giphy-searchbox')
|
|
18
|
+
.then((mod) => {
|
|
19
|
+
setGiphySearchBox(() => mod.default || mod);
|
|
20
|
+
})
|
|
21
|
+
.catch((err) => console.error('Error cargando Giphy Searchbox', err));
|
|
22
|
+
}, []);
|
|
15
23
|
const handleClose = () => {
|
|
16
24
|
setAnchorEl(null);
|
|
17
25
|
};
|
|
@@ -30,11 +38,10 @@ const BtnGif = ({ onClick }) => {
|
|
|
30
38
|
padding: theme.theme.spacing(2),
|
|
31
39
|
'& > .reactGiphySearchbox-searchForm-form': {},
|
|
32
40
|
},
|
|
33
|
-
}, children: jsxRuntime.jsx(
|
|
34
|
-
, onSelect: (gif) => {
|
|
41
|
+
}, children: GiphySearchBox ? (jsxRuntime.jsx(GiphySearchBox, { apiKey: "8QgSXTgUqMUnFkbeiW4Qq1DtZgb0B8cL", onSelect: (gif) => {
|
|
35
42
|
onClick(gif);
|
|
36
43
|
handleClose();
|
|
37
|
-
}, searchPlaceholder: "Buscar" }) }) })] }));
|
|
44
|
+
}, searchPlaceholder: "Buscar" })) : null }) })] }));
|
|
38
45
|
};
|
|
39
46
|
|
|
40
47
|
exports.BtnGif = BtnGif;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BtnGif.js","sources":["../../../../../src/shared/components/react-editor/BtnGif.tsx"],"sourcesContent":["'use client'
|
|
1
|
+
{"version":3,"file":"BtnGif.js","sources":["../../../../../src/shared/components/react-editor/BtnGif.tsx"],"sourcesContent":["'use client';\n\nimport React, { useState, useEffect } from 'react';\nimport GifOutlinedIcon from '@mui/icons-material/GifOutlined';\nimport { Box, Popover, Paper } from '@mui/material';\n\nimport { theme } from '@/shared/mui/theme';\n\ntype GifImage = {\n url: string;\n};\ntype Gif = {\n embed_url: string;\n source: string;\n url: string;\n title: string;\n images: {\n original: GifImage;\n fixed_width_still: GifImage;\n };\n};\n\ntype BtnGifProps = {\n onClick: (gif: Gif) => void;\n};\nexport const BtnGif: React.FC<BtnGifProps> = ({ onClick }) => {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n const [GiphySearchBox, setGiphySearchBox] = useState<any>(null);\n\n useEffect(() => {\n //@ts-ignore\n import('react-giphy-searchbox')\n .then((mod) => {\n setGiphySearchBox(() => mod.default || mod);\n })\n .catch((err) => console.error('Error cargando Giphy Searchbox', err));\n }, []);\n\n const handleClose = (): void => {\n setAnchorEl(null);\n };\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n setAnchorEl(event.currentTarget);\n };\n\n return (\n <>\n <Box\n onClick={handleClick}\n component=\"button\"\n className=\"rsw-btn\"\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\">\n <GifOutlinedIcon />\n </Box>\n <Popover\n id=\"simple-popover\"\n open={Boolean(anchorEl)}\n anchorEl={anchorEl}\n onClose={handleClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'center',\n }}>\n <Paper\n sx={{\n '& > .reactGiphySearchbox-componentWrapper': {\n width: 'auto!important',\n padding: theme.spacing(2),\n '& > .reactGiphySearchbox-searchForm-form': {},\n },\n }}>\n {GiphySearchBox ? (\n <GiphySearchBox\n apiKey=\"8QgSXTgUqMUnFkbeiW4Qq1DtZgb0B8cL\"\n onSelect={(gif: Gif) => {\n onClick(gif);\n handleClose();\n }}\n searchPlaceholder=\"Buscar\"\n />\n ) : null}\n </Paper>\n </Popover>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgCO;;AAED;AACC;;;;AAKL;AAEA;AACE;AACF;;AAmBQ;AACA;AACD;AAEC;AACA;AACD;AAGG;AACE;AACA;AACA;AACD;AACF;;AAMK;AACF;AAQd;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useState } from 'react';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
4
|
import GifOutlinedIcon from '../../../node_modules/@mui/icons-material/esm/GifOutlined.js';
|
|
5
|
-
import ReactGiphySearchBox from 'react-giphy-searchbox';
|
|
6
5
|
import { theme } from '../../mui/theme.js';
|
|
7
6
|
import Box from '../../../node_modules/@mui/material/esm/Box/Box.js';
|
|
8
7
|
import Popover from '../../../node_modules/@mui/material/esm/Popover/Popover.js';
|
|
@@ -10,6 +9,15 @@ import Paper from '../../../node_modules/@mui/material/esm/Paper/Paper.js';
|
|
|
10
9
|
|
|
11
10
|
const BtnGif = ({ onClick }) => {
|
|
12
11
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
12
|
+
const [GiphySearchBox, setGiphySearchBox] = useState(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
//@ts-ignore
|
|
15
|
+
import('react-giphy-searchbox')
|
|
16
|
+
.then((mod) => {
|
|
17
|
+
setGiphySearchBox(() => mod.default || mod);
|
|
18
|
+
})
|
|
19
|
+
.catch((err) => console.error('Error cargando Giphy Searchbox', err));
|
|
20
|
+
}, []);
|
|
13
21
|
const handleClose = () => {
|
|
14
22
|
setAnchorEl(null);
|
|
15
23
|
};
|
|
@@ -28,11 +36,10 @@ const BtnGif = ({ onClick }) => {
|
|
|
28
36
|
padding: theme.spacing(2),
|
|
29
37
|
'& > .reactGiphySearchbox-searchForm-form': {},
|
|
30
38
|
},
|
|
31
|
-
}, children: jsx(
|
|
32
|
-
, onSelect: (gif) => {
|
|
39
|
+
}, children: GiphySearchBox ? (jsx(GiphySearchBox, { apiKey: "8QgSXTgUqMUnFkbeiW4Qq1DtZgb0B8cL", onSelect: (gif) => {
|
|
33
40
|
onClick(gif);
|
|
34
41
|
handleClose();
|
|
35
|
-
}, searchPlaceholder: "Buscar" }) }) })] }));
|
|
42
|
+
}, searchPlaceholder: "Buscar" })) : null }) })] }));
|
|
36
43
|
};
|
|
37
44
|
|
|
38
45
|
export { BtnGif };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BtnGif.js","sources":["../../../../../src/shared/components/react-editor/BtnGif.tsx"],"sourcesContent":["'use client'
|
|
1
|
+
{"version":3,"file":"BtnGif.js","sources":["../../../../../src/shared/components/react-editor/BtnGif.tsx"],"sourcesContent":["'use client';\n\nimport React, { useState, useEffect } from 'react';\nimport GifOutlinedIcon from '@mui/icons-material/GifOutlined';\nimport { Box, Popover, Paper } from '@mui/material';\n\nimport { theme } from '@/shared/mui/theme';\n\ntype GifImage = {\n url: string;\n};\ntype Gif = {\n embed_url: string;\n source: string;\n url: string;\n title: string;\n images: {\n original: GifImage;\n fixed_width_still: GifImage;\n };\n};\n\ntype BtnGifProps = {\n onClick: (gif: Gif) => void;\n};\nexport const BtnGif: React.FC<BtnGifProps> = ({ onClick }) => {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n const [GiphySearchBox, setGiphySearchBox] = useState<any>(null);\n\n useEffect(() => {\n //@ts-ignore\n import('react-giphy-searchbox')\n .then((mod) => {\n setGiphySearchBox(() => mod.default || mod);\n })\n .catch((err) => console.error('Error cargando Giphy Searchbox', err));\n }, []);\n\n const handleClose = (): void => {\n setAnchorEl(null);\n };\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>): void => {\n setAnchorEl(event.currentTarget);\n };\n\n return (\n <>\n <Box\n onClick={handleClick}\n component=\"button\"\n className=\"rsw-btn\"\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\">\n <GifOutlinedIcon />\n </Box>\n <Popover\n id=\"simple-popover\"\n open={Boolean(anchorEl)}\n anchorEl={anchorEl}\n onClose={handleClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'center',\n }}>\n <Paper\n sx={{\n '& > .reactGiphySearchbox-componentWrapper': {\n width: 'auto!important',\n padding: theme.spacing(2),\n '& > .reactGiphySearchbox-searchForm-form': {},\n },\n }}>\n {GiphySearchBox ? (\n <GiphySearchBox\n apiKey=\"8QgSXTgUqMUnFkbeiW4Qq1DtZgb0B8cL\"\n onSelect={(gif: Gif) => {\n onClick(gif);\n handleClose();\n }}\n searchPlaceholder=\"Buscar\"\n />\n ) : null}\n </Paper>\n </Popover>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgCO;;AAED;AACC;;;;AAKL;AAEA;AACE;AACF;;AAmBQ;AACA;AACD;AAEC;AACA;AACD;AAGG;AACE;AACA;AACA;AACD;AACF;;AAMK;AACF;AAQd;;"}
|