@pie-lib/editable-html-tip-tap 2.1.2-next.29 → 2.1.2-next.30
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.
- package/dist/components/CharacterPicker.d.ts +31 -0
- package/dist/components/CharacterPicker.js +131 -0
- package/dist/components/EditableHtml.d.ts +11 -0
- package/dist/components/EditableHtml.js +291 -0
- package/dist/components/MenuBar.d.ts +11 -0
- package/dist/components/MenuBar.js +462 -0
- package/dist/components/TiptapContainer.d.ts +11 -0
- package/dist/components/TiptapContainer.js +154 -0
- package/dist/components/characters/characterUtils.d.ts +35 -0
- package/dist/components/characters/characterUtils.js +465 -0
- package/dist/components/characters/custom-popper.d.ts +14 -0
- package/dist/components/characters/custom-popper.js +32 -0
- package/dist/components/common/done-button.d.ts +30 -0
- package/dist/components/common/done-button.js +26 -0
- package/dist/components/common/toolbar-buttons.d.ts +38 -0
- package/dist/components/common/toolbar-buttons.js +91 -0
- package/dist/components/icons/CssIcon.d.ts +11 -0
- package/dist/components/icons/CssIcon.js +14 -0
- package/dist/components/icons/RespArea.d.ts +26 -0
- package/dist/components/icons/RespArea.js +42 -0
- package/dist/components/icons/TableIcons.d.ts +14 -0
- package/dist/components/icons/TableIcons.js +32 -0
- package/dist/components/icons/TextAlign.d.ts +18 -0
- package/dist/components/icons/TextAlign.js +134 -0
- package/dist/components/image/AltDialog.d.ts +22 -0
- package/dist/components/image/AltDialog.js +61 -0
- package/dist/components/image/ImageToolbar.d.ts +24 -0
- package/dist/components/image/ImageToolbar.js +80 -0
- package/dist/components/image/InsertImageHandler.d.ts +32 -0
- package/dist/components/image/InsertImageHandler.js +53 -0
- package/dist/components/media/MediaDialog.d.ts +43 -0
- package/dist/components/media/MediaDialog.js +389 -0
- package/dist/components/media/MediaToolbar.d.ts +19 -0
- package/dist/components/media/MediaToolbar.js +41 -0
- package/dist/components/media/MediaWrapper.d.ts +19 -0
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.d.ts +23 -0
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.js +58 -0
- package/dist/components/respArea/DragInTheBlank/choice.d.ts +56 -0
- package/dist/components/respArea/DragInTheBlank/choice.js +156 -0
- package/dist/components/respArea/ExplicitConstructedResponse.d.ts +20 -0
- package/dist/components/respArea/ExplicitConstructedResponse.js +83 -0
- package/dist/components/respArea/InlineDropdown.d.ts +18 -0
- package/dist/components/respArea/InlineDropdown.js +119 -0
- package/dist/components/respArea/MathTemplated.d.ts +19 -0
- package/dist/components/respArea/MathTemplated.js +97 -0
- package/dist/components/respArea/ToolbarIcon.d.ts +14 -0
- package/dist/components/respArea/ToolbarIcon.js +17 -0
- package/dist/components/respArea/inlineDropdownUtils.d.ts +15 -0
- package/dist/components/respArea/inlineDropdownUtils.js +15 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constants.js +4 -0
- package/dist/extensions/css.d.ts +11 -0
- package/dist/extensions/css.js +115 -0
- package/dist/extensions/custom-toolbar-wrapper.d.ts +11 -0
- package/dist/extensions/custom-toolbar-wrapper.js +61 -0
- package/dist/extensions/div-node.d.ts +10 -0
- package/dist/extensions/div-node.js +42 -0
- package/dist/extensions/ensure-empty-root-div.d.ts +14 -0
- package/dist/extensions/ensure-empty-root-div.js +24 -0
- package/dist/extensions/ensure-list-item-content-is-div.d.ts +15 -0
- package/dist/extensions/ensure-list-item-content-is-div.js +31 -0
- package/dist/extensions/extended-list-item.d.ts +13 -0
- package/dist/extensions/extended-list-item.js +5 -0
- package/dist/extensions/extended-table-cell.d.ts +10 -0
- package/dist/extensions/extended-table-cell.js +6 -0
- package/dist/extensions/extended-table.d.ts +17 -0
- package/dist/extensions/extended-table.js +34 -0
- package/dist/extensions/heading-paragraph.d.ts +17 -0
- package/dist/extensions/heading-paragraph.js +30 -0
- package/dist/extensions/image-component.d.ts +22 -0
- package/dist/extensions/image-component.js +220 -0
- package/dist/extensions/image.d.ts +10 -0
- package/dist/extensions/image.js +68 -0
- package/dist/extensions/index.d.ts +16 -0
- package/dist/extensions/index.js +64 -0
- package/dist/extensions/math.d.ts +15 -0
- package/dist/extensions/math.js +158 -0
- package/dist/extensions/media.d.ts +19 -0
- package/dist/extensions/media.js +149 -0
- package/dist/extensions/responseArea.d.ts +27 -0
- package/dist/extensions/responseArea.js +259 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +7 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
- package/dist/styles/editorContainerStyles.d.ts +134 -0
- package/dist/theme.d.ts +9 -0
- package/dist/utils/helper.d.ts +9 -0
- package/dist/utils/helper.js +27 -0
- package/dist/utils/size.d.ts +9 -0
- package/dist/utils/size.js +14 -0
- package/package.json +40 -24
- package/CHANGELOG.json +0 -32
- package/CHANGELOG.md +0 -2532
- package/LICENSE.md +0 -5
- package/lib/components/CharacterPicker.js +0 -201
- package/lib/components/CharacterPicker.js.map +0 -1
- package/lib/components/EditableHtml.js +0 -376
- package/lib/components/EditableHtml.js.map +0 -1
- package/lib/components/MenuBar.js +0 -696
- package/lib/components/MenuBar.js.map +0 -1
- package/lib/components/TiptapContainer.js +0 -234
- package/lib/components/TiptapContainer.js.map +0 -1
- package/lib/components/characters/characterUtils.js +0 -378
- package/lib/components/characters/characterUtils.js.map +0 -1
- package/lib/components/characters/custom-popper.js +0 -44
- package/lib/components/characters/custom-popper.js.map +0 -1
- package/lib/components/common/done-button.js +0 -34
- package/lib/components/common/done-button.js.map +0 -1
- package/lib/components/common/toolbar-buttons.js +0 -144
- package/lib/components/common/toolbar-buttons.js.map +0 -1
- package/lib/components/icons/CssIcon.js +0 -25
- package/lib/components/icons/CssIcon.js.map +0 -1
- package/lib/components/icons/RespArea.js +0 -72
- package/lib/components/icons/RespArea.js.map +0 -1
- package/lib/components/icons/TableIcons.js +0 -53
- package/lib/components/icons/TableIcons.js.map +0 -1
- package/lib/components/icons/TextAlign.js +0 -157
- package/lib/components/icons/TextAlign.js.map +0 -1
- package/lib/components/image/AltDialog.js +0 -98
- package/lib/components/image/AltDialog.js.map +0 -1
- package/lib/components/image/ImageToolbar.js +0 -137
- package/lib/components/image/ImageToolbar.js.map +0 -1
- package/lib/components/image/InsertImageHandler.js +0 -135
- package/lib/components/image/InsertImageHandler.js.map +0 -1
- package/lib/components/media/MediaDialog.js +0 -594
- package/lib/components/media/MediaDialog.js.map +0 -1
- package/lib/components/media/MediaToolbar.js +0 -74
- package/lib/components/media/MediaToolbar.js.map +0 -1
- package/lib/components/media/MediaWrapper.js +0 -67
- package/lib/components/media/MediaWrapper.js.map +0 -1
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +0 -84
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +0 -1
- package/lib/components/respArea/DragInTheBlank/choice.js +0 -250
- package/lib/components/respArea/DragInTheBlank/choice.js.map +0 -1
- package/lib/components/respArea/ExplicitConstructedResponse.js +0 -136
- package/lib/components/respArea/ExplicitConstructedResponse.js.map +0 -1
- package/lib/components/respArea/InlineDropdown.js +0 -209
- package/lib/components/respArea/InlineDropdown.js.map +0 -1
- package/lib/components/respArea/MathTemplated.js +0 -130
- package/lib/components/respArea/MathTemplated.js.map +0 -1
- package/lib/components/respArea/ToolbarIcon.js +0 -81
- package/lib/components/respArea/ToolbarIcon.js.map +0 -1
- package/lib/components/respArea/inlineDropdownUtils.js +0 -67
- package/lib/components/respArea/inlineDropdownUtils.js.map +0 -1
- package/lib/constants.js +0 -11
- package/lib/constants.js.map +0 -1
- package/lib/extensions/css.js +0 -217
- package/lib/extensions/css.js.map +0 -1
- package/lib/extensions/custom-toolbar-wrapper.js +0 -92
- package/lib/extensions/custom-toolbar-wrapper.js.map +0 -1
- package/lib/extensions/div-node.js +0 -83
- package/lib/extensions/div-node.js.map +0 -1
- package/lib/extensions/ensure-empty-root-div.js +0 -48
- package/lib/extensions/ensure-empty-root-div.js.map +0 -1
- package/lib/extensions/ensure-list-item-content-is-div.js +0 -64
- package/lib/extensions/ensure-list-item-content-is-div.js.map +0 -1
- package/lib/extensions/extended-list-item.js +0 -15
- package/lib/extensions/extended-list-item.js.map +0 -1
- package/lib/extensions/extended-table-cell.js +0 -22
- package/lib/extensions/extended-table-cell.js.map +0 -1
- package/lib/extensions/extended-table.js +0 -75
- package/lib/extensions/extended-table.js.map +0 -1
- package/lib/extensions/heading-paragraph.js +0 -61
- package/lib/extensions/heading-paragraph.js.map +0 -1
- package/lib/extensions/image-component.js +0 -348
- package/lib/extensions/image-component.js.map +0 -1
- package/lib/extensions/image.js +0 -134
- package/lib/extensions/image.js.map +0 -1
- package/lib/extensions/index.js +0 -46
- package/lib/extensions/index.js.map +0 -1
- package/lib/extensions/math.js +0 -342
- package/lib/extensions/math.js.map +0 -1
- package/lib/extensions/media.js +0 -243
- package/lib/extensions/media.js.map +0 -1
- package/lib/extensions/responseArea.js +0 -446
- package/lib/extensions/responseArea.js.map +0 -1
- package/lib/index.js +0 -37
- package/lib/index.js.map +0 -1
- package/lib/styles/editorContainerStyles.js +0 -137
- package/lib/styles/editorContainerStyles.js.map +0 -1
- package/lib/theme.js +0 -8
- package/lib/theme.js.map +0 -1
- package/lib/utils/helper.js +0 -73
- package/lib/utils/helper.js.map +0 -1
- package/lib/utils/size.js +0 -26
- package/lib/utils/size.js.map +0 -1
- package/src/__tests__/EditableHtml.test.jsx +0 -554
- package/src/__tests__/constants.test.js +0 -19
- package/src/__tests__/div-to-paragraph-conversion.test.jsx +0 -125
- package/src/__tests__/extensions.test.js +0 -208
- package/src/__tests__/index.test.jsx +0 -154
- package/src/__tests__/size-utils.test.js +0 -64
- package/src/__tests__/theme.test.js +0 -17
- package/src/components/CharacterPicker.jsx +0 -207
- package/src/components/EditableHtml.jsx +0 -440
- package/src/components/MenuBar.jsx +0 -554
- package/src/components/TiptapContainer.jsx +0 -219
- package/src/components/__tests__/AltDialog.test.jsx +0 -147
- package/src/components/__tests__/CharacterPicker.test.jsx +0 -261
- package/src/components/__tests__/CssIcon.test.jsx +0 -46
- package/src/components/__tests__/DragInTheBlank.test.jsx +0 -255
- package/src/components/__tests__/ExplicitConstructedResponse.test.jsx +0 -204
- package/src/components/__tests__/ImageToolbar.test.jsx +0 -128
- package/src/components/__tests__/InlineDropdown.test.jsx +0 -388
- package/src/components/__tests__/InsertImageHandler.test.js +0 -161
- package/src/components/__tests__/MediaDialog.test.jsx +0 -293
- package/src/components/__tests__/MediaToolbar.test.jsx +0 -74
- package/src/components/__tests__/MediaWrapper.test.jsx +0 -81
- package/src/components/__tests__/MenuBar.test.jsx +0 -250
- package/src/components/__tests__/RespArea.test.jsx +0 -122
- package/src/components/__tests__/TableIcons.test.jsx +0 -149
- package/src/components/__tests__/TextAlign.test.jsx +0 -167
- package/src/components/__tests__/TiptapContainer.test.jsx +0 -138
- package/src/components/__tests__/characterUtils.test.js +0 -166
- package/src/components/__tests__/choice.test.jsx +0 -171
- package/src/components/__tests__/custom-popper.test.jsx +0 -82
- package/src/components/__tests__/done-button.test.jsx +0 -54
- package/src/components/__tests__/toolbar-buttons.test.jsx +0 -234
- package/src/components/characters/characterUtils.js +0 -447
- package/src/components/characters/custom-popper.js +0 -38
- package/src/components/common/done-button.jsx +0 -27
- package/src/components/common/toolbar-buttons.jsx +0 -122
- package/src/components/icons/CssIcon.jsx +0 -15
- package/src/components/icons/RespArea.jsx +0 -71
- package/src/components/icons/TableIcons.jsx +0 -52
- package/src/components/icons/TextAlign.jsx +0 -114
- package/src/components/image/AltDialog.jsx +0 -82
- package/src/components/image/ImageToolbar.jsx +0 -99
- package/src/components/image/InsertImageHandler.js +0 -107
- package/src/components/media/MediaDialog.jsx +0 -596
- package/src/components/media/MediaToolbar.jsx +0 -49
- package/src/components/media/MediaWrapper.jsx +0 -39
- package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +0 -76
- package/src/components/respArea/DragInTheBlank/choice.jsx +0 -256
- package/src/components/respArea/ExplicitConstructedResponse.jsx +0 -135
- package/src/components/respArea/InlineDropdown.jsx +0 -220
- package/src/components/respArea/MathTemplated.jsx +0 -124
- package/src/components/respArea/ToolbarIcon.jsx +0 -66
- package/src/components/respArea/__tests__/MathTemplated.test.jsx +0 -210
- package/src/components/respArea/inlineDropdownUtils.js +0 -79
- package/src/constants.js +0 -5
- package/src/extensions/__tests__/css.test.js +0 -196
- package/src/extensions/__tests__/custom-toolbar-wrapper.test.jsx +0 -180
- package/src/extensions/__tests__/divNode.test.js +0 -87
- package/src/extensions/__tests__/ensure-empty-root-div.test.js +0 -57
- package/src/extensions/__tests__/ensure-list-item-content-is-div.test.js +0 -44
- package/src/extensions/__tests__/extended-list-item.test.js +0 -13
- package/src/extensions/__tests__/extended-table-cell.test.js +0 -22
- package/src/extensions/__tests__/extended-table.test.js +0 -183
- package/src/extensions/__tests__/image-component.test.jsx +0 -345
- package/src/extensions/__tests__/image.test.js +0 -237
- package/src/extensions/__tests__/math.test.js +0 -603
- package/src/extensions/__tests__/media-node-view.test.jsx +0 -298
- package/src/extensions/__tests__/media.test.js +0 -271
- package/src/extensions/__tests__/responseArea.test.js +0 -601
- package/src/extensions/css.js +0 -220
- package/src/extensions/custom-toolbar-wrapper.jsx +0 -78
- package/src/extensions/div-node.js +0 -86
- package/src/extensions/ensure-empty-root-div.js +0 -47
- package/src/extensions/ensure-list-item-content-is-div.js +0 -62
- package/src/extensions/extended-list-item.js +0 -10
- package/src/extensions/extended-table-cell.js +0 -19
- package/src/extensions/extended-table.js +0 -60
- package/src/extensions/heading-paragraph.js +0 -53
- package/src/extensions/image-component.jsx +0 -338
- package/src/extensions/image.js +0 -109
- package/src/extensions/index.js +0 -81
- package/src/extensions/math.js +0 -326
- package/src/extensions/media.js +0 -188
- package/src/extensions/responseArea.js +0 -401
- package/src/index.jsx +0 -5
- package/src/styles/editorContainerStyles.js +0 -145
- package/src/theme.js +0 -1
- package/src/utils/__tests__/helper.test.js +0 -126
- package/src/utils/helper.js +0 -69
- package/src/utils/size.js +0 -32
|
@@ -1,596 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import debug from 'debug';
|
|
4
|
-
import { styled } from '@mui/material/styles';
|
|
5
|
-
import Button from '@mui/material/Button';
|
|
6
|
-
import Dialog from '@mui/material/Dialog';
|
|
7
|
-
import MuiTabs from '@mui/material/Tabs';
|
|
8
|
-
import MuiTab from '@mui/material/Tab';
|
|
9
|
-
import DialogTitle from '@mui/material/DialogTitle';
|
|
10
|
-
import DialogContent from '@mui/material/DialogContent';
|
|
11
|
-
import DialogContentText from '@mui/material/DialogContentText';
|
|
12
|
-
import DialogActions from '@mui/material/DialogActions';
|
|
13
|
-
import TextField from '@mui/material/TextField';
|
|
14
|
-
import Typography from '@mui/material/Typography';
|
|
15
|
-
import IconButton from '@mui/material/IconButton';
|
|
16
|
-
import ActionDelete from '@mui/icons-material/Delete';
|
|
17
|
-
|
|
18
|
-
const log = debug('@pie-lib:editable-html:plugins:media:dialog');
|
|
19
|
-
|
|
20
|
-
const matchYoutubeUrl = (url) => {
|
|
21
|
-
if (!url) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const p =
|
|
26
|
-
/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
|
|
27
|
-
if (url.match(p)) {
|
|
28
|
-
return url.match(p)[1];
|
|
29
|
-
}
|
|
30
|
-
return false;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const matchVimeoUrl = (url) =>
|
|
34
|
-
url &&
|
|
35
|
-
/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/.test(
|
|
36
|
-
url,
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
const matchDriveUrl = (url) =>
|
|
40
|
-
url && /^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/.test(url);
|
|
41
|
-
|
|
42
|
-
const matchSoundCloudUrl = (url) => {
|
|
43
|
-
if (!url) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const regexp = /^https?:\/\/(soundcloud\.com|snd\.sc)\/(.*)$/;
|
|
48
|
-
return url.match(regexp) && url.match(regexp)[2];
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const makeApiRequest = (url) => {
|
|
52
|
-
return new Promise((resolve) => {
|
|
53
|
-
try {
|
|
54
|
-
fetch(`https://soundcloud.com/oembed?format=json&url=${url}`)
|
|
55
|
-
.then((response) => response.json())
|
|
56
|
-
.then((json) => {
|
|
57
|
-
const d = document.createElement('div');
|
|
58
|
-
|
|
59
|
-
d.innerHTML = json.html;
|
|
60
|
-
|
|
61
|
-
const iframe = d.querySelector('iframe');
|
|
62
|
-
|
|
63
|
-
resolve(iframe.src);
|
|
64
|
-
})
|
|
65
|
-
.catch((err) => {
|
|
66
|
-
resolve('');
|
|
67
|
-
log(err);
|
|
68
|
-
});
|
|
69
|
-
} catch (err) {
|
|
70
|
-
resolve('');
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const typeMap = {
|
|
76
|
-
video: 'Video',
|
|
77
|
-
audio: 'Audio',
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const tabsTypeMap = {
|
|
81
|
-
uploadFile: 'upload-file',
|
|
82
|
-
insertUrl: 'insert-url',
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const StyledDialog = styled(Dialog)(({ theme }) => ({
|
|
86
|
-
'& .MuiDialog-paper': {
|
|
87
|
-
minWidth: '500px',
|
|
88
|
-
},
|
|
89
|
-
}));
|
|
90
|
-
|
|
91
|
-
const StyledDialogContent = styled(DialogContent)(({ theme }) => ({
|
|
92
|
-
padding: 0,
|
|
93
|
-
}));
|
|
94
|
-
|
|
95
|
-
const StyledRow = styled('div')(({ theme }) => ({
|
|
96
|
-
display: 'flex',
|
|
97
|
-
flexDirection: 'space-between',
|
|
98
|
-
}));
|
|
99
|
-
|
|
100
|
-
const StyledUploadInput = styled('div')(({ theme }) => ({
|
|
101
|
-
marginTop: theme.spacing(1.5),
|
|
102
|
-
}));
|
|
103
|
-
|
|
104
|
-
const StyledInput = styled('input')(({ theme }) => ({}));
|
|
105
|
-
|
|
106
|
-
const StyledError = styled(Typography)(({ theme }) => ({
|
|
107
|
-
marginTop: theme.spacing(1.5),
|
|
108
|
-
color: theme.palette.error.main,
|
|
109
|
-
}));
|
|
110
|
-
|
|
111
|
-
const StyledIconButton = styled(IconButton)(({ theme }) => ({
|
|
112
|
-
marginLeft: theme.spacing(1.5),
|
|
113
|
-
}));
|
|
114
|
-
|
|
115
|
-
export class MediaDialog extends React.Component {
|
|
116
|
-
static propTypes = {
|
|
117
|
-
open: PropTypes.bool,
|
|
118
|
-
edit: PropTypes.bool,
|
|
119
|
-
disablePortal: PropTypes.bool,
|
|
120
|
-
handleClose: PropTypes.func,
|
|
121
|
-
uploadSoundSupport: PropTypes.shape({
|
|
122
|
-
add: PropTypes.func,
|
|
123
|
-
delete: PropTypes.func,
|
|
124
|
-
}),
|
|
125
|
-
type: PropTypes.string,
|
|
126
|
-
src: PropTypes.string,
|
|
127
|
-
url: PropTypes.string,
|
|
128
|
-
urlToUse: PropTypes.string,
|
|
129
|
-
starts: PropTypes.number,
|
|
130
|
-
ends: PropTypes.number,
|
|
131
|
-
height: PropTypes.number,
|
|
132
|
-
width: PropTypes.number,
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
constructor(props) {
|
|
136
|
-
super(props);
|
|
137
|
-
|
|
138
|
-
const { ends, height, src, starts, type, uploadSoundSupport, url, urlToUse, width } = props;
|
|
139
|
-
const showUploadFile = uploadSoundSupport?.add && uploadSoundSupport?.delete && type !== 'video' && !src;
|
|
140
|
-
|
|
141
|
-
this.state = {
|
|
142
|
-
ends: ends || 0,
|
|
143
|
-
url: url,
|
|
144
|
-
urlToUse: urlToUse,
|
|
145
|
-
formattedUrl: src,
|
|
146
|
-
height: height || 315,
|
|
147
|
-
invalid: false,
|
|
148
|
-
starts: starts || 0,
|
|
149
|
-
width: width || 560,
|
|
150
|
-
// default selected tab should be upload file if available
|
|
151
|
-
tabValue: showUploadFile ? tabsTypeMap.uploadFile : tabsTypeMap.insertUrl,
|
|
152
|
-
fileUpload: {
|
|
153
|
-
error: null,
|
|
154
|
-
loading: false,
|
|
155
|
-
scheduled: false,
|
|
156
|
-
url: '',
|
|
157
|
-
mimeType: '',
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
componentDidMount() {
|
|
163
|
-
if (this.props.url) {
|
|
164
|
-
this.urlChange({
|
|
165
|
-
target: {
|
|
166
|
-
value: this.props.url,
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
formatUrl = () => {
|
|
173
|
-
const { url, urlToUse, starts, ends } = this.state;
|
|
174
|
-
const isYoutube = matchYoutubeUrl(url);
|
|
175
|
-
const isVimeo = matchVimeoUrl(url);
|
|
176
|
-
let formattedUrl = urlToUse;
|
|
177
|
-
|
|
178
|
-
if ((isYoutube || isVimeo) && urlToUse) {
|
|
179
|
-
const params = [];
|
|
180
|
-
|
|
181
|
-
let paramName;
|
|
182
|
-
let paramStart;
|
|
183
|
-
|
|
184
|
-
switch (true) {
|
|
185
|
-
case isVimeo:
|
|
186
|
-
paramName = 't';
|
|
187
|
-
paramStart = '#';
|
|
188
|
-
break;
|
|
189
|
-
case isYoutube:
|
|
190
|
-
paramName = 'start';
|
|
191
|
-
paramStart = '?';
|
|
192
|
-
break;
|
|
193
|
-
default:
|
|
194
|
-
paramName = 'start';
|
|
195
|
-
paramStart = '?';
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
if (starts) {
|
|
199
|
-
params.push(`${paramName}=${starts}`);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (ends) {
|
|
203
|
-
params.push(`end=${ends}`);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
formattedUrl = `${urlToUse}${params.length ? paramStart : ''}${params.join('&')}`;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const callback = () => this.setState({ formattedUrl, updating: false });
|
|
210
|
-
|
|
211
|
-
this.setState({ formattedUrl: null, updating: true }, callback);
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
handleStateChange = (newState) => this.setState(newState, this.formatUrl);
|
|
215
|
-
|
|
216
|
-
checkAudio = (value) => {
|
|
217
|
-
if (matchSoundCloudUrl(value)) {
|
|
218
|
-
makeApiRequest(value)
|
|
219
|
-
.then((urlToUse) => {
|
|
220
|
-
this.handleStateChange({
|
|
221
|
-
urlToUse,
|
|
222
|
-
invalid: !urlToUse,
|
|
223
|
-
url: value,
|
|
224
|
-
});
|
|
225
|
-
})
|
|
226
|
-
.catch(log);
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
checkVideo = (value) => {
|
|
231
|
-
if (matchYoutubeUrl(value)) {
|
|
232
|
-
const regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
|
|
233
|
-
const match = value.match(regExp);
|
|
234
|
-
const id = match[2];
|
|
235
|
-
const urlToUse = `https://youtube.com/embed/${id}`;
|
|
236
|
-
|
|
237
|
-
log('is youtube');
|
|
238
|
-
|
|
239
|
-
this.handleStateChange({
|
|
240
|
-
urlToUse,
|
|
241
|
-
url: value,
|
|
242
|
-
invalid: false,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (matchVimeoUrl(value)) {
|
|
247
|
-
const id = value.replace(/.*vimeo.com\/(.*)/g, '$1');
|
|
248
|
-
const urlToUse = `https://player.vimeo.com/video/${id}`;
|
|
249
|
-
|
|
250
|
-
log('is vimeo');
|
|
251
|
-
|
|
252
|
-
this.handleStateChange({
|
|
253
|
-
urlToUse,
|
|
254
|
-
url: value,
|
|
255
|
-
ends: null,
|
|
256
|
-
invalid: false,
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (matchDriveUrl(value)) {
|
|
261
|
-
// https://drive.google.com/file/d/11QkK_gUO068amNvZBm9cxZpKX74WYb8q/view
|
|
262
|
-
const id = value.replace(
|
|
263
|
-
/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)\/.*/,
|
|
264
|
-
'$1',
|
|
265
|
-
);
|
|
266
|
-
const urlToUse = `https://drive.google.com/file/d/${id}/preview`;
|
|
267
|
-
|
|
268
|
-
log('is google drive');
|
|
269
|
-
|
|
270
|
-
this.handleStateChange({
|
|
271
|
-
urlToUse,
|
|
272
|
-
url: value,
|
|
273
|
-
ends: null,
|
|
274
|
-
invalid: false,
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
urlChange = (e) => {
|
|
280
|
-
const { value } = e.target || {};
|
|
281
|
-
const { type } = this.props;
|
|
282
|
-
|
|
283
|
-
if (type && type === 'audio') {
|
|
284
|
-
this.checkAudio(value);
|
|
285
|
-
return;
|
|
286
|
-
} else if (type && type === 'video') {
|
|
287
|
-
this.checkVideo(value);
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
this.handleStateChange({
|
|
292
|
-
urlToUse: null,
|
|
293
|
-
url: null,
|
|
294
|
-
invalid: true,
|
|
295
|
-
});
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
changeHandler = (type) => (e) => this.handleStateChange({ [type]: e.target.value });
|
|
299
|
-
|
|
300
|
-
handleDone = (val) => {
|
|
301
|
-
const { handleClose } = this.props;
|
|
302
|
-
const { tabValue, fileUpload } = this.state;
|
|
303
|
-
const isInsertURL = tabValue === tabsTypeMap.insertUrl;
|
|
304
|
-
|
|
305
|
-
if (!val) {
|
|
306
|
-
if (fileUpload.url) {
|
|
307
|
-
this.handleRemoveFile();
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
handleClose(val);
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
if (isInsertURL) {
|
|
315
|
-
const { ends, height, url, urlToUse, formattedUrl, starts, width } = this.state;
|
|
316
|
-
|
|
317
|
-
handleClose(val, {
|
|
318
|
-
tag: 'iframe',
|
|
319
|
-
ends,
|
|
320
|
-
height,
|
|
321
|
-
starts,
|
|
322
|
-
width,
|
|
323
|
-
url,
|
|
324
|
-
urlToUse,
|
|
325
|
-
src: formattedUrl,
|
|
326
|
-
});
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
if (!fileUpload.loading) {
|
|
331
|
-
handleClose(val, {
|
|
332
|
-
tag: 'audio',
|
|
333
|
-
src: fileUpload.url,
|
|
334
|
-
});
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
this.setState({
|
|
339
|
-
fileUpload: {
|
|
340
|
-
...fileUpload,
|
|
341
|
-
scheduled: true,
|
|
342
|
-
},
|
|
343
|
-
});
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
handleUploadFile = async (e) => {
|
|
347
|
-
e.preventDefault();
|
|
348
|
-
|
|
349
|
-
this.setState({
|
|
350
|
-
fileUpload: {
|
|
351
|
-
...this.state.fileUpload,
|
|
352
|
-
error: null,
|
|
353
|
-
loading: true,
|
|
354
|
-
},
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
const fileChosen = e.target.files[0];
|
|
358
|
-
|
|
359
|
-
const reader = new FileReader();
|
|
360
|
-
|
|
361
|
-
reader.onload = () => {
|
|
362
|
-
const dataURL = reader.result;
|
|
363
|
-
|
|
364
|
-
this.setState({
|
|
365
|
-
fileUpload: {
|
|
366
|
-
...this.state.fileUpload,
|
|
367
|
-
url: dataURL,
|
|
368
|
-
mimeType: fileChosen.type,
|
|
369
|
-
},
|
|
370
|
-
});
|
|
371
|
-
};
|
|
372
|
-
reader.readAsDataURL(fileChosen);
|
|
373
|
-
|
|
374
|
-
this.props.uploadSoundSupport.add({
|
|
375
|
-
fileChosen,
|
|
376
|
-
done: (err, src) => {
|
|
377
|
-
log('done: err:', err);
|
|
378
|
-
if (err) {
|
|
379
|
-
//eslint-disable-next-line
|
|
380
|
-
console.log(err);
|
|
381
|
-
this.setState({
|
|
382
|
-
fileUpload: {
|
|
383
|
-
...this.state.fileUpload,
|
|
384
|
-
scheduled: false,
|
|
385
|
-
loading: false,
|
|
386
|
-
error: err,
|
|
387
|
-
},
|
|
388
|
-
});
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
const { fileUpload } = this.state;
|
|
393
|
-
const callback = fileUpload && fileUpload.scheduled ? this.handleDone.bind(this, true) : undefined;
|
|
394
|
-
|
|
395
|
-
this.setState(
|
|
396
|
-
{
|
|
397
|
-
fileUpload: {
|
|
398
|
-
...fileUpload,
|
|
399
|
-
scheduled: false,
|
|
400
|
-
loading: false,
|
|
401
|
-
url: src,
|
|
402
|
-
},
|
|
403
|
-
},
|
|
404
|
-
callback,
|
|
405
|
-
);
|
|
406
|
-
},
|
|
407
|
-
});
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
handleRemoveFile = async () => {
|
|
411
|
-
this.props.uploadSoundSupport.delete(this.state.fileUpload.url, (err) => {
|
|
412
|
-
if (err) {
|
|
413
|
-
//eslint-disable-next-line
|
|
414
|
-
console.log(err);
|
|
415
|
-
this.setState({
|
|
416
|
-
fileUpload: {
|
|
417
|
-
...this.state.fileUpload,
|
|
418
|
-
error: err,
|
|
419
|
-
},
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
// we should put it inside uploadSoundSupport.delete but we can leave it here for testing purposes
|
|
425
|
-
this.setState({
|
|
426
|
-
fileUpload: {
|
|
427
|
-
...this.state.fileUpload,
|
|
428
|
-
loading: false,
|
|
429
|
-
url: '',
|
|
430
|
-
mimeType: '',
|
|
431
|
-
},
|
|
432
|
-
});
|
|
433
|
-
};
|
|
434
|
-
|
|
435
|
-
render() {
|
|
436
|
-
const { open, disablePortal, type, edit, uploadSoundSupport } = this.props;
|
|
437
|
-
const { ends, height, invalid, starts, width, url, mimeType, formattedUrl, updating, tabValue, fileUpload } =
|
|
438
|
-
this.state;
|
|
439
|
-
const isYoutube = matchYoutubeUrl(url);
|
|
440
|
-
const isInsertURL = tabValue === tabsTypeMap.insertUrl;
|
|
441
|
-
const isUploadMedia = tabValue === tabsTypeMap.uploadFile;
|
|
442
|
-
const submitIsDisabled = isInsertURL
|
|
443
|
-
? invalid || url === null || url === undefined
|
|
444
|
-
: !fileUpload.url || fileUpload.scheduled;
|
|
445
|
-
const showUploadFile = uploadSoundSupport?.add && uploadSoundSupport?.delete && type !== 'video';
|
|
446
|
-
|
|
447
|
-
return (
|
|
448
|
-
<StyledDialog
|
|
449
|
-
disablePortal={disablePortal}
|
|
450
|
-
open={open}
|
|
451
|
-
onClose={() => this.handleDone(false)}
|
|
452
|
-
aria-labelledby="form-dialog-title"
|
|
453
|
-
>
|
|
454
|
-
<DialogTitle id="form-dialog-title">Insert {typeMap[type]}</DialogTitle>
|
|
455
|
-
<DialogContent>
|
|
456
|
-
<div>
|
|
457
|
-
<StyledRow>
|
|
458
|
-
<MuiTabs
|
|
459
|
-
indicatorColor="primary"
|
|
460
|
-
value={tabValue}
|
|
461
|
-
onChange={(event, value) => {
|
|
462
|
-
this.setState({ tabValue: value });
|
|
463
|
-
}}
|
|
464
|
-
>
|
|
465
|
-
{showUploadFile ? <MuiTab value={tabsTypeMap.uploadFile} label="Upload file" /> : null}
|
|
466
|
-
<MuiTab
|
|
467
|
-
value={tabsTypeMap.insertUrl}
|
|
468
|
-
label={type === 'video' ? 'Insert YouTube, Vimeo, or Google Drive URL' : 'Insert SoundCloud URL'}
|
|
469
|
-
/>
|
|
470
|
-
</MuiTabs>
|
|
471
|
-
</StyledRow>
|
|
472
|
-
{isInsertURL && (
|
|
473
|
-
<div>
|
|
474
|
-
<TextField
|
|
475
|
-
autoFocus
|
|
476
|
-
error={invalid}
|
|
477
|
-
helperText={invalid ? 'Invalid URL' : ''}
|
|
478
|
-
margin="dense"
|
|
479
|
-
id="name"
|
|
480
|
-
label="URL"
|
|
481
|
-
placeholder={`Paste URL of ${type}...`}
|
|
482
|
-
type="text"
|
|
483
|
-
onChange={this.urlChange}
|
|
484
|
-
value={url}
|
|
485
|
-
fullWidth
|
|
486
|
-
/>
|
|
487
|
-
{type === 'video' && (
|
|
488
|
-
<StyledDialogContent>
|
|
489
|
-
<DialogContentText>Video Properties</DialogContentText>
|
|
490
|
-
<TextField
|
|
491
|
-
autoFocus
|
|
492
|
-
margin="dense"
|
|
493
|
-
id="width"
|
|
494
|
-
label="Width"
|
|
495
|
-
type="number"
|
|
496
|
-
placeholder="Width"
|
|
497
|
-
value={width}
|
|
498
|
-
onChange={this.changeHandler('width')}
|
|
499
|
-
/>
|
|
500
|
-
<TextField
|
|
501
|
-
autoFocus
|
|
502
|
-
margin="dense"
|
|
503
|
-
id="height"
|
|
504
|
-
label="Height"
|
|
505
|
-
type="number"
|
|
506
|
-
placeholder="Height"
|
|
507
|
-
value={height}
|
|
508
|
-
onChange={this.changeHandler('height')}
|
|
509
|
-
/>
|
|
510
|
-
</StyledDialogContent>
|
|
511
|
-
)}
|
|
512
|
-
{formattedUrl && (
|
|
513
|
-
<iframe
|
|
514
|
-
width={width}
|
|
515
|
-
height={height}
|
|
516
|
-
src={formattedUrl}
|
|
517
|
-
frameBorder="0"
|
|
518
|
-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
519
|
-
allowFullScreen
|
|
520
|
-
/>
|
|
521
|
-
)}
|
|
522
|
-
{type === 'video' && (formattedUrl || updating) && !invalid && (
|
|
523
|
-
<React.Fragment>
|
|
524
|
-
<StyledDialogContent>
|
|
525
|
-
<TextField
|
|
526
|
-
autoFocus
|
|
527
|
-
margin="dense"
|
|
528
|
-
id="starts"
|
|
529
|
-
label="Starts"
|
|
530
|
-
type="number"
|
|
531
|
-
placeholder="Starts"
|
|
532
|
-
value={starts}
|
|
533
|
-
onChange={this.changeHandler('starts')}
|
|
534
|
-
/>
|
|
535
|
-
{isYoutube && (
|
|
536
|
-
<TextField
|
|
537
|
-
autoFocus
|
|
538
|
-
margin="dense"
|
|
539
|
-
id="ends"
|
|
540
|
-
label="Ends"
|
|
541
|
-
type="number"
|
|
542
|
-
placeholder="Ends"
|
|
543
|
-
value={ends}
|
|
544
|
-
onChange={this.changeHandler('ends')}
|
|
545
|
-
/>
|
|
546
|
-
)}
|
|
547
|
-
</StyledDialogContent>
|
|
548
|
-
</React.Fragment>
|
|
549
|
-
)}
|
|
550
|
-
</div>
|
|
551
|
-
)}
|
|
552
|
-
{isUploadMedia && (
|
|
553
|
-
<StyledUploadInput>
|
|
554
|
-
<div>
|
|
555
|
-
{fileUpload.url ? (
|
|
556
|
-
<>
|
|
557
|
-
<StyledRow>
|
|
558
|
-
<audio controls="controls" controlsList="nodownload">
|
|
559
|
-
<source type={mimeType} src={fileUpload.url} />
|
|
560
|
-
</audio>
|
|
561
|
-
<StyledIconButton aria-label="delete" onClick={this.handleRemoveFile}>
|
|
562
|
-
<ActionDelete />
|
|
563
|
-
</StyledIconButton>
|
|
564
|
-
</StyledRow>
|
|
565
|
-
{!fileUpload.scheduled && fileUpload.loading ? (
|
|
566
|
-
<Typography variant="subheading">Loading...</Typography>
|
|
567
|
-
) : null}
|
|
568
|
-
{fileUpload.scheduled ? (
|
|
569
|
-
<Typography variant="subheading">
|
|
570
|
-
Waiting for Upload to finish, then inserting item...
|
|
571
|
-
</Typography>
|
|
572
|
-
) : null}
|
|
573
|
-
</>
|
|
574
|
-
) : !fileUpload.loading ? (
|
|
575
|
-
<StyledInput accept="audio/*" onChange={this.handleUploadFile} type="file" />
|
|
576
|
-
) : null}
|
|
577
|
-
{!!fileUpload.error && <StyledError variant="caption">{fileUpload.error}</StyledError>}
|
|
578
|
-
</div>
|
|
579
|
-
</StyledUploadInput>
|
|
580
|
-
)}
|
|
581
|
-
</div>
|
|
582
|
-
</DialogContent>
|
|
583
|
-
<DialogActions>
|
|
584
|
-
<Button onClick={() => this.handleDone(false)} color="primary">
|
|
585
|
-
Cancel
|
|
586
|
-
</Button>
|
|
587
|
-
<Button disabled={submitIsDisabled} onClick={() => this.handleDone(true)} color="primary">
|
|
588
|
-
{edit ? 'Update' : 'Insert'}
|
|
589
|
-
</Button>
|
|
590
|
-
</DialogActions>
|
|
591
|
-
</StyledDialog>
|
|
592
|
-
);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
export default MediaDialog;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { styled } from '@mui/material/styles';
|
|
4
|
-
|
|
5
|
-
const StyledRoot = styled('span')(({ theme }) => ({
|
|
6
|
-
position: 'relative',
|
|
7
|
-
bottom: '5px',
|
|
8
|
-
left: 0,
|
|
9
|
-
width: '100%',
|
|
10
|
-
background: theme.palette.common.white,
|
|
11
|
-
display: 'inline-flex',
|
|
12
|
-
padding: '5px',
|
|
13
|
-
boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)',
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
const StyledEditContainer = styled('span')(({ theme }) => ({
|
|
17
|
-
cursor: 'pointer',
|
|
18
|
-
flex: 3,
|
|
19
|
-
border: `solid ${theme.palette.common.black}`,
|
|
20
|
-
textAlign: 'right',
|
|
21
|
-
borderWidth: '0 2px 0 0',
|
|
22
|
-
marginRight: '5px',
|
|
23
|
-
paddingRight: '5px',
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
|
-
const StyledRemoveContainer = styled('span')({
|
|
27
|
-
cursor: 'pointer',
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
class MediaToolbar extends React.Component {
|
|
31
|
-
static propTypes = {
|
|
32
|
-
onEdit: PropTypes.func,
|
|
33
|
-
hideEdit: PropTypes.bool,
|
|
34
|
-
onRemove: PropTypes.func,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
render() {
|
|
38
|
-
const { hideEdit, onEdit, onRemove } = this.props;
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<StyledRoot>
|
|
42
|
-
{hideEdit ? null : <StyledEditContainer onClick={onEdit}>Edit Settings</StyledEditContainer>}
|
|
43
|
-
<StyledRemoveContainer onClick={onRemove}>Remove</StyledRemoveContainer>
|
|
44
|
-
</StyledRoot>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export default MediaToolbar;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { styled } from '@mui/material/styles';
|
|
4
|
-
|
|
5
|
-
const StyledWrapper = styled('span', {
|
|
6
|
-
shouldForwardProp: (prop) => prop !== 'editor',
|
|
7
|
-
})(({ editor }) => ({
|
|
8
|
-
position: 'relative',
|
|
9
|
-
...(editor && {
|
|
10
|
-
display: 'inline-block',
|
|
11
|
-
overflow: 'hidden',
|
|
12
|
-
}),
|
|
13
|
-
}));
|
|
14
|
-
|
|
15
|
-
class MediaWrapper extends React.Component {
|
|
16
|
-
static propTypes = {
|
|
17
|
-
children: PropTypes.array,
|
|
18
|
-
editor: PropTypes.bool,
|
|
19
|
-
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
render() {
|
|
23
|
-
const { editor, children, width, ...rest } = this.props;
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<StyledWrapper
|
|
27
|
-
editor={editor}
|
|
28
|
-
{...rest}
|
|
29
|
-
style={{
|
|
30
|
-
width: width || 300,
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
{children}
|
|
34
|
-
</StyledWrapper>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default MediaWrapper;
|