0.1.78 β€’ Published 6 months ago

@sc-360-v2/macros-editor v0.1.78

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

@sc-360-v2/macros-editor

✨ Overview

@sc-360-v2/macros-editor is an advanced library designed for creating macros in text editors and code editors. It integrates with popular tools like Froala Editor and Monaco Editor, enabling you to build feature-rich and interactive text editing experiences. This package simplifies the process of embedding macro functionality and code-editing capabilities while maintaining a small footprint.

πŸ”§ Installation

Follow these steps to install and configure the library in your project:

Install the library

Run the following command to add the library to your project:

npm install @sc-360-v2/macros-editor

Install Required Dependencies

To use Code Editor with your project, you must install the required dependencies. Specifically monaco-editor (the Monaco Editor core) need to be installed separately:

npm install monaco-editor

πŸš€ Usage

Here’s a basic example of how to use the @sc-360-v2/macros-editor library in your project.

1. Using the Text Editor

import React from "react";
import TextEditor from "@sc-360-v2/macros-editor/text-editor";
import "@sc-360-v2/macros-editor/text-editor.scss"; //add styles dependencies

const App = () => {
  const handleContentChange = (content: string) => {
    console.log("Updated content:", content);
  };
  const handleContentBlur = (content: string) => {
    console.log("Updated content:", content);
  };

  return (
    <div>
      <h1>Text Editor with Macros</h1>
      <TextEditor
        content="<h1>Text Editor with Macros</h1>"
        onContentChange={handleContentChange}
        oncontentBlur={handleContentBlur}
      />
    </div>
  );
};

export default App;

2. Using the Code Editor

import React from "react";
import CodeEditor from "@sc-360-v2/macros-editor/code-editor";

const App = () => {
  const handleCodeChange = (code: string) => {
    console.log("Updated code:", code);
  };

  return (
    <div>
      <h1>Code Editor with Macros</h1>
      <CodeEditor onContentChange={handleCodeChange} />
    </div>
  );
};

export default App;

πŸ“‚ File Structure

Your project will look like this after installation:

my-project/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   └── App.tsx
β”œβ”€β”€ node_modules/
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

πŸ“¦ Library Build Process

The build process is optimized to reduce the final bundle size. Gzipped assets are created, and unnecessary files are excluded.

  1. Run the build command:

    npm run build
  2. The output will be available in the dist/ folder. You can publish this to npm or use it directly in your project.

🌟 Features

  • πŸ“„ Text Editor with rich macro support
  • πŸ’» Code Editor powered by Monaco Editor
  • ✨ Customizable macros for dynamic content
  • πŸš€ Built with React and TypeScript for type safety
  • πŸ“š Easy integration into any project

πŸ›‘οΈ License

This library is licensed under the MIT License.

0.1.78

6 months ago

0.1.77

6 months ago

0.1.75

7 months ago

0.1.74

7 months ago

0.1.73

7 months ago

0.1.72

7 months ago

0.1.71

7 months ago

0.1.70

7 months ago

0.1.69

7 months ago

0.1.68

7 months ago

0.1.67

7 months ago

0.1.66

7 months ago

0.1.65

8 months ago

0.1.64

8 months ago

0.1.63

8 months ago

0.1.62

8 months ago

0.1.61

8 months ago

0.1.60

8 months ago

0.1.59

8 months ago

0.1.58

8 months ago

0.1.57

8 months ago

0.1.56

8 months ago

0.1.55

8 months ago

0.1.54

9 months ago

0.1.53

9 months ago

0.1.52

9 months ago

0.1.51

9 months ago

0.1.50

9 months ago

0.1.49

9 months ago

0.1.48

9 months ago

0.1.47

9 months ago

0.1.46

9 months ago

0.1.45

9 months ago

0.1.44

9 months ago

0.1.43

9 months ago

0.1.42

9 months ago

0.1.41

9 months ago

0.1.40

9 months ago

0.1.39

9 months ago

0.1.38

9 months ago

0.1.37

10 months ago

0.1.36

10 months ago

0.1.35

10 months ago

0.1.34

10 months ago

0.1.33

10 months ago

0.1.32

10 months ago

0.1.31

10 months ago

0.1.30

11 months ago

0.1.29

11 months ago

0.1.28

11 months ago

0.1.27

11 months ago

0.1.26

11 months ago

0.1.25

11 months ago

0.1.24

11 months ago

0.1.23

11 months ago

0.1.22

11 months ago

0.1.21

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago

0.0.9

11 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago

0.0.0

12 months ago