1.0.9 • Published 3 months ago

@stronglify13/editor v1.0.9

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 months ago

@stronglify13/editor

Introduction

@stronglify13/editor is a package based on Editor.js that provides a predefined configuration with additional block and inline tools, making it easier to create rich text editors.

Requirements to set up the development environment

Before you start, make sure you meet the following requirements:

  • Node.js (version v20.16.0)
    • You can use nvm to install and manage Node.js versions.
    • A .nvmrc file with the recommended version is included in the root of this project.
    • You can install the recommended version with the following command:
      nvm install
    • You can use the recommended version with the following command:
      nvm use
  • yarn installed
  • Have an npm account if you want to publish the package and be part of the @stronglify13 organization.

Installing dependencies

Clone the repository and run:

yarn

Generate a new version of the package

To generate a new version, follow these steps:

  1. Make sure all changes are committed in Git.
  2. Modify the version in package.json:
  3. Build the package:

    npm run build && npx tsc
  4. Verify that everything works correctly before publishing.

Publishing the package

  1. Log in to npm if you haven't already:

    npm login
  2. Publish the package to npm:

    npm publish --access public
  3. Verify that the package has been published correctly by checking npmjs.com.

Exported functionalities

The package exports the following tools and functions:

Main function

  • newEditor(config: NewEditorUsage): Creates a new instance of the editor with the provided configurations.

Block tools

  • Paragraph
  • Header
  • List
  • Image
  • Code
  • RawHTML

Block settings

  • AlignmentTune

Inline tools

  • BoldInlineTool
  • ItalicInlineTool
  • UnderlineInlineTool
  • MarkerInlineTool
  • CodeInlineTool
  • HyperlinkInlineTool
  • IdClassStyleInlineTool

Additional utilities

  • parseEditorHTML: Converts the editor's output to HTML.

Usage example

import { newEditor } from '@stronglify13/editor';

newEditor({
  htmlContainerID: 'editor',
  placeholder: 'Write something...',
  autofocus: true,
});

Contributing

If you want to contribute, open an issue or send a pull request to the project's repository.

License

This package is under the MIT license.

1.0.9

3 months ago

1.0.8

3 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.0

4 months ago