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

@samhammer/ckeditor5-simple-button-plugin

v2.20.0

Published

[![npm version](https://badge.fury.io/js/%40samhammer%2Fckeditor5-simple-button-plugin.svg)](https://www.npmjs.com/package/@samhammer/ckeditor5-simple-button-plugin)

Downloads

125

Readme

ckeditor5-simple-button-plugin

npm version

A generic ckeditor plugin to configure toolbar-buttons from outside.

Features

  • Simply configure ui buttons directly via the configuration object.
  • Possibility to enable those buttons even if the editor is in readonly state.

How to use

To be able to use this plugin you need a custom build of ckeditor.

Further instructions can be found here: https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/installing-plugins.html

Installation:

npm i @samhammer/ckeditor5-simple-button-plugin

Configuration

Each button is described with a configuration object as shown below. The onClick function can return a promise. The button is always disabled before the onClick function is called. It is enabled again after the returned promise is resolved or rejected. If no promise is returned the button is enabled again immediately. The onClick function receives the ButtonView object which makes it possible to change properties of the button (icon, tooltip or something else). The parameter syncDisabledState is optional and defaults to true. If true the enabled-state is always in sync with the readonly-state of the editor. If you need a button in enabled-state when the editor is readonly you have to set this parameter to false.

Example:

InlineEditor
	.create( editorElement, {
		simpleButton: [
            {
                name: "myFirstButton",
                label: "My First button - Click me",
                icon: svgXmlContent,
                syncDisabledState: false,
                onClick: (buttonView) => { /* ... */ }
            },
            ...
        ]
	} )
	.then( ... )
	.catch( ... );

How to publish

For publishing an npm account that is referenced to the organization is required.

See the following how to:

https://docs.npmjs.com/getting-started/publishing-npm-packages

If everything is configured correctly just count up the version number in our package.json and execute one of the following commands:

npm publish --access public

License

ckeditor5-simple-button-plugin is released under the MIT License. See LICENSE file for details.