fable-editor 1.2.1 → 1.2.2

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.
@@ -1,224 +1,226 @@
1
- # FableEditor
2
-
3
- A rich text editor packaged as an npm library with first-class React and Angular wrappers. Built from the original standalone `fable-editor.html`/`fable-editor.js` demo, preserving the full feature set.
4
-
5
- ## Features
6
-
7
- | Feature | Details |
8
- |---|---|
9
- | Toolbar & menubar | Configurable via `toolbar`/`menubar` strings (`\|`-separated groups), or use the built-in defaults. Menus: File, Edit, View, Insert, Format, Tools, Table, Help |
10
- | Responsive toolbar | On narrow screens (mobile/tablet) — or in a narrow host container — the toolbar collapses to a single row with a trailing `…` button that expands/collapses the full set. Automatic, width-driven, no configuration needed |
11
- | Tables | Resize handles, row/column insert & delete, row/column reordering (move a row up/down or a column left/right from the context toolbar or Table menu), cell background color picker (build header rows in one click), cell/row/column/table properties, context toolbar |
12
- | Paste handling | PowerPaste-style clean paste from Word / Google Docs / Excel |
13
- | Internationalization | English / Arabic, automatic RTL/LTR switching |
14
- | Fonts & formatting | Configurable font list (`fontFamilyFormats`), sizes, line-height, word-spacing, letter-spacing, text/background color, change case |
15
- | Theming | `primaryColor` (accent, default `#df3c2b`), `toolbarGroupBackground` and `uiFontFamily` (default Noto Sans stack) options restyle the editor chrome via CSS variables |
16
- | Custom content styling | `contentStyle` injects scoped CSS into the editable area (e.g. default font/size) |
17
- | Images | Placeholder upload UI, drag-and-drop, configurable accepted file types (`imageFileTypes`), pluggable async upload handler |
18
- | Video | Insert/edit dialog with **General** (source URL / upload / width / height), **Embed** (paste embed code) and **Advanced** (alternative source, poster image) tabs. YouTube / Vimeo / Dailymotion page URLs become embedded players — including when pasted directly into the editor. Template media slots can host a video instead of an image. |
19
- | Code | Inline `code` (toolbar button, or type `` `snippet` `` — converts on the closing backtick) and code sample blocks: a dialog with language dropdown + paste-in textarea inserts a styled block with a language header; click a block to edit, copy or delete it. No dependencies, no highlighting engine |
20
- | Documents | Import `.docx` files, source-code view, print preview |
21
- | Productivity | Undo/redo, revision history, autosave draft restore, word count, special characters & emoji pickers (category tabs + glyph grid), page breaks |
22
- | Fullscreen | Toggle fullscreen editing |
23
- | Help | Built-in shortcuts/help dialog |
24
-
25
- ## Install
26
-
27
- ```bash
28
- npm install fable-editor
29
- ```
30
-
31
- > **Note:** the package ships framework wrappers as optional peer dependencies. Install React or Angular dependencies only if you use those wrappers.
32
-
33
- ## Vanilla / Core
34
-
35
- Import the CSS once in your app, then create an editor instance:
36
-
37
- ```ts
38
- import 'fable-editor/style.css';
39
- import { FableEditor } from 'fable-editor';
40
-
41
- const editor = new FableEditor({
42
- target: document.getElementById('editor')!,
43
- language: 'en', // 'en' | 'ar'
44
- height: 400,
45
- initialContent: '<p><br></p>',
46
- onChange: (html) => console.log(html)
47
- });
48
-
49
- // API
50
- editor.getContent();
51
- editor.setContent('<p>Hello</p>');
52
- editor.insertContent('<strong>bold</strong>');
53
- editor.setLanguage('ar');
54
- editor.focus();
55
- editor.destroy();
56
- ```
57
-
58
- ### `init` options
59
-
60
- | Option | Type | Default | Description |
61
- |---|---|---|---|
62
- | `target` | `HTMLElement` | | Required. Element to mount the editor into. |
63
- | `language` | `'en' \| 'ar'` | `'en'` | UI language; also switches text direction. |
64
- | `height` | `number` | `302` | Editable area height in px. |
65
- | `initialContent` | `string` | `'<p><br></p>'` | Starting HTML content. |
66
- | `menubar` | `boolean \| string` | `true` | `true`/omitted = default menu set. `false` = hidden. A string is a space-separated subset/reorder, e.g. `'file edit view insert format tools table help'`. |
67
- | `toolbar` | `boolean \| string` | `true` | `true`/omitted = default toolbar. `false` = hidden. A string lays out the toolbar: `\|` separates groups, spaces separate items, e.g. `'undo redo \| bold italic'`. |
68
- | `statusbar` | `boolean` | `true` | Show/hide the status bar. |
69
- | `readonly` | `boolean` | `false` | Disable editing. |
70
- | `fontFamilyFormats` | `[string, string][]` | built-in list | Overrides the font dropdown. Tuples of `[displayName, cssFontFamilyValue]`. |
71
- | `contentStyle` | `string` | — | Custom CSS for the editable area. The literal word `body` is scoped to this editor instance; other selectors are used verbatim (your responsibility to scope). |
72
- | `imageFileTypes` | `string[]` | common image MIME types | `accept` list for the native image file picker. |
73
- | `imageUploadHandler` | `(file: File) => Promise<string>` | — | Resolve with a URL after uploading; omit to inline images as base64. |
74
- | `onImageUploadError` | `(error, file) => void` | | Called when `imageUploadHandler` rejects. |
75
- | `videoFileTypes` | `string[]` | `['video/mp4','video/webm','video/ogg']` | `accept` list for the native video file picker. |
76
- | `videoUploadHandler` | `(file: File) => Promise<string>` | — | Resolve with a URL after uploading; omit to inline videos as base64. |
77
- | `onVideoUploadError` | `(error, file) => void` | | Called when `videoUploadHandler` rejects. |
78
- | `primaryColor` | `string` | `'#df3c2b'` | Accent color for active states, primary buttons and selection outlines. Any CSS color. Applied as the `--fable-primary` CSS variable. |
79
- | `toolbarGroupBackground` | `string` | `'#f1f3f6'` | Background of each toolbar button group (the rounded pills). Applied as `--fable-tgrp-bg`. |
80
- | `uiFontFamily` | `string` | Noto Sans stack | Font family for the editor UI (menubar, toolbar, dialogs). Load the Noto Sans webfont in your app to use the default, or pass your own family. Applied as `--fable-ui-font`. |
81
- | `draftKey` | `string` | current page path | Storage key suffix for autosaved drafts. |
82
- | `onChange` / `onReady` | functions | | Content-change and ready callbacks (usually set by the React/Angular wrapper instead). |
83
-
84
- ### Theming
85
-
86
- The editor's accent color, toolbar group background and UI font are driven by CSS variables, so they can be set per instance:
87
-
88
- ```ts
89
- new FableEditor({
90
- target: el,
91
- primaryColor: '#df3c2b', // accent (default)
92
- toolbarGroupBackground: '#f1f3f6', // toolbar pill background (default)
93
- uiFontFamily: "'Noto Sans', sans-serif" // UI font (default stack)
94
- });
95
- ```
96
-
97
- The same values are available as React props / Angular inputs. The UI font defaults to a **Noto Sans** stack — load the webfont in your app (e.g. from Google Fonts) or pass any family you've already loaded. Alternatively, set the variables yourself in CSS: `--fable-primary`, `--fable-tgrp-bg`, `--fable-ui-font`.
98
-
99
- ### Toolbar & menubar configuration
100
-
101
- The `toolbar`/`menubar` options accept the same style of layout string as TinyMCE — `|` separates visual groups, spaces separate items:
102
-
103
- ```ts
104
- new FableEditor({
105
- target: document.querySelector('#default-editor')!,
106
- toolbar:
107
- 'undo redo | styles | bold italic underline strikethrough | ' +
108
- 'alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
109
- menubar: 'file edit insert format'
110
- });
111
- ```
112
-
113
- Available toolbar items: `undo redo preview print importword revhistory fontfamily fontsize fontsizeincrease fontsizedecrease bold italic underline strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify bullist numlist outdent indent link blockquote code changecase lineheight wordspacing letterspacing removeformat blocks ltr rtl quickimage quickvideo quicktable codesample template charmap emoji fullscreen sourcecode`. The TinyMCE names `styles` (→ `blocks`), `image` (→ `quickimage`), `media` (→ `quickvideo`) and `table` (→ `quicktable`) are accepted as aliases, so a typical TinyMCE toolbar string works unchanged. Unknown tokens are skipped with a console warning. Menubar keys: `file edit view insert format tools table help`.
114
-
115
- ## React
116
-
117
- ```tsx
118
- import 'fable-editor/style.css';
119
- import { FableEditor } from 'fable-editor/react';
120
-
121
- function App() {
122
- const [value, setValue] = useState('<p><br></p>');
123
-
124
- return (
125
- <FableEditor
126
- value={value}
127
- onChange={setValue}
128
- language="en"
129
- height={400}
130
- toolbar="undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
131
- />
132
- );
133
- }
134
- ```
135
-
136
- `toolbar`/`menubar` accept the same layout strings as the core option (see [Toolbar & menubar configuration](#toolbar--menubar-configuration)), so each app can show exactly the controls it needs.
137
-
138
- Props: `value`, `defaultValue`, `onChange`, `language`, `height`, `menubar`, `toolbar`, `statusbar`, `readonly`, `primaryColor`, `toolbarGroupBackground`, `uiFontFamily`, `fontFamilyFormats`, `contentStyle`, `imageFileTypes`, `imageUploadHandler`, `onImageUploadError`, `videoFileTypes`, `videoUploadHandler`, `onVideoUploadError`, `init`, `className`, `style` (see the [`init` options](#init-options) table above every option is also a top-level prop). A ref exposes `getContent`, `setContent`, `insertContent`, `setLanguage`, `focus`, `destroy`.
139
-
140
- ## Angular
141
-
142
- Add to `angular.json` styles:
143
-
144
- ```json
145
- "styles": [
146
- "src/styles.css",
147
- "node_modules/fable-editor/style.css"
148
- ]
149
- ```
150
-
151
- Import the module:
152
-
153
- ```ts
154
- import { FableEditorModule } from 'fable-editor/angular';
155
-
156
- @NgModule({
157
- imports: [FableEditorModule]
158
- })
159
- export class AppModule {}
160
- ```
161
-
162
- Use in a template:
163
-
164
- ```html
165
- <fable-editor
166
- [(ngModel)]="content"
167
- language="en"
168
- [height]="400"
169
- toolbar="undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image">
170
- </fable-editor>
171
- ```
172
-
173
- Inputs: `language`, `height`, `menubar`, `toolbar`, `statusbar`, `readonly`, `primaryColor`, `toolbarGroupBackground`, `uiFontFamily`, `init`. `menubar`/`toolbar` accept a string directly (e.g. `[toolbar]="'undo redo | bold italic'"`); `fontFamilyFormats`, `contentStyle`, `imageFileTypes`, `imageUploadHandler`, `onImageUploadError`, `videoFileTypes`, `videoUploadHandler`, and `onVideoUploadError` aren't top-level inputs — pass them via `[init]="{ contentStyle: '...' }"` (see the [`init` options](#init-options) table above). Outputs: `editorChange`, `editorReady`. Works with `ngModel` and `formControlName`.
174
-
175
- ## Development & testing
176
-
177
- ```bash
178
- npm install
179
- npm run build # builds core, react, and angular
180
- npm test # automated core tests (Vitest + jsdom)
181
- ```
182
-
183
- ### Manual smoke tests
184
-
185
- ```bash
186
- # Vanilla demo
187
- npm run demo
188
- # open http://localhost:5173/demo/index.html
189
-
190
- # React example
191
- npm run demo:react
192
- # open http://localhost:5173
193
-
194
- # Angular example
195
- npm run demo:angular
196
- # open http://localhost:4200
197
- ```
198
-
199
- > Run `npm run build` before the Angular demo so the library files are up to date.
200
-
201
- ## Project layout
202
-
203
- ```
204
- src/
205
- core/ # framework-agnostic editor engine
206
- react/ # React wrapper
207
- angular/ # Angular wrapper + module
208
- index.ts # Angular library entry point
209
- examples/
210
- react/ # runnable React test app
211
- angular/ # runnable Angular CLI test app
212
- demo/
213
- index.html # manual vanilla test page
214
- test/
215
- core.test.ts # automated core tests
216
- ```
217
-
218
- ## Author
219
-
220
- Sajin Satheesan <an.sajinsatheesan@gmail.com>
221
-
222
- ## License
223
-
224
- MIT
1
+ # FableEditor
2
+
3
+ A rich text editor packaged as an npm library with first-class React and Angular wrappers. Built from the original standalone `fable-editor.html`/`fable-editor.js` demo, preserving the full feature set.
4
+
5
+ ![FableEditor preview](https://raw.githubusercontent.com/an-sajinsatheesan/fable-editor/main/docs/preview.png)
6
+
7
+ ## Features
8
+
9
+ | Feature | Details |
10
+ |---|---|
11
+ | Toolbar & menubar | Configurable via `toolbar`/`menubar` strings (`\|`-separated groups), or use the built-in defaults. Menus: File, Edit, View, Insert, Format, Tools, Table, Help |
12
+ | Responsive toolbar | On narrow screens (mobile/tablet) or in a narrow host container — the toolbar collapses to a single row with a trailing `…` button that expands/collapses the full set. Automatic, width-driven, no configuration needed |
13
+ | Tables | Resize handles, row/column insert & delete, row/column reordering (move a row up/down or a column left/right from the context toolbar or Table menu), cell background color picker (build header rows in one click), cell/row/column/table properties, context toolbar |
14
+ | Paste handling | PowerPaste-style clean paste from Word / Google Docs / Excel |
15
+ | Internationalization | English / Arabic, automatic RTL/LTR switching |
16
+ | Fonts & formatting | Configurable font list (`fontFamilyFormats`), sizes, line-height, word-spacing, letter-spacing, text/background color, change case |
17
+ | Theming | `primaryColor` (accent, default `#df3c2b`), `toolbarGroupBackground` and `uiFontFamily` (default Noto Sans stack) options restyle the editor chrome via CSS variables |
18
+ | Custom content styling | `contentStyle` injects scoped CSS into the editable area (e.g. default font/size) |
19
+ | Images | Placeholder upload UI, drag-and-drop, configurable accepted file types (`imageFileTypes`), pluggable async upload handler |
20
+ | Video | Insert/edit dialog with **General** (source URL / upload / width / height), **Embed** (paste embed code) and **Advanced** (alternative source, poster image) tabs. YouTube / Vimeo / Dailymotion page URLs become embedded players — including when pasted directly into the editor. Template media slots can host a video instead of an image. |
21
+ | Code | Inline `code` (toolbar button, or type `` `snippet` `` converts on the closing backtick) and code sample blocks: a dialog with language dropdown + paste-in textarea inserts a styled block with a language header; click a block to edit, copy or delete it. No dependencies, no highlighting engine |
22
+ | Documents | Import `.docx` files, source-code view, print preview |
23
+ | Productivity | Undo/redo, revision history, autosave draft restore, word count, special characters & emoji pickers (category tabs + glyph grid), page breaks |
24
+ | Fullscreen | Toggle fullscreen editing |
25
+ | Help | Built-in shortcuts/help dialog |
26
+
27
+ ## Install
28
+
29
+ ```bash
30
+ npm install fable-editor
31
+ ```
32
+
33
+ > **Note:** the package ships framework wrappers as optional peer dependencies. Install React or Angular dependencies only if you use those wrappers.
34
+
35
+ ## Vanilla / Core
36
+
37
+ Import the CSS once in your app, then create an editor instance:
38
+
39
+ ```ts
40
+ import 'fable-editor/style.css';
41
+ import { FableEditor } from 'fable-editor';
42
+
43
+ const editor = new FableEditor({
44
+ target: document.getElementById('editor')!,
45
+ language: 'en', // 'en' | 'ar'
46
+ height: 400,
47
+ initialContent: '<p><br></p>',
48
+ onChange: (html) => console.log(html)
49
+ });
50
+
51
+ // API
52
+ editor.getContent();
53
+ editor.setContent('<p>Hello</p>');
54
+ editor.insertContent('<strong>bold</strong>');
55
+ editor.setLanguage('ar');
56
+ editor.focus();
57
+ editor.destroy();
58
+ ```
59
+
60
+ ### `init` options
61
+
62
+ | Option | Type | Default | Description |
63
+ |---|---|---|---|
64
+ | `target` | `HTMLElement` | | Required. Element to mount the editor into. |
65
+ | `language` | `'en' \| 'ar'` | `'en'` | UI language; also switches text direction. |
66
+ | `height` | `number` | `302` | Editable area height in px. |
67
+ | `initialContent` | `string` | `'<p><br></p>'` | Starting HTML content. |
68
+ | `menubar` | `boolean \| string` | `true` | `true`/omitted = default menu set. `false` = hidden. A string is a space-separated subset/reorder, e.g. `'file edit view insert format tools table help'`. |
69
+ | `toolbar` | `boolean \| string` | `true` | `true`/omitted = default toolbar. `false` = hidden. A string lays out the toolbar: `\|` separates groups, spaces separate items, e.g. `'undo redo \| bold italic'`. |
70
+ | `statusbar` | `boolean` | `true` | Show/hide the status bar. |
71
+ | `readonly` | `boolean` | `false` | Disable editing. |
72
+ | `fontFamilyFormats` | `[string, string][]` | built-in list | Overrides the font dropdown. Tuples of `[displayName, cssFontFamilyValue]`. |
73
+ | `contentStyle` | `string` | — | Custom CSS for the editable area. The literal word `body` is scoped to this editor instance; other selectors are used verbatim (your responsibility to scope). |
74
+ | `imageFileTypes` | `string[]` | common image MIME types | `accept` list for the native image file picker. |
75
+ | `imageUploadHandler` | `(file: File) => Promise<string>` | | Resolve with a URL after uploading; omit to inline images as base64. |
76
+ | `onImageUploadError` | `(error, file) => void` | — | Called when `imageUploadHandler` rejects. |
77
+ | `videoFileTypes` | `string[]` | `['video/mp4','video/webm','video/ogg']` | `accept` list for the native video file picker. |
78
+ | `videoUploadHandler` | `(file: File) => Promise<string>` | | Resolve with a URL after uploading; omit to inline videos as base64. |
79
+ | `onVideoUploadError` | `(error, file) => void` | | Called when `videoUploadHandler` rejects. |
80
+ | `primaryColor` | `string` | `'#df3c2b'` | Accent color for active states, primary buttons and selection outlines. Any CSS color. Applied as the `--fable-primary` CSS variable. |
81
+ | `toolbarGroupBackground` | `string` | `'#f1f3f6'` | Background of each toolbar button group (the rounded pills). Applied as `--fable-tgrp-bg`. |
82
+ | `uiFontFamily` | `string` | Noto Sans stack | Font family for the editor UI (menubar, toolbar, dialogs). Load the Noto Sans webfont in your app to use the default, or pass your own family. Applied as `--fable-ui-font`. |
83
+ | `draftKey` | `string` | current page path | Storage key suffix for autosaved drafts. |
84
+ | `onChange` / `onReady` | functions | — | Content-change and ready callbacks (usually set by the React/Angular wrapper instead). |
85
+
86
+ ### Theming
87
+
88
+ The editor's accent color, toolbar group background and UI font are driven by CSS variables, so they can be set per instance:
89
+
90
+ ```ts
91
+ new FableEditor({
92
+ target: el,
93
+ primaryColor: '#df3c2b', // accent (default)
94
+ toolbarGroupBackground: '#f1f3f6', // toolbar pill background (default)
95
+ uiFontFamily: "'Noto Sans', sans-serif" // UI font (default stack)
96
+ });
97
+ ```
98
+
99
+ The same values are available as React props / Angular inputs. The UI font defaults to a **Noto Sans** stack — load the webfont in your app (e.g. from Google Fonts) or pass any family you've already loaded. Alternatively, set the variables yourself in CSS: `--fable-primary`, `--fable-tgrp-bg`, `--fable-ui-font`.
100
+
101
+ ### Toolbar & menubar configuration
102
+
103
+ The `toolbar`/`menubar` options accept the same style of layout string as TinyMCE — `|` separates visual groups, spaces separate items:
104
+
105
+ ```ts
106
+ new FableEditor({
107
+ target: document.querySelector('#default-editor')!,
108
+ toolbar:
109
+ 'undo redo | styles | bold italic underline strikethrough | ' +
110
+ 'alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
111
+ menubar: 'file edit insert format'
112
+ });
113
+ ```
114
+
115
+ Available toolbar items: `undo redo preview print importword revhistory fontfamily fontsize fontsizeincrease fontsizedecrease bold italic underline strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify bullist numlist outdent indent link blockquote code changecase lineheight wordspacing letterspacing removeformat blocks ltr rtl quickimage quickvideo quicktable codesample template charmap emoji fullscreen sourcecode`. The TinyMCE names `styles` (→ `blocks`), `image` (→ `quickimage`), `media` (→ `quickvideo`) and `table` (→ `quicktable`) are accepted as aliases, so a typical TinyMCE toolbar string works unchanged. Unknown tokens are skipped with a console warning. Menubar keys: `file edit view insert format tools table help`.
116
+
117
+ ## React
118
+
119
+ ```tsx
120
+ import 'fable-editor/style.css';
121
+ import { FableEditor } from 'fable-editor/react';
122
+
123
+ function App() {
124
+ const [value, setValue] = useState('<p><br></p>');
125
+
126
+ return (
127
+ <FableEditor
128
+ value={value}
129
+ onChange={setValue}
130
+ language="en"
131
+ height={400}
132
+ toolbar="undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
133
+ />
134
+ );
135
+ }
136
+ ```
137
+
138
+ `toolbar`/`menubar` accept the same layout strings as the core option (see [Toolbar & menubar configuration](#toolbar--menubar-configuration)), so each app can show exactly the controls it needs.
139
+
140
+ Props: `value`, `defaultValue`, `onChange`, `language`, `height`, `menubar`, `toolbar`, `statusbar`, `readonly`, `primaryColor`, `toolbarGroupBackground`, `uiFontFamily`, `fontFamilyFormats`, `contentStyle`, `imageFileTypes`, `imageUploadHandler`, `onImageUploadError`, `videoFileTypes`, `videoUploadHandler`, `onVideoUploadError`, `init`, `className`, `style` (see the [`init` options](#init-options) table above — every option is also a top-level prop). A ref exposes `getContent`, `setContent`, `insertContent`, `setLanguage`, `focus`, `destroy`.
141
+
142
+ ## Angular
143
+
144
+ Add to `angular.json` styles:
145
+
146
+ ```json
147
+ "styles": [
148
+ "src/styles.css",
149
+ "node_modules/fable-editor/style.css"
150
+ ]
151
+ ```
152
+
153
+ Import the module:
154
+
155
+ ```ts
156
+ import { FableEditorModule } from 'fable-editor/angular';
157
+
158
+ @NgModule({
159
+ imports: [FableEditorModule]
160
+ })
161
+ export class AppModule {}
162
+ ```
163
+
164
+ Use in a template:
165
+
166
+ ```html
167
+ <fable-editor
168
+ [(ngModel)]="content"
169
+ language="en"
170
+ [height]="400"
171
+ toolbar="undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image">
172
+ </fable-editor>
173
+ ```
174
+
175
+ Inputs: `language`, `height`, `menubar`, `toolbar`, `statusbar`, `readonly`, `primaryColor`, `toolbarGroupBackground`, `uiFontFamily`, `init`. `menubar`/`toolbar` accept a string directly (e.g. `[toolbar]="'undo redo | bold italic'"`); `fontFamilyFormats`, `contentStyle`, `imageFileTypes`, `imageUploadHandler`, `onImageUploadError`, `videoFileTypes`, `videoUploadHandler`, and `onVideoUploadError` aren't top-level inputs — pass them via `[init]="{ contentStyle: '...' }"` (see the [`init` options](#init-options) table above). Outputs: `editorChange`, `editorReady`. Works with `ngModel` and `formControlName`.
176
+
177
+ ## Development & testing
178
+
179
+ ```bash
180
+ npm install
181
+ npm run build # builds core, react, and angular
182
+ npm test # automated core tests (Vitest + jsdom)
183
+ ```
184
+
185
+ ### Manual smoke tests
186
+
187
+ ```bash
188
+ # Vanilla demo
189
+ npm run demo
190
+ # open http://localhost:5173/demo/index.html
191
+
192
+ # React example
193
+ npm run demo:react
194
+ # open http://localhost:5173
195
+
196
+ # Angular example
197
+ npm run demo:angular
198
+ # open http://localhost:4200
199
+ ```
200
+
201
+ > Run `npm run build` before the Angular demo so the library files are up to date.
202
+
203
+ ## Project layout
204
+
205
+ ```
206
+ src/
207
+ core/ # framework-agnostic editor engine
208
+ react/ # React wrapper
209
+ angular/ # Angular wrapper + module
210
+ index.ts # Angular library entry point
211
+ examples/
212
+ react/ # runnable React test app
213
+ angular/ # runnable Angular CLI test app
214
+ demo/
215
+ index.html # manual vanilla test page
216
+ test/
217
+ core.test.ts # automated core tests
218
+ ```
219
+
220
+ ## Author
221
+
222
+ Sajin Satheesan <an.sajinsatheesan@gmail.com> — [LinkedIn](https://www.linkedin.com/in/sajin-satheesan-b5759a126/)
223
+
224
+ ## License
225
+
226
+ MIT
@@ -124,7 +124,9 @@ export declare class FableEditor implements FableEditorApi {
124
124
  private colorMenu;
125
125
  private applyColor;
126
126
  private syncColorSwatches;
127
+ private fontItems;
127
128
  private fontMenu;
129
+ private sizeItems;
128
130
  private sizeMenu;
129
131
  /** Font sizing needs a non-collapsed range. With a bare caret, grow the
130
132
  selection to the word under it; in an empty spot, select a zero-width
@@ -133,15 +135,19 @@ export declare class FableEditor implements FableEditorApi {
133
135
  private applyFontSize;
134
136
  private stepFontSize;
135
137
  private transformCase;
138
+ private caseItems;
136
139
  private caseMenu;
137
140
  private applyBlockStyle;
138
141
  private currentBlockStyle;
142
+ private blockStyleItems;
139
143
  private lineHeightMenu;
140
144
  private wordSpacingMenu;
141
145
  private letterSpacingMenu;
142
146
  private closestAnchor;
143
147
  private linkDlg;
148
+ private blockItems;
144
149
  private blocksMenu;
150
+ private alignItems;
145
151
  private blockLabel;
146
152
  private tableGrid;
147
153
  private buildTableGridInto;
@@ -53,6 +53,7 @@ export interface I18nStrings {
53
53
  aligncenter: string;
54
54
  alignright: string;
55
55
  alignjustify: string;
56
+ align: string;
56
57
  numlist: string;
57
58
  bullist: string;
58
59
  forecolor: string;