@tmdjr/ngx-editor-js2 20.0.12 β†’ 20.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmdjr/ngx-editor-js2",
3
- "version": "20.0.12",
3
+ "version": "20.1.0",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "peerDependencies": {
6
6
  "@angular/animations": "^20.0.4",
@@ -3,17 +3,12 @@ import { AsyncPipe } from '@angular/common';
3
3
  import { MatCard, MatCardContent } from '@angular/material/card';
4
4
  import { NgxEditorJs2Component } from '@tmdjr/ngx-editor-js2';
5
5
 
6
- import { NgxEditorJs2 } from '../services/ngx-editor-js2';
6
+ import { NgxEditorJs2 } from './services/ngx-editor-js2';
7
+ import { Hero } from './components/hero';
7
8
 
8
9
  @Component({
9
10
  selector: 'app-root',
10
- imports: [
11
- AsyncPipe,
12
- MatCard,
13
- MatCardContent,
14
- NgxEditorJs2Component,
15
- Hero,
16
- ],
11
+ imports: [AsyncPipe, MatCard, MatCardContent, NgxEditorJs2Component, Hero],
17
12
  template: `
18
13
  <main>
19
14
  <app-hero></app-hero>
@@ -50,7 +45,6 @@ import { NgxEditorJs2 } from '../services/ngx-editor-js2';
50
45
  flex-direction: column;
51
46
  align-items: center;
52
47
  gap: 3em;
53
- margin-top: 56px;
54
48
  mat-card {
55
49
  width: 100%;
56
50
  max-width: 800px;
@@ -61,6 +55,6 @@ import { NgxEditorJs2 } from '../services/ngx-editor-js2';
61
55
  `,
62
56
  ],
63
57
  })
64
- export class AppComponent {
58
+ export class App {
65
59
  ngxEditorJs2 = inject(NgxEditorJs2);
66
60
  }
@@ -105,7 +105,7 @@ import { of } from 'rxjs';
105
105
  `,
106
106
  ],
107
107
  })
108
- export class HeroComponent {
108
+ export class Hero {
109
109
  ngxEditorJs2 = inject(NgxEditorJs2);
110
110
 
111
111
  saveValue() {
@@ -4,78 +4,188 @@ import { BehaviorSubject, lastValueFrom, Observable, tap } from 'rxjs';
4
4
 
5
5
  export const TEST_DATA: NgxEditorJsBlock[] = [
6
6
  {
7
- blockId: 'n177d7',
7
+ blockId: 'iovlbzgosf',
8
8
  sortIndex: 0,
9
- componentInstanceName: 'NgxEditorJs2BlockquotesComponent',
10
- savedAction: 'display-large',
11
- dataClean:
12
- '`Design is not just what it looks like and feels like. Design is how it works.',
9
+ componentInstanceName: 'HeaderBlockComponent',
10
+ savedAction: 'h1',
11
+ dataClean: 'πŸš€ Ready to Explore?',
13
12
  },
14
13
  {
15
- blockId: 'n177dsd',
14
+ blockId: '6ldk3i',
16
15
  sortIndex: 1,
17
- componentInstanceName: 'NgxEditorJs2ImageComponent',
18
- savedAction: 'stretch',
16
+ componentInstanceName: 'ParagraphBlockComponent',
17
+ savedAction: 'large',
19
18
  dataClean:
20
- '{"url":"https://res.cloudinary.com/dowdpiikk/image/upload/w_650,q_auto:best,f_auto/v1709445782/lnyst5aqppuin8wt73ci.webp","title":"test"}',
19
+ 'This demo showcases the core concept of Ngx-EditorJs2 β€” a flexible, block-based content editor built with Angular. Each section of content is a self-contained block that can be rearranged via drag and drop, making it easy to structure and reorganize complex content visually.<div><br></div><div>Blocks aren’t just static β€” they can be configured through block-specific settings. For example, the Header block allows you to choose between multiple heading levels (H1–H6), and the Image block supports captions and alignment settings.</div><div><br></div><div>In addition, when selecting text within blocks that support inline formatting, a contextual inline toolbar appears. This toolbar enables quick formatting actions such as <b>bold</b>, <i>italic</i>, and text alignment (left, center, right) β€” allowing for a more expressive and intuitive editing experience.</div><div><br></div><div>Use this page to explore how each block behaves, how they can be customized, and how the editor adapts to your content needs in a modular and scalable way.</div>',
21
20
  },
22
21
  {
23
- blockId: 'iovlbzgosf',
22
+ blockId: 'pkm1k',
24
23
  sortIndex: 2,
25
24
  componentInstanceName: 'HeaderBlockComponent',
26
- savedAction: 'h1',
27
- dataClean: 'Prerequisites',
25
+ savedAction: 'h3',
26
+ dataClean: '✍️ Paragraph + Header',
28
27
  },
29
28
  {
30
- blockId: '8u3uiij5vyj',
29
+ blockId: 'wpg67v',
31
30
  sortIndex: 3,
32
31
  componentInstanceName: 'ParagraphBlockComponent',
33
32
  savedAction: 'large',
34
33
  dataClean:
35
- '<ul><li><a href="https://www.typescriptlang.org/">TypeScript</a> and HTML5 programming</li><li>Angular app-design fundamentals, as described in <a href="https://angular.io/guide/architecture">Angular Concepts</a><br></li><li>The basics of <a href="https://angular.io/guide/architecture-components#template-syntax">Angular template syntax</a><br></li></ul>',
34
+ 'The bread and butter of any editor. Use paragraphs for flowing content, and headers to create structure and hierarchy. <b>Clear</b>. <i>Clean</i>. <u>Essential</u>.',
36
35
  },
37
36
  {
38
- blockId: 'bu23hwyltss',
37
+ blockId: '8u3uiij5vyj',
39
38
  sortIndex: 4,
40
39
  componentInstanceName: 'ParagraphBlockComponent',
41
40
  savedAction: 'large',
42
41
  dataClean:
43
- 'Evaluation of a template expression should have no visible side effects. Use the syntax for template expressions to help avoid side effects. In general, the correct syntax prevents you from assigning a value to anything in a property binding expression. The syntax also prevents you from using increment and decrement operators.',
42
+ '<ul><li><a href="https://www.typescriptlang.org/">TypeScript</a> and HTML5 programming</li><li>Angular app-design fundamentals, as described in <a href="https://angular.io/guide/architecture">Angular Concepts</a><br></li><li>The basics of <a href="https://angular.io/guide/architecture-components#template-syntax">Angular template syntax</a><br></li></ul>',
44
43
  },
45
44
  {
46
- blockId: 'uapf2',
45
+ blockId: '2rdtwb',
47
46
  sortIndex: 5,
48
- componentInstanceName: 'NgxEditorJs2MermaidjsComponent',
49
- savedAction: 'center',
50
- dataClean:
51
- 'flowchart TD\n A[Christmas] -->|Get money| B(Go shopping)\n B --> C{Let me think}\n C -->|One| D[Laptop]\n C -->|Two| E[Hello World iPhone]\n C -->|Three| F[fa:fa-car Car]',
47
+ componentInstanceName: 'ParagraphBlockComponent',
48
+ savedAction: 'medium',
49
+ dataClean: '',
52
50
  },
53
51
  {
54
- blockId: 'bu23hwyltsww',
52
+ blockId: '8w37us',
55
53
  sortIndex: 6,
54
+ componentInstanceName: 'HeaderBlockComponent',
55
+ savedAction: 'h3',
56
+ dataClean: 'πŸ’‘ Quote',
57
+ },
58
+ {
59
+ blockId: '31tbry',
60
+ sortIndex: 7,
56
61
  componentInstanceName: 'ParagraphBlockComponent',
57
- savedAction: 'small',
62
+ savedAction: 'large',
58
63
  dataClean:
59
- 'Material Design uses color to create accessible, personal color schemes that communicate your products hierarchy, state, and brand. See Material Designs Color System page to learn more about its use and purpose.',
64
+ 'Craft your favorite inspiration, callouts, or even markdown-style blockquotes using the Quote block.',
65
+ },
66
+ {
67
+ blockId: 'n177d7',
68
+ sortIndex: 8,
69
+ componentInstanceName: 'NgxEditorJs2BlockquotesComponent',
70
+ savedAction: 'display-large',
71
+ dataClean:
72
+ 'β€œA quote block is like a spotlight β€” simple, elegant, and perfect for making a point.”',
73
+ },
74
+ {
75
+ blockId: 'dq5uat',
76
+ sortIndex: 9,
77
+ componentInstanceName: 'ParagraphBlockComponent',
78
+ savedAction: 'medium',
79
+ dataClean: '',
80
+ },
81
+ {
82
+ blockId: 'mq9i9m',
83
+ sortIndex: 10,
84
+ componentInstanceName: 'HeaderBlockComponent',
85
+ savedAction: 'h3',
86
+ dataClean: 'πŸ“· Image Block',
87
+ },
88
+ {
89
+ blockId: '4xkw3s',
90
+ sortIndex: 11,
91
+ componentInstanceName: 'ParagraphBlockComponent',
92
+ savedAction: 'large',
93
+ dataClean:
94
+ 'A picture says a thousand words. The Image block supports captions and even alignment options to make your visuals shine.',
95
+ },
96
+ {
97
+ blockId: 'n177dsd',
98
+ sortIndex: 12,
99
+ componentInstanceName: 'NgxEditorJs2ImageComponent',
100
+ savedAction: 'stretch',
101
+ dataClean:
102
+ '{"url":"https://res.cloudinary.com/dowdpiikk/image/upload/w_650,q_auto:best,f_auto/v1709445782/lnyst5aqppuin8wt73ci.webp","title":"test"}',
103
+ },
104
+ {
105
+ blockId: 'gt9e9s',
106
+ sortIndex: 13,
107
+ componentInstanceName: 'ParagraphBlockComponent',
108
+ savedAction: 'medium',
109
+ dataClean: '',
110
+ },
111
+ {
112
+ blockId: 'b3t74',
113
+ sortIndex: 14,
114
+ componentInstanceName: 'HeaderBlockComponent',
115
+ savedAction: 'h3',
116
+ dataClean: '🎨 CodeMirror Block',
117
+ },
118
+ {
119
+ blockId: '9qls1d',
120
+ sortIndex: 15,
121
+ componentInstanceName: 'ParagraphBlockComponent',
122
+ savedAction: 'large',
123
+ dataClean:
124
+ 'Embed rich, theme-able code editors right inside your documents. Great for live code samples or collaborative coding.',
60
125
  },
61
126
  {
62
127
  blockId: 'asdfasdf',
63
- sortIndex: 7,
128
+ sortIndex: 16,
64
129
  componentInstanceName: 'NgxEditorJs2CodemirrorComponent',
65
130
  savedAction: 'text/typescript',
66
131
  dataClean:
67
132
  "export class SimpleFormGroup {\n form = new FormGroup({\n first: new FormControl('Nancy', Validators.minLength(2)),\n last: new FormControl('Drew'),\n });\n\n get first(): any {\n return this.form.get('first');\n }\n\n onSubmit(): void {\n console.log(this.form.value); // {first: 'Nancy', last: 'Drew'}\n }\n\n setValue() {\n this.form.setValue({first: 'Carson', last: 'Drew'});\n }\n}",
68
133
  },
69
134
  {
70
- blockId: 'l13u3k',
71
- sortIndex: 8,
135
+ blockId: 'hduds',
136
+ sortIndex: 17,
137
+ componentInstanceName: 'ParagraphBlockComponent',
138
+ savedAction: 'medium',
139
+ dataClean: '',
140
+ },
141
+ {
142
+ blockId: '8npajb',
143
+ sortIndex: 18,
72
144
  componentInstanceName: 'HeaderBlockComponent',
73
- savedAction: 'h1',
74
- dataClean: 'New way of learning...',
145
+ savedAction: 'h3',
146
+ dataClean: 'πŸ”₯ Mermaid.js Block',
147
+ },
148
+ {
149
+ blockId: 'su45ai',
150
+ sortIndex: 19,
151
+ componentInstanceName: 'ParagraphBlockComponent',
152
+ savedAction: 'large',
153
+ dataClean:
154
+ 'Need to include a flowchart, sequence diagram, or Gantt chart? The Mermaid.js block brings technical diagrams to life using simple syntax.',
155
+ },
156
+ {
157
+ blockId: 'uapf2',
158
+ sortIndex: 20,
159
+ componentInstanceName: 'NgxEditorJs2MermaidjsComponent',
160
+ savedAction: 'center',
161
+ dataClean:
162
+ 'flowchart TD\n A[Christmas] -->|Get money| B(Go shopping)\n B --> C{Let me think}\n C -->|One| D[Laptop]\n C -->|Two| E[Hello World iPhone]\n C -->|Three| F[fa:fa-car Car]',
163
+ },
164
+ {
165
+ blockId: 'y3r4xs',
166
+ sortIndex: 21,
167
+ componentInstanceName: 'ParagraphBlockComponent',
168
+ savedAction: 'medium',
169
+ dataClean: '<div><br></div>',
170
+ },
171
+ {
172
+ blockId: 'q5m0u',
173
+ sortIndex: 22,
174
+ componentInstanceName: 'HeaderBlockComponent',
175
+ savedAction: 'h3',
176
+ dataClean: '🧠 Pop Quiz Block',
177
+ },
178
+ {
179
+ blockId: 'ubo23s',
180
+ sortIndex: 23,
181
+ componentInstanceName: 'ParagraphBlockComponent',
182
+ savedAction: 'large',
183
+ dataClean:
184
+ 'Test your knowledge or embed interactive quiz questions inline with your content. Great for workshops, tutorials, or even just friendly challenges.',
75
185
  },
76
186
  {
77
187
  blockId: '9bqhk',
78
- sortIndex: 9,
188
+ sortIndex: 24,
79
189
  componentInstanceName: 'NgxEditorJs2PopQuizComponent',
80
190
  savedAction: 'display-large',
81
191
  dataClean:
@@ -31,7 +31,7 @@ const optionalBlocks = {
31
31
  package: '@tmdjr/ngx-editor-js2-mermaidjs',
32
32
  stylePath: 'dist/ngx-editor-js2-mermaidjs',
33
33
  peers: [
34
- { package: 'mermaid' },
34
+ { package: 'mermaid', version: '^11.6.0' },
35
35
  { package: '@ctrl/ngx-codemirror' },
36
36
  { package: '@types/codemirror' },
37
37
  { package: 'codemirror', version: '5.65.9' },
@@ -42,7 +42,7 @@ const optionalBlocks: Record<
42
42
  package: '@tmdjr/ngx-editor-js2-mermaidjs',
43
43
  stylePath: 'dist/ngx-editor-js2-mermaidjs',
44
44
  peers: [
45
- { package: 'mermaid' },
45
+ { package: 'mermaid', version: '^11.6.0' },
46
46
  { package: '@ctrl/ngx-codemirror' },
47
47
  { package: '@types/codemirror' },
48
48
  { package: 'codemirror', version: '5.65.9' },