@tmdjr/ngx-editor-js2 21.0.7 → 21.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,16 +5,13 @@ DEMO - With blocks: [https://ba5ik7.github.io/ngx-editor-js2-blocks](https://ba5
5
5
  DEMO: [https://ba5ik7.github.io/ngx-editorjs2](https://ba5ik7.github.io/ngx-editorjs2)
6
6
 
7
7
  ## Overview
8
-
9
8
  Ngx-EditorJs2 is an Angular-based, highly extensible block-style editor inspired by Editor.js. It allows users to create and manage rich text content using a variety of customizable blocks while leveraging Angular's reactive capabilities.
10
9
 
11
10
  ### Supports
12
-
13
11
  - Angular 20+
14
12
  - For legacy Angular support, use [ngx-editorjs](https://github.com/Ba5ik7/ngx-editorjs)
15
13
 
16
14
  ## Features
17
-
18
15
  - 📝 **Modular Block System** – Supports paragraph, header, and other content blocks.
19
16
  - 🔄 **Reactive Data Streams** – Uses RxJS for efficient state management.
20
17
  - 🎛 **Drag & Drop** – Easily reorder blocks with smooth animations.
@@ -22,7 +19,6 @@ Ngx-EditorJs2 is an Angular-based, highly extensible block-style editor inspired
22
19
  - 🔧 **Customizable** – Easily extendable with new block types and actions.
23
20
 
24
21
  ## Installation
25
-
26
22
  To install Ngx-EditorJs2, run:
27
23
 
28
24
  ```sh
@@ -39,8 +35,8 @@ ng add @tmdjr/ngx-editor-js2
39
35
 
40
36
  This command will prompt you to select optional blocks and will handle the installation, configuration updates to `angular.json`, global styles, and your application's configuration (`app.config.ts`).
41
37
 
42
- ## Usage
43
38
 
39
+ ## Usage
44
40
  Import the Component into your Angular Standalone Component:
45
41
 
46
42
  ```ts
@@ -58,36 +54,31 @@ import { NgxEditorJs2Component } from '@tmdjr/ngx-editor-js2';
58
54
  `,
59
55
  })
60
56
  ```
61
-
62
57
  - Implementation found in the [Demo Src](https://github.com/Ba5ik7/ngx-editor-js2-blocks/blob/main/projects/demo/src/app/app.component.ts)
63
58
 
64
- ## API
65
59
 
60
+ ## API
66
61
  ### **Inputs**
67
-
68
- | Property | Type | Description |
69
- | --------------- | ------------------------------ | ----------------------------------------------------------------------------------- |
70
- | `blocks` | `NgxEditorJsBlock[]` \| `null` | List of blocks to initialize the editor with. |
71
- | `requestBlocks` | `any` | When the value changes `blocksRequested` will emit the current state of the blocks. |
62
+ | Property | Type | Description |
63
+ |--------------|----------------------------|-------------|
64
+ | `blocks` | `NgxEditorJsBlock[]` \| `null` | List of blocks to initialize the editor with. |
65
+ | `requestBlocks` | `any` | When the value changes `blocksRequested` will emit the current state of the blocks. |
72
66
 
73
67
  ### **Outputs**
74
-
75
- | Property | Type | Description |
76
- | ----------------- | -------------------- | --------------------------------------------------------------------------------------------------- |
77
- | `blocksRequested` | `NgxEditorJsBlock[]` | Emits the current state of blocks in the Form Group. Trigger when the `requestBlocks` value changes |
68
+ | Property | Type | Description |
69
+ |--------------|----------------------------|-------------|
70
+ | `blocksRequested` | `NgxEditorJsBlock[]` | Emits the current state of blocks in the Form Group. Trigger when the `requestBlocks` value changes
78
71
 
79
72
  ## Block Components
80
-
81
73
  Ngx-EditorJs2 comes with built-in block components:
82
-
83
74
  - **ParagraphBlockComponent** – Standard text block.
84
75
  - **HeaderBlockComponent** – Allows different heading levels.
85
76
 
86
77
  You can also add custom blocks by implementing the `NGX_EDITORJS_OPTIONS` provider:
87
78
 
88
79
  ```ts
89
- import { NGX_EDITORJS_OPTIONS } from "@tmdjr/ngx-editor-js2";
90
- import { NgxEditorJs2ImageComponent } from "@tmdjr/ngx-editor-js2-image";
80
+ import { NGX_EDITORJS_OPTIONS } from '@tmdjr/ngx-editor-js2';
81
+ import { NgxEditorJs2ImageComponent } from '@tmdjr/ngx-editor-js2-image';
91
82
 
92
83
  export const appConfig: ApplicationConfig = {
93
84
  providers: [
@@ -97,10 +88,10 @@ export const appConfig: ApplicationConfig = {
97
88
  consumerSupportedBlocks: [
98
89
  {
99
90
  // Customize the block name.
100
- name: "Image",
91
+ name: 'Image',
101
92
  component: NgxEditorJs2ImageComponent,
102
93
  // Must match the component name.
103
- componentInstanceName: "NgxEditorJs2ImageComponent",
94
+ componentInstanceName: 'NgxEditorJs2ImageComponent',
104
95
  },
105
96
  ],
106
97
  },
@@ -114,7 +105,6 @@ export const appConfig: ApplicationConfig = {
114
105
  Ngx-EditorJs2 allows you to extend its functionality with custom blocks. Below are some additional components that can be installed separately to enhance the editor with images, blockquotes, and code blocks.
115
106
 
116
107
  ### 🖼️ Image Block
117
-
118
108
  Easily add and manage images within the editor.
119
109
 
120
110
  - **Component:** `NgxEditorJs2ImageComponent`
@@ -127,7 +117,6 @@ Easily add and manage images within the editor.
127
117
  ---
128
118
 
129
119
  ### 📝 Blockquotes Block
130
-
131
120
  Insert styled blockquotes to emphasize key points in the content.
132
121
 
133
122
  - **Component:** `NgxEditorJs2BlockquotesComponent`
@@ -140,7 +129,6 @@ Insert styled blockquotes to emphasize key points in the content.
140
129
  ---
141
130
 
142
131
  ### 💻 Code Block
143
-
144
132
  Embed syntax-highlighted code snippets using CodeMirror.
145
133
 
146
134
  - **Component:** `NgxEditorJs2CodemirrorComponent`
@@ -153,7 +141,6 @@ Embed syntax-highlighted code snippets using CodeMirror.
153
141
  ---
154
142
 
155
143
  ### 🌐 MFE Loader Block
156
-
157
144
  Dynamically load and embed micro-frontends using Module Federation.
158
145
 
159
146
  - **Component:** `NgxEditorJs2MfeLoaderComponent`
@@ -166,7 +153,6 @@ Dynamically load and embed micro-frontends using Module Federation.
166
153
  ---
167
154
 
168
155
  ### 🧩 MermaidJS Block
169
-
170
156
  Embed interactive Mermaid diagrams for flowcharts, graphs, and more.
171
157
 
172
158
  - **Component:** `NgxEditorJs2MermaidjsComponent`
@@ -179,7 +165,6 @@ Embed interactive Mermaid diagrams for flowcharts, graphs, and more.
179
165
  ---
180
166
 
181
167
  ### 🧐 Pop Quiz Block
182
-
183
168
  Create engaging quizzes within your content for interactive learning.
184
169
 
185
170
  - **Component:** `NgxEditorJs2PopQuizComponent`
@@ -193,8 +178,9 @@ Create engaging quizzes within your content for interactive learning.
193
178
 
194
179
  For more details and documentation, visit the [official repository](https://github.com/Ba5ik7/ngx-editor-js2-blocks).
195
180
 
196
- ## Development
197
181
 
182
+
183
+ ## Development
198
184
  To contribute, clone the repository and install dependencies:
199
185
 
200
186
  ```sh
@@ -217,12 +203,11 @@ npm run watch-ngx-editor-js2 // Important to run 1st
217
203
  npm run start-demo
218
204
  ```
219
205
 
220
- _Custom Block development should be done in the [Ngx-Editor-Js2-Blocks](https://github.com/Ba5ik7/ngx-editor-js2-blocks) MonoRepo._
206
+ *Custom Block development should be done in the [Ngx-Editor-Js2-Blocks](https://github.com/Ba5ik7/ngx-editor-js2-blocks) MonoRepo.*
221
207
 
222
- ## Architecture Overview
223
208
 
209
+ ## Architecture Overview
224
210
  Ngx-EditorJs2 is built on Angular's reactive architecture, using RxJS to manage state and data streams. The library is composed of several Services and Directives that handle different aspects of the editor:
225
-
226
211
  ```mermaid
227
212
  graph TD;
228
213
  NgxEditorJs2Component -->|Contains| EditorJsComponent;
@@ -239,34 +224,29 @@ graph TD;
239
224
  ```
240
225
 
241
226
  ## Services
242
-
243
- | Service | Purpose |
244
- | ---------------------- | ------------------------------------------------ |
245
- | `NgxEditorJs2Service` | Manages available block types and loaded blocks. |
246
- | `EditorJsService` | Handles block rendering and form controls. |
247
- | `BlockMovementService` | Manages drag-and-drop & reordering. |
248
- | `ToolbarInlineService` | Manages inline text formatting. |
249
- | `ToolFabService` | Provides contextual toolbars for block actions. |
227
+ | Service | Purpose |
228
+ |---------------------------|---------|
229
+ | `NgxEditorJs2Service` | Manages available block types and loaded blocks. |
230
+ | `EditorJsService` | Handles block rendering and form controls. |
231
+ | `BlockMovementService` | Manages drag-and-drop & reordering. |
232
+ | `ToolbarInlineService` | Manages inline text formatting. |
233
+ | `ToolFabService` | Provides contextual toolbars for block actions. |
250
234
 
251
235
  ## Creating a Custom Block Component
252
-
253
236
  Ngx-EditorJs2 follows a structured approach where each block component:
254
-
255
237
  - **Implements the `BlockComponent` interface** to ensure consistency.
256
238
  - **Uses `hostDirectives`** to inherit required behaviors such as drag-and-drop.
257
239
  - **Uses `host` CSS classes** to apply styling and animations.
258
240
  - **Uses a `formGroup`**, which integrates with the larger form structure that holds all blocks.
259
241
 
260
242
  ### **How Blocks Work in Ngx-EditorJs2**
261
-
262
243
  Each block in Ngx-EditorJs2 is part of a larger **`formGroup`**, allowing seamless state management across the entire editor. This design ensures that:
263
-
264
244
  - Each block maintains its own **FormControl**, enabling real-time data binding.
265
245
  - The **editor-level formGroup** acts as a centralized store, making it easier to retrieve or modify block data.
266
246
  - Blocks can **interact with services and directives**, enhancing their capabilities dynamically.
267
247
 
268
- _Custom Block development should be done in the [Ngx-Editor-Js2-Blocks](https://github.com/Ba5ik7/ngx-editor-js2-blocks) MonoRepo._
248
+ *Custom Block development should be done in the [Ngx-Editor-Js2-Blocks](https://github.com/Ba5ik7/ngx-editor-js2-blocks) MonoRepo.*
269
249
 
270
250
  ## License
271
-
272
251
  MIT License © 2025 [Wesley DuSell](https://github.com/ba5ik7)
252
+