Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should be called for a message to a tracked widget', () => {
const content = new Widget();
const widget = new DocumentWidget({ content, context });
manager.adoptWidget(context, widget);
MessageLoop.sendMessage(widget, new Message('foo'));
expect(manager.methods).to.contain('messageHook');
});
it('should return false for close-request messages', () => {
const widget = manager.createWidget(widgetFactory, context);
const msg = new Message('close-request');
expect(manager.messageHook(widget, msg)).to.equal(false);
});
/**
* A collection of stateless messages related to widgets.
*/
export
namespace Msg {
/**
* A singleton `'before-show'` message.
*
* #### Notes
* This message is sent to a widget before it becomes visible.
*
* This message is **not** sent when the widget is being attached.
*/
export
const BeforeShow = new Message('before-show');
/**
* A singleton `'after-show'` message.
*
* #### Notes
* This message is sent to a widget after it becomes visible.
*
* This message is **not** sent when the widget is being attached.
*/
export
const AfterShow = new Message('after-show');
/**
* A singleton `'before-hide'` message.
*
* #### Notes
*
* This message is **not** sent when the widget is being attached.
*/
export
const BeforeShow = new Message('before-show');
/**
* A singleton `'after-show'` message.
*
* #### Notes
* This message is sent to a widget after it becomes visible.
*
* This message is **not** sent when the widget is being attached.
*/
export
const AfterShow = new Message('after-show');
/**
* A singleton `'before-hide'` message.
*
* #### Notes
* This message is sent to a widget before it becomes not-visible.
*
* This message is **not** sent when the widget is being detached.
*/
export
const BeforeHide = new Message('before-hide');
/**
* A singleton `'after-hide'` message.
*
* #### Notes
*
* This message is **not** sent when the widget is being attached.
*/
export
const AfterShow = new Message('after-show');
/**
* A singleton `'before-hide'` message.
*
* #### Notes
* This message is sent to a widget before it becomes not-visible.
*
* This message is **not** sent when the widget is being detached.
*/
export
const BeforeHide = new Message('before-hide');
/**
* A singleton `'after-hide'` message.
*
* #### Notes
* This message is sent to a widget after it becomes not-visible.
*
* This message is **not** sent when the widget is being detached.
*/
export
const AfterHide = new Message('after-hide');
/**
* A singleton `'before-attach'` message.
*
* #### Notes
* A singleton `'after-attach'` message.
*
* #### Notes
* This message is sent to a widget after it is attached.
*/
export
const AfterAttach = new Message('after-attach');
/**
* A singleton `'before-detach'` message.
*
* #### Notes
* This message is sent to a widget before it is detached.
*/
export
const BeforeDetach = new Message('before-detach');
/**
* A singleton `'after-detach'` message.
*
* #### Notes
* This message is sent to a widget after it is detached.
*/
export
const AfterDetach = new Message('after-detach');
/**
* A singleton `'parent-changed'` message.
*
* #### Notes
* This message is sent to a widget when its parent has changed.
*/
* A singleton `'after-detach'` message.
*
* #### Notes
* This message is sent to a widget after it is detached.
*/
export
const AfterDetach = new Message('after-detach');
/**
* A singleton `'parent-changed'` message.
*
* #### Notes
* This message is sent to a widget when its parent has changed.
*/
export
const ParentChanged = new Message('parent-changed');
/**
* A singleton conflatable `'update-request'` message.
*
* #### Notes
* This message can be dispatched to supporting widgets in order to
* update their content based on the current widget state. Not all
* widgets will respond to messages of this type.
*
* For widgets with a layout, this message will inform the layout to
* update the position and size of its child widgets.
*/
export
const UpdateRequest = new ConflatableMessage('update-request');
/**
* A singleton `'before-attach'` message.
*
* #### Notes
* This message is sent to a widget before it is attached.
*/
export
const BeforeAttach = new Message('before-attach');
/**
* A singleton `'after-attach'` message.
*
* #### Notes
* This message is sent to a widget after it is attached.
*/
export
const AfterAttach = new Message('after-attach');
/**
* A singleton `'before-detach'` message.
*
* #### Notes
* This message is sent to a widget before it is detached.
*/
export
const BeforeDetach = new Message('before-detach');
/**
* A singleton `'after-detach'` message.
*
* #### Notes
* This message is sent to a widget after it is detached.
*/
* #### Notes
* This message is sent to a widget after it becomes not-visible.
*
* This message is **not** sent when the widget is being detached.
*/
export
const AfterHide = new Message('after-hide');
/**
* A singleton `'before-attach'` message.
*
* #### Notes
* This message is sent to a widget before it is attached.
*/
export
const BeforeAttach = new Message('before-attach');
/**
* A singleton `'after-attach'` message.
*
* #### Notes
* This message is sent to a widget after it is attached.
*/
export
const AfterAttach = new Message('after-attach');
/**
* A singleton `'before-detach'` message.
*
* #### Notes
* This message is sent to a widget before it is detached.
*/
* A singleton `'before-detach'` message.
*
* #### Notes
* This message is sent to a widget before it is detached.
*/
export
const BeforeDetach = new Message('before-detach');
/**
* A singleton `'after-detach'` message.
*
* #### Notes
* This message is sent to a widget after it is detached.
*/
export
const AfterDetach = new Message('after-detach');
/**
* A singleton `'parent-changed'` message.
*
* #### Notes
* This message is sent to a widget when its parent has changed.
*/
export
const ParentChanged = new Message('parent-changed');
/**
* A singleton conflatable `'update-request'` message.
*
* #### Notes
* This message can be dispatched to supporting widgets in order to
* update their content based on the current widget state. Not all