@notectl/angular 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"notectl-angular.mjs","sources":["../../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 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\tinject,\n\tinput,\n\tmodel,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport type {\n\tDocument,\n\tEditorSelection,\n\tEditorState,\n\tNotectlEditorConfig,\n\tPlugin,\n\tPluginConfig,\n\tStateChangeEvent,\n\tTheme,\n\tTransaction,\n} from '@notectl/core';\nimport { NotectlEditor, ThemePreset } from '@notectl/core';\nimport type { TextFormattingConfig } from '@notectl/core/plugins/text-formatting';\n\nimport { NOTECTL_DEFAULT_CONFIG } from './tokens';\nimport type { SelectionChangeEvent } from './types';\n\n/**\n * Angular standalone component wrapping the `<ntl-editor>` Web Component.\n *\n * Uses `afterNextRender()` for SSR-safe initialization and `effect()` for\n * reactive input tracking — no lifecycle interfaces needed.\n *\n * @example\n * ```html\n * <!-- Basic usage -->\n * <ntl-editor [toolbar]=\"toolbar\" [plugins]=\"plugins\" />\n *\n * <!-- Two-way content binding -->\n * <ntl-editor [(content)]=\"myDocument\" [toolbar]=\"toolbar\" />\n *\n * <!-- Reactive forms -->\n * <ntl-editor [formControl]=\"editorControl\" [toolbar]=\"toolbar\" />\n * ```\n */\n@Component({\n\tselector: 'ntl-editor',\n\ttemplate: '<div #host></div>',\n\tstyles: ':host { display: block; }',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NotectlEditorComponent {\n\t// --- Injected dependencies ---\n\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\n\t// --- Signal Inputs (1:1 with Web Component config) ---\n\n\treadonly plugins = input<Plugin[]>([]);\n\treadonly toolbar = input<ReadonlyArray<ReadonlyArray<Plugin>>>();\n\treadonly features = input<Partial<TextFormattingConfig>>();\n\treadonly placeholder = input<string>('Start typing...');\n\treadonly readonlyMode = input<boolean>(false);\n\treadonly autofocus = input<boolean>(false);\n\treadonly maxHistoryDepth = input<number>();\n\treadonly theme = input<ThemePreset | Theme>(ThemePreset.Light);\n\n\t// --- Two-way content binding via model() ---\n\n\t/**\n\t * Two-way bindable document content.\n\t *\n\t * `undefined` means no external content was provided — the editor manages\n\t * its own state. Once the editor emits changes, the model updates to the\n\t * current `Document`.\n\t *\n\t * @example\n\t * ```html\n\t * <ntl-editor [(content)]=\"myDocument\" />\n\t * ```\n\t */\n\treadonly content: ModelSignal<Document | undefined> = model<Document>();\n\n\t// --- Signal Outputs (events bridged from Web Component) ---\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// --- Reactive State ---\n\n\treadonly editorState = signal<EditorState | null>(null);\n\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\t// --- Internal state ---\n\n\tprivate readonly hostRef = viewChild.required<ElementRef<HTMLDivElement>>('host');\n\tprivate editorRef: NotectlEditor | null = null;\n\tprivate readyResolve: (() => void) | null = null;\n\tprivate readonly readyPromise: Promise<void> = new Promise<void>((resolve) => {\n\t\tthis.readyResolve = resolve;\n\t});\n\tprivate readonly initialized = signal(false);\n\n\t/** Tracks the last document set from within the editor to prevent feedback loops. */\n\tprivate lastEditorDoc: Document | null = null;\n\n\tconstructor() {\n\t\t// SSR-safe: only runs in the browser after first render\n\t\tafterNextRender(() => {\n\t\t\tthis.initEditor();\n\t\t});\n\n\t\t// React to input changes via effect() — replaces ngOnChanges\n\t\teffect(() => {\n\t\t\tconst currentTheme: ThemePreset | Theme = this.theme();\n\t\t\tconst currentPlaceholder: string = this.placeholder();\n\t\t\tconst currentReadonly: boolean = this.readonlyMode();\n\n\t\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\t\tif (!this.initialized() || !editor) return;\n\n\t\t\teditor.setTheme(currentTheme);\n\t\t\teditor.configure({\n\t\t\t\tplaceholder: currentPlaceholder,\n\t\t\t\treadonly: currentReadonly,\n\t\t\t});\n\t\t});\n\n\t\t// Sync external content model changes into the editor.\n\t\t// Skips when the document was set by the editor itself (feedback loop prevention).\n\t\teffect(() => {\n\t\t\tconst doc: Document | undefined = this.content();\n\t\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\t\tif (!this.initialized() || !editor || !doc) return;\n\n\t\t\t// Skip if this document originated from the editor's own state change\n\t\t\tif (doc === this.lastEditorDoc) return;\n\n\t\t\teditor.setJSON(doc);\n\t\t});\n\n\t\tthis.destroyRef.onDestroy(() => {\n\t\t\tthis.destroyEditor();\n\t\t});\n\t}\n\n\t// --- Public API (proxy to Web Component) ---\n\n\t/** Returns the document as JSON. */\n\tgetJSON(): Document {\n\t\treturn this.requireEditor().getJSON();\n\t}\n\n\t/** Sets the document from JSON. */\n\tsetJSON(doc: Document): void {\n\t\tthis.requireEditor().setJSON(doc);\n\t}\n\n\t/** Returns sanitized HTML representation of the document. */\n\tasync getContentHTML(): Promise<string> {\n\t\treturn this.requireEditor().getContentHTML();\n\t}\n\n\t/** Sets content from HTML (sanitized). */\n\tasync setContentHTML(html: string): Promise<void> {\n\t\treturn this.requireEditor().setContentHTML(html);\n\t}\n\n\t/** Returns plain text content. */\n\tgetText(): string {\n\t\treturn this.requireEditor().getText();\n\t}\n\n\t/** Proxy to the Web Component's `commands` object. */\n\tget commands(): NotectlEditor['commands'] {\n\t\treturn this.requireEditor().commands;\n\t}\n\n\t/** Proxy to the Web Component's `can()` capability checker. */\n\tcan(): ReturnType<NotectlEditor['can']> {\n\t\treturn this.requireEditor().can();\n\t}\n\n\t/** Executes a named command registered by a plugin. */\n\texecuteCommand(name: string): boolean {\n\t\tif (!this.editorRef) return false;\n\t\treturn this.editorRef.executeCommand(name);\n\t}\n\n\t/** Configures a plugin at runtime. */\n\tconfigurePlugin(pluginId: string, config: PluginConfig): void {\n\t\tthis.editorRef?.configurePlugin(pluginId, config);\n\t}\n\n\t/** Dispatches a transaction. */\n\tdispatch(tr: Transaction): void {\n\t\tthis.editorRef?.dispatch(tr);\n\t}\n\n\t/** Returns the current editor state. */\n\tgetState(): EditorState {\n\t\treturn this.requireEditor().getState();\n\t}\n\n\t/** Changes the theme at runtime. */\n\tsetTheme(theme: ThemePreset | Theme): void {\n\t\tthis.editorRef?.setTheme(theme);\n\t}\n\n\t/** Returns the current theme setting. */\n\tgetTheme(): ThemePreset | Theme {\n\t\treturn this.editorRef?.getTheme() ?? this.theme();\n\t}\n\n\t/** Sets the readonly state programmatically (used by ControlValueAccessor). */\n\tsetReadonly(readonlyState: boolean): void {\n\t\tthis.editorRef?.configure({ readonly: readonlyState });\n\t}\n\n\t/** Resolves when the editor is ready. */\n\twhenReady(): Promise<void> {\n\t\treturn this.readyPromise;\n\t}\n\n\t// --- Private ---\n\n\tprivate initEditor(): void {\n\t\tconst hostElement: HTMLDivElement = this.hostRef().nativeElement;\n\t\tconst config: NotectlEditorConfig = this.buildConfig();\n\n\t\tconst editor: NotectlEditor = new NotectlEditor();\n\t\tthis.editorRef = editor;\n\n\t\t// Register event listeners BEFORE appending to DOM, because\n\t\t// appendChild triggers connectedCallback → init() synchronously.\n\t\teditor.on('stateChange', (event: StateChangeEvent) => {\n\t\t\tthis.editorState.set(event.newState);\n\t\t\tthis.syncContentModel(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.editorBlur.emit();\n\t\t});\n\n\t\teditor.on('ready', () => {\n\t\t\tthis.initialized.set(true);\n\t\t\tconst state: EditorState = editor.getState();\n\t\t\tthis.editorState.set(state);\n\n\t\t\t// Apply initial content model if set before editor was ready\n\t\t\tconst initialContent: Document | undefined = this.content();\n\t\t\tif (initialContent) {\n\t\t\t\teditor.setJSON(initialContent);\n\t\t\t}\n\n\t\t\tthis.readyResolve?.();\n\t\t\tthis.ready.emit();\n\t\t});\n\n\t\t// Init with config BEFORE appending to DOM. appendChild triggers\n\t\t// connectedCallback which calls init() without config — by calling\n\t\t// init(config) first, the editor initializes with the full config\n\t\t// and connectedCallback's init() becomes a no-op (already initialized).\n\t\teditor.init(config);\n\t\thostElement.appendChild(editor);\n\t}\n\n\tprivate buildConfig(): NotectlEditorConfig {\n\t\tconst defaults: Partial<NotectlEditorConfig> = this.defaultConfig ?? {};\n\t\tconst toolbar: ReadonlyArray<ReadonlyArray<Plugin>> | undefined = this.toolbar();\n\t\tconst features: Partial<TextFormattingConfig> | undefined = this.features();\n\t\tconst maxHistory: number | undefined = this.maxHistoryDepth();\n\n\t\tconst config: NotectlEditorConfig = {\n\t\t\t...defaults,\n\t\t\tplugins: this.plugins(),\n\t\t\tplaceholder: this.placeholder(),\n\t\t\treadonly: this.readonlyMode(),\n\t\t\tautofocus: this.autofocus(),\n\t\t\ttheme: this.theme(),\n\t\t};\n\n\t\tif (toolbar !== undefined) {\n\t\t\tconfig.toolbar = toolbar;\n\t\t}\n\t\tif (features !== undefined) {\n\t\t\tconfig.features = features;\n\t\t}\n\t\tif (maxHistory !== undefined) {\n\t\t\tconfig.maxHistoryDepth = maxHistory;\n\t\t}\n\n\t\treturn config;\n\t}\n\n\t/** Syncs editor document changes to the content model without feedback loops. */\n\tprivate syncContentModel(doc: Document): void {\n\t\tthis.lastEditorDoc = doc;\n\t\tthis.content.set(doc);\n\t}\n\n\tprivate destroyEditor(): void {\n\t\tif (this.editorRef) {\n\t\t\tthis.editorRef.destroy();\n\t\t\tthis.editorRef = null;\n\t\t}\n\t\tthis.initialized.set(false);\n\t}\n\n\tprivate requireEditor(): NotectlEditor {\n\t\tconst editor: NotectlEditor | null = this.editorRef;\n\t\tif (!editor) {\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 { DestroyRef, Directive, forwardRef, inject } from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type { Document, StateChangeEvent } from '@notectl/core';\n\nimport { NotectlEditorComponent } from './notectl-editor.component';\nimport { type ContentFormat, NOTECTL_CONTENT_FORMAT } from './tokens';\n\ntype OnChangeFn = (value: Document | string | null) => void;\ntype OnTouchedFn = () => void;\n\n/** Escapes HTML special characters to prevent XSS when inserting plain text. */\nfunction escapeHtml(text: string): string {\n\treturn text\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&#39;');\n}\n\n/**\n * `ControlValueAccessor` directive for Angular forms integration.\n *\n * Supports Reactive Forms (`formControl`, `formControlName`) and\n * template-driven forms (`ngModel`).\n *\n * The content format is configurable via `provideNotectl({ contentFormat })` or\n * the `NOTECTL_CONTENT_FORMAT` injection token:\n * - `'json'` (default) — form value is a `Document` object\n * - `'html'` — form value is a sanitized HTML string\n * - `'text'` — form value is a plain text string\n */\n@Directive({\n\tselector: 'ntl-editor[formControl], ntl-editor[formControlName], ntl-editor[ngModel]',\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef(() => NotectlValueAccessorDirective),\n\t\t\tmulti: true,\n\t\t},\n\t],\n})\nexport class NotectlValueAccessorDirective implements ControlValueAccessor {\n\tprivate readonly editor: NotectlEditorComponent = inject(NotectlEditorComponent);\n\tprivate readonly destroyRef: DestroyRef = inject(DestroyRef);\n\tprivate readonly format: ContentFormat =\n\t\tinject(NOTECTL_CONTENT_FORMAT, { optional: true }) ?? 'json';\n\n\tprivate onChange: OnChangeFn = () => {};\n\tprivate onTouched: OnTouchedFn = () => {};\n\tprivate pendingValue: Document | string | null = null;\n\tprivate suppressEmit = false;\n\n\tprivate readonly stateChangeSub = this.editor.stateChange.subscribe(\n\t\t(_event: StateChangeEvent) => {\n\t\t\tif (this.suppressEmit) return;\n\t\t\tvoid this.readValue().then((value: Document | string | null) => {\n\t\t\t\tthis.onChange(value);\n\t\t\t});\n\t\t},\n\t);\n\n\tprivate readonly blurSub = this.editor.editorBlur.subscribe(() => {\n\t\tthis.onTouched();\n\t});\n\n\tconstructor() {\n\t\tthis.destroyRef.onDestroy(() => {\n\t\t\tthis.stateChangeSub.unsubscribe();\n\t\t\tthis.blurSub.unsubscribe();\n\t\t});\n\t}\n\n\twriteValue(value: Document | string | null): void {\n\t\tif (!value) return;\n\n\t\ttry {\n\t\t\tthis.editor.getState();\n\t\t\tvoid this.writeValueToEditor(value);\n\t\t\treturn;\n\t\t} catch {\n\t\t\t// Editor not ready yet — defer\n\t\t}\n\n\t\tthis.pendingValue = value;\n\t\tvoid this.editor.whenReady().then(async () => {\n\t\t\tif (this.pendingValue !== null) {\n\t\t\t\tawait this.writeValueToEditor(this.pendingValue);\n\t\t\t\tthis.pendingValue = null;\n\t\t\t}\n\t\t});\n\t}\n\n\tregisterOnChange(fn: OnChangeFn): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: OnTouchedFn): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.editor.setReadonly(isDisabled);\n\t}\n\n\tprivate async writeValueToEditor(value: Document | string): Promise<void> {\n\t\tthis.suppressEmit = true;\n\t\ttry {\n\t\t\tif (this.format === 'json' && typeof value === 'object') {\n\t\t\t\tthis.editor.setJSON(value as Document);\n\t\t\t} else if (this.format === 'html' && typeof value === 'string') {\n\t\t\t\tawait this.editor.setContentHTML(value);\n\t\t\t} else if (this.format === 'text' && typeof value === 'string') {\n\t\t\t\tawait this.editor.setContentHTML(`<p>${escapeHtml(value)}</p>`);\n\t\t\t} else if (typeof value === 'string') {\n\t\t\t\tawait this.editor.setContentHTML(value);\n\t\t\t} else {\n\t\t\t\tthis.editor.setJSON(value as Document);\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.suppressEmit = false;\n\t\t}\n\t}\n\n\tprivate async readValue(): Promise<Document | string | null> {\n\t\ttry {\n\t\t\tswitch (this.format) {\n\t\t\t\tcase 'html':\n\t\t\t\t\treturn await this.editor.getContentHTML();\n\t\t\t\tcase 'text':\n\t\t\t\t\treturn this.editor.getText();\n\t\t\t\tdefault:\n\t\t\t\t\treturn this.editor.getJSON();\n\t\t\t}\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n}\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 { 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 { 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;AAGG;MACU,sBAAsB,GAClC,IAAI,cAAc,CAA+B,wBAAwB;AAE1E;;;;;;;AAOG;MACU,sBAAsB,GAClC,IAAI,cAAc,CAAgB,wBAAwB;AAa3D;;;;;;;;;;;;;;AAcG;AACG,SAAU,cAAc,CAAC,OAAA,GAAkC,EAAE,EAAA;IAClE,MAAM,SAAS,GAAG,EAAE;AAEpB,IAAA,IAAI,OAAO,CAAC,MAAM,EAAE;AACnB,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;IAC9E;AAEA,IAAA,IAAI,OAAO,CAAC,aAAa,EAAE;AAC1B,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC;IACrF;AAEA,IAAA,OAAO,wBAAwB,CAAC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AAC1B,QAAA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;IACzB;;AAGA,IAAA,cAAc,CAAC,IAAY,EAAA;AAC1B,QAAA,MAAM,MAAM,GAAkC,IAAI,CAAC,SAAS,EAAE;AAC9D,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,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;;;;"}
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}\n\nconst EMPTY_HTML = '<p></p>';\n\n/** Escapes HTML special characters before inserting plain text. */\nfunction escapeHtml(text: string): string {\n\treturn text\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&#39;');\n}\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\tawait editor.setContentHTML(`<p>${escapeHtml(value)}</p>`);\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\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 { 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,UAAU,GAAG,SAAS;AAE5B;AACA,SAAS,UAAU,CAAC,IAAY,EAAA;AAC/B,IAAA,OAAO;AACL,SAAA,OAAO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,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAApB,oBAAoB,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC;;;ACpCD;;;AAGG;AAEH;;ACLA;;AAEG;;;;"}
@@ -1,10 +1,11 @@
1
+ import * as _notectl_core from '@notectl/core';
2
+ import { EditorSelection, Document, Plugin, ThemePreset, Theme, PaperSize, Locale, StateChangeEvent, EditorState, NotectlEditor, PluginConfig, Transaction, NotectlEditorConfig } from '@notectl/core';
3
+ export { BlockAttrs, BlockNode, DARK_THEME, Document, EditorSelection, EditorState, InlineNode, LIGHT_THEME, Mark, NotectlEditorConfig, PartialTheme, Plugin, PluginConfig, PluginContext, Position, Selection, StateChangeEvent, TextNode, Theme, ThemePreset, ThemePrimitives, Transaction, TransactionMetadata, createTheme } from '@notectl/core';
1
4
  import * as _angular_core from '@angular/core';
2
5
  import { ModelSignal, InjectionToken, EnvironmentProviders } from '@angular/core';
3
- import { EditorSelection, Plugin, ThemePreset, Theme, Document, StateChangeEvent, EditorState, NotectlEditor, PluginConfig, Transaction, NotectlEditorConfig } from '@notectl/core';
4
- export { BlockAttrs, BlockNode, DARK_THEME, Document, EditorSelection, EditorState, InlineNode, LIGHT_THEME, Mark, NotectlEditorConfig, PartialTheme, Plugin, PluginConfig, PluginContext, Position, Selection, StateChangeEvent, TextNode, Theme, ThemePreset, ThemePrimitives, Transaction, TransactionMetadata, createTheme } from '@notectl/core';
6
+ import { ControlValueAccessor } from '@angular/forms';
5
7
  import { TextFormattingConfig } from '@notectl/core/plugins/text-formatting';
6
8
  export { TextFormattingConfig, TextFormattingPlugin } from '@notectl/core/plugins/text-formatting';
7
- import { ControlValueAccessor } from '@angular/forms';
8
9
  import { Observable } from 'rxjs';
9
10
  export { FontDefinition, FontPlugin } from '@notectl/core/plugins/font';
10
11
  export { STARTER_FONTS } from '@notectl/core/fonts';
@@ -30,48 +31,25 @@ export { ToolbarPlugin } from '@notectl/core/plugins/toolbar';
30
31
  interface SelectionChangeEvent {
31
32
  readonly selection: EditorSelection;
32
33
  }
34
+ /** Angular-facing value type used by forms and two-way binding. */
35
+ type NotectlValue = Document | string | null;
33
36
 
34
- /**
35
- * Angular standalone component wrapping the `<ntl-editor>` Web Component.
36
- *
37
- * Uses `afterNextRender()` for SSR-safe initialization and `effect()` for
38
- * reactive input tracking — no lifecycle interfaces needed.
39
- *
40
- * @example
41
- * ```html
42
- * <!-- Basic usage -->
43
- * <ntl-editor [toolbar]="toolbar" [plugins]="plugins" />
44
- *
45
- * <!-- Two-way content binding -->
46
- * <ntl-editor [(content)]="myDocument" [toolbar]="toolbar" />
47
- *
48
- * <!-- Reactive forms -->
49
- * <ntl-editor [formControl]="editorControl" [toolbar]="toolbar" />
50
- * ```
51
- */
52
- declare class NotectlEditorComponent {
37
+ declare class NotectlEditorComponent implements ControlValueAccessor {
53
38
  private readonly destroyRef;
54
39
  private readonly defaultConfig;
55
- readonly plugins: _angular_core.InputSignal<Plugin<Record<string, unknown>>[]>;
56
- readonly toolbar: _angular_core.InputSignal<readonly (readonly Plugin<Record<string, unknown>>[])[]>;
40
+ private readonly contentFormat;
41
+ readonly plugins: _angular_core.InputSignal<readonly Plugin<Record<string, unknown>>[]>;
42
+ readonly toolbar: _angular_core.InputSignal<readonly (readonly Plugin<Record<string, unknown>>[])[] | _notectl_core.ToolbarConfig>;
57
43
  readonly features: _angular_core.InputSignal<Partial<TextFormattingConfig>>;
58
44
  readonly placeholder: _angular_core.InputSignal<string>;
59
45
  readonly readonlyMode: _angular_core.InputSignal<boolean>;
60
46
  readonly autofocus: _angular_core.InputSignal<boolean>;
61
47
  readonly maxHistoryDepth: _angular_core.InputSignal<number>;
62
48
  readonly theme: _angular_core.InputSignal<ThemePreset | Theme>;
63
- /**
64
- * Two-way bindable document content.
65
- *
66
- * `undefined` means no external content was provided — the editor manages
67
- * its own state. Once the editor emits changes, the model updates to the
68
- * current `Document`.
69
- *
70
- * @example
71
- * ```html
72
- * <ntl-editor [(content)]="myDocument" />
73
- * ```
74
- */
49
+ readonly paperSize: _angular_core.InputSignal<PaperSize>;
50
+ readonly dir: _angular_core.InputSignal<"ltr" | "rtl">;
51
+ readonly locale: _angular_core.InputSignal<Locale>;
52
+ readonly styleNonce: _angular_core.InputSignal<string>;
75
53
  readonly content: ModelSignal<Document | undefined>;
76
54
  readonly stateChange: _angular_core.OutputEmitterRef<StateChangeEvent>;
77
55
  readonly selectionChange: _angular_core.OutputEmitterRef<SelectionChangeEvent>;
@@ -80,85 +58,72 @@ declare class NotectlEditorComponent {
80
58
  readonly ready: _angular_core.OutputEmitterRef<void>;
81
59
  readonly editorState: _angular_core.WritableSignal<EditorState>;
82
60
  readonly isEmpty: _angular_core.Signal<boolean>;
61
+ private readonly resolvedPlugins;
62
+ private readonly resolvedToolbar;
63
+ private readonly resolvedFeatures;
64
+ private readonly resolvedPlaceholder;
65
+ private readonly resolvedReadonlyMode;
66
+ private readonly resolvedAutofocus;
67
+ private readonly resolvedMaxHistoryDepth;
68
+ private readonly resolvedTheme;
69
+ private readonly resolvedPaperSize;
70
+ private readonly resolvedDir;
71
+ private readonly resolvedLocale;
72
+ private readonly resolvedStyleNonce;
73
+ readonly effectiveReadonly: _angular_core.Signal<boolean>;
83
74
  private readonly hostRef;
75
+ private readonly initialized;
76
+ private readonly disabledByForms;
77
+ private readonly valueController;
84
78
  private editorRef;
85
79
  private readyResolve;
86
- private readonly readyPromise;
87
- private readonly initialized;
88
- /** Tracks the last document set from within the editor to prevent feedback loops. */
89
- private lastEditorDoc;
80
+ private readyPromise;
81
+ private lastInitConfig;
82
+ private queuedInitConfig;
83
+ private reinitializePromise;
84
+ private pendingInitialDocument;
85
+ private onChange;
86
+ private onTouched;
90
87
  constructor();
91
- /** Returns the document as JSON. */
92
88
  getJSON(): Document;
93
- /** Sets the document from JSON. */
94
89
  setJSON(doc: Document): void;
95
- /** Returns sanitized HTML representation of the document. */
96
90
  getContentHTML(): Promise<string>;
97
- /** Sets content from HTML (sanitized). */
98
91
  setContentHTML(html: string): Promise<void>;
99
- /** Returns plain text content. */
100
92
  getText(): string;
101
- /** Proxy to the Web Component's `commands` object. */
102
93
  get commands(): NotectlEditor['commands'];
103
- /** Proxy to the Web Component's `can()` capability checker. */
104
94
  can(): ReturnType<NotectlEditor['can']>;
105
- /** Executes a named command registered by a plugin. */
106
95
  executeCommand(name: string): boolean;
107
- /** Configures a plugin at runtime. */
108
96
  configurePlugin(pluginId: string, config: PluginConfig): void;
109
- /** Dispatches a transaction. */
110
97
  dispatch(tr: Transaction): void;
111
- /** Returns the current editor state. */
112
98
  getState(): EditorState;
113
- /** Changes the theme at runtime. */
114
99
  setTheme(theme: ThemePreset | Theme): void;
115
- /** Returns the current theme setting. */
116
100
  getTheme(): ThemePreset | Theme;
117
- /** Sets the readonly state programmatically (used by ControlValueAccessor). */
118
101
  setReadonly(readonlyState: boolean): void;
119
- /** Resolves when the editor is ready. */
120
102
  whenReady(): Promise<void>;
103
+ focus(options?: FocusOptions): void;
104
+ writeValue(value: NotectlValue): void;
105
+ registerOnChange(fn: (value: NotectlValue) => void): void;
106
+ registerOnTouched(fn: () => void): void;
107
+ setDisabledState(isDisabled: boolean): void;
108
+ private resetReadyPromise;
121
109
  private initEditor;
110
+ private applyInitialContent;
122
111
  private buildConfig;
123
- /** Syncs editor document changes to the content model without feedback loops. */
124
- private syncContentModel;
112
+ private captureInitConfig;
113
+ private scheduleReinitialization;
125
114
  private destroyEditor;
126
115
  private requireEditor;
127
116
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NotectlEditorComponent, never>;
128
- 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; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; }, { "content": "contentChange"; "stateChange": "stateChange"; "selectionChange": "selectionChange"; "editorFocus": "editorFocus"; "editorBlur": "editorBlur"; "ready": "ready"; }, never, never, true, never>;
117
+ 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>;
129
118
  }
130
119
 
131
- type OnChangeFn = (value: Document | string | null) => void;
132
- type OnTouchedFn = () => void;
133
120
  /**
134
- * `ControlValueAccessor` directive for Angular forms integration.
135
- *
136
- * Supports Reactive Forms (`formControl`, `formControlName`) and
137
- * template-driven forms (`ngModel`).
121
+ * @deprecated Angular Forms support is built into `NotectlEditorComponent`.
138
122
  *
139
- * The content format is configurable via `provideNotectl({ contentFormat })` or
140
- * the `NOTECTL_CONTENT_FORMAT` injection token:
141
- * - `'json'` (default) — form value is a `Document` object
142
- * - `'html'` — form value is a sanitized HTML string
143
- * - `'text'` — form value is a plain text string
123
+ * This directive remains as a compatibility shim so existing imports do not break,
124
+ * but it no longer participates in value accessor registration.
144
125
  */
145
- declare class NotectlValueAccessorDirective implements ControlValueAccessor {
146
- private readonly editor;
147
- private readonly destroyRef;
148
- private readonly format;
149
- private onChange;
150
- private onTouched;
151
- private pendingValue;
152
- private suppressEmit;
153
- private readonly stateChangeSub;
154
- private readonly blurSub;
155
- constructor();
156
- writeValue(value: Document | string | null): void;
157
- registerOnChange(fn: OnChangeFn): void;
158
- registerOnTouched(fn: OnTouchedFn): void;
159
- setDisabledState(isDisabled: boolean): void;
160
- private writeValueToEditor;
161
- private readValue;
126
+ declare class NotectlValueAccessorDirective {
162
127
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NotectlValueAccessorDirective, never>;
163
128
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NotectlValueAccessorDirective, "ntl-editor[formControl], ntl-editor[formControlName], ntl-editor[ngModel]", never, {}, {}, never, never, true, never>;
164
129
  }
@@ -258,4 +223,4 @@ interface NotectlProviderOptions {
258
223
  declare function provideNotectl(options?: NotectlProviderOptions): EnvironmentProviders;
259
224
 
260
225
  export { NOTECTL_CONTENT_FORMAT, NOTECTL_DEFAULT_CONFIG, NotectlEditorComponent, NotectlEditorService, NotectlValueAccessorDirective, provideNotectl };
261
- export type { ContentFormat, NotectlProviderOptions, SelectionChangeEvent };
226
+ export type { ContentFormat, NotectlProviderOptions, NotectlValue, SelectionChangeEvent };
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@notectl/angular",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Angular integration for the notectl rich text editor. Provides a standalone component, reactive forms support, and DI service.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
+ "main": "./dist/fesm2022/notectl-angular.mjs",
7
8
  "module": "./dist/fesm2022/notectl-angular.mjs",
9
+ "types": "./dist/types/notectl-angular.d.ts",
8
10
  "typings": "./dist/types/notectl-angular.d.ts",
9
11
  "sideEffects": false,
10
12
  "files": ["dist", "README.md", "LICENSE"],
@@ -41,20 +43,20 @@
41
43
  "peerDependencies": {
42
44
  "@angular/core": ">=21.0.0",
43
45
  "@angular/forms": ">=21.0.0",
44
- "@notectl/core": "^2.0.1",
46
+ "@notectl/core": "^2.0.3",
45
47
  "rxjs": ">=7.0.0"
46
48
  },
47
49
  "devDependencies": {
48
- "@angular/compiler": "^21.2.0",
49
- "@angular/compiler-cli": "^21.2.0",
50
- "@angular/core": "^21.2.0",
51
- "@angular/forms": "^21.2.0",
52
- "@angular/platform-browser": "^21.2.0",
53
- "@angular/platform-browser-dynamic": "^21.2.0",
50
+ "@angular/compiler": "^21.2.4",
51
+ "@angular/compiler-cli": "^21.2.4",
52
+ "@angular/core": "^21.2.4",
53
+ "@angular/forms": "^21.2.4",
54
+ "@angular/platform-browser": "^21.2.4",
55
+ "@angular/platform-browser-dynamic": "^21.2.4",
54
56
  "@notectl/core": "workspace:*",
55
57
  "ng-packagr": "^21.2.0",
56
58
  "rxjs": "~7.8.2",
57
- "vite": "^6.0.0",
58
- "vitest": "^4.0.18"
59
+ "vite": "^8.0.0",
60
+ "vitest": "^4.1.0"
59
61
  }
60
62
  }