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

@sharpetronics/strapi-plugin-tinymce-editor

v1.0.1

Published

Replaces the default Strapi WYSIWYG editor with a self-hosted build of the TinyMCE editor.

Downloads

28

Readme

Screenshot from 2023-04-20 16-13-33

👋 Introduction

✨ Key features

  • Self-Hosted (No API Key Needed): Speedy native server loading speeds without API dependence.
  • Autolink: Create hyperlinks automatically when a user inputs a valid and complete URL.
  • Autoresize: Resize the editor automatically to the content inside it, and prevent the editor from expanding infinitely.
  • Code: Add a toolbar button that allows a user to edit the HTML code hidden by the WYSIWYG view.
  • Code sample: Insert and embed syntax color highlighted code snippets into the editable area.

And much more ! List of all features.

🔧 Installation

Inside your Strapi app, add the package:

With npm:

npm install @sharpetronics/strapi-plugin-tinymce-editor

With yarn:

yarn add @sharpetronics/strapi-plugin-tinymce-editor

In config/plugins.js file add:

tinymce:{
    enabled:true
};

You will also have to update strapi::security middleware in your middlewares.js file in config folder. If you didn't update this file yet, then replace "strapi::security" with following code (object)

//middlewares.js

   {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,  
        directives: {
          "script-src": ["'self'", "https:"],
          "default-src": ["*.youtube.com", "*.vimeo.com", "rumble.com"],
          "connect-src": ["'self'", "blob:", "*.strapi.io", "*.github.com",],
          "img-src": [
            "'self'",
            "data:",
            "blob:",
          ],
          "style-src": [
            "'self'",
            "'unsafe-inline'",
          ],
          "font-src": ["'self'"],
        },
        upgradeInsecureRequests: null,
      },
    },
  },

Download tinymce_self-hosted package and extract the /tinymce/js/ into your Strapi /public/.

https://www.tiny.cloud/get-tiny/self-hosted/

You should now have a uploads directory and a tinymce folder.

Notice: the public/tinymce directory path should reflect the following:

/public/tinymce/
	-themes
	-skins
	...

Then run build:

yarn build && yarn develop

⚙️ Custom Configuration

Currently, this is work-in-progress (WIP). The default configuration works, but customizing this hasn't been added yet.

Learn more about configuration from official documentation.

The Default Configuration:

// TinyMCE Default src/plugins/strapi-plugin-tinymce-editor/admin/src/components/Tinymce/index.js (WIP)

...
      <Editor
        tinymceScriptSrc={'/tinymce/tinymce.min.js'} // the root of the Strapi project from the public directory.
	value={value}
	tagName={name}
	onEditorChange={(editorContent) => {
	onChange({ target: { name, value: editorContent } });
	}}
	outputFormat="html"
	
        init={{
          height: 900,
          selector: 'textarea',
          skin: 'oxide',
          content_css: 'default',
          menubar: false,
          promotion: false,
	  convert_urls: false,
	  relative_urls : true,
	  remove_script_host : true,
	  toolbar_mode: 'wrap',
	  
          plugins: [
            'advlist', 'autolink', 'lists', 'link', 'emoticons', 'image', 'charmap',
            'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
            'insertdatetime', 'media', 'table', 'codesample', 'preview', 'help', 'wordcount'
          ],
          toolbar: 'fullscreen | preview code | undo redo | blocks | ' +
            'bold italic underline blockquote | ' +
            'image media link codesample | ' +
            'bullist numlist | table',
          content_style: 'body { font-family:Ubuntu,Arial,sans-serif; font-size:14px }'
        }}
      />
...

⚠️ Requirements

Strapi v4.x.x+

Node 14 - 18

Tested with Yarn v3.x.x

Tested on Strapi v4.9.2