npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@onlyoffice/docspace-plugin-sdk

v1.0.0

Published

Simple plugin system for onlyoffice docspace

Downloads

1,605

Readme

ONLYOFFICE DocSpace Plugins SDK

Overview

ONLYOFFICE DocSpace Plugins SDK is an npm package based on TypeScript engines which provides interfaces to create your own plugins for embedding in the DocSpace portal.

To install the @onlyoffice/docspace-plugin-sdk npm package globally, run the following command in the terminal:

npm i -g @onlyoffice/docspace-plugin-sdk

Functionality

  • Creating base plugins with the npx command.
  • Embedding plugins in context menu, info panel, profile menu, main button using the corresponding interfaces.
  • Configuring plugin UI using the DocSpace plugins components.

npx

After installing the npm package, the npx create-docspace-plugin command becomes available and allows you to create a plugin template with the pre-installed plugin types and the implementation of basic methods.

This command displays a dialog which allows you to configure the plugin settings and select the required scopes.

You can find a list of all the dialog questions here.

Developing a plugin

  • Write code for each plugin type using the corresponding variables, methods and items. Put the scripts into the src folder. Specify the required Plugin interface for each plugin to be embedded in the portal.
  • Specify plugin messages that will be returned by the items. Use the appropriate events that will be processed on the portal side.
  • Configure the plugin UI using the plugin components.

Code samples are available at https://github.com/ONLYOFFICE/docspace-plugins.

Building a plugin

To build a plugin, you need the yarn package manager to be installed. After that, follow the instructions below:

  1. Open the terminal and go to the plugin root folder:
cd PDF-Converter
  1. Install all the necessary dependencies (if this was not done previously when creating the plugin template):
yarn install
  1. Collect an archive for uploading to the portal:
yarn build

This command generates the obfuscated code from the entire project and collects it into the plugin.js file using the webpack npm package. After that the plugin builder from the createZip.js file generates the config.json file from the package.json data and creates an archive that contains the assets folder, the plugin.js file, and the config.json file.

The dist folder will be created in the root plugin folder and the plugin archive will be placed in it. This archive is the completed plugin that can be uploaded to the DocSpace portal.