showNotification(name, title, message, [sticky], [level])
Show a notification, if Writer is used inside of Dashboard, the notification will be elevated and displayed through the Dashboard notification instead
Param
Type
Default
Description
Required - The plugin ID of the plugin that sent the notification
Required - Notification title
Required - Notification message
Optional, default false, if true notification stays till user closes it
Optional, default info. success
Copy api . ui . showNotification (
' plugin.id ' ,
' An insightful title ' ,
' And descriptive text ' ,
false
) showArticleMessage(origin, id, options)
Display a message with static positioning at the top of the article. Can disallow closing, and can include buttons with callback functions.
Required - The plugin ID of the plugin that sent the article message
Required - Article message id
Required - Message options
Required - Article message message
Required - Optional, default true, Allow the message to be closed
Required - Optional - Array of button objects {label: string, onClick: function}
showDialog(contentComponent, props, options, [focusPrimary], [theme], [takeover], [cssClass], [clearSelection], [disableEscKey], [heading])
Display a dialog with the specified content.
Supported dialog actions:
`dialog:enablePrimaryBtn`Enables the primary button`dialog:disablePrimaryBtn`Disables the primary button
See : component/dialogComponentarrow-up-right
Param
Type
Default
Description
Required - A substance component or tool that will be rendered inside the dialog
Required - A object that will be passed as props to contentComponent
Component.DialogComponent.Options
Required - Options passed to dialog
Primary button caption, default is i18n representation of Ok, set to false to disable button
Secondary button caption, default is i18n representation of Cancel, set to false to disable button
Callback when clicking button
Focus on primary button on rendering
Choose theme for dialog. Dark or light. Dark with light overlay and vice versa
When set to true got a full width and height modal
Add css class to be append to modal for external styling
Remove cursor and selection in the writing area when modal is presented
Disabled ESC key to close modal
Apply additional heading. Should be handled in the compontent if it can.
showAuthDialog(authComponent, authProps, authOptions)
Display a Auth dialog (401/402) above any other dialogs.
Required - A substance component or tool that will be rendered inside the dialog
Required - A object that will be passed as props to contentComponent
Component.DialogComponent.Options
Required - Options passed to dialog
Primary button caption, default is i18n representation of Ok, set to false to disable button
Secondary button caption, default is i18n representation of Cancel, set to false to disable button
As default the dialog is centered over the editor area, set to true to center over the full writer
showMessageDialog(messages, cbContinue, cbCancel, [heading], [showTimestamp])
Display a number of messages and different options depending on the severity on each message. Messages can be of type info, warning or error.
If there are error messages the user will not be able to continue. If there are warnings the user can continue but suggested to cancel. If only info messages only a continue is possible.
Param
Type
Default
Description
Required - An array of message objects. Each object have the properties type (string: info, warning, error), plugin (string: the plugin name) and message (string)
Required - Callback function for when the user press continue
Required - Callback function for when the user press cancel
Additional text to display above the messages
Set to false to hide timestamp on error messages, not applicable on any other level
Display a simple confirmation dialog
Required - dialog heading
Required - dialog message
Required - object with primary/secondary objects for button specifics
showBottomPanel(pluginName, component, [props], [sticky])
Renders a supplied component in a screen-wide panel which smoothly animates from the bottom of the screen.
Param
Type
Default
Description
Required - Name of plugin that called the function
Required - Component class to be rendered in the Panel
Object which is sent as props to the component class. Defaults to empty object.
Set to true to prevent Panel from closing when clicking outside of the Panel. Defaults to false.
showOverlay(pluginName, component, [props])
Renders a supplied component in a "fullscreen" overlay.
Required - Name of plugin that called the function
Required - Component class to be rendered in the Overlay
Object which is sent as props to the component class. Defaults to empty object.
hideOverlay(pluginName)
Hides the overlay. Useful to call this in a component that rendered as and overlay component.
Required - Name of plugin that called the function
Deprecated
Deprecated, use import {UIComponent} from 'writer' statements for UIComponents instead