@@ -3679,20 +3679,86 @@ function RemoteFunctions(config = {}) {
36793679 var _hoverLockTimer = null ;
36803680
36813681 const DOWNLOAD_EVENTS = {
3682+ DIALOG_OPENED : 'dialogOpened' ,
3683+ DIALOG_CLOSED : 'dialogClosed' ,
36823684 STARTED : 'downloadStarted' ,
36833685 COMPLETED : 'downloadCompleted' ,
36843686 CANCELLED : 'downloadCancelled' ,
36853687 ERROR : 'downloadError'
36863688 } ;
36873689
36883690 let _activeDownloads = new Map ( ) ;
3691+ let _dialogOverlay = null ;
3692+
3693+ function _showDialogOverlay ( ) {
3694+ // don't create multiple overlays
3695+ if ( _dialogOverlay ) {
3696+ return ;
3697+ }
3698+
3699+ // create overlay container
3700+ const overlay = window . document . createElement ( 'div' ) ;
3701+ overlay . className = 'phoenix-dialog-overlay' ;
3702+ overlay . setAttribute ( 'data-phcode-internal-c15r5a9' , 'true' ) ;
3703+ overlay . style . cssText = 'position: fixed; top: 0; left: 0; width: 100%; height: 100%; ' +
3704+ 'background: rgba(0, 0, 0, 0.5); z-index: 10000; pointer-events: auto;' ;
3705+
3706+ // create toast card (matching existing overlay style: #666 background, #ededed text)
3707+ const toast = window . document . createElement ( 'div' ) ;
3708+ toast . className = 'phoenix-dialog-toast' ;
3709+ toast . setAttribute ( 'data-phcode-internal-c15r5a9' , 'true' ) ;
3710+ toast . style . cssText = 'position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); ' +
3711+ 'background: #666; color: #ededed; padding: 24px 32px; border-radius: 6px; ' +
3712+ 'box-shadow: 0 4px 12px rgba(0,0,0,0.15); font-size: 16px; text-align: center;' ;
3713+
3714+ // create icon
3715+ const icon = window . document . createElement ( 'span' ) ;
3716+ icon . className = 'phoenix-dialog-icon' ;
3717+ icon . setAttribute ( 'data-phcode-internal-c15r5a9' , 'true' ) ;
3718+ icon . style . cssText = 'margin-right: 10px; font-size: 18px;' ;
3719+ icon . textContent = 'ⓘ' ;
3720+
3721+ // create message
3722+ const message = window . document . createElement ( 'span' ) ;
3723+ message . className = 'phoenix-dialog-message' ;
3724+ message . setAttribute ( 'data-phcode-internal-c15r5a9' , 'true' ) ;
3725+ message . textContent = 'Select image download location in the editor to continue' ;
3726+
3727+ // assemble the structure
3728+ toast . appendChild ( icon ) ;
3729+ toast . appendChild ( message ) ;
3730+ overlay . appendChild ( toast ) ;
3731+
3732+ // append to body
3733+ window . document . body . appendChild ( overlay ) ;
3734+ _dialogOverlay = overlay ;
3735+ }
3736+
3737+ function _hideDialogOverlay ( ) {
3738+ if ( _dialogOverlay && _dialogOverlay . parentNode ) {
3739+ _dialogOverlay . parentNode . removeChild ( _dialogOverlay ) ;
3740+ _dialogOverlay = null ;
3741+ }
3742+ }
36893743
36903744 function handleDownloadEvent ( eventType , data ) {
36913745 const downloadId = data && data . downloadId ;
36923746 if ( ! downloadId ) {
36933747 return ;
36943748 }
36953749
3750+ // handle dialog events (these don't require download to exist)
3751+ if ( eventType === DOWNLOAD_EVENTS . DIALOG_OPENED ) {
3752+ _showDialogOverlay ( ) ;
3753+ return ;
3754+ }
3755+
3756+ if ( eventType === DOWNLOAD_EVENTS . DIALOG_CLOSED ) {
3757+ _hideDialogOverlay ( ) ;
3758+ return ;
3759+ }
3760+
3761+ // handle download events (these require download to exist)
36963762 const download = _activeDownloads . get ( downloadId ) ;
36973763 if ( ! download ) {
36983764 return ;
0 commit comments