@onlyoffice/docspace-plugin-sdk
Version:
Simple plugin system for onlyoffice docspace
155 lines (154 loc) • 6.32 kB
JavaScript
"use strict";
/**
* (c) Copyright Ascensio System SIA 2026
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @license
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Actions = void 0;
/**
* A collection of events that will be processed on the portal side.
*/
var Actions;
(function (Actions) {
/**
* Calls a function to update the state of the item which action was passed.
* It does not work if the "newProps" parameter is not passed to the message.
*/
Actions["updateProps"] = "update-props";
/**
* Calls a function to update the state of the parent or child items which were passed.
* It does not work if the "contextProps" parameter is not passed to the message.
*/
Actions["updateContext"] = "update-context";
/**
* Calls a function to update the plugin status.
*/
Actions["updateStatus"] = "update-status";
/**
* Calls a function to update all the context menu items.
*/
Actions["updateContextMenuItems"] = "update-context-menu-items";
/**
* Calls a function to update all the info panel items.
*/
Actions["updateInfoPanelItems"] = "update-info-panel-items";
/**
* Calls a function to update all the main button menu items.
*/
Actions["updateMainButtonItems"] = "update-main-button-items";
/**
* Calls a function to update all the profile menu items.
*/
Actions["updateProfileMenuItems"] = "update-profile-menu-items";
/**
* Calls a function to update all the file items.
*/
Actions["updateFileItems"] = "update-file-items";
/**
* Calls a function to update all the event listener items.
*/
Actions["updateEventListenerItems"] = "update-event-listener-items";
/**
* Calls a function to display a toast notification after the user actions.
* It does not work if the "toastProps" parameter is not passed to the message.
*/
Actions["showToast"] = "show-toast";
/**
* Calls a function to open a modal window for creating certain item (file, folder, etc.).
* It does not work if the "createDialogProps" parameter is not passed to the message.
*/
Actions["showCreateDialogModal"] = "show-create-dialog-modal";
/**
* Calls a function to update a modal window for creating certain item (file, folder, etc.).
* It does not work if the "createDialogProps" parameter is not passed to the message.
*/
Actions["updateCreateDialogModal"] = "update-create-dialog-modal";
/**
* Calls a function to open a modal window.
* It does not work if the "modalDialogProps" parameter is not passed to the message.
*/
Actions["showModal"] = "show-modal";
/**
* Calls a function to close a modal window.
*/
Actions["closeModal"] = "close-modal";
/**
* Calls a function to send a message to a frame.
* It does not work if the "postMessage" parameter is not passed to the message or the specified frame is not found.
*/
Actions["sendPostMessage"] = "send-post-message";
/**
* Calls a function to save the data that was transferred in the "settings" parameter
* and returns it in the "setAdminPluginSettingsValue" method each time the plugin is requested.
* It functions only when the "Save" button is clicked in the "Settings" block.
*/
Actions["saveSettings"] = "save-settings";
/**
* Calls a function to display a selector.
* It does not work if the "selectorProps" parameter is not passed to the message.
*/
Actions["showSelector"] = "show-selector";
/**
* Calls a function to update a selector.
* It does not work if the "selectorProps" parameter is not passed to the message.
*/
Actions["updateSelector"] = "update-selector";
/**
* Calls a function to close a selector.
*/
Actions["closeSelector"] = "close-selector";
/**
* Calls a function to add operations in floating button.
* Multiple plugins can show operations simultaneously - they will be aggregated.
* It does not work if the "floatingOperationsButtonProps" parameter is not passed to the message.
*
* **Note:** Each floating operations is identified by its id. Calling this action again
* will not replace the previous operations.
*/
Actions["addFloatingOperationsButton"] = "add-floating-operations-button";
/**
* Calls a function to update operations in floating button.
* It does not work if the "floatingOperationsButtonProps" parameter is not passed to the message.
*/
Actions["updateFloatingOperationsButton"] = "update-floating-operations-button";
/**
* Calls a function to remove the floating operations.
* It does not work if the "floatingOperationsButtonPropsId" parameter is not passed to the message.
*/
Actions["removeFloatingOperationsButton"] = "remove-floating-operations-button";
/**
* Calls a function to navigate to the specified path.
* All actions listed after navigate will be called after the navigation is complete.
* It does not work if the "navigatePath" parameter is not passed to the message.
*/
Actions["navigate"] = "navigate";
/**
* Calls a function to open the plugin info panel.
*/
Actions["openInfoPanel"] = "open-info-panel";
/**
* Calls a function to open the plugin media viewer.
*/
Actions["showMediaViewer"] = "show-media-viewer";
/**
* Calls a function to update the plugin media viewer.
*/
Actions["updateMediaViewer"] = "update-media-viewer";
/**
* Calls a function to close the plugin media viewer.
*/
Actions["closeMediaViewer"] = "close-media-viewer";
})(Actions || (exports.Actions = Actions = {}));