@onesy/ui-react 1.0.40 → 1.0.41
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/Medias/Medias.js +18 -8
- package/esm/Medias/Medias.js +7 -7
- package/esm/index.js +1 -1
- package/package.json +1 -1
package/Medias/Medias.js
CHANGED
@@ -209,9 +209,7 @@ const Medias = react_1.default.forwardRef((props_, ref) => {
|
|
209
209
|
const urlEmbed = item === null || item === void 0 ? void 0 : item.urlEmbed;
|
210
210
|
if (!urlEmbed)
|
211
211
|
return null;
|
212
|
-
const otherProps = {
|
213
|
-
key: index
|
214
|
-
};
|
212
|
+
const otherProps = Object.assign({ key: index }, EmbedProps);
|
215
213
|
const urlEmbedStart = urlEmbed.replace('http://', '').replace('https://', '');
|
216
214
|
const isPlatform = (urlEmbedStart.startsWith('youtu') ||
|
217
215
|
urlEmbedStart.startsWith('www.youtu') ||
|
@@ -235,16 +233,28 @@ const Medias = react_1.default.forwardRef((props_, ref) => {
|
|
235
233
|
if (!(url === null || url === void 0 ? void 0 : url.hostname) || !id)
|
236
234
|
return null;
|
237
235
|
if (item.urlEmbed.includes('youtu.be')) {
|
238
|
-
return ((0, jsx_runtime_1.jsx)("iframe", Object.assign({}, otherProps, { title: item.name || '', src: `https://www.youtube.com/embed/${id}`, allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share', allowFullScreen: true, className:
|
236
|
+
return ((0, jsx_runtime_1.jsx)("iframe", Object.assign({}, otherProps, { title: item.name || '', src: `https://www.youtube.com/embed/${id}`, allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share', allowFullScreen: true, className: (0, style_react_1.classNames)([
|
237
|
+
otherProps === null || otherProps === void 0 ? void 0 : otherProps.className,
|
238
|
+
classes.aspectRatioYoutube
|
239
|
+
]) })));
|
239
240
|
}
|
240
241
|
if (item.urlEmbed.includes('instagram.com')) {
|
241
|
-
return ((0, jsx_runtime_1.jsx)("iframe", Object.assign({}, otherProps, { title: item.name || '', src: `https://www.instagram.com/reel/${id}/embed`, allowFullScreen: true, className:
|
242
|
+
return ((0, jsx_runtime_1.jsx)("iframe", Object.assign({}, otherProps, { title: item.name || '', src: `https://www.instagram.com/reel/${id}/embed`, allowFullScreen: true, className: (0, style_react_1.classNames)([
|
243
|
+
otherProps === null || otherProps === void 0 ? void 0 : otherProps.className,
|
244
|
+
classes.aspectRatioInstagram
|
245
|
+
]) })));
|
242
246
|
}
|
243
247
|
if (item.urlEmbed.includes('tiktok.com')) {
|
244
|
-
return ((0, jsx_runtime_1.jsx)("iframe", Object.assign({}, otherProps, { title: item.name || '', src: `https://www.tiktok.com/embed/v2/${id}`, allowFullScreen: true, className:
|
248
|
+
return ((0, jsx_runtime_1.jsx)("iframe", Object.assign({}, otherProps, { title: item.name || '', src: `https://www.tiktok.com/embed/v2/${id}`, allowFullScreen: true, className: (0, style_react_1.classNames)([
|
249
|
+
otherProps === null || otherProps === void 0 ? void 0 : otherProps.className,
|
250
|
+
classes.aspectRatioTiktok
|
251
|
+
]) })));
|
245
252
|
}
|
246
253
|
if (item.urlEmbed.includes('vimeo.com')) {
|
247
|
-
return ((0, jsx_runtime_1.jsx)("iframe", Object.assign({}, otherProps, { title: item.name || '', src: `https://player.vimeo.com/video/${id}`, allowFullScreen: true, className:
|
254
|
+
return ((0, jsx_runtime_1.jsx)("iframe", Object.assign({}, otherProps, { title: item.name || '', src: `https://player.vimeo.com/video/${id}`, allowFullScreen: true, className: (0, style_react_1.classNames)([
|
255
|
+
otherProps === null || otherProps === void 0 ? void 0 : otherProps.className,
|
256
|
+
classes.aspectRatioVimeo
|
257
|
+
]) })));
|
248
258
|
}
|
249
259
|
return ((0, jsx_runtime_1.jsx)(Link, Object.assign({}, otherProps, { href: item === null || item === void 0 ? void 0 : item.urlEmbed, target: 'blank' }, { children: item.name || item.urlEmbed })));
|
250
260
|
}
|
@@ -252,7 +262,7 @@ const Medias = react_1.default.forwardRef((props_, ref) => {
|
|
252
262
|
return ((0, jsx_runtime_1.jsx)(Line, Object.assign({}, otherProps, { className: classes.customEmbed, fullWidth: true, dangerouslySetInnerHTML: {
|
253
263
|
__html: urlEmbed
|
254
264
|
} })));
|
255
|
-
}, []);
|
265
|
+
}, [EmbedProps]);
|
256
266
|
const getItem = (version, item, index) => {
|
257
267
|
var _a, _b, _c, _d, _e, _f;
|
258
268
|
const media = item.value;
|
package/esm/Medias/Medias.js
CHANGED
@@ -214,9 +214,9 @@ const Medias = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
214
214
|
const getLink = React.useCallback((item, index) => {
|
215
215
|
const urlEmbed = item?.urlEmbed;
|
216
216
|
if (!urlEmbed) return null;
|
217
|
-
const otherProps = {
|
217
|
+
const otherProps = _objectSpread({
|
218
218
|
key: index
|
219
|
-
};
|
219
|
+
}, EmbedProps);
|
220
220
|
const urlEmbedStart = urlEmbed.replace('http://', '').replace('https://', '');
|
221
221
|
const isPlatform = urlEmbedStart.startsWith('youtu') || urlEmbedStart.startsWith('www.youtu') || urlEmbedStart.startsWith('instagram') || urlEmbedStart.startsWith('www.instagram') || urlEmbedStart.startsWith('tiktok') || urlEmbedStart.startsWith('www.tiktok') || urlEmbedStart.startsWith('vimeo') || urlEmbedStart.startsWith('www.vimeo');
|
222
222
|
|
@@ -237,7 +237,7 @@ const Medias = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
237
237
|
src: `https://www.youtube.com/embed/${id}`,
|
238
238
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
239
239
|
allowFullScreen: true,
|
240
|
-
className: classes.aspectRatioYoutube
|
240
|
+
className: classNames([otherProps?.className, classes.aspectRatioYoutube])
|
241
241
|
}));
|
242
242
|
}
|
243
243
|
if (item.urlEmbed.includes('instagram.com')) {
|
@@ -245,7 +245,7 @@ const Medias = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
245
245
|
title: item.name || '',
|
246
246
|
src: `https://www.instagram.com/reel/${id}/embed`,
|
247
247
|
allowFullScreen: true,
|
248
|
-
className: classes.aspectRatioInstagram
|
248
|
+
className: classNames([otherProps?.className, classes.aspectRatioInstagram])
|
249
249
|
}));
|
250
250
|
}
|
251
251
|
if (item.urlEmbed.includes('tiktok.com')) {
|
@@ -253,7 +253,7 @@ const Medias = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
253
253
|
title: item.name || '',
|
254
254
|
src: `https://www.tiktok.com/embed/v2/${id}`,
|
255
255
|
allowFullScreen: true,
|
256
|
-
className: classes.aspectRatioTiktok
|
256
|
+
className: classNames([otherProps?.className, classes.aspectRatioTiktok])
|
257
257
|
}));
|
258
258
|
}
|
259
259
|
if (item.urlEmbed.includes('vimeo.com')) {
|
@@ -261,7 +261,7 @@ const Medias = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
261
261
|
title: item.name || '',
|
262
262
|
src: `https://player.vimeo.com/video/${id}`,
|
263
263
|
allowFullScreen: true,
|
264
|
-
className: classes.aspectRatioVimeo
|
264
|
+
className: classNames([otherProps?.className, classes.aspectRatioVimeo])
|
265
265
|
}));
|
266
266
|
}
|
267
267
|
return /*#__PURE__*/React.createElement(Link, _extends({}, otherProps, {
|
@@ -278,7 +278,7 @@ const Medias = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
278
278
|
__html: urlEmbed
|
279
279
|
}
|
280
280
|
}));
|
281
|
-
}, []);
|
281
|
+
}, [EmbedProps]);
|
282
282
|
const getItem = (version, item, index) => {
|
283
283
|
const media = item.value;
|
284
284
|
const name = (item?.props?.name || !noName) && /*#__PURE__*/React.createElement(Type, _extends({
|
package/esm/index.js
CHANGED