@@ -99,7 +99,9 @@ function RemoteFunctions(config = {}) {
9999 // called when an item is selected from the more options dropdown
100100 "handleDropdownClick" ,
101101 "reRegisterEventHandlers" ,
102- "handleClick" // handle click on an icon in the more options box.
102+ "handleClick" , // handle click on an icon in the more options box.
103+ // when escape key is presses in the editor, we may need to dismiss the live edit boxes.
104+ "handleEscapePressFromEditor"
103105 ] ;
104106
105107 const _moreOptionsHandlers = new Map ( ) ;
@@ -4312,6 +4314,16 @@ function RemoteFunctions(config = {}) {
43124314 } ) ;
43134315 }
43144316
4317+ function _escapeKeyPressInEditor ( ) {
4318+ enableHoverListeners ( ) ; // so that if hover lock is there it will get cleared
4319+ dismissUIAndCleanupState ( ) ;
4320+ getAllNodeMoreOptionsHandlers ( ) . forEach ( handler => {
4321+ if ( handler . handleEscapePressFromEditor ) {
4322+ handler . handleEscapePressFromEditor ( ) ;
4323+ }
4324+ } ) ;
4325+ }
4326+
43154327 function _requestConfigRefresh ( ) {
43164328 // send image gallery state change message to editor to save preference in state manager
43174329 window . _Brackets_MessageBroker . send ( {
@@ -4342,6 +4354,9 @@ function RemoteFunctions(config = {}) {
43424354 } ) ;
43434355
43444356 let customReturns = { } ;
4357+ // only apis that needs to be called from phoenix js layer should be customReturns. APis that are shared within
4358+ // the remote function context only should not be in customReturns and should be in
4359+ // either SHARED_STATE for state vars, GLOBALS for global vars, or LivePreviewView for shared functions.
43454360 customReturns = { // we have to do this else the minifier will strip the customReturns variable
43464361 ...customReturns ,
43474362 "DOMEditHandler" : DOMEditHandler ,
@@ -4356,7 +4371,8 @@ function RemoteFunctions(config = {}) {
43564371 "finishEditing" : finishEditing ,
43574372 "dismissUIAndCleanupState" : dismissUIAndCleanupState ,
43584373 "handleDownloadEvent" : handleDownloadEvent ,
4359- "showToastMessage" : showToastMessage
4374+ "showToastMessage" : showToastMessage ,
4375+ "escapeKeyPressInEditor" : _escapeKeyPressInEditor
43604376 } ;
43614377
43624378 // the below code comment is replaced by added scripts for extensibility
0 commit comments