@vonaffenfels/slate-editor 1.0.58 → 1.0.59
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/BlockEditor.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/SidebarEditor/AssetList.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonaffenfels/slate-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.59",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"cssnano": "^5.0.1",
|
|
72
72
|
"escape-html": "^1.0.3"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "45e9d0390c7c19fbfa54c8bf9c3cef5a076e4198",
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
}
|
|
@@ -128,14 +128,20 @@ export const Asset = ({
|
|
|
128
128
|
|
|
129
129
|
let assetType = "image";
|
|
130
130
|
|
|
131
|
-
if (
|
|
131
|
+
if (mediaUrl?.endsWith(".mp3")) {
|
|
132
132
|
assetType = "audio";
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
if (mediaUrl?.endsWith(".mp4") || mediaUrl?.endsWith(".mov")) {
|
|
136
|
+
assetType = "video";
|
|
137
|
+
}
|
|
138
|
+
|
|
135
139
|
const renderMedia = () => {
|
|
136
140
|
switch (assetType) {
|
|
137
141
|
case "audio":
|
|
138
142
|
return <audio src={mediaUrl} className="mt-2 w-full" controls />;
|
|
143
|
+
case "video":
|
|
144
|
+
return <video src={mediaUrl} className="mt-2 w-full rounded-md" controls />;
|
|
139
145
|
case "image":
|
|
140
146
|
default:
|
|
141
147
|
return <img src={mediaUrl} width="100%" className="mt-2 rounded-md" />;
|