From 148878e00fd14a8119ccf1b6e482810f2f10ea09 Mon Sep 17 00:00:00 2001 From: Johan Sosa Date: Sat, 20 Jan 2024 21:46:42 +0100 Subject: [PATCH] feat(ModalZoom): Added hideButton and opened props --- .../src/overlay/ModalZoom/ModalZoom.js | 40 +++++++++++------- packages/components/src/tokens.compiled.js | 41 +++++++++++++++---- packages/icons/solid/esm/index.d.ts | 5 +++ packages/icons/solid/esm/index.js | 5 +++ packages/icons/solid/index.d.ts | 5 +++ packages/icons/solid/index.js | 5 +++ packages/icons/src/solid/cursor-player.svg | 3 ++ packages/icons/src/solid/download.svg | 3 ++ packages/icons/src/solid/message-chat.svg | 3 ++ packages/icons/src/solid/open.svg | 3 ++ packages/icons/src/solid/search-plus.svg | 3 ++ .../src/common/AssetPlayer/AssetPlayer.js | 5 +++ 12 files changed, 100 insertions(+), 21 deletions(-) create mode 100644 packages/icons/src/solid/cursor-player.svg create mode 100644 packages/icons/src/solid/download.svg create mode 100644 packages/icons/src/solid/message-chat.svg create mode 100644 packages/icons/src/solid/open.svg create mode 100644 packages/icons/src/solid/search-plus.svg diff --git a/packages/components/src/overlay/ModalZoom/ModalZoom.js b/packages/components/src/overlay/ModalZoom/ModalZoom.js index 206790dd0..b3c0418dd 100644 --- a/packages/components/src/overlay/ModalZoom/ModalZoom.js +++ b/packages/components/src/overlay/ModalZoom/ModalZoom.js @@ -1,31 +1,42 @@ import React, { useState, useRef } from 'react'; import { Portal } from '@mantine/core'; +import { noop } from 'lodash'; import { RemoveIcon, ZoomInIcon, ZoomOutIcon } from '@bubbles-ui/icons/outline'; import { TransformComponent, TransformWrapper } from 'react-zoom-pan-pinch'; import { Box } from '../../layout/Box'; import { ModalZoomStyles } from './ModalZoom.styles'; import { MODAL_ZOOM_DEFAULT_PROPS, MODAL_ZOOM_PROP_TYPES } from './ModalZoom.constants'; -const ModalZoom = ({ children, canPlay, style }) => { - const [open, setOpen] = useState(false); +const ModalZoom = ({ children, canPlay, opened, hideButton, onClose = noop, style }) => { + const [open, setOpen] = useState(opened); const center = useRef(null); const { classes } = ModalZoomStyles({}, { name: 'ModalZoom' }); + React.useEffect(() => { + if(opened !== open) { + setOpen(opened); + center.current?.call(); + } + }, [opened]) + return ( <> - { - if (!canPlay) return; - if (center.current) { - center.current.call(); - } - setOpen(true); - }} - > - {children} - + {!hideButton && ( + { + if (!canPlay) return; + if (center.current) { + center.current.call(); + } + setOpen(true); + }} + > + {children} + + )} + {open && ( @@ -33,6 +44,7 @@ const ModalZoom = ({ children, canPlay, style }) => { className={classes.close} onClick={() => { setOpen(false); + onClose(); }} > diff --git a/packages/components/src/tokens.compiled.js b/packages/components/src/tokens.compiled.js index ad11f90d1..c0c8660b3 100644 --- a/packages/components/src/tokens.compiled.js +++ b/packages/components/src/tokens.compiled.js @@ -1153,7 +1153,7 @@ export default { "y": 0, "blur": 4, "spread": 0, - "color": "#ffffff26", + "color": "#ffffff", "type": "dropShadow" }, "type": "boxShadow" @@ -1234,8 +1234,17 @@ export default { "type": "color" }, "hover--reverse-transparent": { - "value": "#ffffff26", - "type": "color" + "value": "#ffffff", + "type": "color", + "$extensions": { + "studio.tokens": { + "modify": { + "type": "alpha", + "value": "0.15", + "space": "lch" + } + } + } }, "down": { "value": "#F1FFBD", @@ -4930,12 +4939,30 @@ export default { "color": { "primary": { "default": { - "value": "#4d535866", - "type": "color" + "value": "#4D5358", + "type": "color", + "$extensions": { + "studio.tokens": { + "modify": { + "type": "alpha", + "value": "0.4", + "space": "lch" + } + } + } }, "hover": { - "value": "#4d5358b3", - "type": "color" + "value": "#4D5358", + "type": "color", + "$extensions": { + "studio.tokens": { + "modify": { + "type": "alpha", + "value": "0.7", + "space": "lch" + } + } + } }, "down": { "value": "#4D5358", diff --git a/packages/icons/solid/esm/index.d.ts b/packages/icons/solid/esm/index.d.ts index d776778fb..12f8ca0de 100644 --- a/packages/icons/solid/esm/index.d.ts +++ b/packages/icons/solid/esm/index.d.ts @@ -40,6 +40,7 @@ export { default as ControlsPreviousIcon } from './ControlsPreviousIcon' export { default as ControlsRecordIcon } from './ControlsRecordIcon' export { default as ControlsRewindIcon } from './ControlsRewindIcon' export { default as ControlsStopIcon } from './ControlsStopIcon' +export { default as CursorPlayerIcon } from './CursorPlayerIcon' export { default as CursorIcon } from './CursorIcon' export { default as CutStarIcon } from './CutStarIcon' export { default as DeleteAlternateIcon } from './DeleteAlternateIcon' @@ -48,6 +49,7 @@ export { default as DeleteIcon } from './DeleteIcon' export { default as DesignShapeMonitorIcon } from './DesignShapeMonitorIcon' export { default as DislikeIcon } from './DislikeIcon' export { default as DoneSquareAlternateIcon } from './DoneSquareAlternateIcon' +export { default as DownloadIcon } from './DownloadIcon' export { default as EditWriteIcon } from './EditWriteIcon' export { default as EditorCenterAlignIcon } from './EditorCenterAlignIcon' export { default as EditorHyperlinkIcon } from './EditorHyperlinkIcon' @@ -99,6 +101,7 @@ export { default as LinkedinIcon } from './LinkedinIcon' export { default as LockIcon } from './LockIcon' export { default as MapFlagIcon } from './MapFlagIcon' export { default as MeetingCameraIcon } from './MeetingCameraIcon' +export { default as MessageChatIcon } from './MessageChatIcon' export { default as MicrophoneOffIcon } from './MicrophoneOffIcon' export { default as MicrophoneIcon } from './MicrophoneIcon' export { default as MoveToTopIcon } from './MoveToTopIcon' @@ -106,6 +109,7 @@ export { default as MusicNoteIcon } from './MusicNoteIcon' export { default as NavigationMenuIcon } from './NavigationMenuIcon' export { default as NoPauseIcon } from './NoPauseIcon' export { default as NonEvaluableIcon } from './NonEvaluableIcon' +export { default as OpenIcon } from './OpenIcon' export { default as ParagraphSpacingIcon } from './ParagraphSpacingIcon' export { default as PassportIcon } from './PassportIcon' export { default as PerformanceMoneyIncreaseIcon } from './PerformanceMoneyIncreaseIcon' @@ -147,6 +151,7 @@ export { default as PunctuableIcon } from './PunctuableIcon' export { default as RatingStarIcon } from './RatingStarIcon' export { default as RemoveBoldIcon } from './RemoveBoldIcon' export { default as ReorderDownIcon } from './ReorderDownIcon' +export { default as SearchPlusIcon } from './SearchPlusIcon' export { default as SettingMenuHorizontalIcon } from './SettingMenuHorizontalIcon' export { default as SettingMenuVerticalIcon } from './SettingMenuVerticalIcon' export { default as SettingsIcon } from './SettingsIcon' diff --git a/packages/icons/solid/esm/index.js b/packages/icons/solid/esm/index.js index 1ac239198..cc7aabe44 100644 --- a/packages/icons/solid/esm/index.js +++ b/packages/icons/solid/esm/index.js @@ -40,6 +40,7 @@ export { default as ControlsPreviousIcon } from './ControlsPreviousIcon.js' export { default as ControlsRecordIcon } from './ControlsRecordIcon.js' export { default as ControlsRewindIcon } from './ControlsRewindIcon.js' export { default as ControlsStopIcon } from './ControlsStopIcon.js' +export { default as CursorPlayerIcon } from './CursorPlayerIcon.js' export { default as CursorIcon } from './CursorIcon.js' export { default as CutStarIcon } from './CutStarIcon.js' export { default as DeleteAlternateIcon } from './DeleteAlternateIcon.js' @@ -48,6 +49,7 @@ export { default as DeleteIcon } from './DeleteIcon.js' export { default as DesignShapeMonitorIcon } from './DesignShapeMonitorIcon.js' export { default as DislikeIcon } from './DislikeIcon.js' export { default as DoneSquareAlternateIcon } from './DoneSquareAlternateIcon.js' +export { default as DownloadIcon } from './DownloadIcon.js' export { default as EditWriteIcon } from './EditWriteIcon.js' export { default as EditorCenterAlignIcon } from './EditorCenterAlignIcon.js' export { default as EditorHyperlinkIcon } from './EditorHyperlinkIcon.js' @@ -99,6 +101,7 @@ export { default as LinkedinIcon } from './LinkedinIcon.js' export { default as LockIcon } from './LockIcon.js' export { default as MapFlagIcon } from './MapFlagIcon.js' export { default as MeetingCameraIcon } from './MeetingCameraIcon.js' +export { default as MessageChatIcon } from './MessageChatIcon.js' export { default as MicrophoneOffIcon } from './MicrophoneOffIcon.js' export { default as MicrophoneIcon } from './MicrophoneIcon.js' export { default as MoveToTopIcon } from './MoveToTopIcon.js' @@ -106,6 +109,7 @@ export { default as MusicNoteIcon } from './MusicNoteIcon.js' export { default as NavigationMenuIcon } from './NavigationMenuIcon.js' export { default as NoPauseIcon } from './NoPauseIcon.js' export { default as NonEvaluableIcon } from './NonEvaluableIcon.js' +export { default as OpenIcon } from './OpenIcon.js' export { default as ParagraphSpacingIcon } from './ParagraphSpacingIcon.js' export { default as PassportIcon } from './PassportIcon.js' export { default as PerformanceMoneyIncreaseIcon } from './PerformanceMoneyIncreaseIcon.js' @@ -147,6 +151,7 @@ export { default as PunctuableIcon } from './PunctuableIcon.js' export { default as RatingStarIcon } from './RatingStarIcon.js' export { default as RemoveBoldIcon } from './RemoveBoldIcon.js' export { default as ReorderDownIcon } from './ReorderDownIcon.js' +export { default as SearchPlusIcon } from './SearchPlusIcon.js' export { default as SettingMenuHorizontalIcon } from './SettingMenuHorizontalIcon.js' export { default as SettingMenuVerticalIcon } from './SettingMenuVerticalIcon.js' export { default as SettingsIcon } from './SettingsIcon.js' diff --git a/packages/icons/solid/index.d.ts b/packages/icons/solid/index.d.ts index d776778fb..12f8ca0de 100644 --- a/packages/icons/solid/index.d.ts +++ b/packages/icons/solid/index.d.ts @@ -40,6 +40,7 @@ export { default as ControlsPreviousIcon } from './ControlsPreviousIcon' export { default as ControlsRecordIcon } from './ControlsRecordIcon' export { default as ControlsRewindIcon } from './ControlsRewindIcon' export { default as ControlsStopIcon } from './ControlsStopIcon' +export { default as CursorPlayerIcon } from './CursorPlayerIcon' export { default as CursorIcon } from './CursorIcon' export { default as CutStarIcon } from './CutStarIcon' export { default as DeleteAlternateIcon } from './DeleteAlternateIcon' @@ -48,6 +49,7 @@ export { default as DeleteIcon } from './DeleteIcon' export { default as DesignShapeMonitorIcon } from './DesignShapeMonitorIcon' export { default as DislikeIcon } from './DislikeIcon' export { default as DoneSquareAlternateIcon } from './DoneSquareAlternateIcon' +export { default as DownloadIcon } from './DownloadIcon' export { default as EditWriteIcon } from './EditWriteIcon' export { default as EditorCenterAlignIcon } from './EditorCenterAlignIcon' export { default as EditorHyperlinkIcon } from './EditorHyperlinkIcon' @@ -99,6 +101,7 @@ export { default as LinkedinIcon } from './LinkedinIcon' export { default as LockIcon } from './LockIcon' export { default as MapFlagIcon } from './MapFlagIcon' export { default as MeetingCameraIcon } from './MeetingCameraIcon' +export { default as MessageChatIcon } from './MessageChatIcon' export { default as MicrophoneOffIcon } from './MicrophoneOffIcon' export { default as MicrophoneIcon } from './MicrophoneIcon' export { default as MoveToTopIcon } from './MoveToTopIcon' @@ -106,6 +109,7 @@ export { default as MusicNoteIcon } from './MusicNoteIcon' export { default as NavigationMenuIcon } from './NavigationMenuIcon' export { default as NoPauseIcon } from './NoPauseIcon' export { default as NonEvaluableIcon } from './NonEvaluableIcon' +export { default as OpenIcon } from './OpenIcon' export { default as ParagraphSpacingIcon } from './ParagraphSpacingIcon' export { default as PassportIcon } from './PassportIcon' export { default as PerformanceMoneyIncreaseIcon } from './PerformanceMoneyIncreaseIcon' @@ -147,6 +151,7 @@ export { default as PunctuableIcon } from './PunctuableIcon' export { default as RatingStarIcon } from './RatingStarIcon' export { default as RemoveBoldIcon } from './RemoveBoldIcon' export { default as ReorderDownIcon } from './ReorderDownIcon' +export { default as SearchPlusIcon } from './SearchPlusIcon' export { default as SettingMenuHorizontalIcon } from './SettingMenuHorizontalIcon' export { default as SettingMenuVerticalIcon } from './SettingMenuVerticalIcon' export { default as SettingsIcon } from './SettingsIcon' diff --git a/packages/icons/solid/index.js b/packages/icons/solid/index.js index b6233ff9a..e653814cf 100644 --- a/packages/icons/solid/index.js +++ b/packages/icons/solid/index.js @@ -40,6 +40,7 @@ module.exports.ControlsPreviousIcon = require("./ControlsPreviousIcon.js") module.exports.ControlsRecordIcon = require("./ControlsRecordIcon.js") module.exports.ControlsRewindIcon = require("./ControlsRewindIcon.js") module.exports.ControlsStopIcon = require("./ControlsStopIcon.js") +module.exports.CursorPlayerIcon = require("./CursorPlayerIcon.js") module.exports.CursorIcon = require("./CursorIcon.js") module.exports.CutStarIcon = require("./CutStarIcon.js") module.exports.DeleteAlternateIcon = require("./DeleteAlternateIcon.js") @@ -48,6 +49,7 @@ module.exports.DeleteIcon = require("./DeleteIcon.js") module.exports.DesignShapeMonitorIcon = require("./DesignShapeMonitorIcon.js") module.exports.DislikeIcon = require("./DislikeIcon.js") module.exports.DoneSquareAlternateIcon = require("./DoneSquareAlternateIcon.js") +module.exports.DownloadIcon = require("./DownloadIcon.js") module.exports.EditWriteIcon = require("./EditWriteIcon.js") module.exports.EditorCenterAlignIcon = require("./EditorCenterAlignIcon.js") module.exports.EditorHyperlinkIcon = require("./EditorHyperlinkIcon.js") @@ -99,6 +101,7 @@ module.exports.LinkedinIcon = require("./LinkedinIcon.js") module.exports.LockIcon = require("./LockIcon.js") module.exports.MapFlagIcon = require("./MapFlagIcon.js") module.exports.MeetingCameraIcon = require("./MeetingCameraIcon.js") +module.exports.MessageChatIcon = require("./MessageChatIcon.js") module.exports.MicrophoneOffIcon = require("./MicrophoneOffIcon.js") module.exports.MicrophoneIcon = require("./MicrophoneIcon.js") module.exports.MoveToTopIcon = require("./MoveToTopIcon.js") @@ -106,6 +109,7 @@ module.exports.MusicNoteIcon = require("./MusicNoteIcon.js") module.exports.NavigationMenuIcon = require("./NavigationMenuIcon.js") module.exports.NoPauseIcon = require("./NoPauseIcon.js") module.exports.NonEvaluableIcon = require("./NonEvaluableIcon.js") +module.exports.OpenIcon = require("./OpenIcon.js") module.exports.ParagraphSpacingIcon = require("./ParagraphSpacingIcon.js") module.exports.PassportIcon = require("./PassportIcon.js") module.exports.PerformanceMoneyIncreaseIcon = require("./PerformanceMoneyIncreaseIcon.js") @@ -147,6 +151,7 @@ module.exports.PunctuableIcon = require("./PunctuableIcon.js") module.exports.RatingStarIcon = require("./RatingStarIcon.js") module.exports.RemoveBoldIcon = require("./RemoveBoldIcon.js") module.exports.ReorderDownIcon = require("./ReorderDownIcon.js") +module.exports.SearchPlusIcon = require("./SearchPlusIcon.js") module.exports.SettingMenuHorizontalIcon = require("./SettingMenuHorizontalIcon.js") module.exports.SettingMenuVerticalIcon = require("./SettingMenuVerticalIcon.js") module.exports.SettingsIcon = require("./SettingsIcon.js") diff --git a/packages/icons/src/solid/cursor-player.svg b/packages/icons/src/solid/cursor-player.svg new file mode 100644 index 000000000..e46e070f9 --- /dev/null +++ b/packages/icons/src/solid/cursor-player.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/icons/src/solid/download.svg b/packages/icons/src/solid/download.svg new file mode 100644 index 000000000..5e1a429a3 --- /dev/null +++ b/packages/icons/src/solid/download.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/icons/src/solid/message-chat.svg b/packages/icons/src/solid/message-chat.svg new file mode 100644 index 000000000..50fe8d24e --- /dev/null +++ b/packages/icons/src/solid/message-chat.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/icons/src/solid/open.svg b/packages/icons/src/solid/open.svg new file mode 100644 index 000000000..349c05ed7 --- /dev/null +++ b/packages/icons/src/solid/open.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/icons/src/solid/search-plus.svg b/packages/icons/src/solid/search-plus.svg new file mode 100644 index 000000000..dbc79b9e3 --- /dev/null +++ b/packages/icons/src/solid/search-plus.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/packages/leemons/src/common/AssetPlayer/AssetPlayer.js b/packages/leemons/src/common/AssetPlayer/AssetPlayer.js index efe2c7ab2..7889054a4 100644 --- a/packages/leemons/src/common/AssetPlayer/AssetPlayer.js +++ b/packages/leemons/src/common/AssetPlayer/AssetPlayer.js @@ -252,6 +252,11 @@ const AssetPlayer = ({ }, { name: 'AssetPlayer' }, ); + + console.log('AssetPlayer -> URL:', url); + console.log('AssetPlayer -> fileType:', fileType); + console.log('AssetPlayer -> media:', media); + return (