@notectl/angular 2.1.3 → 2.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.
package/README.md CHANGED
@@ -299,6 +299,8 @@ notectl ships plugins for:
299
299
  - Tables
300
300
  - Code blocks
301
301
  - Images
302
+ - Math and formulas (MathML)
303
+ - Video embeds
302
304
  - Text color and highlight
303
305
  - Alignment and text direction
304
306
  - Fonts and font sizes
@@ -206,29 +206,62 @@ function initConfigEquals(a, b) {
206
206
  a.locale === b.locale &&
207
207
  a.styleNonce === b.styleNonce);
208
208
  }
209
+ /**
210
+ * Sentinel default for the Signal Forms `value` model. Reference identity lets the
211
+ * value-to-editor effect ignore the untouched initial value (so it never clobbers
212
+ * `content` or initial content) while still syncing any document a bound field provides.
213
+ */
214
+ const EMPTY_FORM_VALUE = { children: [] };
209
215
  class NotectlEditorComponent {
210
216
  destroyRef = inject(DestroyRef);
211
217
  defaultConfig = inject(NOTECTL_DEFAULT_CONFIG, { optional: true });
212
218
  contentFormat = inject(NOTECTL_CONTENT_FORMAT, { optional: true }) ?? 'json';
213
- plugins = input(undefined, ...(ngDevMode ? [{ debugName: "plugins" }] : /* istanbul ignore next */ []));
214
- toolbar = input(undefined, ...(ngDevMode ? [{ debugName: "toolbar" }] : /* istanbul ignore next */ []));
215
- features = input(undefined, ...(ngDevMode ? [{ debugName: "features" }] : /* istanbul ignore next */ []));
216
- placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
217
- readonlyMode = input(undefined, ...(ngDevMode ? [{ debugName: "readonlyMode" }] : /* istanbul ignore next */ []));
218
- autofocus = input(undefined, ...(ngDevMode ? [{ debugName: "autofocus" }] : /* istanbul ignore next */ []));
219
- maxHistoryDepth = input(undefined, ...(ngDevMode ? [{ debugName: "maxHistoryDepth" }] : /* istanbul ignore next */ []));
220
- theme = input(undefined, ...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
221
- paperSize = input(undefined, ...(ngDevMode ? [{ debugName: "paperSize" }] : /* istanbul ignore next */ []));
222
- dir = input(undefined, ...(ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []));
223
- locale = input(undefined, ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
224
- styleNonce = input(undefined, ...(ngDevMode ? [{ debugName: "styleNonce" }] : /* istanbul ignore next */ []));
225
- content = model(undefined, ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
219
+ plugins = input(undefined, /* @ts-ignore */
220
+ ...(ngDevMode ? [{ debugName: "plugins" }] : /* istanbul ignore next */ []));
221
+ toolbar = input(undefined, /* @ts-ignore */
222
+ ...(ngDevMode ? [{ debugName: "toolbar" }] : /* istanbul ignore next */ []));
223
+ features = input(undefined, /* @ts-ignore */
224
+ ...(ngDevMode ? [{ debugName: "features" }] : /* istanbul ignore next */ []));
225
+ placeholder = input(undefined, /* @ts-ignore */
226
+ ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
227
+ readonlyMode = input(undefined, /* @ts-ignore */
228
+ ...(ngDevMode ? [{ debugName: "readonlyMode" }] : /* istanbul ignore next */ []));
229
+ autofocus = input(undefined, /* @ts-ignore */
230
+ ...(ngDevMode ? [{ debugName: "autofocus" }] : /* istanbul ignore next */ []));
231
+ maxHistoryDepth = input(undefined, /* @ts-ignore */
232
+ ...(ngDevMode ? [{ debugName: "maxHistoryDepth" }] : /* istanbul ignore next */ []));
233
+ theme = input(undefined, /* @ts-ignore */
234
+ ...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
235
+ paperSize = input(undefined, /* @ts-ignore */
236
+ ...(ngDevMode ? [{ debugName: "paperSize" }] : /* istanbul ignore next */ []));
237
+ dir = input(undefined, /* @ts-ignore */
238
+ ...(ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []));
239
+ locale = input(undefined, /* @ts-ignore */
240
+ ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
241
+ styleNonce = input(undefined, /* @ts-ignore */
242
+ ...(ngDevMode ? [{ debugName: "styleNonce" }] : /* istanbul ignore next */ []));
243
+ /** Disabled status received from a bound Signal Forms field (`FormUiControl.disabled`). */
244
+ disabled = input(false, /* @ts-ignore */
245
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
246
+ content = model(undefined, /* @ts-ignore */
247
+ ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
248
+ /**
249
+ * Signal Forms value model implementing the `FormValueControl<Document>` contract, so the
250
+ * editor binds to Angular 22 Signal Forms through the `[formField]` directive. `value` and
251
+ * `content` are independent views onto editor state: both are driven from editor state
252
+ * changes and both write to the editor when set externally, never to each other.
253
+ */
254
+ value = model(EMPTY_FORM_VALUE, /* @ts-ignore */
255
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
226
256
  stateChange = output();
227
257
  selectionChange = output();
228
258
  editorFocus = output();
229
259
  editorBlur = output();
230
260
  ready = output();
231
- editorState = signal(null, ...(ngDevMode ? [{ debugName: "editorState" }] : /* istanbul ignore next */ []));
261
+ /** Emitted when the editor blurs, so a bound Signal Forms field marks itself touched. */
262
+ touch = output();
263
+ editorState = signal(null, /* @ts-ignore */
264
+ ...(ngDevMode ? [{ debugName: "editorState" }] : /* istanbul ignore next */ []));
232
265
  isEmpty = computed(() => {
233
266
  const state = this.editorState();
234
267
  if (!state)
@@ -242,28 +275,47 @@ class NotectlEditorComponent {
242
275
  if (!block)
243
276
  return true;
244
277
  return block.type === 'paragraph' && block.children.length === 0;
245
- }, ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
246
- resolvedPlugins = computed(() => this.plugins() ?? this.defaultConfig?.plugins ?? [], ...(ngDevMode ? [{ debugName: "resolvedPlugins" }] : /* istanbul ignore next */ []));
247
- resolvedToolbar = computed(() => this.toolbar() ?? this.defaultConfig?.toolbar, ...(ngDevMode ? [{ debugName: "resolvedToolbar" }] : /* istanbul ignore next */ []));
248
- resolvedFeatures = computed(() => this.features() ?? this.defaultConfig?.features, ...(ngDevMode ? [{ debugName: "resolvedFeatures" }] : /* istanbul ignore next */ []));
249
- resolvedPlaceholder = computed(() => this.placeholder() ?? this.defaultConfig?.placeholder ?? 'Start typing...', ...(ngDevMode ? [{ debugName: "resolvedPlaceholder" }] : /* istanbul ignore next */ []));
250
- resolvedReadonlyMode = computed(() => this.readonlyMode() ?? this.defaultConfig?.readonly ?? false, ...(ngDevMode ? [{ debugName: "resolvedReadonlyMode" }] : /* istanbul ignore next */ []));
251
- resolvedAutofocus = computed(() => this.autofocus() ?? this.defaultConfig?.autofocus ?? false, ...(ngDevMode ? [{ debugName: "resolvedAutofocus" }] : /* istanbul ignore next */ []));
252
- resolvedMaxHistoryDepth = computed(() => this.maxHistoryDepth() ?? this.defaultConfig?.maxHistoryDepth, ...(ngDevMode ? [{ debugName: "resolvedMaxHistoryDepth" }] : /* istanbul ignore next */ []));
253
- resolvedTheme = computed(() => this.theme() ?? this.defaultConfig?.theme ?? ThemePreset.Light, ...(ngDevMode ? [{ debugName: "resolvedTheme" }] : /* istanbul ignore next */ []));
254
- resolvedPaperSize = computed(() => this.paperSize() ?? this.defaultConfig?.paperSize, ...(ngDevMode ? [{ debugName: "resolvedPaperSize" }] : /* istanbul ignore next */ []));
255
- resolvedDir = computed(() => this.dir() ?? this.defaultConfig?.dir, ...(ngDevMode ? [{ debugName: "resolvedDir" }] : /* istanbul ignore next */ []));
256
- resolvedLocale = computed(() => this.locale() ?? this.defaultConfig?.locale, ...(ngDevMode ? [{ debugName: "resolvedLocale" }] : /* istanbul ignore next */ []));
257
- resolvedStyleNonce = computed(() => this.styleNonce() ?? this.defaultConfig?.styleNonce, ...(ngDevMode ? [{ debugName: "resolvedStyleNonce" }] : /* istanbul ignore next */ []));
258
- effectiveReadonly = computed(() => this.disabledByForms() || this.resolvedReadonlyMode(), ...(ngDevMode ? [{ debugName: "effectiveReadonly" }] : /* istanbul ignore next */ []));
278
+ }, /* @ts-ignore */
279
+ ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
280
+ resolvedPlugins = computed(() => this.plugins() ?? this.defaultConfig?.plugins ?? [], /* @ts-ignore */
281
+ ...(ngDevMode ? [{ debugName: "resolvedPlugins" }] : /* istanbul ignore next */ []));
282
+ resolvedToolbar = computed(() => this.toolbar() ?? this.defaultConfig?.toolbar, /* @ts-ignore */
283
+ ...(ngDevMode ? [{ debugName: "resolvedToolbar" }] : /* istanbul ignore next */ []));
284
+ resolvedFeatures = computed(() => this.features() ?? this.defaultConfig?.features, /* @ts-ignore */
285
+ ...(ngDevMode ? [{ debugName: "resolvedFeatures" }] : /* istanbul ignore next */ []));
286
+ resolvedPlaceholder = computed(() => this.placeholder() ?? this.defaultConfig?.placeholder ?? 'Start typing...', /* @ts-ignore */
287
+ ...(ngDevMode ? [{ debugName: "resolvedPlaceholder" }] : /* istanbul ignore next */ []));
288
+ resolvedReadonlyMode = computed(() => this.readonlyMode() ?? this.defaultConfig?.readonly ?? false, /* @ts-ignore */
289
+ ...(ngDevMode ? [{ debugName: "resolvedReadonlyMode" }] : /* istanbul ignore next */ []));
290
+ resolvedAutofocus = computed(() => this.autofocus() ?? this.defaultConfig?.autofocus ?? false, /* @ts-ignore */
291
+ ...(ngDevMode ? [{ debugName: "resolvedAutofocus" }] : /* istanbul ignore next */ []));
292
+ resolvedMaxHistoryDepth = computed(() => this.maxHistoryDepth() ?? this.defaultConfig?.maxHistoryDepth, /* @ts-ignore */
293
+ ...(ngDevMode ? [{ debugName: "resolvedMaxHistoryDepth" }] : /* istanbul ignore next */ []));
294
+ resolvedTheme = computed(() => this.theme() ?? this.defaultConfig?.theme ?? ThemePreset.Light, /* @ts-ignore */
295
+ ...(ngDevMode ? [{ debugName: "resolvedTheme" }] : /* istanbul ignore next */ []));
296
+ resolvedPaperSize = computed(() => this.paperSize() ?? this.defaultConfig?.paperSize, /* @ts-ignore */
297
+ ...(ngDevMode ? [{ debugName: "resolvedPaperSize" }] : /* istanbul ignore next */ []));
298
+ resolvedDir = computed(() => this.dir() ?? this.defaultConfig?.dir, /* @ts-ignore */
299
+ ...(ngDevMode ? [{ debugName: "resolvedDir" }] : /* istanbul ignore next */ []));
300
+ resolvedLocale = computed(() => this.locale() ?? this.defaultConfig?.locale, /* @ts-ignore */
301
+ ...(ngDevMode ? [{ debugName: "resolvedLocale" }] : /* istanbul ignore next */ []));
302
+ resolvedStyleNonce = computed(() => this.styleNonce() ?? this.defaultConfig?.styleNonce, /* @ts-ignore */
303
+ ...(ngDevMode ? [{ debugName: "resolvedStyleNonce" }] : /* istanbul ignore next */ []));
304
+ effectiveReadonly = computed(() => this.disabledByForms() || this.disabled() || this.resolvedReadonlyMode(), /* @ts-ignore */
305
+ ...(ngDevMode ? [{ debugName: "effectiveReadonly" }] : /* istanbul ignore next */ []));
259
306
  hostRef = viewChild.required('host');
260
- initialized = signal(false, ...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
261
- disabledByForms = signal(false, ...(ngDevMode ? [{ debugName: "disabledByForms" }] : /* istanbul ignore next */ []));
307
+ initialized = signal(false, /* @ts-ignore */
308
+ ...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
309
+ disabledByForms = signal(false, /* @ts-ignore */
310
+ ...(ngDevMode ? [{ debugName: "disabledByForms" }] : /* istanbul ignore next */ []));
262
311
  valueController = new EditorValueController({
263
312
  emitControlValue: (value) => this.onChange(value),
264
313
  getEditor: () => this.editorRef,
265
314
  getFormat: () => this.contentFormat,
266
- updateContent: (doc) => this.content.set(doc),
315
+ updateContent: (doc) => {
316
+ this.content.set(doc);
317
+ this.value.set(doc);
318
+ },
267
319
  whenReady: () => this.readyPromise,
268
320
  });
269
321
  editorRef = null;
@@ -298,6 +350,12 @@ class NotectlEditorComponent {
298
350
  return;
299
351
  this.valueController.syncExternalContent(doc);
300
352
  });
353
+ effect(() => {
354
+ const doc = this.value();
355
+ if (doc === EMPTY_FORM_VALUE)
356
+ return;
357
+ this.valueController.syncExternalContent(doc);
358
+ });
301
359
  effect(() => {
302
360
  this.scheduleReinitialization(this.captureInitConfig());
303
361
  });
@@ -395,7 +453,12 @@ class NotectlEditorComponent {
395
453
  this.editorFocus.emit();
396
454
  });
397
455
  editor.on('blur', () => {
398
- this.onTouched();
456
+ // Only blurs after the editor is initialized mark the form field touched; any blur
457
+ // emitted while the editor is still setting up is not a user interaction.
458
+ if (this.initialized()) {
459
+ this.onTouched();
460
+ this.touch.emit();
461
+ }
399
462
  this.editorBlur.emit();
400
463
  });
401
464
  editor.on('ready', () => {
@@ -495,8 +558,8 @@ class NotectlEditorComponent {
495
558
  }
496
559
  return editor;
497
560
  }
498
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NotectlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
499
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.6", type: NotectlEditorComponent, isStandalone: true, selector: "ntl-editor", inputs: { plugins: { classPropertyName: "plugins", publicName: "plugins", isSignal: true, isRequired: false, transformFunction: null }, toolbar: { classPropertyName: "toolbar", publicName: "toolbar", isSignal: true, isRequired: false, transformFunction: null }, features: { classPropertyName: "features", publicName: "features", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonlyMode: { classPropertyName: "readonlyMode", publicName: "readonlyMode", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, maxHistoryDepth: { classPropertyName: "maxHistoryDepth", publicName: "maxHistoryDepth", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, paperSize: { classPropertyName: "paperSize", publicName: "paperSize", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, styleNonce: { classPropertyName: "styleNonce", publicName: "styleNonce", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { content: "contentChange", stateChange: "stateChange", selectionChange: "selectionChange", editorFocus: "editorFocus", editorBlur: "editorBlur", ready: "ready" }, host: { properties: { "attr.aria-disabled": "effectiveReadonly() ? \"true\" : null", "class.ntl-editor-disabled": "effectiveReadonly()" } }, providers: [
561
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: NotectlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
562
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.1", type: NotectlEditorComponent, isStandalone: true, selector: "ntl-editor", inputs: { plugins: { classPropertyName: "plugins", publicName: "plugins", isSignal: true, isRequired: false, transformFunction: null }, toolbar: { classPropertyName: "toolbar", publicName: "toolbar", isSignal: true, isRequired: false, transformFunction: null }, features: { classPropertyName: "features", publicName: "features", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonlyMode: { classPropertyName: "readonlyMode", publicName: "readonlyMode", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, maxHistoryDepth: { classPropertyName: "maxHistoryDepth", publicName: "maxHistoryDepth", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, paperSize: { classPropertyName: "paperSize", publicName: "paperSize", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, styleNonce: { classPropertyName: "styleNonce", publicName: "styleNonce", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { content: "contentChange", value: "valueChange", stateChange: "stateChange", selectionChange: "selectionChange", editorFocus: "editorFocus", editorBlur: "editorBlur", ready: "ready", touch: "touch" }, host: { properties: { "attr.aria-disabled": "effectiveReadonly() ? \"true\" : null", "class.ntl-editor-disabled": "effectiveReadonly()" } }, providers: [
500
563
  {
501
564
  provide: NG_VALUE_ACCESSOR,
502
565
  useExisting: forwardRef(() => NotectlEditorComponent),
@@ -504,7 +567,7 @@ class NotectlEditorComponent {
504
567
  },
505
568
  ], viewQueries: [{ propertyName: "hostRef", first: true, predicate: ["host"], descendants: true, isSignal: true }], ngImport: i0, template: '<div #host></div>', isInline: true, styles: [":host{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
506
569
  }
507
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NotectlEditorComponent, decorators: [{
570
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: NotectlEditorComponent, decorators: [{
508
571
  type: Component,
509
572
  args: [{ selector: 'ntl-editor', standalone: true, template: '<div #host></div>', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
510
573
  {
@@ -516,7 +579,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
516
579
  '[attr.aria-disabled]': 'effectiveReadonly() ? "true" : null',
517
580
  '[class.ntl-editor-disabled]': 'effectiveReadonly()',
518
581
  }, styles: [":host{display:block}\n"] }]
519
- }], ctorParameters: () => [], propDecorators: { plugins: [{ type: i0.Input, args: [{ isSignal: true, alias: "plugins", required: false }] }], toolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbar", required: false }] }], features: [{ type: i0.Input, args: [{ isSignal: true, alias: "features", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonlyMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonlyMode", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], maxHistoryDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHistoryDepth", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], paperSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "paperSize", required: false }] }], dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], styleNonce: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleNonce", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }, { type: i0.Output, args: ["contentChange"] }], stateChange: [{ type: i0.Output, args: ["stateChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], editorFocus: [{ type: i0.Output, args: ["editorFocus"] }], editorBlur: [{ type: i0.Output, args: ["editorBlur"] }], ready: [{ type: i0.Output, args: ["ready"] }], hostRef: [{ type: i0.ViewChild, args: ['host', { isSignal: true }] }] } });
582
+ }], ctorParameters: () => [], propDecorators: { plugins: [{ type: i0.Input, args: [{ isSignal: true, alias: "plugins", required: false }] }], toolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbar", required: false }] }], features: [{ type: i0.Input, args: [{ isSignal: true, alias: "features", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonlyMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonlyMode", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], maxHistoryDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHistoryDepth", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], paperSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "paperSize", required: false }] }], dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], styleNonce: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleNonce", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }, { type: i0.Output, args: ["contentChange"] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], stateChange: [{ type: i0.Output, args: ["stateChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], editorFocus: [{ type: i0.Output, args: ["editorFocus"] }], editorBlur: [{ type: i0.Output, args: ["editorBlur"] }], ready: [{ type: i0.Output, args: ["ready"] }], touch: [{ type: i0.Output, args: ["touch"] }], hostRef: [{ type: i0.ViewChild, args: ['host', { isSignal: true }] }] } });
520
583
 
521
584
  /**
522
585
  * @deprecated Angular Forms support is built into `NotectlEditorComponent`.
@@ -525,10 +588,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
525
588
  * but it no longer participates in value accessor registration.
526
589
  */
527
590
  class NotectlValueAccessorDirective {
528
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NotectlValueAccessorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
529
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.6", type: NotectlValueAccessorDirective, isStandalone: true, selector: "ntl-editor[formControl], ntl-editor[formControlName], ntl-editor[ngModel]", ngImport: i0 });
591
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: NotectlValueAccessorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
592
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.1", type: NotectlValueAccessorDirective, isStandalone: true, selector: "ntl-editor[formControl], ntl-editor[formControlName], ntl-editor[ngModel]", ngImport: i0 });
530
593
  }
531
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NotectlValueAccessorDirective, decorators: [{
594
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: NotectlValueAccessorDirective, decorators: [{
532
595
  type: Directive,
533
596
  args: [{
534
597
  selector: 'ntl-editor[formControl], ntl-editor[formControlName], ntl-editor[ngModel]',
@@ -568,10 +631,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
568
631
  */
569
632
  class NotectlEditorService {
570
633
  destroyRef = inject(DestroyRef);
571
- editorRef = signal(null, ...(ngDevMode ? [{ debugName: "editorRef" }] : /* istanbul ignore next */ []));
634
+ editorRef = signal(null, /* @ts-ignore */
635
+ ...(ngDevMode ? [{ debugName: "editorRef" }] : /* istanbul ignore next */ []));
572
636
  stateChangeSubject = new Subject();
573
637
  /** Whether an editor is currently registered with this service. */
574
- hasEditor = computed(() => this.editorRef() !== null, ...(ngDevMode ? [{ debugName: "hasEditor" }] : /* istanbul ignore next */ []));
638
+ hasEditor = computed(() => this.editorRef() !== null, /* @ts-ignore */
639
+ ...(ngDevMode ? [{ debugName: "hasEditor" }] : /* istanbul ignore next */ []));
575
640
  /** Observable stream of state change events from the editor. */
576
641
  stateChanges$ = this.stateChangeSubject.asObservable();
577
642
  stateChangeSub = null;
@@ -618,10 +683,10 @@ class NotectlEditorService {
618
683
  dispatch(tr) {
619
684
  this.editorRef()?.dispatch(tr);
620
685
  }
621
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NotectlEditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
622
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NotectlEditorService });
686
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: NotectlEditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
687
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: NotectlEditorService });
623
688
  }
624
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NotectlEditorService, decorators: [{
689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: NotectlEditorService, decorators: [{
625
690
  type: Injectable
626
691
  }], ctorParameters: () => [] });
627
692
 
@@ -1 +1 @@
1
- {"version":3,"file":"notectl-angular.mjs","sources":["../../src/lib/value-interop.ts","../../src/lib/EditorValueController.ts","../../src/lib/tokens.ts","../../src/lib/notectl-editor.component.ts","../../src/lib/value-accessor.directive.ts","../../src/lib/notectl-editor.service.ts","../../src/public-api.ts","../../src/notectl-angular.ts"],"sourcesContent":["import type { Document } from '@notectl/core';\n\nimport type { ContentFormat } from './tokens';\nimport type { NotectlValue } from './types';\n\ninterface EditorContentApi {\n\tgetContentHTML(): Promise<string>;\n\tgetJSON(): Document;\n\tgetText(): string;\n\tsetContentHTML(html: string): Promise<void>;\n\tsetJSON(doc: Document): void;\n\tsetText(value: string): void;\n}\n\nconst EMPTY_HTML = '<p></p>';\n\nfunction isDocumentValue(value: NotectlValue): value is Document {\n\treturn typeof value === 'object' && value !== null;\n}\n\nexport async function readEditorValue(\n\teditor: EditorContentApi,\n\tformat: ContentFormat,\n): Promise<NotectlValue> {\n\tswitch (format) {\n\t\tcase 'html':\n\t\t\treturn editor.getContentHTML();\n\t\tcase 'text':\n\t\t\treturn editor.getText();\n\t\tdefault:\n\t\t\treturn editor.getJSON();\n\t}\n}\n\nexport async function writeEditorValue(\n\teditor: EditorContentApi,\n\tformat: ContentFormat,\n\tvalue: NotectlValue,\n): Promise<void> {\n\tif (value === null || value === '') {\n\t\tawait editor.setContentHTML(EMPTY_HTML);\n\t\treturn;\n\t}\n\n\tif (format === 'json' && isDocumentValue(value)) {\n\t\teditor.setJSON(value);\n\t\treturn;\n\t}\n\n\tif (format === 'text' && typeof value === 'string') {\n\t\t// Routing through `setText` (rather than `setContentHTML('<p>${escaped}</p>')`)\n\t\t// preserves block identity and multi-paragraph structure across signal-form\n\t\t// round-trips, fixing the cursor reset reported in #103 for `contentFormat: 'text'`.\n\t\teditor.setText(value);\n\t\treturn;\n\t}\n\n\tif (typeof value === 'string') {\n\t\tawait editor.setContentHTML(value);\n\t\treturn;\n\t}\n\n\teditor.setJSON(value);\n}\n","import type { Document, NotectlEditor } from '@notectl/core';\n\nimport type { ContentFormat } from './tokens';\nimport type { NotectlValue } from './types';\nimport { readEditorValue, writeEditorValue } from './value-interop';\n\ninterface EditorValueControllerOptions {\n\treadonly getEditor: () => NotectlEditor | null;\n\treadonly getFormat: () => ContentFormat;\n\treadonly whenReady: () => Promise<void>;\n\treadonly updateContent: (doc: Document) => void;\n\treadonly emitControlValue: (value: NotectlValue) => void;\n}\n\nexport class EditorValueController {\n\tprivate readonly options: EditorValueControllerOptions;\n\tprivate lastDocument: Document | undefined;\n\tprivate mutedControlChanges = 0;\n\tprivate serializedReadVersion = 0;\n\tprivate writeQueue: Promise<void> = Promise.resolve();\n\n\tconstructor(options: EditorValueControllerOptions) {\n\t\tthis.options = options;\n\t}\n\n\treset(): void {\n\t\tthis.lastDocument = undefined;\n\t\tthis.serializedReadVersion++;\n\t}\n\n\thandleEditorStateChange(doc: Document): void {\n\t\tthis.lastDocument = doc;\n\t\tthis.options.updateContent(doc);\n\n\t\tif (this.mutedControlChanges > 0) return;\n\n\t\tconst readVersion = ++this.serializedReadVersion;\n\t\tvoid this.readCurrentValue().then((value: NotectlValue) => {\n\t\t\tif (readVersion !== this.serializedReadVersion) return;\n\t\t\tthis.options.emitControlValue(value);\n\t\t});\n\t}\n\n\tsyncExternalContent(doc: Document): void {\n\t\tif (doc === this.lastDocument) return;\n\t\tthis.lastDocument = doc;\n\t\tvoid this.enqueueSilent(async (editor: NotectlEditor) => {\n\t\t\teditor.setJSON(doc);\n\t\t});\n\t}\n\n\twriteControlValue(value: NotectlValue): void {\n\t\tvoid this.enqueueSilent(async (editor: NotectlEditor) => {\n\t\t\tawait writeEditorValue(editor, this.options.getFormat(), value);\n\t\t});\n\t}\n\n\tsetDocument(doc: Document): Promise<void> {\n\t\tthis.lastDocument = doc;\n\t\treturn this.enqueueInteractive(async (editor: NotectlEditor) => {\n\t\t\teditor.setJSON(doc);\n\t\t});\n\t}\n\n\tsetSerializedValue(value: NotectlValue): Promise<void> {\n\t\treturn this.enqueueInteractive(async (editor: NotectlEditor) => {\n\t\t\tawait writeEditorValue(editor, this.options.getFormat(), value);\n\t\t});\n\t}\n\n\tapplyInitialDocument(editor: NotectlEditor, doc: Document): Promise<void> {\n\t\tthis.lastDocument = doc;\n\t\treturn this.runSilent(async () => {\n\t\t\teditor.setJSON(doc);\n\t\t});\n\t}\n\n\tprivate async readCurrentValue(): Promise<NotectlValue> {\n\t\tconst editor: NotectlEditor | null = this.options.getEditor();\n\t\tif (!editor) return null;\n\t\treturn readEditorValue(editor, this.options.getFormat());\n\t}\n\n\tprivate enqueueSilent(task: (editor: NotectlEditor) => Promise<void>): Promise<void> {\n\t\treturn this.enqueue(task, true);\n\t}\n\n\tprivate enqueueInteractive(task: (editor: NotectlEditor) => Promise<void>): Promise<void> {\n\t\treturn this.enqueue(task, false);\n\t}\n\n\tprivate enqueue(task: (editor: NotectlEditor) => Promise<void>, silent: boolean): Promise<void> {\n\t\tconst next = this.writeQueue.then(async () => {\n\t\t\tawait this.options.whenReady();\n\t\t\tconst editor: NotectlEditor | null = this.options.getEditor();\n\t\t\tif (!editor) return;\n\n\t\t\tif (silent) {\n\t\t\t\tawait this.runSilent(() => task(editor));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait task(editor);\n\t\t});\n\n\t\tthis.writeQueue = next.catch(() => undefined);\n\t\treturn next;\n\t}\n\n\tprivate async runSilent(task: () => Promise<void>): Promise<void> {\n\t\tthis.mutedControlChanges++;\n\t\ttry {\n\t\t\tawait task();\n\t\t} finally {\n\t\t\tthis.mutedControlChanges--;\n\t\t}\n\t}\n}\n","import { type EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport type { NotectlEditorConfig } from '@notectl/core';\n\n/**\n * Default configuration applied to all `<notectl-editor>` instances within\n * the injector scope. Component-level inputs override these defaults.\n */\nexport const NOTECTL_DEFAULT_CONFIG: InjectionToken<Partial<NotectlEditorConfig>> =\n\tnew InjectionToken<Partial<NotectlEditorConfig>>('notectl-default-config');\n\n/**\n * Content format used by the `ControlValueAccessor` for forms integration.\n * Determines how editor content is serialized when reading/writing form values.\n *\n * - `'json'` — `Document` objects (default)\n * - `'html'` — sanitized HTML strings\n * - `'text'` — plain text strings\n */\nexport const NOTECTL_CONTENT_FORMAT: InjectionToken<ContentFormat> =\n\tnew InjectionToken<ContentFormat>('notectl-content-format');\n\n/** Supported content serialization formats for forms integration. */\nexport type ContentFormat = 'json' | 'html' | 'text';\n\n/** Options for `provideNotectl()`. */\nexport interface NotectlProviderOptions {\n\t/** Default editor configuration applied to all instances. */\n\treadonly config?: Partial<NotectlEditorConfig>;\n\t/** Content serialization format for forms integration. Defaults to `'json'`. */\n\treadonly contentFormat?: ContentFormat;\n}\n\n/**\n * Configures the notectl editor at the environment injector level.\n *\n * @example\n * ```typescript\n * bootstrapApplication(App, {\n * providers: [\n * provideNotectl({\n * config: { theme: ThemePreset.Light, placeholder: 'Start typing...' },\n * contentFormat: 'json',\n * }),\n * ],\n * });\n * ```\n */\nexport function provideNotectl(options: NotectlProviderOptions = {}): EnvironmentProviders {\n\tconst providers = [];\n\n\tif (options.config) {\n\t\tproviders.push({ provide: NOTECTL_DEFAULT_CONFIG, useValue: options.config });\n\t}\n\n\tif (options.contentFormat) {\n\t\tproviders.push({ provide: NOTECTL_CONTENT_FORMAT, useValue: options.contentFormat });\n\t}\n\n\treturn makeEnvironmentProviders(providers);\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tDestroyRef,\n\ttype ElementRef,\n\ttype ModelSignal,\n\tafterNextRender,\n\tcomputed,\n\teffect,\n\tforwardRef,\n\tinject,\n\tinput,\n\tmodel,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type {\n\tDocument,\n\tEditorSelection,\n\tEditorState,\n\tNotectlEditorConfig,\n\tPaperSize,\n\tPlugin,\n\tPluginConfig,\n\tStateChangeEvent,\n\tTheme,\n\tTransaction,\n} from '@notectl/core';\nimport { NotectlEditor, ThemePreset } from '@notectl/core';\nimport type { Locale } from '@notectl/core';\nimport type { TextFormattingConfig } from '@notectl/core/plugins/text-formatting';\n\nimport { EditorValueController } from './EditorValueController';\nimport { type ContentFormat, NOTECTL_CONTENT_FORMAT, NOTECTL_DEFAULT_CONFIG } from './tokens';\nimport type { NotectlValue, SelectionChangeEvent } from './types';\n\ninterface InitConfigSnapshot {\n\treadonly autofocus: boolean;\n\treadonly features: Partial<TextFormattingConfig> | undefined;\n\treadonly locale: Locale | undefined;\n\treadonly maxHistoryDepth: number | undefined;\n\treadonly plugins: readonly Plugin[];\n\treadonly styleNonce: string | undefined;\n\treadonly toolbar: NotectlEditorConfig['toolbar'];\n}\n\nfunction initConfigEquals(a: InitConfigSnapshot, b: InitConfigSnapshot): boolean {\n\treturn (\n\t\ta.plugins === b.plugins &&\n\t\ta.toolbar === b.toolbar &&\n\t\ta.features === b.features &&\n\t\ta.autofocus === b.autofocus &&\n\t\ta.maxHistoryDepth === b.maxHistoryDepth &&\n\t\ta.locale === b.locale &&\n\t\ta.styleNonce === b.styleNonce\n\t);\n}\n\n@Component({\n\tselector: 'ntl-editor',\n\tstandalone: true,\n\ttemplate: '<div #host></div>',\n\tstyles: ':host { display: block; }',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef(() => NotectlEditorComponent),\n\t\t\tmulti: true,\n\t\t},\n\t],\n\thost: {\n\t\t'[attr.aria-disabled]': 'effectiveReadonly() ? \"true\" : null',\n\t\t'[class.ntl-editor-disabled]': 'effectiveReadonly()',\n\t},\n})\nexport class NotectlEditorComponent implements ControlValueAccessor {\n\tprivate readonly destroyRef: DestroyRef = inject(DestroyRef);\n\tprivate readonly defaultConfig: Partial<NotectlEditorConfig> | null = inject(\n\t\tNOTECTL_DEFAULT_CONFIG,\n\t\t{ optional: true },\n\t);\n\tprivate readonly contentFormat: ContentFormat =\n\t\tinject(NOTECTL_CONTENT_FORMAT, { optional: true }) ?? 'json';\n\n\treadonly plugins = input<readonly Plugin[] | undefined>(undefined);\n\treadonly toolbar = input<NotectlEditorConfig['toolbar']>(undefined);\n\treadonly features = input<Partial<TextFormattingConfig> | undefined>(undefined);\n\treadonly placeholder = input<string | undefined>(undefined);\n\treadonly readonlyMode = input<boolean | undefined>(undefined);\n\treadonly autofocus = input<boolean | undefined>(undefined);\n\treadonly maxHistoryDepth = input<number | undefined>(undefined);\n\treadonly theme = input<ThemePreset | Theme | undefined>(undefined);\n\treadonly paperSize = input<PaperSize | undefined>(undefined);\n\treadonly dir = input<'ltr' | 'rtl' | undefined>(undefined);\n\treadonly locale = input<Locale | undefined>(undefined);\n\treadonly styleNonce = input<string | undefined>(undefined);\n\n\treadonly content: ModelSignal<Document | undefined> = model<Document | undefined>(undefined);\n\n\treadonly stateChange = output<StateChangeEvent>();\n\treadonly selectionChange = output<SelectionChangeEvent>();\n\treadonly editorFocus = output<void>();\n\treadonly editorBlur = output<void>();\n\treadonly ready = output<void>();\n\n\treadonly editorState = signal<EditorState | null>(null);\n\treadonly isEmpty = computed<boolean>(() => {\n\t\tconst state: EditorState | null = this.editorState();\n\t\tif (!state) return true;\n\t\tconst doc: Document = state.doc;\n\t\tif (doc.children.length === 0) return true;\n\t\tif (doc.children.length > 1) return false;\n\t\tconst block = doc.children[0];\n\t\tif (!block) return true;\n\t\treturn block.type === 'paragraph' && block.children.length === 0;\n\t});\n\n\tprivate readonly resolvedPlugins = computed<readonly Plugin[]>(\n\t\t() => this.plugins() ?? this.defaultConfig?.plugins ?? [],\n\t);\n\tprivate readonly resolvedToolbar = computed<NotectlEditorConfig['toolbar']>(\n\t\t() => this.toolbar() ?? this.defaultConfig?.toolbar,\n\t);\n\tprivate readonly resolvedFeatures = computed<Partial<TextFormattingConfig> | undefined>(\n\t\t() => this.features() ?? this.defaultConfig?.features,\n\t);\n\tprivate readonly resolvedPlaceholder = computed<string>(\n\t\t() => this.placeholder() ?? this.defaultConfig?.placeholder ?? 'Start typing...',\n\t);\n\tprivate readonly resolvedReadonlyMode = computed<boolean>(\n\t\t() => this.readonlyMode() ?? this.defaultConfig?.readonly ?? false,\n\t);\n\tprivate readonly resolvedAutofocus = computed<boolean>(\n\t\t() => this.autofocus() ?? this.defaultConfig?.autofocus ?? false,\n\t);\n\tprivate readonly resolvedMaxHistoryDepth = computed<number | undefined>(\n\t\t() => this.maxHistoryDepth() ?? this.defaultConfig?.maxHistoryDepth,\n\t);\n\tprivate readonly resolvedTheme = computed<ThemePreset | Theme>(\n\t\t() => this.theme() ?? this.defaultConfig?.theme ?? ThemePreset.Light,\n\t);\n\tprivate readonly resolvedPaperSize = computed<PaperSize | undefined>(\n\t\t() => this.paperSize() ?? this.defaultConfig?.paperSize,\n\t);\n\tprivate readonly resolvedDir = computed<'ltr' | 'rtl' | undefined>(\n\t\t() => this.dir() ?? this.defaultConfig?.dir,\n\t);\n\tprivate readonly resolvedLocale = computed<Locale | undefined>(\n\t\t() => this.locale() ?? this.defaultConfig?.locale,\n\t);\n\tprivate readonly resolvedStyleNonce = computed<string | undefined>(\n\t\t() => this.styleNonce() ?? this.defaultConfig?.styleNonce,\n\t);\n\n\treadonly effectiveReadonly = computed<boolean>(\n\t\t() => this.disabledByForms() || this.resolvedReadonlyMode(),\n\t);\n\n\tprivate readonly hostRef = viewChild.required<ElementRef<HTMLDivElement>>('host');\n\tprivate readonly initialized = signal(false);\n\tprivate readonly disabledByForms = signal(false);\n\n\tprivate readonly valueController = new EditorValueController({\n\t\temitControlValue: (value: NotectlValue) => this.onChange(value),\n\t\tgetEditor: () => this.editorRef,\n\t\tgetFormat: () => this.contentFormat,\n\t\tupdateContent: (doc: Document) => this.content.set(doc),\n\t\twhenReady: () => this.readyPromise,\n\t});\n\n\tprivate editorRef: NotectlEditor | null = null;\n\tprivate readyResolve: (() => void) | null = null;\n\tprivate readyPromise!: Promise<void>;\n\tprivate lastInitConfig: InitConfigSnapshot | null = null;\n\tprivate queuedInitConfig: InitConfigSnapshot | null = null;\n\tprivate reinitializePromise: Promise<void> | null = null;\n\tprivate pendingInitialDocument: Document | undefined;\n\tprivate onChange: (value: NotectlValue) => void = () => {};\n\tprivate onTouched: () => void = () => {};\n\n\tconstructor() {\n\t\tthis.resetReadyPromise();\n\n\t\tafterNextRender(() => {\n\t\t\tthis.initEditor(this.captureInitConfig());\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\t\tif (!this.initialized() || !editor) return;\n\n\t\t\teditor.setTheme(this.resolvedTheme());\n\t\t\teditor.configure({\n\t\t\t\tdir: this.resolvedDir(),\n\t\t\t\tpaperSize: this.resolvedPaperSize(),\n\t\t\t\tplaceholder: this.resolvedPlaceholder(),\n\t\t\t\treadonly: this.effectiveReadonly(),\n\t\t\t});\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst doc: Document | undefined = this.content();\n\t\t\tif (!doc) return;\n\t\t\tthis.valueController.syncExternalContent(doc);\n\t\t});\n\n\t\teffect(() => {\n\t\t\tthis.scheduleReinitialization(this.captureInitConfig());\n\t\t});\n\n\t\tthis.destroyRef.onDestroy(() => {\n\t\t\tvoid this.destroyEditor();\n\t\t});\n\t}\n\n\tgetJSON(): Document {\n\t\treturn this.requireEditor().getJSON();\n\t}\n\n\tsetJSON(doc: Document): void {\n\t\tvoid this.valueController.setDocument(doc);\n\t}\n\n\tasync getContentHTML(): Promise<string> {\n\t\treturn this.requireEditor().getContentHTML();\n\t}\n\n\tasync setContentHTML(html: string): Promise<void> {\n\t\tawait this.valueController.setSerializedValue(html);\n\t}\n\n\tgetText(): string {\n\t\treturn this.requireEditor().getText();\n\t}\n\n\tsetText(value: string): void {\n\t\tthis.requireEditor().setText(value);\n\t}\n\n\tget commands(): NotectlEditor['commands'] {\n\t\treturn this.requireEditor().commands;\n\t}\n\n\tcan(): ReturnType<NotectlEditor['can']> {\n\t\treturn this.requireEditor().can();\n\t}\n\n\texecuteCommand(name: string): boolean {\n\t\treturn this.editorRef?.executeCommand(name) ?? false;\n\t}\n\n\tconfigurePlugin(pluginId: string, config: PluginConfig): void {\n\t\tthis.editorRef?.configurePlugin(pluginId, config);\n\t}\n\n\tdispatch(tr: Transaction): void {\n\t\tthis.editorRef?.dispatch(tr);\n\t}\n\n\tgetState(): EditorState {\n\t\treturn this.requireEditor().getState();\n\t}\n\n\tsetTheme(theme: ThemePreset | Theme): void {\n\t\tthis.editorRef?.setTheme(theme);\n\t}\n\n\tgetTheme(): ThemePreset | Theme {\n\t\treturn this.editorRef?.getTheme() ?? this.resolvedTheme();\n\t}\n\n\tsetReadonly(readonlyState: boolean): void {\n\t\tthis.editorRef?.configure({ readonly: readonlyState });\n\t}\n\n\twhenReady(): Promise<void> {\n\t\treturn this.readyPromise;\n\t}\n\n\tfocus(options?: FocusOptions): void {\n\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\tif (!editor) return;\n\n\t\tconst focusTarget =\n\t\t\teditor.shadowRoot?.querySelector<HTMLElement>('[contenteditable]') ?? editor;\n\t\tfocusTarget.focus(options);\n\t}\n\n\twriteValue(value: NotectlValue): void {\n\t\tthis.valueController.writeControlValue(value);\n\t}\n\n\tregisterOnChange(fn: (value: NotectlValue) => void): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => void): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabledByForms.set(isDisabled);\n\t}\n\n\tprivate resetReadyPromise(): void {\n\t\tthis.readyPromise = new Promise<void>((resolve) => {\n\t\t\tthis.readyResolve = resolve;\n\t\t});\n\t}\n\n\tprivate initEditor(snapshot: InitConfigSnapshot): void {\n\t\tconst hostElement: HTMLDivElement = this.hostRef().nativeElement;\n\t\tconst editor = new NotectlEditor();\n\t\tthis.editorRef = editor;\n\t\tthis.lastInitConfig = snapshot;\n\t\tthis.valueController.reset();\n\n\t\teditor.on('stateChange', (event: StateChangeEvent) => {\n\t\t\tthis.editorState.set(event.newState);\n\t\t\tthis.valueController.handleEditorStateChange(event.newState.doc);\n\t\t\tthis.stateChange.emit(event);\n\t\t});\n\n\t\teditor.on('selectionChange', (event: { selection: EditorSelection }) => {\n\t\t\tthis.selectionChange.emit(event);\n\t\t});\n\n\t\teditor.on('focus', () => {\n\t\t\tthis.editorFocus.emit();\n\t\t});\n\n\t\teditor.on('blur', () => {\n\t\t\tthis.onTouched();\n\t\t\tthis.editorBlur.emit();\n\t\t});\n\n\t\teditor.on('ready', () => {\n\t\t\tthis.initialized.set(true);\n\t\t\tthis.editorState.set(editor.getState());\n\t\t\tvoid this.applyInitialContent(editor).finally(() => {\n\t\t\t\tthis.readyResolve?.();\n\t\t\t\tthis.ready.emit();\n\t\t\t});\n\t\t});\n\n\t\teditor.init(this.buildConfig());\n\t\thostElement.appendChild(editor);\n\t}\n\n\tprivate async applyInitialContent(editor: NotectlEditor): Promise<void> {\n\t\tconst currentContent: Document | undefined = this.content();\n\t\tconst initialContent = currentContent ?? this.pendingInitialDocument;\n\t\tthis.pendingInitialDocument = undefined;\n\n\t\tif (!initialContent) return;\n\t\tawait this.valueController.applyInitialDocument(editor, initialContent);\n\t}\n\n\tprivate buildConfig(): NotectlEditorConfig {\n\t\tconst config: NotectlEditorConfig = {\n\t\t\t...this.defaultConfig,\n\t\t\tautofocus: this.resolvedAutofocus(),\n\t\t\tdir: this.resolvedDir(),\n\t\t\tlocale: this.resolvedLocale(),\n\t\t\tmaxHistoryDepth: this.resolvedMaxHistoryDepth(),\n\t\t\tpaperSize: this.resolvedPaperSize(),\n\t\t\tplaceholder: this.resolvedPlaceholder(),\n\t\t\tplugins: this.resolvedPlugins(),\n\t\t\treadonly: this.effectiveReadonly(),\n\t\t\tstyleNonce: this.resolvedStyleNonce(),\n\t\t\ttheme: this.resolvedTheme(),\n\t\t};\n\n\t\tconst toolbar = this.resolvedToolbar();\n\t\tif (toolbar !== undefined) {\n\t\t\tconfig.toolbar = toolbar;\n\t\t}\n\n\t\tconst features = this.resolvedFeatures();\n\t\tif (features !== undefined) {\n\t\t\tconfig.features = features;\n\t\t}\n\n\t\treturn config;\n\t}\n\n\tprivate captureInitConfig(): InitConfigSnapshot {\n\t\treturn {\n\t\t\tautofocus: this.resolvedAutofocus(),\n\t\t\tfeatures: this.resolvedFeatures(),\n\t\t\tlocale: this.resolvedLocale(),\n\t\t\tmaxHistoryDepth: this.resolvedMaxHistoryDepth(),\n\t\t\tplugins: this.resolvedPlugins(),\n\t\t\tstyleNonce: this.resolvedStyleNonce(),\n\t\t\ttoolbar: this.resolvedToolbar(),\n\t\t};\n\t}\n\n\tprivate scheduleReinitialization(snapshot: InitConfigSnapshot): void {\n\t\tif (!this.initialized() || !this.lastInitConfig) return;\n\t\tif (initConfigEquals(snapshot, this.lastInitConfig)) return;\n\n\t\tthis.queuedInitConfig = snapshot;\n\t\tif (this.reinitializePromise) return;\n\n\t\tthis.reinitializePromise = (async () => {\n\t\t\twhile (this.queuedInitConfig) {\n\t\t\t\tconst nextSnapshot = this.queuedInitConfig;\n\t\t\t\tthis.queuedInitConfig = null;\n\t\t\t\tthis.pendingInitialDocument = this.editorRef?.getJSON();\n\t\t\t\tthis.resetReadyPromise();\n\t\t\t\tthis.initialized.set(false);\n\t\t\t\tawait this.destroyEditor();\n\t\t\t\tthis.initEditor(nextSnapshot);\n\t\t\t\tawait this.readyPromise;\n\t\t\t}\n\t\t})().finally(() => {\n\t\t\tthis.reinitializePromise = null;\n\t\t});\n\t}\n\n\tprivate async destroyEditor(): Promise<void> {\n\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\tif (!editor) {\n\t\t\tthis.initialized.set(false);\n\t\t\tthis.editorState.set(null);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.editorRef = null;\n\t\teditor.remove();\n\t\tawait editor.destroy();\n\t\tthis.initialized.set(false);\n\t\tthis.editorState.set(null);\n\t}\n\n\tprivate requireEditor(): NotectlEditor {\n\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\tif (!editor || !this.initialized()) {\n\t\t\tthrow new Error('NotectlEditor is not initialized. Await whenReady() first.');\n\t\t}\n\t\treturn editor;\n\t}\n}\n","import { Directive } from '@angular/core';\n\n/**\n * @deprecated Angular Forms support is built into `NotectlEditorComponent`.\n *\n * This directive remains as a compatibility shim so existing imports do not break,\n * but it no longer participates in value accessor registration.\n */\n@Directive({\n\tselector: 'ntl-editor[formControl], ntl-editor[formControlName], ntl-editor[ngModel]',\n\tstandalone: true,\n})\nexport class NotectlValueAccessorDirective {}\n","import { DestroyRef, Injectable, computed, inject, signal } from '@angular/core';\nimport type { EditorState, StateChangeEvent, Transaction } from '@notectl/core';\nimport { type Observable, Subject } from 'rxjs';\n\nimport type { NotectlEditorComponent } from './notectl-editor.component';\n\n/**\n * Optional injectable service for programmatic editor access via DI.\n *\n * Useful when a toolbar or other component needs to interact with\n * the editor without a direct template reference.\n *\n * The service must be provided at a shared injector level and\n * connected to the editor component via `register()`.\n *\n * @example\n * ```typescript\n * @Component({\n * providers: [NotectlEditorService],\n * template: `\n * <app-toolbar />\n * <ntl-editor #editor [plugins]=\"plugins\" />\n * `,\n * })\n * export class EditorPage {\n * private readonly editor = viewChild.required<NotectlEditorComponent>('editor');\n * private readonly service = inject(NotectlEditorService);\n *\n * constructor() {\n * afterNextRender(() => {\n * this.service.register(this.editor());\n * });\n * }\n * }\n * ```\n */\n@Injectable()\nexport class NotectlEditorService {\n\tprivate readonly destroyRef: DestroyRef = inject(DestroyRef);\n\tprivate readonly editorRef = signal<NotectlEditorComponent | null>(null);\n\tprivate readonly stateChangeSubject = new Subject<StateChangeEvent>();\n\n\t/** Whether an editor is currently registered with this service. */\n\treadonly hasEditor = computed<boolean>(() => this.editorRef() !== null);\n\n\t/** Observable stream of state change events from the editor. */\n\treadonly stateChanges$: Observable<StateChangeEvent> = this.stateChangeSubject.asObservable();\n\n\tprivate stateChangeSub: { unsubscribe(): void } | null = null;\n\n\tconstructor() {\n\t\tthis.destroyRef.onDestroy(() => {\n\t\t\tthis.unregister();\n\t\t\tthis.stateChangeSubject.complete();\n\t\t});\n\t}\n\n\t/** Registers an editor component with this service. */\n\tregister(editor: NotectlEditorComponent): void {\n\t\tthis.unregister();\n\t\tthis.editorRef.set(editor);\n\n\t\tthis.stateChangeSub = editor.stateChange.subscribe((event: StateChangeEvent) => {\n\t\t\tthis.stateChangeSubject.next(event);\n\t\t});\n\t}\n\n\t/** Unregisters the current editor from this service. */\n\tunregister(): void {\n\t\tthis.stateChangeSub?.unsubscribe();\n\t\tthis.stateChangeSub = null;\n\t\tthis.editorRef.set(null);\n\t}\n\n\t/** Executes a named command on the registered editor. */\n\texecuteCommand(name: string): boolean {\n\t\tconst editor: NotectlEditorComponent | null = this.editorRef();\n\t\tif (!editor) return false;\n\t\treturn editor.executeCommand(name);\n\t}\n\n\t/** Returns the current editor state, or `null` if no editor is registered. */\n\tgetState(): EditorState | null {\n\t\tconst editor: NotectlEditorComponent | null = this.editorRef();\n\t\tif (!editor) return null;\n\t\ttry {\n\t\t\treturn editor.getState();\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/** Dispatches a transaction on the registered editor. */\n\tdispatch(tr: Transaction): void {\n\t\tthis.editorRef()?.dispatch(tr);\n\t}\n}\n","/**\n * @notectl/angular — Angular integration for the notectl rich text editor.\n * @packageDocumentation\n */\n\n// --- Angular Bindings ---\nexport { NotectlEditorComponent } from './lib/notectl-editor.component';\nexport { NotectlValueAccessorDirective } from './lib/value-accessor.directive';\nexport { NotectlEditorService } from './lib/notectl-editor.service';\n\n// --- Provider Function ---\nexport {\n\tprovideNotectl,\n\ttype NotectlProviderOptions,\n} from './lib/tokens';\n\n// --- Injection Tokens ---\nexport {\n\tNOTECTL_DEFAULT_CONFIG,\n\tNOTECTL_CONTENT_FORMAT,\n\ttype ContentFormat,\n} from './lib/tokens';\n\n// --- Angular-specific Types ---\nexport type { NotectlValue, SelectionChangeEvent } from './lib/types';\n\n// --- Re-exports from @notectl/core (convenience) ---\n\n// Model types\nexport type {\n\tDocument,\n\tBlockNode,\n\tTextNode,\n\tInlineNode,\n\tMark,\n\tBlockAttrs,\n} from '@notectl/core';\n\n// Selection types\nexport type { EditorSelection, Position, Selection } from '@notectl/core';\n\n// State types\nexport type {\n\tEditorState,\n\tTransaction,\n\tTransactionMetadata,\n\tStateChangeEvent,\n} from '@notectl/core';\n\n// Plugin types\nexport type { Plugin, PluginConfig, PluginContext } from '@notectl/core';\n\n// Theme types\nexport type { Theme, PartialTheme, ThemePrimitives } from '@notectl/core';\nexport { ThemePreset, LIGHT_THEME, DARK_THEME, createTheme } from '@notectl/core';\n\n// Editor config\nexport type { NotectlEditorConfig } from '@notectl/core';\n\n// Plugin config types (from sub-path exports)\nexport type { TextFormattingConfig } from '@notectl/core/plugins/text-formatting';\nexport type { FontDefinition } from '@notectl/core/plugins/font';\n\n// Starter fonts\n/** @deprecated Import from '@notectl/core/fonts' instead. */\nexport { STARTER_FONTS } from '@notectl/core/fonts';\n\n// Plugins (tree-shakable re-exports from sub-paths)\nexport { TextFormattingPlugin } from '@notectl/core/plugins/text-formatting';\nexport { HeadingPlugin } from '@notectl/core/plugins/heading';\nexport { ListPlugin } from '@notectl/core/plugins/list';\nexport { LinkPlugin } from '@notectl/core/plugins/link';\nexport { BlockquotePlugin } from '@notectl/core/plugins/blockquote';\nexport { CodeBlockPlugin } from '@notectl/core/plugins/code-block';\nexport { TablePlugin } from '@notectl/core/plugins/table';\nexport { ImagePlugin } from '@notectl/core/plugins/image';\nexport { HorizontalRulePlugin } from '@notectl/core/plugins/horizontal-rule';\nexport { HardBreakPlugin } from '@notectl/core/plugins/hard-break';\nexport { StrikethroughPlugin } from '@notectl/core/plugins/strikethrough';\nexport { HighlightPlugin } from '@notectl/core/plugins/highlight';\nexport { TextColorPlugin } from '@notectl/core/plugins/text-color';\nexport { FontPlugin } from '@notectl/core/plugins/font';\nexport { FontSizePlugin } from '@notectl/core/plugins/font-size';\nexport { AlignmentPlugin } from '@notectl/core/plugins/alignment';\nexport { TextDirectionPlugin } from '@notectl/core/plugins/text-direction';\nexport { BidiIsolationPlugin } from '@notectl/core/plugins/bidi-isolation';\nexport { TextDirectionAutoPlugin } from '@notectl/core/plugins/text-direction-auto';\nexport { SuperSubPlugin } from '@notectl/core/plugins/super-sub';\nexport { ToolbarPlugin } from '@notectl/core/plugins/toolbar';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,UAAU,GAAG,SAAS;AAE5B,SAAS,eAAe,CAAC,KAAmB,EAAA;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;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../src/lib/notectl-editor.component.ts","../../src/lib/value-accessor.directive.ts","../../src/lib/notectl-editor.service.ts","../../src/public-api.ts","../../src/notectl-angular.ts"],"sourcesContent":["import type { Document } from '@notectl/core';\n\nimport type { ContentFormat } from './tokens';\nimport type { NotectlValue } from './types';\n\ninterface EditorContentApi {\n\tgetContentHTML(): Promise<string>;\n\tgetJSON(): Document;\n\tgetText(): string;\n\tsetContentHTML(html: string): Promise<void>;\n\tsetJSON(doc: Document): void;\n\tsetText(value: string): void;\n}\n\nconst EMPTY_HTML = '<p></p>';\n\nfunction isDocumentValue(value: NotectlValue): value is Document {\n\treturn typeof value === 'object' && value !== null;\n}\n\nexport async function readEditorValue(\n\teditor: EditorContentApi,\n\tformat: ContentFormat,\n): Promise<NotectlValue> {\n\tswitch (format) {\n\t\tcase 'html':\n\t\t\treturn editor.getContentHTML();\n\t\tcase 'text':\n\t\t\treturn editor.getText();\n\t\tdefault:\n\t\t\treturn editor.getJSON();\n\t}\n}\n\nexport async function writeEditorValue(\n\teditor: EditorContentApi,\n\tformat: ContentFormat,\n\tvalue: NotectlValue,\n): Promise<void> {\n\tif (value === null || value === '') {\n\t\tawait editor.setContentHTML(EMPTY_HTML);\n\t\treturn;\n\t}\n\n\tif (format === 'json' && isDocumentValue(value)) {\n\t\teditor.setJSON(value);\n\t\treturn;\n\t}\n\n\tif (format === 'text' && typeof value === 'string') {\n\t\t// Routing through `setText` (rather than `setContentHTML('<p>${escaped}</p>')`)\n\t\t// preserves block identity and multi-paragraph structure across signal-form\n\t\t// round-trips, fixing the cursor reset reported in #103 for `contentFormat: 'text'`.\n\t\teditor.setText(value);\n\t\treturn;\n\t}\n\n\tif (typeof value === 'string') {\n\t\tawait editor.setContentHTML(value);\n\t\treturn;\n\t}\n\n\teditor.setJSON(value);\n}\n","import type { Document, NotectlEditor } from '@notectl/core';\n\nimport type { ContentFormat } from './tokens';\nimport type { NotectlValue } from './types';\nimport { readEditorValue, writeEditorValue } from './value-interop';\n\ninterface EditorValueControllerOptions {\n\treadonly getEditor: () => NotectlEditor | null;\n\treadonly getFormat: () => ContentFormat;\n\treadonly whenReady: () => Promise<void>;\n\treadonly updateContent: (doc: Document) => void;\n\treadonly emitControlValue: (value: NotectlValue) => void;\n}\n\nexport class EditorValueController {\n\tprivate readonly options: EditorValueControllerOptions;\n\tprivate lastDocument: Document | undefined;\n\tprivate mutedControlChanges = 0;\n\tprivate serializedReadVersion = 0;\n\tprivate writeQueue: Promise<void> = Promise.resolve();\n\n\tconstructor(options: EditorValueControllerOptions) {\n\t\tthis.options = options;\n\t}\n\n\treset(): void {\n\t\tthis.lastDocument = undefined;\n\t\tthis.serializedReadVersion++;\n\t}\n\n\thandleEditorStateChange(doc: Document): void {\n\t\tthis.lastDocument = doc;\n\t\tthis.options.updateContent(doc);\n\n\t\tif (this.mutedControlChanges > 0) return;\n\n\t\tconst readVersion = ++this.serializedReadVersion;\n\t\tvoid this.readCurrentValue().then((value: NotectlValue) => {\n\t\t\tif (readVersion !== this.serializedReadVersion) return;\n\t\t\tthis.options.emitControlValue(value);\n\t\t});\n\t}\n\n\tsyncExternalContent(doc: Document): void {\n\t\tif (doc === this.lastDocument) return;\n\t\tthis.lastDocument = doc;\n\t\tvoid this.enqueueSilent(async (editor: NotectlEditor) => {\n\t\t\teditor.setJSON(doc);\n\t\t});\n\t}\n\n\twriteControlValue(value: NotectlValue): void {\n\t\tvoid this.enqueueSilent(async (editor: NotectlEditor) => {\n\t\t\tawait writeEditorValue(editor, this.options.getFormat(), value);\n\t\t});\n\t}\n\n\tsetDocument(doc: Document): Promise<void> {\n\t\tthis.lastDocument = doc;\n\t\treturn this.enqueueInteractive(async (editor: NotectlEditor) => {\n\t\t\teditor.setJSON(doc);\n\t\t});\n\t}\n\n\tsetSerializedValue(value: NotectlValue): Promise<void> {\n\t\treturn this.enqueueInteractive(async (editor: NotectlEditor) => {\n\t\t\tawait writeEditorValue(editor, this.options.getFormat(), value);\n\t\t});\n\t}\n\n\tapplyInitialDocument(editor: NotectlEditor, doc: Document): Promise<void> {\n\t\tthis.lastDocument = doc;\n\t\treturn this.runSilent(async () => {\n\t\t\teditor.setJSON(doc);\n\t\t});\n\t}\n\n\tprivate async readCurrentValue(): Promise<NotectlValue> {\n\t\tconst editor: NotectlEditor | null = this.options.getEditor();\n\t\tif (!editor) return null;\n\t\treturn readEditorValue(editor, this.options.getFormat());\n\t}\n\n\tprivate enqueueSilent(task: (editor: NotectlEditor) => Promise<void>): Promise<void> {\n\t\treturn this.enqueue(task, true);\n\t}\n\n\tprivate enqueueInteractive(task: (editor: NotectlEditor) => Promise<void>): Promise<void> {\n\t\treturn this.enqueue(task, false);\n\t}\n\n\tprivate enqueue(task: (editor: NotectlEditor) => Promise<void>, silent: boolean): Promise<void> {\n\t\tconst next = this.writeQueue.then(async () => {\n\t\t\tawait this.options.whenReady();\n\t\t\tconst editor: NotectlEditor | null = this.options.getEditor();\n\t\t\tif (!editor) return;\n\n\t\t\tif (silent) {\n\t\t\t\tawait this.runSilent(() => task(editor));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait task(editor);\n\t\t});\n\n\t\tthis.writeQueue = next.catch(() => undefined);\n\t\treturn next;\n\t}\n\n\tprivate async runSilent(task: () => Promise<void>): Promise<void> {\n\t\tthis.mutedControlChanges++;\n\t\ttry {\n\t\t\tawait task();\n\t\t} finally {\n\t\t\tthis.mutedControlChanges--;\n\t\t}\n\t}\n}\n","import { type EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport type { NotectlEditorConfig } from '@notectl/core';\n\n/**\n * Default configuration applied to all `<notectl-editor>` instances within\n * the injector scope. Component-level inputs override these defaults.\n */\nexport const NOTECTL_DEFAULT_CONFIG: InjectionToken<Partial<NotectlEditorConfig>> =\n\tnew InjectionToken<Partial<NotectlEditorConfig>>('notectl-default-config');\n\n/**\n * Content format used by the `ControlValueAccessor` for forms integration.\n * Determines how editor content is serialized when reading/writing form values.\n *\n * - `'json'` — `Document` objects (default)\n * - `'html'` — sanitized HTML strings\n * - `'text'` — plain text strings\n */\nexport const NOTECTL_CONTENT_FORMAT: InjectionToken<ContentFormat> =\n\tnew InjectionToken<ContentFormat>('notectl-content-format');\n\n/** Supported content serialization formats for forms integration. */\nexport type ContentFormat = 'json' | 'html' | 'text';\n\n/** Options for `provideNotectl()`. */\nexport interface NotectlProviderOptions {\n\t/** Default editor configuration applied to all instances. */\n\treadonly config?: Partial<NotectlEditorConfig>;\n\t/** Content serialization format for forms integration. Defaults to `'json'`. */\n\treadonly contentFormat?: ContentFormat;\n}\n\n/**\n * Configures the notectl editor at the environment injector level.\n *\n * @example\n * ```typescript\n * bootstrapApplication(App, {\n * providers: [\n * provideNotectl({\n * config: { theme: ThemePreset.Light, placeholder: 'Start typing...' },\n * contentFormat: 'json',\n * }),\n * ],\n * });\n * ```\n */\nexport function provideNotectl(options: NotectlProviderOptions = {}): EnvironmentProviders {\n\tconst providers = [];\n\n\tif (options.config) {\n\t\tproviders.push({ provide: NOTECTL_DEFAULT_CONFIG, useValue: options.config });\n\t}\n\n\tif (options.contentFormat) {\n\t\tproviders.push({ provide: NOTECTL_CONTENT_FORMAT, useValue: options.contentFormat });\n\t}\n\n\treturn makeEnvironmentProviders(providers);\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tDestroyRef,\n\ttype ElementRef,\n\ttype ModelSignal,\n\tafterNextRender,\n\tcomputed,\n\teffect,\n\tforwardRef,\n\tinject,\n\tinput,\n\tmodel,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type {\n\tDocument,\n\tEditorSelection,\n\tEditorState,\n\tNotectlEditorConfig,\n\tPaperSize,\n\tPlugin,\n\tPluginConfig,\n\tStateChangeEvent,\n\tTheme,\n\tTransaction,\n} from '@notectl/core';\nimport { NotectlEditor, ThemePreset } from '@notectl/core';\nimport type { Locale } from '@notectl/core';\nimport type { TextFormattingConfig } from '@notectl/core/plugins/text-formatting';\n\nimport { EditorValueController } from './EditorValueController';\nimport { type ContentFormat, NOTECTL_CONTENT_FORMAT, NOTECTL_DEFAULT_CONFIG } from './tokens';\nimport type { NotectlValue, SelectionChangeEvent } from './types';\n\ninterface InitConfigSnapshot {\n\treadonly autofocus: boolean;\n\treadonly features: Partial<TextFormattingConfig> | undefined;\n\treadonly locale: Locale | undefined;\n\treadonly maxHistoryDepth: number | undefined;\n\treadonly plugins: readonly Plugin[];\n\treadonly styleNonce: string | undefined;\n\treadonly toolbar: NotectlEditorConfig['toolbar'];\n}\n\nfunction initConfigEquals(a: InitConfigSnapshot, b: InitConfigSnapshot): boolean {\n\treturn (\n\t\ta.plugins === b.plugins &&\n\t\ta.toolbar === b.toolbar &&\n\t\ta.features === b.features &&\n\t\ta.autofocus === b.autofocus &&\n\t\ta.maxHistoryDepth === b.maxHistoryDepth &&\n\t\ta.locale === b.locale &&\n\t\ta.styleNonce === b.styleNonce\n\t);\n}\n\n/**\n * Sentinel default for the Signal Forms `value` model. Reference identity lets the\n * value-to-editor effect ignore the untouched initial value (so it never clobbers\n * `content` or initial content) while still syncing any document a bound field provides.\n */\nconst EMPTY_FORM_VALUE: Document = { children: [] };\n\n@Component({\n\tselector: 'ntl-editor',\n\tstandalone: true,\n\ttemplate: '<div #host></div>',\n\tstyles: ':host { display: block; }',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef(() => NotectlEditorComponent),\n\t\t\tmulti: true,\n\t\t},\n\t],\n\thost: {\n\t\t'[attr.aria-disabled]': 'effectiveReadonly() ? \"true\" : null',\n\t\t'[class.ntl-editor-disabled]': 'effectiveReadonly()',\n\t},\n})\nexport class NotectlEditorComponent implements ControlValueAccessor {\n\tprivate readonly destroyRef: DestroyRef = inject(DestroyRef);\n\tprivate readonly defaultConfig: Partial<NotectlEditorConfig> | null = inject(\n\t\tNOTECTL_DEFAULT_CONFIG,\n\t\t{ optional: true },\n\t);\n\tprivate readonly contentFormat: ContentFormat =\n\t\tinject(NOTECTL_CONTENT_FORMAT, { optional: true }) ?? 'json';\n\n\treadonly plugins = input<readonly Plugin[] | undefined>(undefined);\n\treadonly toolbar = input<NotectlEditorConfig['toolbar']>(undefined);\n\treadonly features = input<Partial<TextFormattingConfig> | undefined>(undefined);\n\treadonly placeholder = input<string | undefined>(undefined);\n\treadonly readonlyMode = input<boolean | undefined>(undefined);\n\treadonly autofocus = input<boolean | undefined>(undefined);\n\treadonly maxHistoryDepth = input<number | undefined>(undefined);\n\treadonly theme = input<ThemePreset | Theme | undefined>(undefined);\n\treadonly paperSize = input<PaperSize | undefined>(undefined);\n\treadonly dir = input<'ltr' | 'rtl' | undefined>(undefined);\n\treadonly locale = input<Locale | undefined>(undefined);\n\treadonly styleNonce = input<string | undefined>(undefined);\n\n\t/** Disabled status received from a bound Signal Forms field (`FormUiControl.disabled`). */\n\treadonly disabled = input<boolean>(false);\n\n\treadonly content: ModelSignal<Document | undefined> = model<Document | undefined>(undefined);\n\n\t/**\n\t * Signal Forms value model implementing the `FormValueControl<Document>` contract, so the\n\t * editor binds to Angular 22 Signal Forms through the `[formField]` directive. `value` and\n\t * `content` are independent views onto editor state: both are driven from editor state\n\t * changes and both write to the editor when set externally, never to each other.\n\t */\n\treadonly value: ModelSignal<Document> = model<Document>(EMPTY_FORM_VALUE);\n\n\treadonly stateChange = output<StateChangeEvent>();\n\treadonly selectionChange = output<SelectionChangeEvent>();\n\treadonly editorFocus = output<void>();\n\treadonly editorBlur = output<void>();\n\treadonly ready = output<void>();\n\n\t/** Emitted when the editor blurs, so a bound Signal Forms field marks itself touched. */\n\treadonly touch = output<void>();\n\n\treadonly editorState = signal<EditorState | null>(null);\n\treadonly isEmpty = computed<boolean>(() => {\n\t\tconst state: EditorState | null = this.editorState();\n\t\tif (!state) return true;\n\t\tconst doc: Document = state.doc;\n\t\tif (doc.children.length === 0) return true;\n\t\tif (doc.children.length > 1) return false;\n\t\tconst block = doc.children[0];\n\t\tif (!block) return true;\n\t\treturn block.type === 'paragraph' && block.children.length === 0;\n\t});\n\n\tprivate readonly resolvedPlugins = computed<readonly Plugin[]>(\n\t\t() => this.plugins() ?? this.defaultConfig?.plugins ?? [],\n\t);\n\tprivate readonly resolvedToolbar = computed<NotectlEditorConfig['toolbar']>(\n\t\t() => this.toolbar() ?? this.defaultConfig?.toolbar,\n\t);\n\tprivate readonly resolvedFeatures = computed<Partial<TextFormattingConfig> | undefined>(\n\t\t() => this.features() ?? this.defaultConfig?.features,\n\t);\n\tprivate readonly resolvedPlaceholder = computed<string>(\n\t\t() => this.placeholder() ?? this.defaultConfig?.placeholder ?? 'Start typing...',\n\t);\n\tprivate readonly resolvedReadonlyMode = computed<boolean>(\n\t\t() => this.readonlyMode() ?? this.defaultConfig?.readonly ?? false,\n\t);\n\tprivate readonly resolvedAutofocus = computed<boolean>(\n\t\t() => this.autofocus() ?? this.defaultConfig?.autofocus ?? false,\n\t);\n\tprivate readonly resolvedMaxHistoryDepth = computed<number | undefined>(\n\t\t() => this.maxHistoryDepth() ?? this.defaultConfig?.maxHistoryDepth,\n\t);\n\tprivate readonly resolvedTheme = computed<ThemePreset | Theme>(\n\t\t() => this.theme() ?? this.defaultConfig?.theme ?? ThemePreset.Light,\n\t);\n\tprivate readonly resolvedPaperSize = computed<PaperSize | undefined>(\n\t\t() => this.paperSize() ?? this.defaultConfig?.paperSize,\n\t);\n\tprivate readonly resolvedDir = computed<'ltr' | 'rtl' | undefined>(\n\t\t() => this.dir() ?? this.defaultConfig?.dir,\n\t);\n\tprivate readonly resolvedLocale = computed<Locale | undefined>(\n\t\t() => this.locale() ?? this.defaultConfig?.locale,\n\t);\n\tprivate readonly resolvedStyleNonce = computed<string | undefined>(\n\t\t() => this.styleNonce() ?? this.defaultConfig?.styleNonce,\n\t);\n\n\treadonly effectiveReadonly = computed<boolean>(\n\t\t() => this.disabledByForms() || this.disabled() || this.resolvedReadonlyMode(),\n\t);\n\n\tprivate readonly hostRef = viewChild.required<ElementRef<HTMLDivElement>>('host');\n\tprivate readonly initialized = signal(false);\n\tprivate readonly disabledByForms = signal(false);\n\n\tprivate readonly valueController = new EditorValueController({\n\t\temitControlValue: (value: NotectlValue) => this.onChange(value),\n\t\tgetEditor: () => this.editorRef,\n\t\tgetFormat: () => this.contentFormat,\n\t\tupdateContent: (doc: Document) => {\n\t\t\tthis.content.set(doc);\n\t\t\tthis.value.set(doc);\n\t\t},\n\t\twhenReady: () => this.readyPromise,\n\t});\n\n\tprivate editorRef: NotectlEditor | null = null;\n\tprivate readyResolve: (() => void) | null = null;\n\tprivate readyPromise!: Promise<void>;\n\tprivate lastInitConfig: InitConfigSnapshot | null = null;\n\tprivate queuedInitConfig: InitConfigSnapshot | null = null;\n\tprivate reinitializePromise: Promise<void> | null = null;\n\tprivate pendingInitialDocument: Document | undefined;\n\tprivate onChange: (value: NotectlValue) => void = () => {};\n\tprivate onTouched: () => void = () => {};\n\n\tconstructor() {\n\t\tthis.resetReadyPromise();\n\n\t\tafterNextRender(() => {\n\t\t\tthis.initEditor(this.captureInitConfig());\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\t\tif (!this.initialized() || !editor) return;\n\n\t\t\teditor.setTheme(this.resolvedTheme());\n\t\t\teditor.configure({\n\t\t\t\tdir: this.resolvedDir(),\n\t\t\t\tpaperSize: this.resolvedPaperSize(),\n\t\t\t\tplaceholder: this.resolvedPlaceholder(),\n\t\t\t\treadonly: this.effectiveReadonly(),\n\t\t\t});\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst doc: Document | undefined = this.content();\n\t\t\tif (!doc) return;\n\t\t\tthis.valueController.syncExternalContent(doc);\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst doc: Document = this.value();\n\t\t\tif (doc === EMPTY_FORM_VALUE) return;\n\t\t\tthis.valueController.syncExternalContent(doc);\n\t\t});\n\n\t\teffect(() => {\n\t\t\tthis.scheduleReinitialization(this.captureInitConfig());\n\t\t});\n\n\t\tthis.destroyRef.onDestroy(() => {\n\t\t\tvoid this.destroyEditor();\n\t\t});\n\t}\n\n\tgetJSON(): Document {\n\t\treturn this.requireEditor().getJSON();\n\t}\n\n\tsetJSON(doc: Document): void {\n\t\tvoid this.valueController.setDocument(doc);\n\t}\n\n\tasync getContentHTML(): Promise<string> {\n\t\treturn this.requireEditor().getContentHTML();\n\t}\n\n\tasync setContentHTML(html: string): Promise<void> {\n\t\tawait this.valueController.setSerializedValue(html);\n\t}\n\n\tgetText(): string {\n\t\treturn this.requireEditor().getText();\n\t}\n\n\tsetText(value: string): void {\n\t\tthis.requireEditor().setText(value);\n\t}\n\n\tget commands(): NotectlEditor['commands'] {\n\t\treturn this.requireEditor().commands;\n\t}\n\n\tcan(): ReturnType<NotectlEditor['can']> {\n\t\treturn this.requireEditor().can();\n\t}\n\n\texecuteCommand(name: string): boolean {\n\t\treturn this.editorRef?.executeCommand(name) ?? false;\n\t}\n\n\tconfigurePlugin(pluginId: string, config: PluginConfig): void {\n\t\tthis.editorRef?.configurePlugin(pluginId, config);\n\t}\n\n\tdispatch(tr: Transaction): void {\n\t\tthis.editorRef?.dispatch(tr);\n\t}\n\n\tgetState(): EditorState {\n\t\treturn this.requireEditor().getState();\n\t}\n\n\tsetTheme(theme: ThemePreset | Theme): void {\n\t\tthis.editorRef?.setTheme(theme);\n\t}\n\n\tgetTheme(): ThemePreset | Theme {\n\t\treturn this.editorRef?.getTheme() ?? this.resolvedTheme();\n\t}\n\n\tsetReadonly(readonlyState: boolean): void {\n\t\tthis.editorRef?.configure({ readonly: readonlyState });\n\t}\n\n\twhenReady(): Promise<void> {\n\t\treturn this.readyPromise;\n\t}\n\n\tfocus(options?: FocusOptions): void {\n\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\tif (!editor) return;\n\n\t\tconst focusTarget =\n\t\t\teditor.shadowRoot?.querySelector<HTMLElement>('[contenteditable]') ?? editor;\n\t\tfocusTarget.focus(options);\n\t}\n\n\twriteValue(value: NotectlValue): void {\n\t\tthis.valueController.writeControlValue(value);\n\t}\n\n\tregisterOnChange(fn: (value: NotectlValue) => void): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => void): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabledByForms.set(isDisabled);\n\t}\n\n\tprivate resetReadyPromise(): void {\n\t\tthis.readyPromise = new Promise<void>((resolve) => {\n\t\t\tthis.readyResolve = resolve;\n\t\t});\n\t}\n\n\tprivate initEditor(snapshot: InitConfigSnapshot): void {\n\t\tconst hostElement: HTMLDivElement = this.hostRef().nativeElement;\n\t\tconst editor = new NotectlEditor();\n\t\tthis.editorRef = editor;\n\t\tthis.lastInitConfig = snapshot;\n\t\tthis.valueController.reset();\n\n\t\teditor.on('stateChange', (event: StateChangeEvent) => {\n\t\t\tthis.editorState.set(event.newState);\n\t\t\tthis.valueController.handleEditorStateChange(event.newState.doc);\n\t\t\tthis.stateChange.emit(event);\n\t\t});\n\n\t\teditor.on('selectionChange', (event: { selection: EditorSelection }) => {\n\t\t\tthis.selectionChange.emit(event);\n\t\t});\n\n\t\teditor.on('focus', () => {\n\t\t\tthis.editorFocus.emit();\n\t\t});\n\n\t\teditor.on('blur', () => {\n\t\t\t// Only blurs after the editor is initialized mark the form field touched; any blur\n\t\t\t// emitted while the editor is still setting up is not a user interaction.\n\t\t\tif (this.initialized()) {\n\t\t\t\tthis.onTouched();\n\t\t\t\tthis.touch.emit();\n\t\t\t}\n\t\t\tthis.editorBlur.emit();\n\t\t});\n\n\t\teditor.on('ready', () => {\n\t\t\tthis.initialized.set(true);\n\t\t\tthis.editorState.set(editor.getState());\n\t\t\tvoid this.applyInitialContent(editor).finally(() => {\n\t\t\t\tthis.readyResolve?.();\n\t\t\t\tthis.ready.emit();\n\t\t\t});\n\t\t});\n\n\t\teditor.init(this.buildConfig());\n\t\thostElement.appendChild(editor);\n\t}\n\n\tprivate async applyInitialContent(editor: NotectlEditor): Promise<void> {\n\t\tconst currentContent: Document | undefined = this.content();\n\t\tconst initialContent = currentContent ?? this.pendingInitialDocument;\n\t\tthis.pendingInitialDocument = undefined;\n\n\t\tif (!initialContent) return;\n\t\tawait this.valueController.applyInitialDocument(editor, initialContent);\n\t}\n\n\tprivate buildConfig(): NotectlEditorConfig {\n\t\tconst config: NotectlEditorConfig = {\n\t\t\t...this.defaultConfig,\n\t\t\tautofocus: this.resolvedAutofocus(),\n\t\t\tdir: this.resolvedDir(),\n\t\t\tlocale: this.resolvedLocale(),\n\t\t\tmaxHistoryDepth: this.resolvedMaxHistoryDepth(),\n\t\t\tpaperSize: this.resolvedPaperSize(),\n\t\t\tplaceholder: this.resolvedPlaceholder(),\n\t\t\tplugins: this.resolvedPlugins(),\n\t\t\treadonly: this.effectiveReadonly(),\n\t\t\tstyleNonce: this.resolvedStyleNonce(),\n\t\t\ttheme: this.resolvedTheme(),\n\t\t};\n\n\t\tconst toolbar = this.resolvedToolbar();\n\t\tif (toolbar !== undefined) {\n\t\t\tconfig.toolbar = toolbar;\n\t\t}\n\n\t\tconst features = this.resolvedFeatures();\n\t\tif (features !== undefined) {\n\t\t\tconfig.features = features;\n\t\t}\n\n\t\treturn config;\n\t}\n\n\tprivate captureInitConfig(): InitConfigSnapshot {\n\t\treturn {\n\t\t\tautofocus: this.resolvedAutofocus(),\n\t\t\tfeatures: this.resolvedFeatures(),\n\t\t\tlocale: this.resolvedLocale(),\n\t\t\tmaxHistoryDepth: this.resolvedMaxHistoryDepth(),\n\t\t\tplugins: this.resolvedPlugins(),\n\t\t\tstyleNonce: this.resolvedStyleNonce(),\n\t\t\ttoolbar: this.resolvedToolbar(),\n\t\t};\n\t}\n\n\tprivate scheduleReinitialization(snapshot: InitConfigSnapshot): void {\n\t\tif (!this.initialized() || !this.lastInitConfig) return;\n\t\tif (initConfigEquals(snapshot, this.lastInitConfig)) return;\n\n\t\tthis.queuedInitConfig = snapshot;\n\t\tif (this.reinitializePromise) return;\n\n\t\tthis.reinitializePromise = (async () => {\n\t\t\twhile (this.queuedInitConfig) {\n\t\t\t\tconst nextSnapshot = this.queuedInitConfig;\n\t\t\t\tthis.queuedInitConfig = null;\n\t\t\t\tthis.pendingInitialDocument = this.editorRef?.getJSON();\n\t\t\t\tthis.resetReadyPromise();\n\t\t\t\tthis.initialized.set(false);\n\t\t\t\tawait this.destroyEditor();\n\t\t\t\tthis.initEditor(nextSnapshot);\n\t\t\t\tawait this.readyPromise;\n\t\t\t}\n\t\t})().finally(() => {\n\t\t\tthis.reinitializePromise = null;\n\t\t});\n\t}\n\n\tprivate async destroyEditor(): Promise<void> {\n\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\tif (!editor) {\n\t\t\tthis.initialized.set(false);\n\t\t\tthis.editorState.set(null);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.editorRef = null;\n\t\teditor.remove();\n\t\tawait editor.destroy();\n\t\tthis.initialized.set(false);\n\t\tthis.editorState.set(null);\n\t}\n\n\tprivate requireEditor(): NotectlEditor {\n\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\tif (!editor || !this.initialized()) {\n\t\t\tthrow new Error('NotectlEditor is not initialized. Await whenReady() first.');\n\t\t}\n\t\treturn editor;\n\t}\n}\n","import { Directive } from '@angular/core';\n\n/**\n * @deprecated Angular Forms support is built into `NotectlEditorComponent`.\n *\n * This directive remains as a compatibility shim so existing imports do not break,\n * but it no longer participates in value accessor registration.\n */\n@Directive({\n\tselector: 'ntl-editor[formControl], ntl-editor[formControlName], ntl-editor[ngModel]',\n\tstandalone: true,\n})\nexport class NotectlValueAccessorDirective {}\n","import { DestroyRef, Injectable, computed, inject, signal } from '@angular/core';\nimport type { EditorState, StateChangeEvent, Transaction } from '@notectl/core';\nimport { type Observable, Subject } from 'rxjs';\n\nimport type { NotectlEditorComponent } from './notectl-editor.component';\n\n/**\n * Optional injectable service for programmatic editor access via DI.\n *\n * Useful when a toolbar or other component needs to interact with\n * the editor without a direct template reference.\n *\n * The service must be provided at a shared injector level and\n * connected to the editor component via `register()`.\n *\n * @example\n * ```typescript\n * @Component({\n * providers: [NotectlEditorService],\n * template: `\n * <app-toolbar />\n * <ntl-editor #editor [plugins]=\"plugins\" />\n * `,\n * })\n * export class EditorPage {\n * private readonly editor = viewChild.required<NotectlEditorComponent>('editor');\n * private readonly service = inject(NotectlEditorService);\n *\n * constructor() {\n * afterNextRender(() => {\n * this.service.register(this.editor());\n * });\n * }\n * }\n * ```\n */\n@Injectable()\nexport class NotectlEditorService {\n\tprivate readonly destroyRef: DestroyRef = inject(DestroyRef);\n\tprivate readonly editorRef = signal<NotectlEditorComponent | null>(null);\n\tprivate readonly stateChangeSubject = new Subject<StateChangeEvent>();\n\n\t/** Whether an editor is currently registered with this service. */\n\treadonly hasEditor = computed<boolean>(() => this.editorRef() !== null);\n\n\t/** Observable stream of state change events from the editor. */\n\treadonly stateChanges$: Observable<StateChangeEvent> = this.stateChangeSubject.asObservable();\n\n\tprivate stateChangeSub: { unsubscribe(): void } | null = null;\n\n\tconstructor() {\n\t\tthis.destroyRef.onDestroy(() => {\n\t\t\tthis.unregister();\n\t\t\tthis.stateChangeSubject.complete();\n\t\t});\n\t}\n\n\t/** Registers an editor component with this service. */\n\tregister(editor: NotectlEditorComponent): void {\n\t\tthis.unregister();\n\t\tthis.editorRef.set(editor);\n\n\t\tthis.stateChangeSub = editor.stateChange.subscribe((event: StateChangeEvent) => {\n\t\t\tthis.stateChangeSubject.next(event);\n\t\t});\n\t}\n\n\t/** Unregisters the current editor from this service. */\n\tunregister(): void {\n\t\tthis.stateChangeSub?.unsubscribe();\n\t\tthis.stateChangeSub = null;\n\t\tthis.editorRef.set(null);\n\t}\n\n\t/** Executes a named command on the registered editor. */\n\texecuteCommand(name: string): boolean {\n\t\tconst editor: NotectlEditorComponent | null = this.editorRef();\n\t\tif (!editor) return false;\n\t\treturn editor.executeCommand(name);\n\t}\n\n\t/** Returns the current editor state, or `null` if no editor is registered. */\n\tgetState(): EditorState | null {\n\t\tconst editor: NotectlEditorComponent | null = this.editorRef();\n\t\tif (!editor) return null;\n\t\ttry {\n\t\t\treturn editor.getState();\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/** Dispatches a transaction on the registered editor. */\n\tdispatch(tr: Transaction): void {\n\t\tthis.editorRef()?.dispatch(tr);\n\t}\n}\n","/**\n * @notectl/angular — Angular integration for the notectl rich text editor.\n * @packageDocumentation\n */\n\n// --- Angular Bindings ---\nexport { NotectlEditorComponent } from './lib/notectl-editor.component';\nexport { NotectlValueAccessorDirective } from './lib/value-accessor.directive';\nexport { NotectlEditorService } from './lib/notectl-editor.service';\n\n// --- Provider Function ---\nexport {\n\tprovideNotectl,\n\ttype NotectlProviderOptions,\n} from './lib/tokens';\n\n// --- Injection Tokens ---\nexport {\n\tNOTECTL_DEFAULT_CONFIG,\n\tNOTECTL_CONTENT_FORMAT,\n\ttype ContentFormat,\n} from './lib/tokens';\n\n// --- Angular-specific Types ---\nexport type { NotectlValue, SelectionChangeEvent } from './lib/types';\n\n// --- Re-exports from @notectl/core (convenience) ---\n\n// Model types\nexport type {\n\tDocument,\n\tBlockNode,\n\tTextNode,\n\tInlineNode,\n\tMark,\n\tBlockAttrs,\n} from '@notectl/core';\n\n// Selection types\nexport type { EditorSelection, Position, Selection } from '@notectl/core';\n\n// State types\nexport type {\n\tEditorState,\n\tTransaction,\n\tTransactionMetadata,\n\tStateChangeEvent,\n} from '@notectl/core';\n\n// Plugin types\nexport type { Plugin, PluginConfig, PluginContext } from '@notectl/core';\n\n// Theme types\nexport type { Theme, PartialTheme, ThemePrimitives } from '@notectl/core';\nexport { ThemePreset, LIGHT_THEME, DARK_THEME, createTheme } from '@notectl/core';\n\n// Editor config\nexport type { NotectlEditorConfig } from '@notectl/core';\n\n// Plugin config types (from sub-path exports)\nexport type { TextFormattingConfig } from '@notectl/core/plugins/text-formatting';\nexport type { FontDefinition } from '@notectl/core/plugins/font';\n\n// Starter fonts\n/** @deprecated Import from '@notectl/core/fonts' instead. */\nexport { STARTER_FONTS } from '@notectl/core/fonts';\n\n// Plugins (tree-shakable re-exports from sub-paths)\nexport { TextFormattingPlugin } from '@notectl/core/plugins/text-formatting';\nexport { HeadingPlugin } from '@notectl/core/plugins/heading';\nexport { ListPlugin } from '@notectl/core/plugins/list';\nexport { LinkPlugin } from '@notectl/core/plugins/link';\nexport { BlockquotePlugin } from '@notectl/core/plugins/blockquote';\nexport { CodeBlockPlugin } from '@notectl/core/plugins/code-block';\nexport { TablePlugin } from '@notectl/core/plugins/table';\nexport { ImagePlugin } from '@notectl/core/plugins/image';\nexport { HorizontalRulePlugin } from '@notectl/core/plugins/horizontal-rule';\nexport { HardBreakPlugin } from '@notectl/core/plugins/hard-break';\nexport { StrikethroughPlugin } from '@notectl/core/plugins/strikethrough';\nexport { HighlightPlugin } from '@notectl/core/plugins/highlight';\nexport { TextColorPlugin } from '@notectl/core/plugins/text-color';\nexport { FontPlugin } from '@notectl/core/plugins/font';\nexport { FontSizePlugin } from '@notectl/core/plugins/font-size';\nexport { AlignmentPlugin } from '@notectl/core/plugins/alignment';\nexport { TextDirectionPlugin } from '@notectl/core/plugins/text-direction';\nexport { BidiIsolationPlugin } from '@notectl/core/plugins/bidi-isolation';\nexport { TextDirectionAutoPlugin } from '@notectl/core/plugins/text-direction-auto';\nexport { SuperSubPlugin } from '@notectl/core/plugins/super-sub';\nexport { ToolbarPlugin } from '@notectl/core/plugins/toolbar';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,UAAU,GAAG,SAAS;AAE5B,SAAS,eAAe,CAAC,KAAmB,EAAA;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;AACnD;AAEO,eAAe,eAAe,CACpC,MAAwB,EACxB,MAAqB,EA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AAO,KAAK;AACzB,QAAA,OAAO,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC;IACnC;;IAGA,QAAQ,GAAA;AACP,QAAA,MAAM,MAAM,GAAkC,IAAI,CAAC,SAAS,EAAE;AAC9D,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,IAAI;AACxB,QAAA,IAAI;AACH,YAAA,OAAO,MAAM,CAAC,QAAQ,EAAE;QACzB;AAAE,QAAA,MAAM;AACP,YAAA,OAAO,IAAI;QACZ;IACD;;AAGA,IAAA,QAAQ,CAAC,EAAe,EAAA;QACvB,IAAI,CAAC,SAAS,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC;IAC/B;uGA1DY,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAApB,oBAAoB,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC;;;ACpCD;;;AAGG;AAEH;;ACLA;;AAEG;;;;"}
@@ -40,25 +40,36 @@ declare class NotectlEditorComponent implements ControlValueAccessor {
40
40
  private readonly destroyRef;
41
41
  private readonly defaultConfig;
42
42
  private readonly contentFormat;
43
- readonly plugins: _angular_core.InputSignal<readonly Plugin<Record<string, unknown>>[]>;
44
- readonly toolbar: _angular_core.InputSignal<readonly (readonly Plugin<Record<string, unknown>>[])[] | _notectl_core.ToolbarConfig>;
45
- readonly features: _angular_core.InputSignal<Partial<TextFormattingConfig>>;
46
- readonly placeholder: _angular_core.InputSignal<string>;
47
- readonly readonlyMode: _angular_core.InputSignal<boolean>;
48
- readonly autofocus: _angular_core.InputSignal<boolean>;
49
- readonly maxHistoryDepth: _angular_core.InputSignal<number>;
50
- readonly theme: _angular_core.InputSignal<ThemePreset | Theme>;
51
- readonly paperSize: _angular_core.InputSignal<PaperSize>;
52
- readonly dir: _angular_core.InputSignal<"ltr" | "rtl">;
53
- readonly locale: _angular_core.InputSignal<Locale>;
54
- readonly styleNonce: _angular_core.InputSignal<string>;
43
+ readonly plugins: _angular_core.InputSignal<readonly Plugin<Record<string, unknown>>[] | undefined>;
44
+ readonly toolbar: _angular_core.InputSignal<readonly (readonly Plugin<Record<string, unknown>>[])[] | _notectl_core.ToolbarConfig | undefined>;
45
+ readonly features: _angular_core.InputSignal<Partial<TextFormattingConfig> | undefined>;
46
+ readonly placeholder: _angular_core.InputSignal<string | undefined>;
47
+ readonly readonlyMode: _angular_core.InputSignal<boolean | undefined>;
48
+ readonly autofocus: _angular_core.InputSignal<boolean | undefined>;
49
+ readonly maxHistoryDepth: _angular_core.InputSignal<number | undefined>;
50
+ readonly theme: _angular_core.InputSignal<ThemePreset | Theme | undefined>;
51
+ readonly paperSize: _angular_core.InputSignal<PaperSize | undefined>;
52
+ readonly dir: _angular_core.InputSignal<"ltr" | "rtl" | undefined>;
53
+ readonly locale: _angular_core.InputSignal<Locale | undefined>;
54
+ readonly styleNonce: _angular_core.InputSignal<string | undefined>;
55
+ /** Disabled status received from a bound Signal Forms field (`FormUiControl.disabled`). */
56
+ readonly disabled: _angular_core.InputSignal<boolean>;
55
57
  readonly content: ModelSignal<Document | undefined>;
58
+ /**
59
+ * Signal Forms value model implementing the `FormValueControl<Document>` contract, so the
60
+ * editor binds to Angular 22 Signal Forms through the `[formField]` directive. `value` and
61
+ * `content` are independent views onto editor state: both are driven from editor state
62
+ * changes and both write to the editor when set externally, never to each other.
63
+ */
64
+ readonly value: ModelSignal<Document>;
56
65
  readonly stateChange: _angular_core.OutputEmitterRef<StateChangeEvent>;
57
66
  readonly selectionChange: _angular_core.OutputEmitterRef<SelectionChangeEvent>;
58
67
  readonly editorFocus: _angular_core.OutputEmitterRef<void>;
59
68
  readonly editorBlur: _angular_core.OutputEmitterRef<void>;
60
69
  readonly ready: _angular_core.OutputEmitterRef<void>;
61
- readonly editorState: _angular_core.WritableSignal<EditorState>;
70
+ /** Emitted when the editor blurs, so a bound Signal Forms field marks itself touched. */
71
+ readonly touch: _angular_core.OutputEmitterRef<void>;
72
+ readonly editorState: _angular_core.WritableSignal<EditorState | null>;
62
73
  readonly isEmpty: _angular_core.Signal<boolean>;
63
74
  private readonly resolvedPlugins;
64
75
  private readonly resolvedToolbar;
@@ -117,7 +128,7 @@ declare class NotectlEditorComponent implements ControlValueAccessor {
117
128
  private destroyEditor;
118
129
  private requireEditor;
119
130
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NotectlEditorComponent, never>;
120
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NotectlEditorComponent, "ntl-editor", never, { "plugins": { "alias": "plugins"; "required": false; "isSignal": true; }; "toolbar": { "alias": "toolbar"; "required": false; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonlyMode": { "alias": "readonlyMode"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "maxHistoryDepth": { "alias": "maxHistoryDepth"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "paperSize": { "alias": "paperSize"; "required": false; "isSignal": true; }; "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "styleNonce": { "alias": "styleNonce"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; }, { "content": "contentChange"; "stateChange": "stateChange"; "selectionChange": "selectionChange"; "editorFocus": "editorFocus"; "editorBlur": "editorBlur"; "ready": "ready"; }, never, never, true, never>;
131
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NotectlEditorComponent, "ntl-editor", never, { "plugins": { "alias": "plugins"; "required": false; "isSignal": true; }; "toolbar": { "alias": "toolbar"; "required": false; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonlyMode": { "alias": "readonlyMode"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "maxHistoryDepth": { "alias": "maxHistoryDepth"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "paperSize": { "alias": "paperSize"; "required": false; "isSignal": true; }; "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "styleNonce": { "alias": "styleNonce"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "content": "contentChange"; "value": "valueChange"; "stateChange": "stateChange"; "selectionChange": "selectionChange"; "editorFocus": "editorFocus"; "editorBlur": "editorBlur"; "ready": "ready"; "touch": "touch"; }, never, never, true, never>;
121
132
  }
122
133
 
123
134
  /**
package/package.json CHANGED
@@ -1,62 +1,65 @@
1
1
  {
2
- "name": "@notectl/angular",
3
- "version": "2.1.3",
4
- "description": "Angular integration for the notectl rich text editor. Provides a standalone component, reactive forms support, and DI service.",
5
- "license": "MIT",
6
- "type": "module",
7
- "main": "./dist/fesm2022/notectl-angular.mjs",
8
- "module": "./dist/fesm2022/notectl-angular.mjs",
9
- "types": "./dist/types/notectl-angular.d.ts",
10
- "typings": "./dist/types/notectl-angular.d.ts",
11
- "sideEffects": false,
12
- "files": ["dist", "README.md", "LICENSE"],
13
- "keywords": [
14
- "angular",
15
- "rich-text-editor",
16
- "notectl",
17
- "web-component",
18
- "editor",
19
- "wysiwyg",
20
- "reactive-forms",
21
- "signals"
22
- ],
23
- "repository": {
24
- "type": "git",
25
- "url": "https://github.com/Samyssmile/notectl.git",
26
- "directory": "packages/angular"
27
- },
28
- "homepage": "https://github.com/Samyssmile/notectl",
29
- "bugs": {
30
- "url": "https://github.com/Samyssmile/notectl/issues"
31
- },
32
- "scripts": {
33
- "build": "ng-packagr -p ng-package.json",
34
- "prepack": "cp ../../README.md ./README.md && cp ../../LICENSE ./LICENSE",
35
- "postpack": "rm -f ./README.md ./LICENSE",
36
- "test": "vitest run",
37
- "test:watch": "vitest",
38
- "typecheck": "tsc --noEmit"
39
- },
40
- "dependencies": {
41
- "tslib": "^2.8.1"
42
- },
43
- "peerDependencies": {
44
- "@angular/core": ">=21.0.0",
45
- "@angular/forms": ">=21.0.0",
46
- "@notectl/core": "^2.1.3",
47
- "rxjs": ">=7.0.0"
48
- },
49
- "devDependencies": {
50
- "@angular/compiler": "^21.2.6",
51
- "@angular/compiler-cli": "^21.2.6",
52
- "@angular/core": "^21.2.6",
53
- "@angular/forms": "^21.2.6",
54
- "@angular/platform-browser": "^21.2.6",
55
- "@angular/platform-browser-dynamic": "^21.2.6",
56
- "@notectl/core": "workspace:*",
57
- "ng-packagr": "^21.2.1",
58
- "rxjs": "~7.8.2",
59
- "vite": "^8.0.8",
60
- "vitest": "^4.1.2"
61
- }
62
- }
2
+ "name": "@notectl/angular",
3
+ "version": "2.2.2",
4
+ "description": "Angular integration for the notectl rich text editor. Provides a standalone component, reactive forms support, and DI service.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/fesm2022/notectl-angular.mjs",
8
+ "module": "./dist/fesm2022/notectl-angular.mjs",
9
+ "types": "./dist/types/notectl-angular.d.ts",
10
+ "typings": "./dist/types/notectl-angular.d.ts",
11
+ "sideEffects": false,
12
+ "files": [
13
+ "dist",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "keywords": [
18
+ "angular",
19
+ "rich-text-editor",
20
+ "notectl",
21
+ "web-component",
22
+ "editor",
23
+ "wysiwyg",
24
+ "reactive-forms",
25
+ "signals"
26
+ ],
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/Samyssmile/notectl.git",
30
+ "directory": "packages/angular"
31
+ },
32
+ "homepage": "https://github.com/Samyssmile/notectl",
33
+ "bugs": {
34
+ "url": "https://github.com/Samyssmile/notectl/issues"
35
+ },
36
+ "dependencies": {
37
+ "tslib": "^2.8.1"
38
+ },
39
+ "peerDependencies": {
40
+ "@angular/core": ">=21.0.0",
41
+ "@angular/forms": ">=21.0.0",
42
+ "@notectl/core": "^2.2.2",
43
+ "rxjs": ">=7.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "@angular/compiler": "^22.0.1",
47
+ "@angular/compiler-cli": "^22.0.0",
48
+ "@angular/core": "^22.0.1",
49
+ "@angular/forms": "^22.0.0",
50
+ "@angular/platform-browser": "^22.0.0",
51
+ "@angular/platform-browser-dynamic": "^22.0.0",
52
+ "ng-packagr": "^22.0.0",
53
+ "rxjs": "~7.8.2",
54
+ "typescript": "^6.0.0",
55
+ "vite": "^8.0.16",
56
+ "vitest": "^4.1.2",
57
+ "@notectl/core": "2.2.2"
58
+ },
59
+ "scripts": {
60
+ "build": "ng-packagr -p ng-package.json",
61
+ "test": "vitest run",
62
+ "test:watch": "vitest",
63
+ "typecheck": "tsc --noEmit"
64
+ }
65
+ }