@r-zubkov/ngx-blocknote 0.0.0-stage → 0.1.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,506 @@
1
+ import { isPlatformBrowser } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { ApplicationRef, ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, EnvironmentInjector, InjectionToken, PLATFORM_ID, afterRenderEffect, createComponent, inject, input, output, signal, untracked, viewChild } from "@angular/core";
4
+ import { BlockNoteEditor, addStyleAttributes, createBlockSpec, createInlineContentSpec, createStyleSpec, inlineContentToNodes, nodeToCustomInlineContent } from "@blocknote/core";
5
+ function createAngularView({ component, environmentInjector, hostElement, inputs, findContentDOM }) {
6
+ const applicationRef = environmentInjector.get(ApplicationRef);
7
+ const componentRef = createComponent(component, {
8
+ environmentInjector,
9
+ hostElement
10
+ });
11
+ let attached = false;
12
+ let destroyed = false;
13
+ function destroy() {
14
+ if (destroyed) return;
15
+ destroyed = true;
16
+ try {
17
+ if (attached) applicationRef.detachView(componentRef.hostView);
18
+ } finally {
19
+ componentRef.destroy();
20
+ }
21
+ }
22
+ function update(nextInputs) {
23
+ if (destroyed) return;
24
+ for (const [name, value] of Object.entries(nextInputs)) componentRef.setInput(name, value);
25
+ componentRef.changeDetectorRef.detectChanges();
26
+ }
27
+ try {
28
+ applicationRef.attachView(componentRef.hostView);
29
+ attached = true;
30
+ update(inputs);
31
+ const contentDOM = findContentDOM?.(hostElement) ?? void 0;
32
+ if (findContentDOM && (!contentDOM || contentDOM === hostElement || !hostElement.contains(contentDOM))) throw new Error("The Angular renderer must provide a contentDOM descendant.");
33
+ return {
34
+ dom: hostElement,
35
+ contentDOM,
36
+ update,
37
+ destroy
38
+ };
39
+ } catch (renderError) {
40
+ try {
41
+ destroy();
42
+ } catch (destroyError) {
43
+ throw new AggregateError([renderError, destroyError], "Angular view rendering and cleanup both failed.", { cause: destroyError });
44
+ }
45
+ throw renderError;
46
+ }
47
+ }
48
+ function createAngularBlockSpec(config, { environmentInjector, component, findContentDOM = (host) => host.querySelector("[data-content-dom]"), findFrameSlot, frame, parse, toExternalHTML }) {
49
+ const frameOptions = config.layoutOnly ? {
50
+ component,
51
+ findFrameSlot
52
+ } : frame;
53
+ function checkBrowser() {
54
+ if (!isPlatformBrowser(environmentInjector.get(PLATFORM_ID))) throw new Error("Angular block rendering requires a browser.");
55
+ }
56
+ function renderView(context) {
57
+ return createAngularView({
58
+ component,
59
+ environmentInjector,
60
+ hostElement: environmentInjector.get(DOCUMENT).createElement("div"),
61
+ inputs: { context },
62
+ findContentDOM: config.content === "none" ? void 0 : findContentDOM
63
+ });
64
+ }
65
+ function contextData(block, editor) {
66
+ return {
67
+ block,
68
+ editor
69
+ };
70
+ }
71
+ function snapshot(context) {
72
+ const { dom, contentDOM, destroy } = renderView(context);
73
+ destroy();
74
+ return {
75
+ dom,
76
+ contentDOM
77
+ };
78
+ }
79
+ function liveContext(block, editor) {
80
+ const updateBlock = (update) => {
81
+ editor.updateBlock(block.id, update);
82
+ };
83
+ return (current) => ({
84
+ ...contextData(current, editor),
85
+ renderMode: "live",
86
+ updateBlock
87
+ });
88
+ }
89
+ const render = function(block, editor) {
90
+ checkBrowser();
91
+ const data = contextData(block, editor);
92
+ if (this.renderType !== "nodeView") return snapshot({
93
+ ...data,
94
+ renderMode: "external"
95
+ });
96
+ const context = liveContext(block, editor);
97
+ const view = renderView(context(block));
98
+ return {
99
+ dom: view.dom,
100
+ contentDOM: view.contentDOM,
101
+ destroy: view.destroy,
102
+ update: () => {
103
+ const current = editor.getBlock(block.id);
104
+ if (current?.type !== config.type) return false;
105
+ view.update({ context: context(current) });
106
+ return true;
107
+ }
108
+ };
109
+ };
110
+ function createFrameRenderer(options) {
111
+ const findSlot = options.findFrameSlot ?? ((host) => host.querySelector("[data-frame-slot]"));
112
+ return function(block, editor) {
113
+ checkBrowser();
114
+ const owningEditor = editor;
115
+ const context = liveContext(block, owningEditor);
116
+ const live = this.renderType === "nodeView";
117
+ const view = createAngularView({
118
+ component: options.component,
119
+ environmentInjector,
120
+ hostElement: environmentInjector.get(DOCUMENT).createElement("div"),
121
+ inputs: { context: live ? context(block) : {
122
+ ...contextData(block, owningEditor),
123
+ renderMode: "external"
124
+ } },
125
+ findContentDOM: findSlot
126
+ });
127
+ const slot = view.contentDOM;
128
+ slot.setAttribute("data-frame-slot", "");
129
+ if (!live) {
130
+ view.destroy();
131
+ return {
132
+ dom: view.dom,
133
+ slot
134
+ };
135
+ }
136
+ return {
137
+ dom: view.dom,
138
+ slot,
139
+ destroy: view.destroy,
140
+ update: (current) => view.update({ context: context(current) })
141
+ };
142
+ };
143
+ }
144
+ return createBlockSpec(config, {
145
+ parse,
146
+ render: config.layoutOnly ? void 0 : render,
147
+ renderFrame: frameOptions && createFrameRenderer(frameOptions),
148
+ toExternalHTML(block, editor, { nestingLevel } = { nestingLevel: 0 }) {
149
+ checkBrowser();
150
+ const context = {
151
+ ...contextData(block, editor),
152
+ renderMode: "external"
153
+ };
154
+ return toExternalHTML?.({
155
+ ...context,
156
+ nestingLevel
157
+ }) ?? (frameOptions ? void 0 : snapshot(context));
158
+ }
159
+ })();
160
+ }
161
+ function createAngularInlineContentSpec(config, { component, environmentInjector, findContentDOM = (host) => host.querySelector("[data-content-dom]"), parse, toExternalHTML }) {
162
+ function checkBrowser() {
163
+ if (!isPlatformBrowser(environmentInjector.get(PLATFORM_ID))) throw new Error("Angular inline content rendering requires a browser.");
164
+ }
165
+ function renderView(context) {
166
+ checkBrowser();
167
+ return createAngularView({
168
+ component,
169
+ environmentInjector,
170
+ hostElement: environmentInjector.get(DOCUMENT).createElement("span"),
171
+ inputs: { context },
172
+ findContentDOM: config.content === "none" ? void 0 : findContentDOM
173
+ });
174
+ }
175
+ const spec = createInlineContentSpec(config, {
176
+ parse,
177
+ toExternalHTML: toExternalHTML && ((inlineContent, editor) => {
178
+ checkBrowser();
179
+ return toExternalHTML({
180
+ inlineContent,
181
+ editor,
182
+ renderMode: "external"
183
+ }) ?? spec.implementation.render(inlineContent, () => {}, editor);
184
+ }),
185
+ render(inlineContent, _replace, editor, node, getPos) {
186
+ const typedEditor = editor;
187
+ if (getPos() === void 0) {
188
+ const { dom, contentDOM, destroy } = renderView({
189
+ inlineContent,
190
+ editor: typedEditor,
191
+ renderMode: "external"
192
+ });
193
+ destroy();
194
+ return {
195
+ dom,
196
+ contentDOM
197
+ };
198
+ }
199
+ let active = true;
200
+ const position = () => active ? getPos() : void 0;
201
+ const updateInlineContent = (replacement) => {
202
+ const from = position();
203
+ if (from === void 0) return;
204
+ editor.transact((transaction) => {
205
+ const current = transaction.doc.nodeAt(from);
206
+ if (current?.type !== node.type) return;
207
+ const nodes = inlineContentToNodes([replacement], editor.pmSchema);
208
+ transaction.replaceWith(from, from + current.nodeSize, nodes.map((replacementNode) => replacementNode.mark(current.marks)));
209
+ });
210
+ };
211
+ const live = {
212
+ editor: typedEditor,
213
+ renderMode: "live",
214
+ getPos: position,
215
+ updateInlineContent
216
+ };
217
+ const view = renderView({
218
+ ...live,
219
+ inlineContent,
220
+ node
221
+ });
222
+ return {
223
+ dom: view.dom,
224
+ contentDOM: view.contentDOM,
225
+ update(nextNode) {
226
+ if (!nextNode.sameMarkup(node)) return false;
227
+ const current = nodeToCustomInlineContent(nextNode, typedEditor.schema.inlineContentSchema, typedEditor.schema.styleSchema);
228
+ view.update({ context: {
229
+ ...live,
230
+ node: nextNode,
231
+ inlineContent: current
232
+ } });
233
+ return true;
234
+ },
235
+ destroy() {
236
+ active = false;
237
+ view.destroy();
238
+ }
239
+ };
240
+ }
241
+ });
242
+ return spec;
243
+ }
244
+ const BLOCK_NOTE_EDITOR_CONTEXT = new InjectionToken("NgxBlockNoteComponent editor context");
245
+ function injectBlockNoteEditor() {
246
+ const context = inject(BLOCK_NOTE_EDITOR_CONTEXT, { optional: true });
247
+ if (context === null) throw new Error("injectBlockNoteEditor() requires an enclosing NgxBlockNoteComponent.");
248
+ return context.editor;
249
+ }
250
+ function createStyleMark(config, parse, renderLive, renderSnapshot, renderExternal) {
251
+ const base = createStyleSpec(config, {
252
+ parse,
253
+ render() {
254
+ throw new Error("Angular styles require an editor when rendering.");
255
+ }
256
+ });
257
+ function getEditor(options) {
258
+ const { editor } = options;
259
+ if (!(editor instanceof BlockNoteEditor)) throw new Error("BlockNote did not supply the editor for the Angular mark.");
260
+ return editor;
261
+ }
262
+ const decorate = (view, value) => {
263
+ addStyleAttributes(view, config.type, value, config.propSchema);
264
+ return view;
265
+ };
266
+ return {
267
+ ...base,
268
+ implementation: {
269
+ mark: base.implementation.mark.extend({
270
+ addMarkView() {
271
+ const editor = getEditor(this.options);
272
+ return ({ mark }) => {
273
+ const value = mark.attrs["stringValue"];
274
+ return decorate(renderLive(value, editor), value);
275
+ };
276
+ },
277
+ renderHTML({ mark }) {
278
+ const value = mark.attrs["stringValue"];
279
+ return decorate(renderExternal(value, getEditor(this.options)), value);
280
+ }
281
+ }),
282
+ render: (value, editor) => decorate(renderSnapshot(value, editor), value),
283
+ toExternalHTML: (value, editor) => decorate(renderExternal(value, editor), value)
284
+ }
285
+ };
286
+ }
287
+ function createAngularStyleSpec(config, { component, environmentInjector, findContentDOM = (host) => host.querySelector("[data-content-dom]"), parse, toExternalHTML }) {
288
+ function contextFor(renderMode, [value, editor]) {
289
+ if (!isPlatformBrowser(environmentInjector.get(PLATFORM_ID))) throw new Error("Angular style rendering requires a browser.");
290
+ return {
291
+ value: config.propSchema === "boolean" ? true : value,
292
+ editor,
293
+ renderMode
294
+ };
295
+ }
296
+ function renderView(context) {
297
+ return createAngularView({
298
+ component,
299
+ environmentInjector,
300
+ hostElement: environmentInjector.get(DOCUMENT).createElement("span"),
301
+ inputs: { context },
302
+ findContentDOM
303
+ });
304
+ }
305
+ function snapshot(context) {
306
+ const { dom, contentDOM, destroy } = renderView(context);
307
+ destroy();
308
+ return {
309
+ dom,
310
+ contentDOM
311
+ };
312
+ }
313
+ return createStyleMark(config, parse, (...args) => renderView(contextFor("live", args)), (...args) => snapshot(contextFor("external", args)), (...args) => {
314
+ const context = contextFor("external", args);
315
+ return toExternalHTML?.(context) ?? snapshot(context);
316
+ });
317
+ }
318
+ var NgxBlockNoteComponent = class NgxBlockNoteComponent {
319
+ constructor() {
320
+ this.editor = input.required(...ngDevMode ? [{ debugName: "editor" }] : /* istanbul ignore next */ []);
321
+ this.editable = input(...ngDevMode ? [void 0, { debugName: "editable" }] : /* istanbul ignore next */ []);
322
+ this.contentChange = output();
323
+ this.selectionChange = output();
324
+ this.focusChange = output();
325
+ this.mountPoint = viewChild.required("mountPoint", ...ngDevMode ? [{ debugName: "mountPoint" }] : /* istanbul ignore next */ []);
326
+ const destroyRef = inject(DestroyRef);
327
+ let mountedEditor;
328
+ let unsubscribe = [];
329
+ const unmount = () => {
330
+ const editor = mountedEditor;
331
+ mountedEditor = void 0;
332
+ const listeners = unsubscribe;
333
+ unsubscribe = [];
334
+ for (const remove of listeners) remove();
335
+ editor?.unmount();
336
+ };
337
+ destroyRef.onDestroy(unmount);
338
+ afterRenderEffect({ mixedReadWrite: () => {
339
+ const editor = this.editor();
340
+ const editable = this.editable();
341
+ const element = this.mountPoint().nativeElement;
342
+ untracked(() => {
343
+ const swapping = mountedEditor !== editor;
344
+ if (swapping) unmount();
345
+ if (editable !== void 0) {
346
+ const dom = swapping ? void 0 : editor.domElement;
347
+ const tabIndex = dom?.getAttribute("tabindex");
348
+ const wasFocused = dom?.matches(":focus");
349
+ editor.isEditable = editable;
350
+ if (dom && tabIndex != null && !dom.hasAttribute("tabindex")) {
351
+ dom.setAttribute("tabindex", tabIndex);
352
+ if (wasFocused) dom.focus({ preventScroll: true });
353
+ }
354
+ }
355
+ if (swapping) try {
356
+ unsubscribe.push(editor.onChange((editor, context) => this.contentChange.emit({
357
+ editor,
358
+ ...context
359
+ })));
360
+ unsubscribe.push(editor.onSelectionChange((editor) => this.selectionChange.emit({ editor })));
361
+ unsubscribe.push(editor.onFocusChange((editor, context) => this.focusChange.emit({
362
+ editor,
363
+ ...context
364
+ })));
365
+ mountedEditor = editor;
366
+ editor.mount(element);
367
+ } catch (error) {
368
+ unmount();
369
+ throw error;
370
+ }
371
+ });
372
+ } });
373
+ }
374
+ static {
375
+ this.ɵfac = i0.ɵɵngDeclareFactory({
376
+ minVersion: "12.0.0",
377
+ version: "22.3.0",
378
+ ngImport: i0,
379
+ type: NgxBlockNoteComponent,
380
+ deps: [],
381
+ target: i0.ɵɵFactoryTarget.Component
382
+ });
383
+ }
384
+ static {
385
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
386
+ minVersion: "17.2.0",
387
+ version: "22.3.0",
388
+ type: NgxBlockNoteComponent,
389
+ isStandalone: true,
390
+ selector: "ngx-blocknote",
391
+ inputs: {
392
+ editor: {
393
+ classPropertyName: "editor",
394
+ publicName: "editor",
395
+ isSignal: true,
396
+ isRequired: true,
397
+ transformFunction: null
398
+ },
399
+ editable: {
400
+ classPropertyName: "editable",
401
+ publicName: "editable",
402
+ isSignal: true,
403
+ isRequired: false,
404
+ transformFunction: null
405
+ }
406
+ },
407
+ outputs: {
408
+ contentChange: "contentChange",
409
+ selectionChange: "selectionChange",
410
+ focusChange: "focusChange"
411
+ },
412
+ host: { classAttribute: "ngx-blocknote" },
413
+ providers: [{
414
+ provide: BLOCK_NOTE_EDITOR_CONTEXT,
415
+ useFactory: () => ({
416
+ editor: inject(NgxBlockNoteComponent).editor,
417
+ environmentInjector: inject(EnvironmentInjector)
418
+ })
419
+ }],
420
+ viewQueries: [{
421
+ propertyName: "mountPoint",
422
+ first: true,
423
+ predicate: ["mountPoint"],
424
+ descendants: true,
425
+ isSignal: true
426
+ }],
427
+ ngImport: i0,
428
+ template: "<div #mountPoint class=\"ngx-blocknote-mount\"></div><ng-content />",
429
+ isInline: true,
430
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
431
+ });
432
+ }
433
+ };
434
+ i0.ɵɵngDeclareClassMetadata({
435
+ minVersion: "12.0.0",
436
+ version: "22.3.0",
437
+ ngImport: i0,
438
+ type: NgxBlockNoteComponent,
439
+ decorators: [{
440
+ type: Component,
441
+ args: [{
442
+ selector: "ngx-blocknote",
443
+ standalone: true,
444
+ changeDetection: ChangeDetectionStrategy.OnPush,
445
+ host: { class: "ngx-blocknote" },
446
+ template: "<div #mountPoint class=\"ngx-blocknote-mount\"></div><ng-content />",
447
+ providers: [{
448
+ provide: BLOCK_NOTE_EDITOR_CONTEXT,
449
+ useFactory: () => ({
450
+ editor: inject(NgxBlockNoteComponent).editor,
451
+ environmentInjector: inject(EnvironmentInjector)
452
+ })
453
+ }]
454
+ }]
455
+ }],
456
+ ctorParameters: () => [],
457
+ propDecorators: {
458
+ editor: [{
459
+ type: i0.Input,
460
+ args: [{
461
+ isSignal: true,
462
+ alias: "editor",
463
+ required: true
464
+ }]
465
+ }],
466
+ editable: [{
467
+ type: i0.Input,
468
+ args: [{
469
+ isSignal: true,
470
+ alias: "editable",
471
+ required: false
472
+ }]
473
+ }],
474
+ contentChange: [{
475
+ type: i0.Output,
476
+ args: ["contentChange"]
477
+ }],
478
+ selectionChange: [{
479
+ type: i0.Output,
480
+ args: ["selectionChange"]
481
+ }],
482
+ focusChange: [{
483
+ type: i0.Output,
484
+ args: ["focusChange"]
485
+ }],
486
+ mountPoint: [{
487
+ type: i0.ViewChild,
488
+ args: ["mountPoint", { isSignal: true }]
489
+ }]
490
+ }
491
+ });
492
+ function toBlockNoteSignal(store, { selector, equal = Object.is, injector }) {
493
+ const destroyRef = injector ? injector.get(DestroyRef) : inject(DestroyRef);
494
+ const selected = signal(selector(store.state), {
495
+ ...ngDevMode ? { debugName: "selected" } : /* istanbul ignore next */ {},
496
+ equal
497
+ });
498
+ const unsubscribe = store.subscribe(({ currentVal }) => {
499
+ if (!destroyRef.destroyed) selected.set(selector(currentVal));
500
+ });
501
+ destroyRef.onDestroy(unsubscribe);
502
+ return selected.asReadonly();
503
+ }
504
+ export { NgxBlockNoteComponent, createAngularBlockSpec, createAngularInlineContentSpec, createAngularStyleSpec, injectBlockNoteEditor, toBlockNoteSignal };
505
+
506
+ //# sourceMappingURL=r-zubkov-ngx-blocknote.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"r-zubkov-ngx-blocknote.mjs","names":["typedEditor"],"sources":["../../../src/angular-view-renderer.ts","../../../src/create-angular-block-spec.ts","../../../src/create-angular-inline-content-spec.ts","../../../src/block-note-editor-context.ts","../../../src/block-note-style-mark.ts","../../../src/create-angular-style-spec.ts","../../../src/ngx-blocknote.component.ts","../../../src/to-block-note-signal.ts"],"sourcesContent":["import {\n ApplicationRef,\n EnvironmentInjector,\n InputSignalWithTransform,\n Signal,\n Type,\n createComponent,\n} from \"@angular/core\";\n\ntype ViewInputValue<Input> =\n Input extends Signal<infer Read>\n ? Input extends InputSignalWithTransform<Read, infer Write>\n ? Write\n : Input\n : Input;\n\ntype ViewInputs<Component> = {\n [Key in Extract<keyof Component, string>]?: ViewInputValue<Component[Key]>;\n};\n\ninterface AngularViewOptions<Component> {\n readonly component: Type<Component>;\n readonly environmentInjector: EnvironmentInjector;\n readonly hostElement: HTMLElement;\n readonly inputs: ViewInputs<NoInfer<Component>>;\n readonly findContentDOM?: (host: HTMLElement) => HTMLElement | null;\n}\n\nexport function createAngularView<Component>({\n component,\n environmentInjector,\n hostElement,\n inputs,\n findContentDOM,\n}: AngularViewOptions<Component>) {\n const applicationRef = environmentInjector.get(ApplicationRef);\n const componentRef = createComponent(component, {\n environmentInjector,\n hostElement,\n });\n let attached = false;\n let destroyed = false;\n\n function destroy(): void {\n if (destroyed) {\n return;\n }\n\n destroyed = true;\n try {\n if (attached) {\n applicationRef.detachView(componentRef.hostView);\n }\n } finally {\n componentRef.destroy();\n }\n }\n\n function update(nextInputs: ViewInputs<Component>): void {\n if (destroyed) {\n return;\n }\n\n for (const [name, value] of Object.entries(nextInputs)) {\n componentRef.setInput(name, value);\n }\n componentRef.changeDetectorRef.detectChanges();\n }\n\n try {\n applicationRef.attachView(componentRef.hostView);\n attached = true;\n update(inputs);\n\n const contentDOM = findContentDOM?.(hostElement) ?? undefined;\n if (\n findContentDOM &&\n (!contentDOM ||\n contentDOM === hostElement ||\n !hostElement.contains(contentDOM))\n ) {\n throw new Error(\n \"The Angular renderer must provide a contentDOM descendant.\",\n );\n }\n\n return { dom: hostElement, contentDOM, update, destroy };\n } catch (renderError) {\n try {\n destroy();\n } catch (destroyError) {\n throw new AggregateError(\n [renderError, destroyError],\n \"Angular view rendering and cleanup both failed.\",\n { cause: destroyError },\n );\n }\n throw renderError;\n }\n}\n","import { isPlatformBrowser } from \"@angular/common\";\nimport { DOCUMENT, PLATFORM_ID } from \"@angular/core\";\nimport type { EnvironmentInjector, InputSignal, Type } from \"@angular/core\";\nimport { createBlockSpec } from \"@blocknote/core\";\nimport type {\n Block,\n BlockConfig,\n BlockFromConfig,\n BlockImplementation,\n BlockNoteEditor,\n BlockSchema,\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentSchema,\n PartialBlockFromConfig,\n PropSchema,\n StyleSchema,\n} from \"@blocknote/core\";\nimport { createAngularView } from \"./angular-view-renderer\";\n\ntype ContentMode = \"inline\" | \"plain\" | \"none\";\ntype AngularBlockConfig = BlockConfig<string, PropSchema, ContentMode>;\n\nexport type AngularBlockContext<\n Config extends AngularBlockConfig,\n B extends BlockSchema = Record<Config[\"type\"], Config>,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n> = Readonly<{\n block: Omit<BlockFromConfig<Config, I, S>, \"children\"> &\n Pick<Block<B, I, S>, \"children\">;\n editor: BlockNoteEditor<B, I, S>;\n}> &\n (\n | Readonly<{\n renderMode: \"live\";\n updateBlock: (\n update: Pick<\n PartialBlockFromConfig<Config, I, S>,\n \"props\" | \"content\"\n >,\n ) => void;\n }>\n | Readonly<{ renderMode: \"external\" }>\n );\n\nexport interface AngularBlockFrameOptions<\n Config extends AngularBlockConfig,\n B extends BlockSchema = Record<Config[\"type\"], Config>,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n> {\n readonly component: Type<{\n readonly context: InputSignal<AngularBlockContext<Config, B, I, S>>;\n }>;\n /** Resolves a stable descendant for the block and its children. Defaults to `[data-frame-slot]`. */\n readonly findFrameSlot?: (host: HTMLElement) => HTMLElement | null;\n}\n\nexport interface AngularBlockSpecOptions<\n Config extends AngularBlockConfig,\n B extends BlockSchema = Record<Config[\"type\"], Config>,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n> {\n readonly environmentInjector: EnvironmentInjector;\n readonly component: Type<{\n readonly context: InputSignal<AngularBlockContext<Config, B, I, S>>;\n }>;\n /** Resolves the stable editable descendant. Defaults to `[data-content-dom]`. */\n readonly findContentDOM?: (host: HTMLElement) => HTMLElement | null;\n /** Resolves the frame slot for a layout-only block. Defaults to [data-frame-slot]. */\n readonly findFrameSlot?: (host: HTMLElement) => HTMLElement | null;\n /** An Angular frame around the block content and its children. */\n readonly frame?: AngularBlockFrameOptions<Config, B, I, S>;\n readonly parse?: BlockImplementation<\n Config[\"type\"],\n Config[\"propSchema\"],\n Config[\"content\"]\n >[\"parse\"];\n /** Returning undefined uses the Angular content and frame snapshots. */\n readonly toExternalHTML?: (context: {\n readonly block: AngularBlockContext<Config, B, I, S>[\"block\"];\n readonly editor: BlockNoteEditor<B, I, S>;\n readonly renderMode: \"external\";\n readonly nestingLevel: number;\n }) =>\n | {\n dom: HTMLElement | DocumentFragment;\n contentDOM?: HTMLElement;\n childrenDOM?: HTMLElement;\n }\n | undefined;\n}\n\nexport function createAngularBlockSpec<\n const Name extends string,\n const Props extends PropSchema,\n const Content extends ContentMode,\n B extends BlockSchema = Record<Name, BlockConfig<Name, Props, Content>>,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n config: BlockConfig<Name, Props, Content>,\n {\n environmentInjector,\n component,\n findContentDOM = (host) => host.querySelector(\"[data-content-dom]\"),\n findFrameSlot,\n frame,\n parse,\n toExternalHTML,\n }: AngularBlockSpecOptions<\n NoInfer<BlockConfig<Name, Props, Content>>,\n B,\n I,\n S\n >,\n) {\n type Config = BlockConfig<Name, Props, Content>;\n type Context = AngularBlockContext<Config, B, I, S>;\n type Implementation = BlockImplementation<Name, Props, Content>;\n type Render = NonNullable<Implementation[\"render\"]>;\n const frameOptions = config.layoutOnly ? { component, findFrameSlot } : frame;\n\n function checkBrowser(): void {\n if (!isPlatformBrowser(environmentInjector.get(PLATFORM_ID))) {\n throw new Error(\"Angular block rendering requires a browser.\");\n }\n }\n\n function renderView(context: Context) {\n return createAngularView({\n component,\n environmentInjector,\n hostElement: environmentInjector.get(DOCUMENT).createElement(\"div\"),\n inputs: { context },\n findContentDOM: config.content === \"none\" ? undefined : findContentDOM,\n });\n }\n\n // The upstream hook types the editor as a single-block schema. The caller's\n // component can declare the complete schema used to register this spec.\n function contextData(block: unknown, editor: Parameters<Render>[1]) {\n return {\n block: block as Context[\"block\"],\n editor: editor as unknown as BlockNoteEditor<B, I, S>,\n };\n }\n\n function snapshot(context: Context) {\n const { dom, contentDOM, destroy } = renderView(context);\n destroy();\n return { dom, contentDOM };\n }\n\n function liveContext(block: { id: string }, editor: Parameters<Render>[1]) {\n const updateBlock: Extract<\n Context,\n { renderMode: \"live\" }\n >[\"updateBlock\"] = (update) => {\n editor.updateBlock(\n block.id,\n update as Parameters<typeof editor.updateBlock>[1],\n );\n };\n return (current: unknown): Context => ({\n ...contextData(current, editor),\n renderMode: \"live\",\n updateBlock,\n });\n }\n\n const render: Render = function (block, editor) {\n checkBrowser();\n const data = contextData(block, editor);\n if (this.renderType !== \"nodeView\") {\n return snapshot({ ...data, renderMode: \"external\" });\n }\n\n const context = liveContext(block, editor);\n const view = renderView(context(block));\n\n return {\n dom: view.dom,\n contentDOM: view.contentDOM,\n destroy: view.destroy,\n update: () => {\n const current = editor.getBlock(block.id);\n if (current?.type !== config.type) {\n return false;\n }\n view.update({ context: context(current) });\n return true;\n },\n };\n };\n\n function createFrameRenderer(\n options: AngularBlockFrameOptions<Config, B, I, S>,\n ): NonNullable<Implementation[\"renderFrame\"]> {\n const findSlot =\n options.findFrameSlot ??\n ((host: HTMLElement) =>\n host.querySelector<HTMLElement>(\"[data-frame-slot]\"));\n return function (block, editor) {\n checkBrowser();\n // The frame hook supplies arbitrary inline and style schemas upstream.\n const owningEditor = editor as unknown as Parameters<Render>[1];\n const context = liveContext(block, owningEditor);\n const live = this.renderType === \"nodeView\";\n const view = createAngularView({\n component: options.component,\n environmentInjector,\n hostElement: environmentInjector.get(DOCUMENT).createElement(\"div\"),\n inputs: {\n context: live\n ? context(block)\n : { ...contextData(block, owningEditor), renderMode: \"external\" },\n },\n findContentDOM: findSlot,\n });\n // createAngularView validates the required slot and tears down on failure.\n const slot = view.contentDOM!;\n slot.setAttribute(\"data-frame-slot\", \"\");\n if (!live) {\n view.destroy();\n return { dom: view.dom, slot };\n }\n return {\n dom: view.dom,\n slot,\n destroy: view.destroy,\n update: (current) => view.update({ context: context(current) }),\n };\n };\n }\n\n return createBlockSpec<Name, Props, Content>(config, {\n parse,\n render: config.layoutOnly ? undefined : render,\n renderFrame: frameOptions && createFrameRenderer(frameOptions),\n toExternalHTML(block, editor, { nestingLevel } = { nestingLevel: 0 }) {\n checkBrowser();\n const context = {\n ...contextData(block, editor),\n renderMode: \"external\",\n } as const;\n return (\n toExternalHTML?.({ ...context, nestingLevel }) ??\n (frameOptions ? undefined : snapshot(context))\n );\n },\n })();\n}\n","import { isPlatformBrowser } from \"@angular/common\";\nimport { DOCUMENT, PLATFORM_ID } from \"@angular/core\";\nimport type { EnvironmentInjector, InputSignal, Type } from \"@angular/core\";\nimport {\n createInlineContentSpec,\n inlineContentToNodes,\n nodeToCustomInlineContent,\n} from \"@blocknote/core\";\nimport type {\n BlockNoteEditor,\n BlockSchema,\n CustomInlineContentConfig,\n CustomInlineContentImplementation,\n DefaultBlockSchema,\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentFromConfig,\n InlineContentSchema,\n InlineContentSpec,\n PartialCustomInlineContentFromConfig,\n StyleSchema,\n} from \"@blocknote/core\";\nimport { createAngularView } from \"./angular-view-renderer\";\n\ntype InlineNode<\n Config extends CustomInlineContentConfig,\n S extends StyleSchema,\n> = Parameters<CustomInlineContentImplementation<Config, S>[\"render\"]>[3];\n\nexport type AngularInlineContentContext<\n Config extends CustomInlineContentConfig,\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n> = Readonly<{\n inlineContent: InlineContentFromConfig<Config, S>;\n editor: BlockNoteEditor<B, I, S>;\n}> &\n (\n | Readonly<{\n renderMode: \"live\";\n node: InlineNode<Config, S>;\n getPos: () => number | undefined;\n /** Replaces this inline element with the supplied content and props. */\n updateInlineContent: (\n update: PartialCustomInlineContentFromConfig<Config, S>,\n ) => void;\n }>\n | Readonly<{ renderMode: \"external\" }>\n );\n\nexport interface AngularInlineContentSpecOptions<\n Config extends CustomInlineContentConfig,\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n> {\n readonly environmentInjector: EnvironmentInjector;\n readonly component: Type<{\n readonly context: InputSignal<AngularInlineContentContext<Config, B, I, S>>;\n }>;\n /** Resolves the stable editable descendant. Defaults to `[data-content-dom]`. */\n readonly findContentDOM?: (host: HTMLElement) => HTMLElement | null;\n readonly parse?: CustomInlineContentImplementation<Config, S>[\"parse\"];\n /** Returning undefined uses a synchronous snapshot of the component. */\n readonly toExternalHTML?: (\n context: Extract<\n AngularInlineContentContext<Config, B, I, S>,\n { renderMode: \"external\" }\n >,\n ) =>\n | { dom: HTMLElement | DocumentFragment; contentDOM?: HTMLElement }\n | undefined;\n}\n\n/** Creates a BlockNote inline spec backed by an Angular component. */\nexport function createAngularInlineContentSpec<\n const Config extends CustomInlineContentConfig,\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n config: Config,\n {\n component,\n environmentInjector,\n findContentDOM = (host) => host.querySelector(\"[data-content-dom]\"),\n parse,\n toExternalHTML,\n }: AngularInlineContentSpecOptions<NoInfer<Config>, B, I, S>,\n): InlineContentSpec<Config> {\n type Context = AngularInlineContentContext<Config, B, I, S>;\n\n function checkBrowser(): void {\n if (!isPlatformBrowser(environmentInjector.get(PLATFORM_ID))) {\n throw new Error(\"Angular inline content rendering requires a browser.\");\n }\n }\n\n function renderView(context: Context) {\n checkBrowser();\n return createAngularView({\n component,\n environmentInjector,\n hostElement: environmentInjector.get(DOCUMENT).createElement(\"span\"),\n inputs: { context },\n findContentDOM: config.content === \"none\" ? undefined : findContentDOM,\n });\n }\n\n const spec: InlineContentSpec<Config> = createInlineContentSpec<Config, S>(\n config,\n {\n parse,\n toExternalHTML:\n toExternalHTML &&\n ((inlineContent, editor) => {\n checkBrowser();\n const typedEditor = editor as BlockNoteEditor<B, I, S>;\n return (\n toExternalHTML({\n inlineContent,\n editor: typedEditor,\n renderMode: \"external\",\n }) ?? spec.implementation.render(inlineContent, () => {}, editor)\n );\n }),\n render(inlineContent, _replace, editor, node, getPos) {\n const typedEditor = editor as BlockNoteEditor<B, I, S>;\n if (getPos() === undefined) {\n const { dom, contentDOM, destroy } = renderView({\n inlineContent,\n editor: typedEditor,\n renderMode: \"external\",\n });\n destroy();\n return { dom, contentDOM };\n }\n\n let active = true;\n const position = () => (active ? getPos() : undefined);\n const updateInlineContent: Extract<\n Context,\n { renderMode: \"live\" }\n >[\"updateInlineContent\"] = (replacement) => {\n const from = position();\n if (from === undefined) return;\n\n // The upstream replacement callback closes over the initial node size.\n // Read the current node so editing the slot before replacement is safe.\n editor.transact((transaction) => {\n const current = transaction.doc.nodeAt(from);\n if (current?.type !== node.type) return;\n\n const nodes = inlineContentToNodes([replacement], editor.pmSchema);\n transaction.replaceWith(\n from,\n from + current.nodeSize,\n nodes.map((replacementNode) =>\n replacementNode.mark(current.marks),\n ),\n );\n });\n };\n const live = {\n editor: typedEditor,\n renderMode: \"live\",\n getPos: position,\n updateInlineContent,\n } as const;\n const view = renderView({ ...live, inlineContent, node });\n\n // BlockNote forwards the render result to the ProseMirror node view.\n return {\n dom: view.dom,\n contentDOM: view.contentDOM,\n update(nextNode: typeof node) {\n if (!nextNode.sameMarkup(node)) return false;\n\n const current = nodeToCustomInlineContent(\n nextNode,\n typedEditor.schema.inlineContentSchema,\n typedEditor.schema.styleSchema,\n ) as unknown as InlineContentFromConfig<Config, S>;\n view.update({\n context: { ...live, node: nextNode, inlineContent: current },\n });\n return true;\n },\n destroy() {\n active = false;\n view.destroy();\n },\n };\n },\n },\n );\n\n return spec;\n}\n","import { inject, InjectionToken } from \"@angular/core\";\nimport type { EnvironmentInjector, Signal } from \"@angular/core\";\nimport type {\n BlockNoteEditor,\n BlockSchema,\n DefaultBlockSchema,\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentSchema,\n StyleSchema,\n} from \"@blocknote/core\";\n\nexport const BLOCK_NOTE_EDITOR_CONTEXT = new InjectionToken<{\n readonly editor: Signal<unknown>;\n readonly environmentInjector: EnvironmentInjector;\n}>(\"NgxBlockNoteComponent editor context\");\n\n/**\n * Reads the nearest host's editor as a signal from an Angular injection context.\n * For a custom schema, pass the same schema types as the host's editor.\n */\nexport function injectBlockNoteEditor<\n BSchema extends BlockSchema = DefaultBlockSchema,\n ISchema extends InlineContentSchema = DefaultInlineContentSchema,\n SSchema extends StyleSchema = DefaultStyleSchema,\n>(): Signal<BlockNoteEditor<BSchema, ISchema, SSchema>> {\n const context = inject(BLOCK_NOTE_EDITOR_CONTEXT, { optional: true });\n if (context === null) {\n throw new Error(\n \"injectBlockNoteEditor() requires an enclosing NgxBlockNoteComponent.\",\n );\n }\n // Angular DI resolves the host instance, but cannot carry schema parameters.\n return context.editor as Signal<BlockNoteEditor<BSchema, ISchema, SSchema>>;\n}\n","import {\n addStyleAttributes,\n BlockNoteEditor,\n createStyleSpec,\n} from \"@blocknote/core\";\nimport type {\n CustomStyleImplementation,\n StyleConfig,\n StyleImplementation,\n StyleSpec,\n} from \"@blocknote/core\";\n\ntype StyleRender<Config extends StyleConfig> =\n StyleImplementation<Config>[\"render\"];\n\nexport function createStyleMark<Config extends StyleConfig>(\n config: Config,\n parse: CustomStyleImplementation<Config>[\"parse\"],\n renderLive: (\n ...args: Parameters<StyleRender<Config>>\n ) => ReturnType<StyleRender<Config>> & { destroy(): void },\n renderSnapshot: StyleRender<Config>,\n renderExternal: StyleRender<Config>,\n): StyleSpec<Config> {\n // BlockNote 0.57.0 configures each mark with its owning editor and stores\n // the string payload in stringValue. Its stock mark view drops destroy.\n const base = createStyleSpec(config, {\n parse,\n render() {\n throw new Error(\"Angular styles require an editor when rendering.\");\n },\n });\n\n function getEditor(options: { editor?: unknown }) {\n const { editor } = options;\n if (!(editor instanceof BlockNoteEditor)) {\n throw new Error(\n \"BlockNote did not supply the editor for the Angular mark.\",\n );\n }\n return editor;\n }\n\n const decorate = <View extends ReturnType<StyleRender<Config>>>(\n view: View,\n value: Parameters<StyleRender<Config>>[0],\n ): View => {\n addStyleAttributes(view, config.type, value, config.propSchema);\n return view;\n };\n\n return {\n ...base,\n implementation: {\n mark: base.implementation.mark.extend<{ editor?: unknown }>({\n addMarkView() {\n const editor = getEditor(this.options);\n return ({ mark }) => {\n const value = mark.attrs[\"stringValue\"];\n return decorate(renderLive(value, editor), value);\n };\n },\n renderHTML({ mark }) {\n const value = mark.attrs[\"stringValue\"];\n return decorate(\n renderExternal(value, getEditor(this.options)),\n value,\n );\n },\n }),\n render: (value, editor) => decorate(renderSnapshot(value, editor), value),\n toExternalHTML: (value, editor) =>\n decorate(renderExternal(value, editor), value),\n },\n };\n}\n","import { isPlatformBrowser } from \"@angular/common\";\nimport { DOCUMENT, PLATFORM_ID } from \"@angular/core\";\nimport type { EnvironmentInjector, InputSignal, Type } from \"@angular/core\";\nimport type {\n BlockNoteEditor,\n BlockSchema,\n CustomStyleImplementation,\n DefaultBlockSchema,\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentSchema,\n StyleConfig,\n StyleImplementation,\n StyleSchema,\n StyleSpec,\n} from \"@blocknote/core\";\nimport { createAngularView } from \"./angular-view-renderer\";\nimport { createStyleMark } from \"./block-note-style-mark\";\n\ntype StyleValues = { boolean: true; string: string };\n\nexport type AngularStyleContext<\n Config extends StyleConfig,\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n> = Readonly<{\n value: StyleValues[Config[\"propSchema\"]];\n editor: BlockNoteEditor<B, I, S>;\n renderMode: \"live\" | \"external\";\n}>;\n\nexport interface AngularStyleSpecOptions<\n Config extends StyleConfig,\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n> {\n readonly environmentInjector: EnvironmentInjector;\n readonly component: Type<{\n readonly context: InputSignal<AngularStyleContext<Config, B, I, S>>;\n }>;\n /** Resolves the stable inline descendant. Defaults to `[data-content-dom]`. */\n readonly findContentDOM?: (host: HTMLElement) => HTMLElement | null;\n readonly parse?: CustomStyleImplementation<Config>[\"parse\"];\n /** Returning undefined uses a synchronous snapshot of the component. */\n readonly toExternalHTML?: (\n context: AngularStyleContext<Config, B, I, S> & { renderMode: \"external\" },\n ) => { dom: HTMLElement; contentDOM: HTMLElement } | undefined;\n}\n\n/** Creates a BlockNote text style backed by an Angular component. */\nexport function createAngularStyleSpec<\n const Config extends StyleConfig,\n B extends BlockSchema = DefaultBlockSchema,\n I extends InlineContentSchema = DefaultInlineContentSchema,\n S extends StyleSchema = DefaultStyleSchema,\n>(\n config: Config,\n {\n component,\n environmentInjector,\n findContentDOM = (host) => host.querySelector(\"[data-content-dom]\"),\n parse,\n toExternalHTML,\n }: AngularStyleSpecOptions<NoInfer<Config>, B, I, S>,\n): StyleSpec<Config> {\n type Context = AngularStyleContext<Config, B, I, S>;\n type RenderArgs = Parameters<StyleImplementation<Config>[\"render\"]>;\n\n function contextFor<Mode extends Context[\"renderMode\"]>(\n renderMode: Mode,\n [value, editor]: RenderArgs,\n ): Context & { renderMode: Mode } {\n if (!isPlatformBrowser(environmentInjector.get(PLATFORM_ID))) {\n throw new Error(\"Angular style rendering requires a browser.\");\n }\n return {\n value: (config.propSchema === \"boolean\"\n ? true\n : value) as Context[\"value\"],\n editor: editor as Context[\"editor\"],\n renderMode,\n };\n }\n\n function renderView(context: Context) {\n return createAngularView({\n component,\n environmentInjector,\n hostElement: environmentInjector.get(DOCUMENT).createElement(\"span\"),\n inputs: { context },\n findContentDOM,\n });\n }\n\n function snapshot(context: Context) {\n const { dom, contentDOM, destroy } = renderView(context);\n destroy();\n return { dom, contentDOM };\n }\n\n return createStyleMark(\n config,\n parse,\n (...args) => renderView(contextFor(\"live\", args)),\n (...args) => snapshot(contextFor(\"external\", args)),\n (...args) => {\n const context = contextFor(\"external\", args);\n return toExternalHTML?.(context) ?? snapshot(context);\n },\n );\n}\n","import {\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n EnvironmentInjector,\n inject,\n input,\n output,\n untracked,\n viewChild,\n} from \"@angular/core\";\nimport type {\n BlockNoteEditor,\n BlockSchema,\n DefaultBlockSchema,\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentSchema,\n StyleSchema,\n} from \"@blocknote/core\";\nimport { BLOCK_NOTE_EDITOR_CONTEXT } from \"./block-note-editor-context\";\nimport type {\n NgxBlockNoteChangeEvent,\n NgxBlockNoteFocusChangeEvent,\n NgxBlockNoteSelectionChangeEvent,\n} from \"./ngx-blocknote.events\";\n\n/** Hosts the currently supplied caller-owned BlockNote editor. */\n@Component({\n selector: \"ngx-blocknote\",\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: \"ngx-blocknote\" },\n // SSR and hydration share this empty mount element. Angular never renders\n // children inside it, so BlockNote owns its contents after the browser render.\n template: '<div #mountPoint class=\"ngx-blocknote-mount\"></div><ng-content />',\n providers: [\n {\n provide: BLOCK_NOTE_EDITOR_CONTEXT,\n useFactory: () => ({\n editor: inject(NgxBlockNoteComponent).editor,\n environmentInjector: inject(EnvironmentInjector),\n }),\n },\n ],\n})\nexport class NgxBlockNoteComponent<\n BSchema extends BlockSchema = DefaultBlockSchema,\n ISchema extends InlineContentSchema = DefaultInlineContentSchema,\n SSchema extends StyleSchema = DefaultStyleSchema,\n> {\n readonly editor =\n input.required<BlockNoteEditor<BSchema, ISchema, SSchema>>();\n\n /** When undefined, leaves the caller's editable state as it is. */\n readonly editable = input<boolean>();\n\n /** Emits on document changes with a lazy getChanges callback. */\n readonly contentChange =\n output<NgxBlockNoteChangeEvent<BSchema, ISchema, SSchema>>();\n\n /** Emits when the cursor or selection changes. */\n readonly selectionChange =\n output<NgxBlockNoteSelectionChangeEvent<BSchema, ISchema, SSchema>>();\n\n /** Emits when the editor's content area gains or loses DOM focus. */\n readonly focusChange =\n output<NgxBlockNoteFocusChangeEvent<BSchema, ISchema, SSchema>>();\n\n private readonly mountPoint =\n viewChild.required<ElementRef<HTMLDivElement>>(\"mountPoint\");\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n let mountedEditor: BlockNoteEditor<BSchema, ISchema, SSchema> | undefined;\n let unsubscribe: (() => void)[] = [];\n\n const unmount = () => {\n const editor = mountedEditor;\n mountedEditor = undefined;\n const listeners = unsubscribe;\n unsubscribe = [];\n for (const remove of listeners) {\n remove();\n }\n editor?.unmount();\n };\n destroyRef.onDestroy(unmount);\n\n // Render effects run only in the browser, after the host view is rendered.\n afterRenderEffect({\n mixedReadWrite: () => {\n const editor = this.editor();\n const editable = this.editable();\n const element = this.mountPoint().nativeElement;\n\n // Upstream callbacks may read their own signals during editor operations.\n untracked(() => {\n const swapping = mountedEditor !== editor;\n if (swapping) {\n unmount();\n }\n if (editable !== undefined) {\n const dom = swapping ? undefined : editor.domElement;\n const tabIndex = dom?.getAttribute(\"tabindex\");\n const wasFocused = dom?.matches(\":focus\");\n editor.isEditable = editable;\n // BlockNote 0.57 can lose its tabindex when toggling to read-only.\n if (dom && tabIndex != null && !dom.hasAttribute(\"tabindex\")) {\n dom.setAttribute(\"tabindex\", tabIndex);\n if (wasFocused) {\n dom.focus({ preventScroll: true });\n }\n }\n }\n if (swapping) {\n try {\n unsubscribe.push(\n editor.onChange((editor, context) =>\n this.contentChange.emit({ editor, ...context }),\n ),\n );\n unsubscribe.push(\n editor.onSelectionChange((editor) =>\n this.selectionChange.emit({ editor }),\n ),\n );\n unsubscribe.push(\n editor.onFocusChange((editor, context) =>\n this.focusChange.emit({ editor, ...context }),\n ),\n );\n mountedEditor = editor;\n editor.mount(element);\n } catch (error) {\n unmount();\n throw error;\n }\n }\n });\n },\n });\n }\n}\n","import { DestroyRef, inject, signal } from \"@angular/core\";\nimport type { Injector, Signal, ValueEqualityFn } from \"@angular/core\";\nimport type { Store } from \"@blocknote/core\";\n\nexport type ReadableBlockNoteStore<State> = Readonly<\n Pick<Store<State>, \"state\" | \"subscribe\">\n>;\n\nexport interface BlockNoteSignalOptions<State, Selected> {\n selector: (state: State) => Selected;\n equal?: ValueEqualityFn<Selected>;\n injector?: Injector;\n}\n\n/** Reads a BlockNote store as a signal scoped to the Angular injection context. */\nexport function toBlockNoteSignal<State, Selected>(\n store: ReadableBlockNoteStore<State>,\n {\n selector,\n equal = Object.is,\n injector,\n }: BlockNoteSignalOptions<State, Selected>,\n): Signal<Selected> {\n const destroyRef = injector ? injector.get(DestroyRef) : inject(DestroyRef);\n const selected = signal(selector(store.state), { equal });\n const unsubscribe = store.subscribe(({ currentVal }) => {\n if (!destroyRef.destroyed) {\n selected.set(selector(currentVal));\n }\n });\n destroyRef.onDestroy(unsubscribe);\n return selected.asReadonly();\n}\n"],"mappings":";;;;AA4BA,SAAgB,kBA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A;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,iBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,iBAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAY,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA;ACzD/D,SAAgB,kBACd,OACA,EACE,UACA,QAAQ,OAAO,IACf,YACwC;CAE1C,MAAM,aAAa,WAAW,SAAS,IAAI,UAAU,IAAI,OAAO,UAAU;CAC1E,MAAM,WAAW,OAAO,SAAS,MAAM,KAAK,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI;CAAK,CAAA;CACtD,MAAM,cAAc,MAAM,WAAW,EAAE,iBAAgB;EACrD,IAAI,CAAC,WAAW,WACd,SAAS,IAAI,SAAS,UAAU,CAAC;CAErC,CAAC;CACD,WAAW,UAAU,WAAW;CAChC,OAAO,SAAS,WAAU;AAC5B"}
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
+ "license": "MPL-2.0",
3
+ "repository": {
4
+ "type": "git",
5
+ "url": "git+https://github.com/r-zubkov/ngx-blocknote.git"
6
+ },
7
+ "publishConfig": {
8
+ "access": "public",
9
+ "tag": "next"
10
+ },
11
+ "engines": {
12
+ "node": "^22.22.3 || ^24.15.0 || >=26.0.0"
13
+ },
14
+ "peerDependencies": {
15
+ "@angular/common": ">=22.3.0 <23.0.0",
16
+ "@angular/core": ">=22.3.0 <23.0.0",
17
+ "@blocknote/core": ">=0.57.0 <0.58.0",
18
+ "rxjs": "^7.4.0"
19
+ },
20
+ "dependencies": {
21
+ "tslib": "2.9.1"
22
+ },
23
+ "sideEffects": false,
2
24
  "name": "@r-zubkov/ngx-blocknote",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
25
+ "type": "module",
26
+ "main": "./fesm2022/r-zubkov-ngx-blocknote.mjs",
27
+ "module": "./fesm2022/r-zubkov-ngx-blocknote.mjs",
28
+ "typings": "./types/r-zubkov-ngx-blocknote.d.ts",
29
+ "types": "./types/r-zubkov-ngx-blocknote.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./types/r-zubkov-ngx-blocknote.d.ts",
33
+ "default": "./fesm2022/r-zubkov-ngx-blocknote.mjs"
34
+ },
35
+ "./package.json": {
36
+ "default": "./package.json"
37
+ }
38
+ },
39
+ "version": "0.1.0-next.0"
6
40
  }