@ecodev/natural-editor 41.2.1 → 41.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"ecodev-natural-editor.js","sources":["../../../projects/natural-editor/src/lib/utils/image.ts","../../../projects/natural-editor/src/lib/utils/schema.ts","../../../projects/natural-editor/src/lib/link-dialog/link-dialog.component.ts","../../../projects/natural-editor/src/lib/link-dialog/link-dialog.component.html","../../../projects/natural-editor/src/lib/utils/table.ts","../../../projects/natural-editor/src/lib/utils/menu.ts","../../../projects/natural-editor/src/lib/utils/inputrules.ts","../../../projects/natural-editor/src/lib/utils/keymap.ts","../../../projects/natural-editor/src/lib/editor/editor.component.ts","../../../projects/natural-editor/src/lib/editor/editor.component.html","../../../projects/natural-editor/src/lib/editor.module.ts","../../../projects/natural-editor/src/public-api.ts","../../../projects/natural-editor/src/ecodev-natural-editor.ts"],"sourcesContent":["import {Decoration, DecorationSet, EditorView} from 'prosemirror-view';\nimport {EditorState, Plugin} from 'prosemirror-state';\nimport {Observable} from 'rxjs';\nimport {Schema} from 'prosemirror-model';\nimport {Inject, Injectable} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\n\nexport type ImageUploader = (file: File) => Observable<string>;\n\n@Injectable()\nexport class ImagePlugin {\n public readonly plugin: Plugin<DecorationSet>;\n\n constructor(@Inject(DOCUMENT) private readonly document: Document) {\n this.plugin = new Plugin<DecorationSet>({\n state: {\n init(): DecorationSet {\n return DecorationSet.empty;\n },\n apply(tr, set): DecorationSet {\n // Adjust decoration positions to changes made by the transaction\n set = set.map(tr.mapping, tr.doc);\n\n // See if the transaction adds or removes any placeholders\n const action = tr.getMeta(this);\n if (action && action.add) {\n const widget = document.createElement('placeholder');\n const deco = Decoration.widget(action.add.pos, widget, {id: action.add.id});\n set = set.add(tr.doc, [deco]);\n } else if (action && action.remove) {\n set = set.remove(set.find(undefined, undefined, spec => spec.id === action.remove.id));\n }\n\n return set;\n },\n },\n props: {\n decorations(state): DecorationSet {\n return this.getState(state);\n },\n },\n });\n }\n\n private findPlaceholder(state: EditorState, id: {}): number | null {\n const decorators = this.plugin.getState(state);\n const found = decorators.find(undefined, undefined, spec => spec.id === id);\n return found.length ? found[0].from : null;\n }\n\n public startImageUpload(view: EditorView, file: File, uploader: ImageUploader, schema: Schema): void {\n // A fresh object to act as the ID for this upload\n const id = {};\n\n // Replace the selection with a placeholder\n const tr = view.state.tr;\n if (!tr.selection.empty) {\n tr.deleteSelection();\n }\n\n tr.setMeta(this.plugin, {add: {id, pos: tr.selection.from}});\n view.dispatch(tr);\n\n uploader(file).subscribe({\n next: url => {\n const pos = this.findPlaceholder(view.state, id);\n // If the content around the placeholder has been deleted, drop\n // the image\n if (pos === null) {\n return;\n }\n\n // Otherwise, insert it at the placeholder's position, and remove\n // the placeholder\n view.dispatch(\n view.state.tr\n .replaceWith(pos, pos, schema.nodes.image.create({src: url}))\n .setMeta(this.plugin, {remove: {id}}),\n );\n },\n error: () => {\n // On failure, just clean up the placeholder\n view?.dispatch(tr.setMeta(this.plugin, {remove: {id}}));\n },\n });\n }\n}\n","import {marks, nodes} from 'prosemirror-schema-basic';\nimport {addListNodes} from 'prosemirror-schema-list';\nimport {Schema} from 'prosemirror-model';\nimport {tableNodes} from 'prosemirror-tables';\n\n// Keep only basic elements\ntype BasicNodes = Omit<typeof nodes, 'image' | 'code_block' | 'blockquote' | 'horizontal_rule'>;\nconst basicNodes: BasicNodes = {\n heading: nodes.heading,\n doc: nodes.doc,\n paragraph: nodes.paragraph,\n text: nodes.text,\n hard_break: nodes.hard_break,\n};\n\ntype BasicMarks = Omit<typeof marks, 'code'>;\nconst basicMarks: BasicMarks = {\n link: marks.link,\n em: marks.em,\n strong: marks.strong,\n};\n\nconst tmpSchema = new Schema({nodes: basicNodes, marks: basicMarks});\n\nexport const basicSchema = new Schema({\n nodes: addListNodes(tmpSchema.spec.nodes, 'paragraph block*', 'block'),\n marks: tmpSchema.spec.marks,\n});\n\nconst tmpSchema2 = new Schema({\n nodes: {\n ...nodes,\n ...tableNodes({\n tableGroup: 'block',\n cellContent: 'block+',\n cellAttributes: {\n background: {\n default: null,\n getFromDOM(dom: Element): string | null {\n return (dom as HTMLElement).style.backgroundColor || null;\n },\n setDOMAttr(value: any, attrs: any): void {\n if (value) {\n attrs.style = (attrs.style || '') + `background-color: ${value};`;\n }\n },\n },\n },\n }),\n },\n marks: basicMarks,\n});\n\nexport const advancedSchema = new Schema({\n nodes: addListNodes(tmpSchema2.spec.nodes, 'paragraph block*', 'block'),\n marks: basicMarks,\n});\n","import {Component, Inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, Validators} from '@angular/forms';\nimport {ifValid} from '@ecodev/natural';\n\nexport interface LinkDialogData {\n href: string;\n title?: string;\n}\n\n@Component({\n templateUrl: './link-dialog.component.html',\n styleUrls: ['./link-dialog.component.scss'],\n})\nexport class LinkDialogComponent {\n public readonly hrefControl = new FormControl('', Validators.required);\n public readonly titleControl = new FormControl('');\n public readonly form = new FormGroup({\n href: this.hrefControl,\n title: this.titleControl,\n });\n\n constructor(\n @Inject(MAT_DIALOG_DATA) data: LinkDialogData,\n private dialogRef: MatDialogRef<LinkDialogComponent, LinkDialogData>,\n ) {\n this.form.setValue(data);\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.value);\n }\n}\n","<h2 i18n mat-dialog-title>Insérer un lien</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n>URL</mat-label>\n <input matInput [formControl]=\"hrefControl\" (keydown.enter)=\"maybeConfirm()\" />\n <mat-error *ngIf=\"hrefControl.hasError('required')\" i18n>Ce champ est requis</mat-error>\n </mat-form-field>\n <mat-form-field>\n <mat-label i18n>Titre</mat-label>\n <input matInput [formControl]=\"titleControl\" (keydown.enter)=\"maybeConfirm()\" />\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button mat-button [mat-dialog-close] i18n>Annuler</button>\n <button mat-stroked-button (click)=\"maybeConfirm()\" [disabled]=\"!form.valid\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {EditorState, TextSelection, Transaction} from 'prosemirror-state';\nimport {Fragment, Node as ProsemirrorNode, NodeType} from 'prosemirror-model';\nimport {tableNodeTypes} from 'prosemirror-tables';\n\nfunction createCell(\n cellType: NodeType,\n cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>,\n): ProsemirrorNode<any> | null | undefined {\n return cellContent ? cellType.createChecked(null, cellContent) : cellType.createAndFill();\n}\n\nfunction createTable(\n state: EditorState,\n rowsCount: number,\n colsCount: number,\n withHeaderRow: boolean,\n cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>,\n): ProsemirrorNode {\n const types = tableNodeTypes(state.schema);\n const headerCells = [];\n const cells = [];\n\n for (let index = 0; index < colsCount; index += 1) {\n const cell = createCell(types.cell, cellContent);\n\n if (cell) {\n cells.push(cell);\n }\n\n if (withHeaderRow) {\n const headerCell = createCell(types.header_cell, cellContent);\n\n if (headerCell) {\n headerCells.push(headerCell);\n }\n }\n }\n\n const rows = [];\n\n for (let index = 0; index < rowsCount; index += 1) {\n rows.push(types.row.createChecked(null, withHeaderRow && index === 0 ? headerCells : cells));\n }\n\n return types.table.createChecked(null, rows);\n}\n\nexport function addTable(\n state: EditorState,\n dispatch?: (tr: Transaction) => void,\n {\n rowsCount = 3,\n colsCount = 3,\n withHeaderRow = true,\n cellContent,\n }: {\n rowsCount?: number;\n colsCount?: number;\n withHeaderRow?: boolean;\n cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>;\n } = {},\n): void {\n const offset = state.tr.selection.anchor + 1;\n\n const nodes = createTable(state, rowsCount, colsCount, withHeaderRow, cellContent);\n const tr = state.tr.replaceSelectionWith(nodes).scrollIntoView();\n const resolvedPos = tr.doc.resolve(offset);\n\n // move cursor into table\n tr.setSelection(TextSelection.near(resolvedPos));\n\n dispatch?.(tr);\n}\n","import {\n blockTypeItem,\n joinUpItem,\n liftItem,\n MenuItem,\n MenuItemSpec,\n redoItem,\n selectParentNodeItem,\n undoItem,\n wrapItem,\n} from 'prosemirror-menu';\nimport {EditorState, Transaction} from 'prosemirror-state';\nimport {Command, toggleMark} from 'prosemirror-commands';\nimport {wrapInList} from 'prosemirror-schema-list';\nimport {MarkType, NodeType, Schema} from 'prosemirror-model';\nimport {MatDialog} from '@angular/material/dialog';\nimport {LinkDialogComponent, LinkDialogData} from '../link-dialog/link-dialog.component';\nimport {EditorView} from 'prosemirror-view';\nimport {\n addColumnAfter,\n addColumnBefore,\n addRowAfter,\n addRowBefore,\n deleteColumn,\n deleteRow,\n deleteTable,\n mergeCells,\n splitCell,\n toggleHeaderCell,\n toggleHeaderColumn,\n toggleHeaderRow,\n} from 'prosemirror-tables';\nimport {addTable} from './table';\n\n/**\n * One item of the menu.\n *\n * This is the equivalent of `MenuItem` but without all the rendering logic since we use Angular\n * templates for rendering. Also it caches the state of the item everytime the editor state changes,\n * so Angular can query the state as often as needed without performance hit.\n */\nexport class Item {\n /**\n * Whether the item is 'active' (for example, the item for toggling the strong mark might be active when the cursor is in strong text).\n */\n public active = false;\n\n /**\n * Button is shown but disabled, because the item cannot be (un-)applied\n */\n public disabled = false;\n\n /**\n * Whether the item is shown at the moment\n */\n public show = true;\n\n constructor(public readonly spec: MenuItemSpec) {}\n\n /**\n * Update the item state according to the editor state\n */\n public update(view: EditorView, state: EditorState): void {\n if (this.spec.active) {\n this.active = this.spec.active(state);\n }\n\n if (this.spec.enable) {\n this.disabled = !this.spec.enable(state);\n }\n\n if (this.spec.select) {\n this.show = this.spec.select(state);\n }\n }\n}\n\n/**\n * Convert built-in `MenuItem` into our Angular specific `Item`\n */\nfunction toItem(item: MenuItem): Item {\n return new Item(item.spec);\n}\n\nfunction canInsert(state: EditorState, nodeType: NodeType): boolean {\n const $from = state.selection.$from;\n for (let d = $from.depth; d >= 0; d--) {\n const index = $from.index(d);\n if ($from.node(d).canReplaceWith(index, index, nodeType)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction cmdItem(cmd: Command, options: Partial<MenuItemSpec> = {}, useEnable = false): Item {\n const passedOptions: MenuItemSpec = {\n run: cmd,\n ...options,\n };\n\n if ((!options.enable || useEnable) && !options.select) {\n passedOptions[options.enable ? 'enable' : 'select'] = (state: EditorState) => cmd(state);\n }\n\n return new Item(passedOptions);\n}\n\nfunction markActive(state: EditorState, type: MarkType): boolean {\n const {from, $from, to, empty} = state.selection;\n if (empty) {\n return !!type.isInSet(state.storedMarks || $from.marks());\n } else {\n return state.doc.rangeHasMark(from, to, type);\n }\n}\n\nfunction markItem(markType: MarkType, options: Partial<MenuItemSpec> = {}): Item {\n const passedOptions: Partial<MenuItemSpec> = {\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n ...options,\n };\n\n return cmdItem(toggleMark(markType), passedOptions, true);\n}\n\nfunction linkItem(markType: MarkType, dialog: MatDialog): Item {\n return new Item({\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n enable(state: EditorState): boolean {\n return !state.selection.empty;\n },\n run(state: EditorState, dispatch: (p: Transaction) => void, view: EditorView): boolean | void {\n if (markActive(state, markType)) {\n toggleMark(markType)(state, dispatch);\n return true;\n }\n\n dialog\n .open<LinkDialogComponent, LinkDialogData, LinkDialogData>(LinkDialogComponent, {\n data: {\n href: '',\n title: '',\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (result) {\n if (!result.title) {\n delete result.title;\n }\n\n toggleMark(markType, result)(view.state, view.dispatch);\n }\n\n view.focus();\n });\n },\n });\n}\n\nfunction wrapListItem(nodeType: NodeType): Item {\n return cmdItem(wrapInList(nodeType));\n}\n\nexport type Key =\n | 'toggleStrong'\n | 'toggleEm'\n | 'toggleCode'\n | 'toggleLink'\n | 'wrapBulletList'\n | 'wrapOrderedList'\n | 'wrapBlockQuote'\n | 'makeParagraph'\n | 'makeCodeBlock'\n | 'makeHead1'\n | 'makeHead2'\n | 'makeHead3'\n | 'makeHead4'\n | 'makeHead5'\n | 'makeHead6'\n | 'insertHorizontalRule'\n | 'joinUp'\n | 'lift'\n | 'selectParentNode'\n | 'undo'\n | 'redo'\n | 'insertTable'\n | 'addColumnBefore'\n | 'addColumnAfter'\n | 'deleteColumn'\n | 'addRowBefore'\n | 'addRowAfter'\n | 'deleteRow'\n | 'deleteTable'\n | 'mergeCells'\n | 'splitCell'\n | 'toggleHeaderColumn'\n | 'toggleHeaderRow'\n | 'toggleHeaderCell';\n\nexport type MenuItems = Partial<Record<Key, Item>>;\n\n/**\n * Given a schema, look for default mark and node types in it and\n * return an object with relevant menu items relating to those marks:\n */\nexport function buildMenuItems(schema: Schema, dialog: MatDialog): MenuItems {\n const r: MenuItems = {\n joinUp: toItem(joinUpItem),\n lift: toItem(liftItem),\n selectParentNode: toItem(selectParentNodeItem),\n undo: toItem(undoItem as unknown as MenuItem), // Typing is incorrect, so we force it\n redo: toItem(redoItem as unknown as MenuItem),\n };\n\n let type: MarkType | NodeType | undefined;\n type = schema.marks.strong;\n if (type) {\n r.toggleStrong = markItem(type);\n }\n\n type = schema.marks.em;\n if (type) {\n r.toggleEm = markItem(type);\n }\n\n type = schema.marks.code;\n if (type) {\n r.toggleCode = markItem(type);\n }\n\n type = schema.marks.link;\n if (type) {\n r.toggleLink = linkItem(type, dialog);\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n r.wrapBulletList = wrapListItem(type);\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n r.wrapOrderedList = wrapListItem(type);\n }\n\n type = schema.nodes.blockquote;\n if (type) {\n r.wrapBlockQuote = toItem(wrapItem(type, {}));\n }\n\n type = schema.nodes.paragraph;\n if (type) {\n r.makeParagraph = toItem(blockTypeItem(type, {}));\n }\n\n type = schema.nodes.code_block;\n if (type) {\n r.makeCodeBlock = toItem(blockTypeItem(type, {}));\n }\n\n type = schema.nodes.heading;\n if (type) {\n r.makeHead1 = toItem(blockTypeItem(type, {attrs: {level: 1}}));\n r.makeHead2 = toItem(blockTypeItem(type, {attrs: {level: 2}}));\n r.makeHead3 = toItem(blockTypeItem(type, {attrs: {level: 3}}));\n r.makeHead4 = toItem(blockTypeItem(type, {attrs: {level: 4}}));\n r.makeHead5 = toItem(blockTypeItem(type, {attrs: {level: 5}}));\n r.makeHead6 = toItem(blockTypeItem(type, {attrs: {level: 6}}));\n }\n\n type = schema.nodes.horizontal_rule;\n if (type) {\n const hr = type;\n r.insertHorizontalRule = new Item({\n enable(state): boolean {\n return canInsert(state, hr);\n },\n run(state, dispatch): void {\n dispatch(state.tr.replaceSelectionWith(hr.create()));\n },\n });\n }\n\n type = schema.nodes.table;\n if (type) {\n r.insertTable = new Item({run: (e, tr) => addTable(e, tr)});\n r.addColumnBefore = new Item({run: addColumnBefore});\n r.addColumnAfter = new Item({run: addColumnAfter});\n r.deleteColumn = new Item({run: deleteColumn});\n r.addRowBefore = new Item({run: addRowBefore});\n r.addRowAfter = new Item({run: addRowAfter});\n r.deleteRow = new Item({run: deleteRow});\n r.deleteTable = new Item({run: deleteTable});\n r.mergeCells = new Item({run: mergeCells});\n r.splitCell = new Item({run: splitCell});\n r.toggleHeaderColumn = new Item({run: toggleHeaderColumn});\n r.toggleHeaderRow = new Item({run: toggleHeaderRow});\n r.toggleHeaderCell = new Item({run: toggleHeaderCell});\n }\n\n return r;\n}\n","import {\n ellipsis,\n emDash,\n InputRule,\n inputRules,\n textblockTypeInputRule,\n wrappingInputRule,\n} from 'prosemirror-inputrules';\nimport {NodeType, Schema} from 'prosemirror-model';\nimport {Plugin} from 'prosemirror-state';\n\n/**\n * Given a blockquote node type, returns an input rule that turns `\"> \"`\n * at the start of a textblock into a blockquote.\n */\nfunction blockQuoteRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(/^\\s*>\\s$/, nodeType);\n}\n\n/**\n * Given a list node type, returns an input rule that turns a number\n * followed by a dot at the start of a textblock into an ordered list.\n */\nfunction orderedListRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(\n /^(\\d+)\\.\\s$/,\n nodeType,\n match => ({order: +match[1]}),\n (match, node) => node.childCount + node.attrs.order === +match[1],\n );\n}\n\n/**\n * Given a list node type, returns an input rule that turns a bullet\n * (dash, plush, or asterisk) at the start of a textblock into a\n * bullet list.\n */\nfunction bulletListRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(/^\\s*([-+*])\\s$/, nodeType);\n}\n\n/**\n * Given a code block node type, returns an input rule that turns a\n * textblock starting with three backticks into a code block.\n */\nfunction codeBlockRule(nodeType: NodeType): InputRule {\n return textblockTypeInputRule(/^```$/, nodeType);\n}\n\n/**\n * Given a node type and a maximum level, creates an input rule that\n * turns up to that number of `#` characters followed by a space at\n * the start of a textblock into a heading whose level corresponds to\n * the number of `#` signs.\n */\nfunction headingRule(nodeType: NodeType, maxLevel: number): InputRule {\n return textblockTypeInputRule(new RegExp('^(#{1,' + maxLevel + '})\\\\s$'), nodeType, match => ({\n level: match[1].length,\n }));\n}\n\n/**\n * A set of input rules for creating the basic block quotes, lists,\n * code blocks, and heading.\n */\nexport function buildInputRules(schema: Schema): Plugin {\n const rules = [ellipsis, emDash];\n\n let type = schema.nodes.blockquote;\n if (type) {\n rules.push(blockQuoteRule(type));\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n rules.push(orderedListRule(type));\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n rules.push(bulletListRule(type));\n }\n\n type = schema.nodes.code_block;\n if (type) {\n rules.push(codeBlockRule(type));\n }\n\n type = schema.nodes.heading;\n if (type) {\n rules.push(headingRule(type, 6));\n }\n\n return inputRules({rules});\n}\n","import {\n chainCommands,\n exitCode,\n joinDown,\n joinUp,\n Keymap,\n lift,\n selectParentNode,\n setBlockType,\n toggleMark,\n wrapIn,\n} from 'prosemirror-commands';\nimport {liftListItem, sinkListItem, splitListItem, wrapInList} from 'prosemirror-schema-list';\nimport {redo, undo} from 'prosemirror-history';\nimport {undoInputRule} from 'prosemirror-inputrules';\nimport {MarkType, NodeType, Schema} from 'prosemirror-model';\n\n/**\n * Inspect the given schema looking for marks and nodes from the\n * basic schema, and if found, add key bindings related to them.\n * This will add:\n *\n * * **Mod-b** for toggling [strong](#schema-basic.StrongMark)\n * * **Mod-i** for toggling [emphasis](#schema-basic.EmMark)\n * * **Mod-`** for toggling [code font](#schema-basic.CodeMark)\n * * **Ctrl-Shift-0** for making the current textblock a paragraph\n * * **Ctrl-Shift-1** to **Ctrl-Shift-Digit6** for making the current\n * textblock a heading of the corresponding level\n * * **Ctrl-Shift-Backslash** to make the current textblock a code block\n * * **Ctrl-Shift-8** to wrap the selection in an ordered list\n * * **Ctrl-Shift-9** to wrap the selection in a bullet list\n * * **Ctrl->** to wrap the selection in a block quote\n * * **Enter** to split a non-empty textblock in a list item while at\n * the same time splitting the list item\n * * **Mod-Enter** to insert a hard break\n * * **Mod-_** to insert a horizontal rule\n * * **Backspace** to undo an input rule\n * * **Alt-ArrowUp** to `joinUp`\n * * **Alt-ArrowDown** to `joinDown`\n * * **Mod-BracketLeft** to `lift`\n * * **Escape** to `selectParentNode`\n *\n * You can suppress or map these bindings by passing a `mapKeys`\n * argument, which maps key names (say `\"Mod-B\"` to either `false`, to\n * remove the binding, or a new key name string.\n */\nexport function buildKeymap(schema: Schema, isMac: boolean): Keymap {\n const keys: Keymap = {};\n\n keys['Mod-z'] = undo;\n keys['Shift-Mod-z'] = redo;\n keys['Backspace'] = undoInputRule;\n if (!isMac) {\n keys['Mod-y'] = redo;\n }\n\n keys['Alt-ArrowUp'] = joinUp;\n keys['Alt-ArrowDown'] = joinDown;\n keys['Mod-BracketLeft'] = lift;\n keys['Escape'] = selectParentNode;\n\n let type: MarkType | NodeType = schema.marks.strong;\n if (type) {\n keys['Mod-b'] = toggleMark(type);\n keys['Mod-B'] = toggleMark(type);\n }\n\n type = schema.marks.em;\n if (type) {\n keys['Mod-i'] = toggleMark(type);\n keys['Mod-I'] = toggleMark(type);\n }\n\n type = schema.marks.code;\n if (type) {\n keys['Mod-`'] = toggleMark(type);\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n keys['Shift-Ctrl-8'] = wrapInList(type);\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n keys['Shift-Ctrl-9'] = wrapInList(type);\n }\n\n type = schema.nodes.blockquote;\n if (type) {\n keys['Ctrl->'] = wrapIn(type);\n }\n\n type = schema.nodes.hard_break;\n if (type) {\n const br = type;\n const cmd = chainCommands(exitCode, (state, dispatch) => {\n dispatch?.(state.tr.replaceSelectionWith(br.create()).scrollIntoView());\n return true;\n });\n keys['Mod-Enter'] = cmd;\n keys['Shift-Enter'] = cmd;\n if (isMac) {\n keys['Ctrl-Enter'] = cmd;\n }\n }\n\n type = schema.nodes.list_item;\n if (type) {\n keys['Enter'] = splitListItem(type);\n keys['Mod-['] = liftListItem(type);\n keys['Mod-]'] = sinkListItem(type);\n }\n\n type = schema.nodes.paragraph;\n if (type) {\n keys['Shift-Ctrl-0'] = setBlockType(type);\n }\n\n type = schema.nodes.code_block;\n if (type) {\n keys['Shift-Ctrl-\\\\'] = setBlockType(type);\n }\n\n type = schema.nodes.heading;\n if (type) {\n for (let i = 1; i <= 6; i++) {\n keys['Shift-Ctrl-' + i] = setBlockType(type, {level: i});\n }\n }\n\n type = schema.nodes.horizontal_rule;\n if (type) {\n const hr = type;\n keys['Mod-_'] = (state, dispatch) => {\n dispatch?.(state.tr.replaceSelectionWith(hr.create()).scrollIntoView());\n return true;\n };\n }\n\n return keys;\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {ControlValueAccessor, NgControl} from '@angular/forms';\nimport {EditorView} from 'prosemirror-view';\nimport {EditorState, Plugin, Transaction} from 'prosemirror-state';\nimport {DOMParser, DOMSerializer, Schema} from 'prosemirror-model';\nimport {DOCUMENT} from '@angular/common';\nimport {MatDialog} from '@angular/material/dialog';\nimport {columnResizing, goToNextCell, tableEditing} from 'prosemirror-tables';\nimport {keymap} from 'prosemirror-keymap';\nimport {ImagePlugin, ImageUploader} from '../utils/image';\nimport {advancedSchema, basicSchema} from '../utils/schema';\nimport {buildMenuItems, Key, MenuItems} from '../utils/menu';\nimport {history} from 'prosemirror-history';\nimport {baseKeymap} from 'prosemirror-commands';\nimport {dropCursor} from 'prosemirror-dropcursor';\nimport {gapCursor} from 'prosemirror-gapcursor';\nimport {buildInputRules} from '../utils/inputrules';\nimport {buildKeymap} from '../utils/keymap';\n\n/**\n * Prosemirror component\n *\n * Usage :\n *\n * ```html\n * <natural-editor [(ngModel)]=\"htmlString\"></natural-editor>\n * ```\n */\n// @dynamic\n@Component({\n selector: 'natural-editor',\n templateUrl: './editor.component.html',\n styleUrls: ['./editor.component.scss'],\n providers: [ImagePlugin],\n})\nexport class NaturalEditorComponent implements OnInit, OnDestroy, ControlValueAccessor {\n private view: EditorView | null = null;\n\n @ViewChild('editor', {read: ElementRef, static: true}) private editor!: ElementRef;\n\n @Output() public readonly contentChange = new EventEmitter<string>();\n\n /**\n * Callback to upload an image.\n *\n * If given it will enable advanced schema, including image and tables.\n * It must be given on initialization and cannot be changed later on.\n */\n @Input() public imageUploader: ImageUploader | null = null;\n\n private schema: Schema = basicSchema;\n\n /**\n * Interface with ControlValueAccessor\n * Notifies parent model / form controller\n */\n private onChange?: (value: string | null) => void;\n\n /**\n * HTML string\n */\n private content = '';\n\n public menu: MenuItems | null = null;\n\n /**\n * If subscribed to, then the save button will be shown and click events forwarded\n */\n @Output() public readonly save = new EventEmitter<void>();\n\n constructor(\n @Optional() @Self() public readonly ngControl: NgControl,\n @Inject(DOCUMENT) private readonly document: Document,\n private readonly dialog: MatDialog,\n private readonly imagePlugin: ImagePlugin,\n ) {\n if (this.ngControl !== null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n public ngOnInit(): void {\n this.schema = this.imageUploader ? advancedSchema : basicSchema;\n this.menu = buildMenuItems(this.schema, this.dialog);\n const serializer = DOMSerializer.fromSchema(this.schema);\n const state = this.createState();\n\n this.view = new EditorView(this.editor.nativeElement, {\n state: state,\n dispatchTransaction: (transaction: Transaction) => {\n if (!this.view) {\n return;\n }\n\n const newState = this.view.state.apply(transaction);\n this.view.updateState(newState);\n\n // Transform doc into HTML string\n const dom = serializer.serializeFragment(this.view.state.doc as any);\n const el = this.document.createElement('_');\n el.appendChild(dom);\n\n const newContent = el.innerHTML;\n if (this.content === newContent) {\n return;\n }\n\n this.content = el.innerHTML;\n\n if (this.onChange) {\n this.onChange(this.content);\n }\n this.contentChange.emit(this.content);\n },\n });\n this.update();\n }\n\n public writeValue(val: string | undefined): void {\n if (typeof val === 'string' && val !== this.content) {\n this.content = val;\n }\n\n if (this.view !== null) {\n const state = this.createState();\n this.view.updateState(state);\n }\n }\n\n private createState(): EditorState {\n const template = this.document.createElement('_');\n template.innerHTML = '<div>' + this.content + '</div>';\n if (!template.firstChild) {\n throw new Error('child of template element could not be created');\n }\n\n const parser = DOMParser.fromSchema(this.schema);\n const doc = parser.parse(template.firstChild);\n\n return EditorState.create({\n doc: doc,\n plugins: this.createPlugins(),\n });\n }\n\n private createPlugins(): Plugin[] {\n const isMac = !!this.document.defaultView?.navigator.platform.match(/Mac/);\n\n const plugins = [\n buildInputRules(this.schema),\n keymap(buildKeymap(this.schema, isMac)),\n keymap(baseKeymap),\n dropCursor(),\n gapCursor(),\n history(),\n new Plugin({\n props: {\n attributes: {class: 'ProseMirror-example-setup-style'},\n },\n }),\n new Plugin({\n view: () => this,\n }),\n ];\n\n if (this.schema === advancedSchema) {\n plugins.push(\n this.imagePlugin.plugin,\n columnResizing(undefined as any),\n tableEditing(),\n keymap({\n Tab: goToNextCell(1),\n 'Shift-Tab': goToNextCell(-1),\n }),\n );\n }\n\n return plugins;\n }\n\n /**\n * Called by Prosemirror whenever the editor state changes. So we update our menu states.\n */\n public update(): void {\n if (!this.view || !this.menu) {\n return;\n }\n\n for (const item of Object.values(this.menu)) {\n item.update(this.view, this.view.state);\n }\n }\n\n public registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: any): void {}\n\n public setDisabledState(isDisabled: boolean): void {\n // TODO disable editor ?\n }\n\n public ngOnDestroy(): void {\n if (this.view) {\n this.view.destroy();\n this.view = null;\n }\n }\n\n public run(event: Event, key: Key): void {\n if (!this.view || !this.menu) {\n return;\n }\n\n const item = this.menu[key];\n if (!item || item.disabled || !item.show) {\n return;\n }\n\n item.spec.run(this.view.state, this.view.dispatch, this.view, event);\n this.view.focus();\n }\n\n public upload(file: File): void {\n if (!this.view || !this.imageUploader) {\n return;\n }\n\n if (this.view.state.selection.$from.parent.inlineContent) {\n this.imagePlugin.startImageUpload(this.view, file, this.imageUploader, this.schema);\n }\n\n this.view.focus();\n }\n}\n","<div class=\"menu-container\" *ngIf=\"menu\">\n <div class=\"menu\">\n <button mat-button *ngIf=\"save.observed\" (click)=\"save.emit()\" i18n-matTooltip matTooltip=\"Enregistrer\">\n <mat-icon>save</mat-icon>\n </button>\n\n <mat-button-toggle-group multiple>\n <mat-button-toggle\n *ngIf=\"menu.toggleStrong\"\n [disabled]=\"menu.toggleStrong.disabled\"\n [checked]=\"menu.toggleStrong.active\"\n (click)=\"run($event, 'toggleStrong')\"\n i18n-matTooltip\n matTooltip=\"Gras\"\n >\n <mat-icon>format_bold</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.toggleEm\"\n [disabled]=\"menu.toggleEm.disabled\"\n [checked]=\"menu.toggleEm.active\"\n (click)=\"run($event, 'toggleEm')\"\n i18n-matTooltip\n matTooltip=\"Italique\"\n >\n <mat-icon>format_italic</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.toggleCode\"\n [disabled]=\"menu.toggleCode.disabled\"\n [checked]=\"menu.toggleCode.active\"\n (click)=\"run($event, 'toggleCode')\"\n i18n-matTooltip\n matTooltip=\"Code\"\n >\n <mat-icon>code</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.toggleLink\"\n [disabled]=\"menu.toggleLink.disabled\"\n [checked]=\"menu.toggleLink.active\"\n (click)=\"run($event, 'toggleLink')\"\n i18n-matTooltip\n matTooltip=\"Insérer un lien...\"\n >\n <mat-icon>insert_link</mat-icon>\n </mat-button-toggle>\n </mat-button-toggle-group>\n\n <button mat-button [matMenuTriggerFor]=\"blockMenu\">\n <span i18n>Type</span>\n <mat-icon>arrow_drop_down</mat-icon>\n </button>\n\n <mat-menu #blockMenu=\"matMenu\">\n <button\n mat-menu-item\n *ngIf=\"menu.makeParagraph\"\n [disabled]=\"menu.makeParagraph.disabled\"\n (click)=\"run($event, 'makeParagraph')\"\n i18n\n >Paragraphe\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeCodeBlock\"\n [disabled]=\"menu.makeCodeBlock.disabled\"\n (click)=\"run($event, 'makeCodeBlock')\"\n i18n\n >Code\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead1\"\n [disabled]=\"menu.makeHead1.disabled\"\n (click)=\"run($event, 'makeHead1')\"\n i18n\n >Titre 1\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead2\"\n [disabled]=\"menu.makeHead2.disabled\"\n (click)=\"run($event, 'makeHead2')\"\n i18n\n >Titre 2\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead3\"\n [disabled]=\"menu.makeHead3.disabled\"\n (click)=\"run($event, 'makeHead3')\"\n i18n\n >Titre 3\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead4\"\n [disabled]=\"menu.makeHead4.disabled\"\n (click)=\"run($event, 'makeHead4')\"\n i18n\n >Titre 4\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead5\"\n [disabled]=\"menu.makeHead5.disabled\"\n (click)=\"run($event, 'makeHead5')\"\n i18n\n >Titre 5\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead6\"\n [disabled]=\"menu.makeHead6.disabled\"\n (click)=\"run($event, 'makeHead6')\"\n i18n\n >Titre 6\n </button>\n </mat-menu>\n\n <button mat-button [matMenuTriggerFor]=\"tableMenu\" *ngIf=\"menu.addColumnBefore\">\n <span i18n>Tableau</span>\n <mat-icon>arrow_drop_down</mat-icon>\n </button>\n\n <mat-menu #tableMenu=\"matMenu\">\n <button\n mat-menu-item\n *ngIf=\"menu.insertTable\"\n [disabled]=\"menu.insertTable.disabled\"\n (click)=\"run($event, 'insertTable')\"\n i18n\n >Insérer un tableau\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.deleteTable\"\n [disabled]=\"menu.deleteTable.disabled\"\n (click)=\"run($event, 'deleteTable')\"\n i18n\n >Supprimer le tableau\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.mergeCells\"\n [disabled]=\"menu.mergeCells.disabled\"\n (click)=\"run($event, 'mergeCells')\"\n i18n\n >Fusionner les cellules\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.splitCell\"\n [disabled]=\"menu.splitCell.disabled\"\n (click)=\"run($event, 'splitCell')\"\n i18n\n >Scinder les cellules\n </button>\n\n <mat-divider></mat-divider>\n\n <button\n mat-menu-item\n *ngIf=\"menu.addColumnBefore\"\n [disabled]=\"menu.addColumnBefore.disabled\"\n (click)=\"run($event, 'addColumnBefore')\"\n i18n\n >Insérer une colonne avant\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.addColumnAfter\"\n [disabled]=\"menu.addColumnAfter.disabled\"\n (click)=\"run($event, 'addColumnAfter')\"\n i18n\n >Insérer une colonne après\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.deleteColumn\"\n [disabled]=\"menu.deleteColumn.disabled\"\n (click)=\"run($event, 'deleteColumn')\"\n i18n\n >Supprimer la colonne\n </button>\n\n <mat-divider></mat-divider>\n\n <button\n mat-menu-item\n *ngIf=\"menu.addRowBefore\"\n [disabled]=\"menu.addRowBefore.disabled\"\n (click)=\"run($event, 'addRowBefore')\"\n i18n\n >Insérer une ligne avant\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.addRowAfter\"\n [disabled]=\"menu.addRowAfter.disabled\"\n (click)=\"run($event, 'addRowAfter')\"\n i18n\n >Insérer une ligne après\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.deleteRow\"\n [disabled]=\"menu.deleteRow.disabled\"\n (click)=\"run($event, 'deleteRow')\"\n i18n\n >Supprimer la ligne\n </button>\n\n <mat-divider></mat-divider>\n\n <button\n mat-menu-item\n *ngIf=\"menu.toggleHeaderColumn\"\n [disabled]=\"menu.toggleHeaderColumn.disabled\"\n (click)=\"run($event, 'toggleHeaderColumn')\"\n i18n\n >Entête de colonne\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.toggleHeaderRow\"\n [disabled]=\"menu.toggleHeaderRow.disabled\"\n (click)=\"run($event, 'toggleHeaderRow')\"\n i18n\n >Entête de ligne\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.toggleHeaderCell\"\n [disabled]=\"menu.toggleHeaderCell.disabled\"\n (click)=\"run($event, 'toggleHeaderCell')\"\n i18n\n >Entête de cellule\n </button>\n </mat-menu>\n\n <button\n mat-button\n *ngIf=\"imageUploader\"\n naturalFileDrop\n [selectable]=\"true\"\n [broadcast]=\"false\"\n i18n-matTooltip\n matTooltip=\"Insérer une image\"\n (fileChange)=\"upload($event)\"\n >\n <mat-icon>insert_photo</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.undo\"\n [disabled]=\"menu.undo.disabled\"\n (click)=\"run($event, 'undo')\"\n i18n-matTooltip\n matTooltip=\"Annuler\"\n >\n <mat-icon>undo</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.redo\"\n [disabled]=\"menu.redo.disabled\"\n (click)=\"run($event, 'redo')\"\n i18n-matTooltip\n matTooltip=\"Refaire\"\n >\n <mat-icon>redo</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.wrapBulletList && menu.wrapBulletList.show\"\n [disabled]=\"menu.wrapBulletList.disabled\"\n (click)=\"run($event, 'wrapBulletList')\"\n i18n-matTooltip\n matTooltip=\"Liste à puce\"\n >\n <mat-icon>format_list_bulleted</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.wrapOrderedList && menu.wrapOrderedList.show\"\n [disabled]=\"menu.wrapOrderedList.disabled\"\n (click)=\"run($event, 'wrapOrderedList')\"\n i18n-matTooltip\n matTooltip=\"Liste à numéro\"\n >\n <mat-icon>format_list_numbered</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.wrapBlockQuote && menu.wrapBlockQuote.show\"\n [disabled]=\"menu.wrapBlockQuote.disabled\"\n (click)=\"run($event, 'wrapBlockQuote')\"\n i18n-matTooltip\n matTooltip=\"Citation\"\n >\n <mat-icon>format_quote</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.joinUp && menu.joinUp.show\"\n [disabled]=\"menu.joinUp.disabled\"\n (click)=\"run($event, 'joinUp')\"\n i18n-matTooltip\n matTooltip=\"Fusionner avec l'élément du haut\"\n >\n <mat-icon>move_up</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.lift && menu.lift.show\"\n [disabled]=\"menu.lift.disabled\"\n (click)=\"run($event, 'lift')\"\n i18n-matTooltip\n matTooltip=\"Désindenter\"\n >\n <mat-icon>format_indent_decrease</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.selectParentNode && menu.selectParentNode.show\"\n [disabled]=\"menu.selectParentNode.disabled\"\n (click)=\"run($event, 'selectParentNode')\"\n i18n-matTooltip\n matTooltip=\"Sélectionner l'élément parent\"\n >\n <mat-icon>select_all</mat-icon>\n </button>\n </div>\n</div>\n<div #editor></div>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {NaturalEditorComponent} from './editor/editor.component';\nimport {MatButtonModule} from '@angular/material/button';\nimport {MatButtonToggleModule} from '@angular/material/button-toggle';\nimport {MatToolbarModule} from '@angular/material/toolbar';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatMenuModule} from '@angular/material/menu';\nimport {LinkDialogComponent} from './link-dialog/link-dialog.component';\nimport {ReactiveFormsModule} from '@angular/forms';\nimport {MatDialogModule} from '@angular/material/dialog';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {MatInputModule} from '@angular/material/input';\nimport {MatTooltipModule} from '@angular/material/tooltip';\nimport {NaturalFileModule} from '@ecodev/natural';\nimport {MatDividerModule} from '@angular/material/divider';\n\nconst imports = [\n CommonModule,\n MatButtonModule,\n MatButtonToggleModule,\n MatDialogModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatMenuModule,\n MatToolbarModule,\n MatTooltipModule,\n ReactiveFormsModule,\n NaturalFileModule,\n MatDividerModule,\n];\n\n@NgModule({\n declarations: [NaturalEditorComponent, LinkDialogComponent],\n imports: [...imports],\n exports: [...imports, NaturalEditorComponent],\n})\nexport class NaturalEditorModule {}\n","// Load `$localize` onto the global scope - to be able to use that function to translate strings in components/services.\nimport '@angular/localize/init';\n\n/*\n * Public API Surface of natural-editor\n */\n\nexport {NaturalEditorComponent} from './lib/editor/editor.component';\nexport {NaturalEditorModule} from './lib/editor.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAUa,WAAW;IAGpB,YAA+C,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAgB;YACpC,KAAK,EAAE;gBACH,IAAI;oBACA,OAAO,aAAa,CAAC,KAAK,CAAC;iBAC9B;gBACD,KAAK,CAAC,EAAE,EAAE,GAAG;;oBAET,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,CA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eAAe;QACf,qBAAqB;QACrB,eAAe;QACf,kBAAkB;QAClB,aAAa;QACb,cAAc;QACd,aAAa;QACb,gBAAgB;QAChB,gBAAgB;QAChB,mBAAmB;QACnB,iBAAiB;QACjB,gBAAgB,EAMM,sBAAsB;iHAEnC,mBAAmB,YAHnB,CAAC,GAAG,OAAO,CAAC,EAjBrB,YAAY;QACZ,eAAe;QACf,qBAAqB;QACrB,eAAe;QACf,kBAAkB;QAClB,aAAa;QACb,cAAc;QACd,aAAa;QACb,gBAAgB;QAChB,gBAAgB;QAChB,mBAAmB;QACnB,iBAAiB;QACjB,gBAAgB;2FAQP,mBAAmB;kBAL/B,QAAQ;mBAAC;oBACN,YAAY,EAAE,CAAC,sBAAsB,EAAE,mBAAmB,CAAC;oBAC3D,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;oBACrB,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,sBAAsB,CAAC;iBAChD;;;ACrCD;;ACAA;;;;;;"}
1
+ {"version":3,"file":"ecodev-natural-editor.js","sources":["../../../projects/natural-editor/src/lib/utils/image.ts","../../../projects/natural-editor/src/lib/utils/paragraph-with-alignment.ts","../../../projects/natural-editor/src/lib/utils/schema.ts","../../../projects/natural-editor/src/lib/link-dialog/link-dialog.component.ts","../../../projects/natural-editor/src/lib/link-dialog/link-dialog.component.html","../../../projects/natural-editor/src/lib/utils/table.ts","../../../projects/natural-editor/src/lib/utils/item.ts","../../../projects/natural-editor/src/lib/utils/text-align-item.ts","../../../projects/natural-editor/src/lib/utils/menu.ts","../../../projects/natural-editor/src/lib/utils/inputrules.ts","../../../projects/natural-editor/src/lib/utils/keymap.ts","../../../projects/natural-editor/src/lib/editor/editor.component.ts","../../../projects/natural-editor/src/lib/editor/editor.component.html","../../../projects/natural-editor/src/lib/editor.module.ts","../../../projects/natural-editor/src/public-api.ts","../../../projects/natural-editor/src/ecodev-natural-editor.ts"],"sourcesContent":["import {Decoration, DecorationSet, EditorView} from 'prosemirror-view';\nimport {EditorState, Plugin} from 'prosemirror-state';\nimport {Observable} from 'rxjs';\nimport {Schema} from 'prosemirror-model';\nimport {Inject, Injectable} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\n\nexport type ImageUploader = (file: File) => Observable<string>;\n\n@Injectable()\nexport class ImagePlugin {\n public readonly plugin: Plugin<DecorationSet>;\n\n constructor(@Inject(DOCUMENT) private readonly document: Document) {\n this.plugin = new Plugin<DecorationSet>({\n state: {\n init(): DecorationSet {\n return DecorationSet.empty;\n },\n apply(tr, set): DecorationSet {\n // Adjust decoration positions to changes made by the transaction\n set = set.map(tr.mapping, tr.doc);\n\n // See if the transaction adds or removes any placeholders\n const action = tr.getMeta(this);\n if (action && action.add) {\n const widget = document.createElement('placeholder');\n const deco = Decoration.widget(action.add.pos, widget, {id: action.add.id});\n set = set.add(tr.doc, [deco]);\n } else if (action && action.remove) {\n set = set.remove(set.find(undefined, undefined, spec => spec.id === action.remove.id));\n }\n\n return set;\n },\n },\n props: {\n decorations(state): DecorationSet {\n return this.getState(state);\n },\n },\n });\n }\n\n private findPlaceholder(state: EditorState, id: {}): number | null {\n const decorators = this.plugin.getState(state);\n const found = decorators.find(undefined, undefined, spec => spec.id === id);\n return found.length ? found[0].from : null;\n }\n\n public startImageUpload(view: EditorView, file: File, uploader: ImageUploader, schema: Schema): void {\n // A fresh object to act as the ID for this upload\n const id = {};\n\n // Replace the selection with a placeholder\n const tr = view.state.tr;\n if (!tr.selection.empty) {\n tr.deleteSelection();\n }\n\n tr.setMeta(this.plugin, {add: {id, pos: tr.selection.from}});\n view.dispatch(tr);\n\n uploader(file).subscribe({\n next: url => {\n const pos = this.findPlaceholder(view.state, id);\n // If the content around the placeholder has been deleted, drop\n // the image\n if (pos === null) {\n return;\n }\n\n // Otherwise, insert it at the placeholder's position, and remove\n // the placeholder\n view.dispatch(\n view.state.tr\n .replaceWith(pos, pos, schema.nodes.image.create({src: url}))\n .setMeta(this.plugin, {remove: {id}}),\n );\n },\n error: () => {\n // On failure, just clean up the placeholder\n view?.dispatch(tr.setMeta(this.plugin, {remove: {id}}));\n },\n });\n }\n}\n","import {NodeSpec} from 'prosemirror-model';\n\nconst ALIGN_PATTERN = /(left|right|center|justify)/;\n\n// https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js\n// :: NodeSpec A plain paragraph textblock. Represented in the DOM\n// as a `<p>` element.\nexport const paragraphWithAlignment: NodeSpec = {\n attrs: {\n align: {default: null},\n id: {default: null},\n },\n content: 'inline*',\n group: 'block',\n parseDOM: [\n {\n tag: 'p',\n getAttrs: dom => {\n if (!(dom instanceof HTMLElement)) {\n return;\n }\n\n const {textAlign} = dom.style;\n\n let align: string | null = dom.getAttribute('align') || textAlign || '';\n align = ALIGN_PATTERN.test(align) ? align : null;\n\n const id = dom.getAttribute('id') || '';\n\n return {align, id};\n },\n },\n ],\n toDOM: node => {\n const {align, id} = node.attrs;\n const attrs: {[key: string]: any} = {};\n\n let style = '';\n if (align && align !== 'left') {\n style += `text-align: ${align};`;\n }\n\n if (style) {\n attrs.style = style;\n }\n\n if (id) {\n attrs.id = id;\n }\n\n return ['p', attrs, 0];\n },\n};\n","import {marks, nodes} from 'prosemirror-schema-basic';\nimport {addListNodes} from 'prosemirror-schema-list';\nimport {Schema} from 'prosemirror-model';\nimport {tableNodes} from 'prosemirror-tables';\nimport {paragraphWithAlignment} from './paragraph-with-alignment';\n\n// Keep only basic elements\ntype BasicNodes = Omit<typeof nodes, 'image' | 'code_block' | 'blockquote' | 'horizontal_rule'>;\nconst basicNodes: BasicNodes = {\n heading: nodes.heading,\n doc: nodes.doc,\n paragraph: nodes.paragraph,\n text: nodes.text,\n hard_break: nodes.hard_break,\n};\n\ntype BasicMarks = Omit<typeof marks, 'code'>;\nconst basicMarks: BasicMarks = {\n link: marks.link,\n em: marks.em,\n strong: marks.strong,\n};\n\nconst tmpSchema = new Schema({nodes: basicNodes, marks: basicMarks});\n\nexport const basicSchema = new Schema({\n nodes: addListNodes(tmpSchema.spec.nodes, 'paragraph block*', 'block'),\n marks: tmpSchema.spec.marks,\n});\n\nconst tmpSchema2 = new Schema({\n nodes: {\n ...nodes,\n ...tableNodes({\n tableGroup: 'block',\n cellContent: 'block+',\n cellAttributes: {\n background: {\n default: null,\n getFromDOM(dom: Element): string | null {\n return (dom as HTMLElement).style.backgroundColor || null;\n },\n setDOMAttr(value: any, attrs: any): void {\n if (value) {\n attrs.style = (attrs.style || '') + `background-color: ${value};`;\n }\n },\n },\n },\n }),\n paragraph: paragraphWithAlignment,\n },\n marks: basicMarks,\n});\n\nexport const advancedSchema = new Schema({\n nodes: addListNodes(tmpSchema2.spec.nodes, 'paragraph block*', 'block'),\n marks: basicMarks,\n});\n","import {Component, Inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {FormControl, FormGroup, Validators} from '@angular/forms';\nimport {ifValid} from '@ecodev/natural';\n\nexport interface LinkDialogData {\n href: string;\n title?: string;\n}\n\n@Component({\n templateUrl: './link-dialog.component.html',\n styleUrls: ['./link-dialog.component.scss'],\n})\nexport class LinkDialogComponent {\n public readonly hrefControl = new FormControl('', Validators.required);\n public readonly titleControl = new FormControl('');\n public readonly form = new FormGroup({\n href: this.hrefControl,\n title: this.titleControl,\n });\n\n constructor(\n @Inject(MAT_DIALOG_DATA) data: LinkDialogData,\n private dialogRef: MatDialogRef<LinkDialogComponent, LinkDialogData>,\n ) {\n this.form.setValue(data);\n }\n\n public maybeConfirm(): void {\n ifValid(this.form).subscribe(() => this.confirm());\n }\n\n private confirm(): void {\n this.dialogRef.close(this.form.value);\n }\n}\n","<h2 i18n mat-dialog-title>Insérer un lien</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n>URL</mat-label>\n <input matInput [formControl]=\"hrefControl\" (keydown.enter)=\"maybeConfirm()\" />\n <mat-error *ngIf=\"hrefControl.hasError('required')\" i18n>Ce champ est requis</mat-error>\n </mat-form-field>\n <mat-form-field>\n <mat-label i18n>Titre</mat-label>\n <input matInput [formControl]=\"titleControl\" (keydown.enter)=\"maybeConfirm()\" />\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button mat-button [mat-dialog-close] i18n>Annuler</button>\n <button mat-stroked-button (click)=\"maybeConfirm()\" [disabled]=\"!form.valid\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n","import {EditorState, TextSelection, Transaction} from 'prosemirror-state';\nimport {Fragment, Node as ProsemirrorNode, NodeType} from 'prosemirror-model';\nimport {tableNodeTypes} from 'prosemirror-tables';\n\nfunction createCell(\n cellType: NodeType,\n cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>,\n): ProsemirrorNode<any> | null | undefined {\n return cellContent ? cellType.createChecked(null, cellContent) : cellType.createAndFill();\n}\n\nfunction createTable(\n state: EditorState,\n rowsCount: number,\n colsCount: number,\n withHeaderRow: boolean,\n cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>,\n): ProsemirrorNode {\n const types = tableNodeTypes(state.schema);\n const headerCells = [];\n const cells = [];\n\n for (let index = 0; index < colsCount; index += 1) {\n const cell = createCell(types.cell, cellContent);\n\n if (cell) {\n cells.push(cell);\n }\n\n if (withHeaderRow) {\n const headerCell = createCell(types.header_cell, cellContent);\n\n if (headerCell) {\n headerCells.push(headerCell);\n }\n }\n }\n\n const rows = [];\n\n for (let index = 0; index < rowsCount; index += 1) {\n rows.push(types.row.createChecked(null, withHeaderRow && index === 0 ? headerCells : cells));\n }\n\n return types.table.createChecked(null, rows);\n}\n\nexport function addTable(\n state: EditorState,\n dispatch?: (tr: Transaction) => void,\n {\n rowsCount = 3,\n colsCount = 3,\n withHeaderRow = true,\n cellContent,\n }: {\n rowsCount?: number;\n colsCount?: number;\n withHeaderRow?: boolean;\n cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>;\n } = {},\n): void {\n const offset = state.tr.selection.anchor + 1;\n\n const nodes = createTable(state, rowsCount, colsCount, withHeaderRow, cellContent);\n const tr = state.tr.replaceSelectionWith(nodes).scrollIntoView();\n const resolvedPos = tr.doc.resolve(offset);\n\n // move cursor into table\n tr.setSelection(TextSelection.near(resolvedPos));\n\n dispatch?.(tr);\n}\n","import {MenuItemSpec} from 'prosemirror-menu';\nimport {EditorState} from 'prosemirror-state';\nimport {EditorView} from 'prosemirror-view';\n\n/**\n * One item of the menu.\n *\n * This is the equivalent of `MenuItem` but without all the rendering logic since we use Angular\n * templates for rendering. Also it caches the state of the item everytime the editor state changes,\n * so Angular can query the state as often as needed without performance hit.\n */\nexport class Item {\n /**\n * Whether the item is 'active' (for example, the item for toggling the strong mark might be active when the cursor is in strong text).\n */\n public active = false;\n\n /**\n * Button is shown but disabled, because the item cannot be (un-)applied\n */\n public disabled = false;\n\n /**\n * Whether the item is shown at the moment\n */\n public show = true;\n\n constructor(public readonly spec: MenuItemSpec) {}\n\n /**\n * Update the item state according to the editor state\n */\n public update(view: EditorView, state: EditorState): void {\n if (this.spec.active) {\n this.active = this.spec.active(state);\n }\n\n if (this.spec.enable) {\n this.disabled = !this.spec.enable(state);\n }\n\n if (this.spec.select) {\n this.show = this.spec.select(state);\n }\n }\n}\n","import {Node, NodeType, Schema} from 'prosemirror-model';\nimport {AllSelection, TextSelection, Transaction} from 'prosemirror-state';\nimport {Item} from './item';\n\ntype Alignment = 'left' | 'right' | 'center' | 'justify';\n\nfunction setTextAlign(tr: Transaction, schema: Schema, alignment: null | Alignment): Transaction {\n console.log('setTextAlign', alignment);\n const {selection, doc} = tr;\n if (!selection || !doc) {\n return tr;\n }\n const {from, to} = selection;\n const {nodes} = schema;\n\n const tasks: {\n node: Node;\n pos: number;\n nodeType: NodeType;\n }[] = [];\n\n alignment = alignment || null;\n\n const allowedNodeTypes = new Set([\n nodes.paragraph,\n // nodes['blockquote'],\n // nodes['listItem'],\n // nodes['heading'],\n ]);\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type;\n const align = node.attrs.align || null;\n if (align !== alignment && allowedNodeTypes.has(nodeType)) {\n tasks.push({\n node,\n pos,\n nodeType,\n });\n }\n return true;\n });\n\n if (!tasks.length) {\n return tr;\n }\n\n tasks.forEach(job => {\n const {node, pos, nodeType} = job;\n const newAttrs = {\n ...node.attrs,\n align: alignment ? alignment : null,\n };\n console.log('newAttrs', newAttrs);\n tr = tr.setNodeMarkup(pos, nodeType, newAttrs, node.marks);\n });\n\n return tr;\n}\n\nexport class TextAlignItem extends Item {\n constructor(alignment: Alignment) {\n super({\n active: state => {\n const {selection, doc} = state;\n const {from, to} = selection;\n let keepLooking = true;\n let active = false;\n doc.nodesBetween(from, to, node => {\n if (keepLooking && node.attrs.align === alignment) {\n keepLooking = false;\n active = true;\n }\n return keepLooking;\n });\n\n return active;\n },\n\n enable: state => {\n const {selection} = state;\n return selection instanceof TextSelection || selection instanceof AllSelection;\n },\n\n run: (state, dispatch): boolean => {\n const {schema, selection} = state;\n\n console.log(this);\n const tr = setTextAlign(state.tr.setSelection(selection), schema, this.active ? null : alignment);\n if (tr.docChanged) {\n dispatch?.(tr);\n return true;\n } else {\n return false;\n }\n },\n });\n }\n}\n","import {\n blockTypeItem,\n joinUpItem,\n liftItem,\n MenuItem,\n MenuItemSpec,\n redoItem,\n selectParentNodeItem,\n undoItem,\n wrapItem,\n} from 'prosemirror-menu';\nimport {EditorState, Transaction} from 'prosemirror-state';\nimport {Command, toggleMark} from 'prosemirror-commands';\nimport {wrapInList} from 'prosemirror-schema-list';\nimport {MarkType, NodeType, Schema} from 'prosemirror-model';\nimport {MatDialog} from '@angular/material/dialog';\nimport {LinkDialogComponent, LinkDialogData} from '../link-dialog/link-dialog.component';\nimport {EditorView} from 'prosemirror-view';\nimport {\n addColumnAfter,\n addColumnBefore,\n addRowAfter,\n addRowBefore,\n deleteColumn,\n deleteRow,\n deleteTable,\n mergeCells,\n splitCell,\n toggleHeaderCell,\n toggleHeaderColumn,\n toggleHeaderRow,\n} from 'prosemirror-tables';\nimport {addTable} from './table';\nimport {Item} from './item';\nimport {paragraphWithAlignment} from './paragraph-with-alignment';\nimport {TextAlignItem} from './text-align-item';\n\n/**\n * Convert built-in `MenuItem` into our Angular specific `Item`\n */\nfunction toItem(item: MenuItem): Item {\n return new Item(item.spec);\n}\n\nfunction canInsert(state: EditorState, nodeType: NodeType): boolean {\n const $from = state.selection.$from;\n for (let d = $from.depth; d >= 0; d--) {\n const index = $from.index(d);\n if ($from.node(d).canReplaceWith(index, index, nodeType)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction cmdItem(cmd: Command, options: Partial<MenuItemSpec> = {}, useEnable = false): Item {\n const passedOptions: MenuItemSpec = {\n run: cmd,\n ...options,\n };\n\n if ((!options.enable || useEnable) && !options.select) {\n passedOptions[options.enable ? 'enable' : 'select'] = (state: EditorState) => cmd(state);\n }\n\n return new Item(passedOptions);\n}\n\nfunction markActive(state: EditorState, type: MarkType): boolean {\n const {from, $from, to, empty} = state.selection;\n if (empty) {\n return !!type.isInSet(state.storedMarks || $from.marks());\n } else {\n return state.doc.rangeHasMark(from, to, type);\n }\n}\n\nfunction markItem(markType: MarkType, options: Partial<MenuItemSpec> = {}): Item {\n const passedOptions: Partial<MenuItemSpec> = {\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n ...options,\n };\n\n return cmdItem(toggleMark(markType), passedOptions, true);\n}\n\nfunction linkItem(markType: MarkType, dialog: MatDialog): Item {\n return new Item({\n active(state: EditorState): boolean {\n return markActive(state, markType);\n },\n enable(state: EditorState): boolean {\n return !state.selection.empty;\n },\n run(state: EditorState, dispatch: (p: Transaction) => void, view: EditorView): boolean | void {\n if (markActive(state, markType)) {\n toggleMark(markType)(state, dispatch);\n return true;\n }\n\n dialog\n .open<LinkDialogComponent, LinkDialogData, LinkDialogData>(LinkDialogComponent, {\n data: {\n href: '',\n title: '',\n },\n })\n .afterClosed()\n .subscribe(result => {\n if (result) {\n if (!result.title) {\n delete result.title;\n }\n\n toggleMark(markType, result)(view.state, view.dispatch);\n }\n\n view.focus();\n });\n },\n });\n}\n\nfunction wrapListItem(nodeType: NodeType): Item {\n return cmdItem(wrapInList(nodeType));\n}\n\nexport type Key =\n | 'toggleStrong'\n | 'toggleEm'\n | 'toggleCode'\n | 'toggleLink'\n | 'wrapBulletList'\n | 'wrapOrderedList'\n | 'wrapBlockQuote'\n | 'makeParagraph'\n | 'makeCodeBlock'\n | 'makeHead1'\n | 'makeHead2'\n | 'makeHead3'\n | 'makeHead4'\n | 'makeHead5'\n | 'makeHead6'\n | 'alignLeft'\n | 'alignRight'\n | 'alignCenter'\n | 'alignJustify'\n | 'insertHorizontalRule'\n | 'joinUp'\n | 'lift'\n | 'selectParentNode'\n | 'undo'\n | 'redo'\n | 'insertTable'\n | 'addColumnBefore'\n | 'addColumnAfter'\n | 'deleteColumn'\n | 'addRowBefore'\n | 'addRowAfter'\n | 'deleteRow'\n | 'deleteTable'\n | 'mergeCells'\n | 'splitCell'\n | 'toggleHeaderColumn'\n | 'toggleHeaderRow'\n | 'toggleHeaderCell';\n\nexport type MenuItems = Partial<Record<Key, Item>>;\n\n/**\n * Given a schema, look for default mark and node types in it and\n * return an object with relevant menu items relating to those marks:\n */\nexport function buildMenuItems(schema: Schema, dialog: MatDialog): MenuItems {\n const r: MenuItems = {\n joinUp: toItem(joinUpItem),\n lift: toItem(liftItem),\n selectParentNode: toItem(selectParentNodeItem),\n undo: toItem(undoItem as unknown as MenuItem), // Typing is incorrect, so we force it\n redo: toItem(redoItem as unknown as MenuItem),\n };\n\n let type: MarkType | NodeType | undefined;\n type = schema.marks.strong;\n if (type) {\n r.toggleStrong = markItem(type);\n }\n\n type = schema.marks.em;\n if (type) {\n r.toggleEm = markItem(type);\n }\n\n type = schema.marks.code;\n if (type) {\n r.toggleCode = markItem(type);\n }\n\n type = schema.marks.link;\n if (type) {\n r.toggleLink = linkItem(type, dialog);\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n r.wrapBulletList = wrapListItem(type);\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n r.wrapOrderedList = wrapListItem(type);\n }\n\n type = schema.nodes.blockquote;\n if (type) {\n r.wrapBlockQuote = toItem(wrapItem(type, {}));\n }\n\n type = schema.nodes.paragraph;\n if (type) {\n r.makeParagraph = toItem(blockTypeItem(type, {}));\n\n if (type.spec === paragraphWithAlignment) {\n r.alignLeft = new TextAlignItem('left');\n r.alignRight = new TextAlignItem('right');\n r.alignCenter = new TextAlignItem('center');\n r.alignJustify = new TextAlignItem('justify');\n }\n }\n\n type = schema.nodes.code_block;\n if (type) {\n r.makeCodeBlock = toItem(blockTypeItem(type, {}));\n }\n\n type = schema.nodes.heading;\n if (type) {\n r.makeHead1 = toItem(blockTypeItem(type, {attrs: {level: 1}}));\n r.makeHead2 = toItem(blockTypeItem(type, {attrs: {level: 2}}));\n r.makeHead3 = toItem(blockTypeItem(type, {attrs: {level: 3}}));\n r.makeHead4 = toItem(blockTypeItem(type, {attrs: {level: 4}}));\n r.makeHead5 = toItem(blockTypeItem(type, {attrs: {level: 5}}));\n r.makeHead6 = toItem(blockTypeItem(type, {attrs: {level: 6}}));\n }\n\n type = schema.nodes.horizontal_rule;\n if (type) {\n const hr = type;\n r.insertHorizontalRule = new Item({\n enable(state): boolean {\n return canInsert(state, hr);\n },\n run(state, dispatch): void {\n dispatch(state.tr.replaceSelectionWith(hr.create()));\n },\n });\n }\n\n type = schema.nodes.table;\n if (type) {\n r.insertTable = new Item({run: (e, tr) => addTable(e, tr)});\n r.addColumnBefore = new Item({run: addColumnBefore});\n r.addColumnAfter = new Item({run: addColumnAfter});\n r.deleteColumn = new Item({run: deleteColumn});\n r.addRowBefore = new Item({run: addRowBefore});\n r.addRowAfter = new Item({run: addRowAfter});\n r.deleteRow = new Item({run: deleteRow});\n r.deleteTable = new Item({run: deleteTable});\n r.mergeCells = new Item({run: mergeCells});\n r.splitCell = new Item({run: splitCell});\n r.toggleHeaderColumn = new Item({run: toggleHeaderColumn});\n r.toggleHeaderRow = new Item({run: toggleHeaderRow});\n r.toggleHeaderCell = new Item({run: toggleHeaderCell});\n }\n\n return r;\n}\n","import {\n ellipsis,\n emDash,\n InputRule,\n inputRules,\n textblockTypeInputRule,\n wrappingInputRule,\n} from 'prosemirror-inputrules';\nimport {NodeType, Schema} from 'prosemirror-model';\nimport {Plugin} from 'prosemirror-state';\n\n/**\n * Given a blockquote node type, returns an input rule that turns `\"> \"`\n * at the start of a textblock into a blockquote.\n */\nfunction blockQuoteRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(/^\\s*>\\s$/, nodeType);\n}\n\n/**\n * Given a list node type, returns an input rule that turns a number\n * followed by a dot at the start of a textblock into an ordered list.\n */\nfunction orderedListRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(\n /^(\\d+)\\.\\s$/,\n nodeType,\n match => ({order: +match[1]}),\n (match, node) => node.childCount + node.attrs.order === +match[1],\n );\n}\n\n/**\n * Given a list node type, returns an input rule that turns a bullet\n * (dash, plush, or asterisk) at the start of a textblock into a\n * bullet list.\n */\nfunction bulletListRule(nodeType: NodeType): InputRule {\n return wrappingInputRule(/^\\s*([-+*])\\s$/, nodeType);\n}\n\n/**\n * Given a code block node type, returns an input rule that turns a\n * textblock starting with three backticks into a code block.\n */\nfunction codeBlockRule(nodeType: NodeType): InputRule {\n return textblockTypeInputRule(/^```$/, nodeType);\n}\n\n/**\n * Given a node type and a maximum level, creates an input rule that\n * turns up to that number of `#` characters followed by a space at\n * the start of a textblock into a heading whose level corresponds to\n * the number of `#` signs.\n */\nfunction headingRule(nodeType: NodeType, maxLevel: number): InputRule {\n return textblockTypeInputRule(new RegExp('^(#{1,' + maxLevel + '})\\\\s$'), nodeType, match => ({\n level: match[1].length,\n }));\n}\n\n/**\n * A set of input rules for creating the basic block quotes, lists,\n * code blocks, and heading.\n */\nexport function buildInputRules(schema: Schema): Plugin {\n const rules = [ellipsis, emDash];\n\n let type = schema.nodes.blockquote;\n if (type) {\n rules.push(blockQuoteRule(type));\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n rules.push(orderedListRule(type));\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n rules.push(bulletListRule(type));\n }\n\n type = schema.nodes.code_block;\n if (type) {\n rules.push(codeBlockRule(type));\n }\n\n type = schema.nodes.heading;\n if (type) {\n rules.push(headingRule(type, 6));\n }\n\n return inputRules({rules});\n}\n","import {\n chainCommands,\n exitCode,\n joinDown,\n joinUp,\n Keymap,\n lift,\n selectParentNode,\n setBlockType,\n toggleMark,\n wrapIn,\n} from 'prosemirror-commands';\nimport {liftListItem, sinkListItem, splitListItem, wrapInList} from 'prosemirror-schema-list';\nimport {redo, undo} from 'prosemirror-history';\nimport {undoInputRule} from 'prosemirror-inputrules';\nimport {MarkType, NodeType, Schema} from 'prosemirror-model';\n\n/**\n * Inspect the given schema looking for marks and nodes from the\n * basic schema, and if found, add key bindings related to them.\n * This will add:\n *\n * * **Mod-b** for toggling [strong](#schema-basic.StrongMark)\n * * **Mod-i** for toggling [emphasis](#schema-basic.EmMark)\n * * **Mod-`** for toggling [code font](#schema-basic.CodeMark)\n * * **Ctrl-Shift-0** for making the current textblock a paragraph\n * * **Ctrl-Shift-1** to **Ctrl-Shift-Digit6** for making the current\n * textblock a heading of the corresponding level\n * * **Ctrl-Shift-Backslash** to make the current textblock a code block\n * * **Ctrl-Shift-8** to wrap the selection in an ordered list\n * * **Ctrl-Shift-9** to wrap the selection in a bullet list\n * * **Ctrl->** to wrap the selection in a block quote\n * * **Enter** to split a non-empty textblock in a list item while at\n * the same time splitting the list item\n * * **Mod-Enter** to insert a hard break\n * * **Mod-_** to insert a horizontal rule\n * * **Backspace** to undo an input rule\n * * **Alt-ArrowUp** to `joinUp`\n * * **Alt-ArrowDown** to `joinDown`\n * * **Mod-BracketLeft** to `lift`\n * * **Escape** to `selectParentNode`\n *\n * You can suppress or map these bindings by passing a `mapKeys`\n * argument, which maps key names (say `\"Mod-B\"` to either `false`, to\n * remove the binding, or a new key name string.\n */\nexport function buildKeymap(schema: Schema, isMac: boolean): Keymap {\n const keys: Keymap = {};\n\n keys['Mod-z'] = undo;\n keys['Shift-Mod-z'] = redo;\n keys['Backspace'] = undoInputRule;\n if (!isMac) {\n keys['Mod-y'] = redo;\n }\n\n keys['Alt-ArrowUp'] = joinUp;\n keys['Alt-ArrowDown'] = joinDown;\n keys['Mod-BracketLeft'] = lift;\n keys['Escape'] = selectParentNode;\n\n let type: MarkType | NodeType = schema.marks.strong;\n if (type) {\n keys['Mod-b'] = toggleMark(type);\n keys['Mod-B'] = toggleMark(type);\n }\n\n type = schema.marks.em;\n if (type) {\n keys['Mod-i'] = toggleMark(type);\n keys['Mod-I'] = toggleMark(type);\n }\n\n type = schema.marks.code;\n if (type) {\n keys['Mod-`'] = toggleMark(type);\n }\n\n type = schema.nodes.bullet_list;\n if (type) {\n keys['Shift-Ctrl-8'] = wrapInList(type);\n }\n\n type = schema.nodes.ordered_list;\n if (type) {\n keys['Shift-Ctrl-9'] = wrapInList(type);\n }\n\n type = schema.nodes.blockquote;\n if (type) {\n keys['Ctrl->'] = wrapIn(type);\n }\n\n type = schema.nodes.hard_break;\n if (type) {\n const br = type;\n const cmd = chainCommands(exitCode, (state, dispatch) => {\n dispatch?.(state.tr.replaceSelectionWith(br.create()).scrollIntoView());\n return true;\n });\n keys['Mod-Enter'] = cmd;\n keys['Shift-Enter'] = cmd;\n if (isMac) {\n keys['Ctrl-Enter'] = cmd;\n }\n }\n\n type = schema.nodes.list_item;\n if (type) {\n keys['Enter'] = splitListItem(type);\n keys['Mod-['] = liftListItem(type);\n keys['Mod-]'] = sinkListItem(type);\n }\n\n type = schema.nodes.paragraph;\n if (type) {\n keys['Shift-Ctrl-0'] = setBlockType(type);\n }\n\n type = schema.nodes.code_block;\n if (type) {\n keys['Shift-Ctrl-\\\\'] = setBlockType(type);\n }\n\n type = schema.nodes.heading;\n if (type) {\n for (let i = 1; i <= 6; i++) {\n keys['Shift-Ctrl-' + i] = setBlockType(type, {level: i});\n }\n }\n\n type = schema.nodes.horizontal_rule;\n if (type) {\n const hr = type;\n keys['Mod-_'] = (state, dispatch) => {\n dispatch?.(state.tr.replaceSelectionWith(hr.create()).scrollIntoView());\n return true;\n };\n }\n\n return keys;\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {ControlValueAccessor, NgControl} from '@angular/forms';\nimport {EditorView} from 'prosemirror-view';\nimport {EditorState, Plugin, Transaction} from 'prosemirror-state';\nimport {DOMParser, DOMSerializer, Schema} from 'prosemirror-model';\nimport {DOCUMENT} from '@angular/common';\nimport {MatDialog} from '@angular/material/dialog';\nimport {columnResizing, goToNextCell, tableEditing} from 'prosemirror-tables';\nimport {keymap} from 'prosemirror-keymap';\nimport {ImagePlugin, ImageUploader} from '../utils/image';\nimport {advancedSchema, basicSchema} from '../utils/schema';\nimport {buildMenuItems, Key, MenuItems} from '../utils/menu';\nimport {history} from 'prosemirror-history';\nimport {baseKeymap} from 'prosemirror-commands';\nimport {dropCursor} from 'prosemirror-dropcursor';\nimport {gapCursor} from 'prosemirror-gapcursor';\nimport {buildInputRules} from '../utils/inputrules';\nimport {buildKeymap} from '../utils/keymap';\n\n/**\n * Prosemirror component\n *\n * Usage :\n *\n * ```html\n * <natural-editor [(ngModel)]=\"htmlString\"></natural-editor>\n * ```\n */\n// @dynamic\n@Component({\n selector: 'natural-editor',\n templateUrl: './editor.component.html',\n styleUrls: ['./editor.component.scss'],\n providers: [ImagePlugin],\n})\nexport class NaturalEditorComponent implements OnInit, OnDestroy, ControlValueAccessor {\n private view: EditorView | null = null;\n\n @ViewChild('editor', {read: ElementRef, static: true}) private editor!: ElementRef;\n\n @Output() public readonly contentChange = new EventEmitter<string>();\n\n /**\n * Callback to upload an image.\n *\n * If given it will enable advanced schema, including image and tables.\n * It must be given on initialization and cannot be changed later on.\n */\n @Input() public imageUploader: ImageUploader | null = null;\n\n private schema: Schema = basicSchema;\n\n /**\n * Interface with ControlValueAccessor\n * Notifies parent model / form controller\n */\n private onChange?: (value: string | null) => void;\n\n /**\n * HTML string\n */\n private content = '';\n\n public menu: MenuItems | null = null;\n\n /**\n * If subscribed to, then the save button will be shown and click events forwarded\n */\n @Output() public readonly save = new EventEmitter<void>();\n\n constructor(\n @Optional() @Self() public readonly ngControl: NgControl,\n @Inject(DOCUMENT) private readonly document: Document,\n private readonly dialog: MatDialog,\n private readonly imagePlugin: ImagePlugin,\n ) {\n if (this.ngControl !== null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n public ngOnInit(): void {\n this.schema = this.imageUploader ? advancedSchema : basicSchema;\n this.menu = buildMenuItems(this.schema, this.dialog);\n const serializer = DOMSerializer.fromSchema(this.schema);\n const state = this.createState();\n\n this.view = new EditorView(this.editor.nativeElement, {\n state: state,\n dispatchTransaction: (transaction: Transaction) => {\n if (!this.view) {\n return;\n }\n\n const newState = this.view.state.apply(transaction);\n this.view.updateState(newState);\n\n // Transform doc into HTML string\n const dom = serializer.serializeFragment(this.view.state.doc as any);\n const el = this.document.createElement('_');\n el.appendChild(dom);\n\n const newContent = el.innerHTML;\n if (this.content === newContent) {\n return;\n }\n\n this.content = el.innerHTML;\n\n if (this.onChange) {\n this.onChange(this.content);\n }\n this.contentChange.emit(this.content);\n },\n });\n this.update();\n }\n\n public writeValue(val: string | undefined): void {\n if (typeof val === 'string' && val !== this.content) {\n this.content = val;\n }\n\n if (this.view !== null) {\n const state = this.createState();\n this.view.updateState(state);\n }\n }\n\n private createState(): EditorState {\n const template = this.document.createElement('_');\n template.innerHTML = '<div>' + this.content + '</div>';\n if (!template.firstChild) {\n throw new Error('child of template element could not be created');\n }\n\n const parser = DOMParser.fromSchema(this.schema);\n const doc = parser.parse(template.firstChild);\n\n return EditorState.create({\n doc: doc,\n plugins: this.createPlugins(),\n });\n }\n\n private createPlugins(): Plugin[] {\n const isMac = !!this.document.defaultView?.navigator.platform.match(/Mac/);\n\n const plugins = [\n buildInputRules(this.schema),\n keymap(buildKeymap(this.schema, isMac)),\n keymap(baseKeymap),\n dropCursor(),\n gapCursor(),\n history(),\n new Plugin({\n props: {\n attributes: {class: 'ProseMirror-example-setup-style'},\n },\n }),\n new Plugin({\n view: () => this,\n }),\n ];\n\n if (this.schema === advancedSchema) {\n plugins.push(\n this.imagePlugin.plugin,\n columnResizing(undefined as any),\n tableEditing(),\n keymap({\n Tab: goToNextCell(1),\n 'Shift-Tab': goToNextCell(-1),\n }),\n );\n }\n\n return plugins;\n }\n\n /**\n * Called by Prosemirror whenever the editor state changes. So we update our menu states.\n */\n public update(): void {\n if (!this.view || !this.menu) {\n return;\n }\n\n for (const item of Object.values(this.menu)) {\n item.update(this.view, this.view.state);\n }\n }\n\n public registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: any): void {}\n\n public setDisabledState(isDisabled: boolean): void {\n // TODO disable editor ?\n }\n\n public ngOnDestroy(): void {\n if (this.view) {\n this.view.destroy();\n this.view = null;\n }\n }\n\n public run(event: Event, key: Key): void {\n if (!this.view || !this.menu) {\n return;\n }\n\n const item = this.menu[key];\n if (!item || item.disabled || !item.show) {\n return;\n }\n\n item.spec.run(this.view.state, this.view.dispatch, this.view, event);\n this.view.focus();\n }\n\n public upload(file: File): void {\n if (!this.view || !this.imageUploader) {\n return;\n }\n\n if (this.view.state.selection.$from.parent.inlineContent) {\n this.imagePlugin.startImageUpload(this.view, file, this.imageUploader, this.schema);\n }\n\n this.view.focus();\n }\n}\n","<div class=\"menu-container\" *ngIf=\"menu\">\n <div class=\"menu\">\n <button mat-button *ngIf=\"save.observed\" (click)=\"save.emit()\" i18n-matTooltip matTooltip=\"Enregistrer\">\n <mat-icon>save</mat-icon>\n </button>\n\n <mat-button-toggle-group multiple>\n <mat-button-toggle\n *ngIf=\"menu.toggleStrong\"\n [disabled]=\"menu.toggleStrong.disabled\"\n [checked]=\"menu.toggleStrong.active\"\n (click)=\"run($event, 'toggleStrong')\"\n i18n-matTooltip\n matTooltip=\"Gras\"\n >\n <mat-icon>format_bold</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.toggleEm\"\n [disabled]=\"menu.toggleEm.disabled\"\n [checked]=\"menu.toggleEm.active\"\n (click)=\"run($event, 'toggleEm')\"\n i18n-matTooltip\n matTooltip=\"Italique\"\n >\n <mat-icon>format_italic</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.toggleCode\"\n [disabled]=\"menu.toggleCode.disabled\"\n [checked]=\"menu.toggleCode.active\"\n (click)=\"run($event, 'toggleCode')\"\n i18n-matTooltip\n matTooltip=\"Code\"\n >\n <mat-icon>code</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.toggleLink\"\n [disabled]=\"menu.toggleLink.disabled\"\n [checked]=\"menu.toggleLink.active\"\n (click)=\"run($event, 'toggleLink')\"\n i18n-matTooltip\n matTooltip=\"Insérer un lien...\"\n >\n <mat-icon>insert_link</mat-icon>\n </mat-button-toggle>\n </mat-button-toggle-group>\n\n <button mat-button [matMenuTriggerFor]=\"blockMenu\">\n <span i18n>Type</span>\n <mat-icon>arrow_drop_down</mat-icon>\n </button>\n\n <mat-menu #blockMenu=\"matMenu\">\n <button\n mat-menu-item\n *ngIf=\"menu.makeParagraph\"\n [disabled]=\"menu.makeParagraph.disabled\"\n (click)=\"run($event, 'makeParagraph')\"\n i18n\n >Paragraphe\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeCodeBlock\"\n [disabled]=\"menu.makeCodeBlock.disabled\"\n (click)=\"run($event, 'makeCodeBlock')\"\n i18n\n >Code\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead1\"\n [disabled]=\"menu.makeHead1.disabled\"\n (click)=\"run($event, 'makeHead1')\"\n i18n\n >Titre 1\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead2\"\n [disabled]=\"menu.makeHead2.disabled\"\n (click)=\"run($event, 'makeHead2')\"\n i18n\n >Titre 2\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead3\"\n [disabled]=\"menu.makeHead3.disabled\"\n (click)=\"run($event, 'makeHead3')\"\n i18n\n >Titre 3\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead4\"\n [disabled]=\"menu.makeHead4.disabled\"\n (click)=\"run($event, 'makeHead4')\"\n i18n\n >Titre 4\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead5\"\n [disabled]=\"menu.makeHead5.disabled\"\n (click)=\"run($event, 'makeHead5')\"\n i18n\n >Titre 5\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead6\"\n [disabled]=\"menu.makeHead6.disabled\"\n (click)=\"run($event, 'makeHead6')\"\n i18n\n >Titre 6\n </button>\n </mat-menu>\n\n <button mat-button [matMenuTriggerFor]=\"tableMenu\" *ngIf=\"menu.addColumnBefore\">\n <span i18n>Tableau</span>\n <mat-icon>arrow_drop_down</mat-icon>\n </button>\n\n <mat-menu #tableMenu=\"matMenu\">\n <button\n mat-menu-item\n *ngIf=\"menu.insertTable\"\n [disabled]=\"menu.insertTable.disabled\"\n (click)=\"run($event, 'insertTable')\"\n i18n\n >Insérer un tableau\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.deleteTable\"\n [disabled]=\"menu.deleteTable.disabled\"\n (click)=\"run($event, 'deleteTable')\"\n i18n\n >Supprimer le tableau\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.mergeCells\"\n [disabled]=\"menu.mergeCells.disabled\"\n (click)=\"run($event, 'mergeCells')\"\n i18n\n >Fusionner les cellules\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.splitCell\"\n [disabled]=\"menu.splitCell.disabled\"\n (click)=\"run($event, 'splitCell')\"\n i18n\n >Scinder les cellules\n </button>\n\n <mat-divider></mat-divider>\n\n <button\n mat-menu-item\n *ngIf=\"menu.addColumnBefore\"\n [disabled]=\"menu.addColumnBefore.disabled\"\n (click)=\"run($event, 'addColumnBefore')\"\n i18n\n >Insérer une colonne avant\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.addColumnAfter\"\n [disabled]=\"menu.addColumnAfter.disabled\"\n (click)=\"run($event, 'addColumnAfter')\"\n i18n\n >Insérer une colonne après\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.deleteColumn\"\n [disabled]=\"menu.deleteColumn.disabled\"\n (click)=\"run($event, 'deleteColumn')\"\n i18n\n >Supprimer la colonne\n </button>\n\n <mat-divider></mat-divider>\n\n <button\n mat-menu-item\n *ngIf=\"menu.addRowBefore\"\n [disabled]=\"menu.addRowBefore.disabled\"\n (click)=\"run($event, 'addRowBefore')\"\n i18n\n >Insérer une ligne avant\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.addRowAfter\"\n [disabled]=\"menu.addRowAfter.disabled\"\n (click)=\"run($event, 'addRowAfter')\"\n i18n\n >Insérer une ligne après\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.deleteRow\"\n [disabled]=\"menu.deleteRow.disabled\"\n (click)=\"run($event, 'deleteRow')\"\n i18n\n >Supprimer la ligne\n </button>\n\n <mat-divider></mat-divider>\n\n <button\n mat-menu-item\n *ngIf=\"menu.toggleHeaderColumn\"\n [disabled]=\"menu.toggleHeaderColumn.disabled\"\n (click)=\"run($event, 'toggleHeaderColumn')\"\n i18n\n >Entête de colonne\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.toggleHeaderRow\"\n [disabled]=\"menu.toggleHeaderRow.disabled\"\n (click)=\"run($event, 'toggleHeaderRow')\"\n i18n\n >Entête de ligne\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.toggleHeaderCell\"\n [disabled]=\"menu.toggleHeaderCell.disabled\"\n (click)=\"run($event, 'toggleHeaderCell')\"\n i18n\n >Entête de cellule\n </button>\n </mat-menu>\n\n <button\n mat-button\n *ngIf=\"imageUploader\"\n naturalFileDrop\n [selectable]=\"true\"\n [broadcast]=\"false\"\n i18n-matTooltip\n matTooltip=\"Insérer une image\"\n (fileChange)=\"upload($event)\"\n >\n <mat-icon>insert_photo</mat-icon>\n </button>\n\n <mat-button-toggle-group *ngIf=\"menu.alignLeft\">\n <mat-button-toggle\n *ngIf=\"menu.alignLeft\"\n [disabled]=\"menu.alignLeft.disabled\"\n [checked]=\"menu.alignLeft.active\"\n (click)=\"run($event, 'alignLeft')\"\n i18n-matTooltip\n matTooltip=\"Aligner gauche\"\n >\n <mat-icon>format_align_left</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.alignCenter\"\n [disabled]=\"menu.alignCenter.disabled\"\n [checked]=\"menu.alignCenter.active\"\n (click)=\"run($event, 'alignCenter')\"\n i18n-matTooltip\n matTooltip=\"Centrer\"\n >\n <mat-icon>format_align_center</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.alignRight\"\n [disabled]=\"menu.alignRight.disabled\"\n [checked]=\"menu.alignRight.active\"\n (click)=\"run($event, 'alignRight')\"\n i18n-matTooltip\n matTooltip=\"Aligner droite\"\n >\n <mat-icon>format_align_right</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.alignJustify\"\n [disabled]=\"menu.alignJustify.disabled\"\n [checked]=\"menu.alignJustify.active\"\n (click)=\"run($event, 'alignJustify')\"\n i18n-matTooltip\n matTooltip=\"Justifier\"\n >\n <mat-icon>format_align_justify</mat-icon>\n </mat-button-toggle>\n </mat-button-toggle-group>\n\n <button\n mat-button\n *ngIf=\"menu.undo\"\n [disabled]=\"menu.undo.disabled\"\n (click)=\"run($event, 'undo')\"\n i18n-matTooltip\n matTooltip=\"Annuler\"\n >\n <mat-icon>undo</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.redo\"\n [disabled]=\"menu.redo.disabled\"\n (click)=\"run($event, 'redo')\"\n i18n-matTooltip\n matTooltip=\"Refaire\"\n >\n <mat-icon>redo</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.wrapBulletList && menu.wrapBulletList.show\"\n [disabled]=\"menu.wrapBulletList.disabled\"\n (click)=\"run($event, 'wrapBulletList')\"\n i18n-matTooltip\n matTooltip=\"Liste à puce\"\n >\n <mat-icon>format_list_bulleted</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.wrapOrderedList && menu.wrapOrderedList.show\"\n [disabled]=\"menu.wrapOrderedList.disabled\"\n (click)=\"run($event, 'wrapOrderedList')\"\n i18n-matTooltip\n matTooltip=\"Liste à numéro\"\n >\n <mat-icon>format_list_numbered</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.wrapBlockQuote && menu.wrapBlockQuote.show\"\n [disabled]=\"menu.wrapBlockQuote.disabled\"\n (click)=\"run($event, 'wrapBlockQuote')\"\n i18n-matTooltip\n matTooltip=\"Citation\"\n >\n <mat-icon>format_quote</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.joinUp && menu.joinUp.show\"\n [disabled]=\"menu.joinUp.disabled\"\n (click)=\"run($event, 'joinUp')\"\n i18n-matTooltip\n matTooltip=\"Fusionner avec l'élément du haut\"\n >\n <mat-icon>move_up</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.lift && menu.lift.show\"\n [disabled]=\"menu.lift.disabled\"\n (click)=\"run($event, 'lift')\"\n i18n-matTooltip\n matTooltip=\"Désindenter\"\n >\n <mat-icon>format_indent_decrease</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.selectParentNode && menu.selectParentNode.show\"\n [disabled]=\"menu.selectParentNode.disabled\"\n (click)=\"run($event, 'selectParentNode')\"\n i18n-matTooltip\n matTooltip=\"Sélectionner l'élément parent\"\n >\n <mat-icon>select_all</mat-icon>\n </button>\n </div>\n</div>\n<div #editor></div>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {NaturalEditorComponent} from './editor/editor.component';\nimport {MatButtonModule} from '@angular/material/button';\nimport {MatButtonToggleModule} from '@angular/material/button-toggle';\nimport {MatToolbarModule} from '@angular/material/toolbar';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatMenuModule} from '@angular/material/menu';\nimport {LinkDialogComponent} from './link-dialog/link-dialog.component';\nimport {ReactiveFormsModule} from '@angular/forms';\nimport {MatDialogModule} from '@angular/material/dialog';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {MatInputModule} from '@angular/material/input';\nimport {MatTooltipModule} from '@angular/material/tooltip';\nimport {NaturalFileModule} from '@ecodev/natural';\nimport {MatDividerModule} from '@angular/material/divider';\n\nconst imports = [\n CommonModule,\n MatButtonModule,\n MatButtonToggleModule,\n MatDialogModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatMenuModule,\n MatToolbarModule,\n MatTooltipModule,\n ReactiveFormsModule,\n NaturalFileModule,\n MatDividerModule,\n];\n\n@NgModule({\n declarations: [NaturalEditorComponent, LinkDialogComponent],\n imports: [...imports],\n exports: [...imports, NaturalEditorComponent],\n})\nexport class NaturalEditorModule {}\n","// Load `$localize` onto the global scope - to be able to use that function to translate strings in components/services.\nimport '@angular/localize/init';\n\n/*\n * Public API Surface of natural-editor\n */\n\nexport {NaturalEditorComponent} from './lib/editor/editor.component';\nexport {NaturalEditorModule} from './lib/editor.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAUa,WAAW;IAGpB,YAA+C,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAgB;YACpC,KAAK,EAAE;gBACH,IAAI;oBACA,OAAO,aAAa,CAAC,KAAK,CAAC;iBAC9B;gBACD,KAAK,CAAC,EAAE,EAAE,GAAG;;oBAET,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;;oBAGlC,MAAM,MAAM,GA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osemirror-state';
3
+ import { EditorView } from 'prosemirror-view';
4
+ /**
5
+ * One item of the menu.
6
+ *
7
+ * This is the equivalent of `MenuItem` but without all the rendering logic since we use Angular
8
+ * templates for rendering. Also it caches the state of the item everytime the editor state changes,
9
+ * so Angular can query the state as often as needed without performance hit.
10
+ */
11
+ export declare class Item {
12
+ readonly spec: MenuItemSpec;
13
+ /**
14
+ * Whether the item is 'active' (for example, the item for toggling the strong mark might be active when the cursor is in strong text).
15
+ */
16
+ active: boolean;
17
+ /**
18
+ * Button is shown but disabled, because the item cannot be (un-)applied
19
+ */
20
+ disabled: boolean;
21
+ /**
22
+ * Whether the item is shown at the moment
23
+ */
24
+ show: boolean;
25
+ constructor(spec: MenuItemSpec);
26
+ /**
27
+ * Update the item state according to the editor state
28
+ */
29
+ update(view: EditorView, state: EditorState): void;
30
+ }
@@ -1,36 +1,7 @@
1
- import { MenuItemSpec } from 'prosemirror-menu';
2
- import { EditorState } from 'prosemirror-state';
3
1
  import { Schema } from 'prosemirror-model';
4
2
  import { MatDialog } from '@angular/material/dialog';
5
- import { EditorView } from 'prosemirror-view';
6
- /**
7
- * One item of the menu.
8
- *
9
- * This is the equivalent of `MenuItem` but without all the rendering logic since we use Angular
10
- * templates for rendering. Also it caches the state of the item everytime the editor state changes,
11
- * so Angular can query the state as often as needed without performance hit.
12
- */
13
- export declare class Item {
14
- readonly spec: MenuItemSpec;
15
- /**
16
- * Whether the item is 'active' (for example, the item for toggling the strong mark might be active when the cursor is in strong text).
17
- */
18
- active: boolean;
19
- /**
20
- * Button is shown but disabled, because the item cannot be (un-)applied
21
- */
22
- disabled: boolean;
23
- /**
24
- * Whether the item is shown at the moment
25
- */
26
- show: boolean;
27
- constructor(spec: MenuItemSpec);
28
- /**
29
- * Update the item state according to the editor state
30
- */
31
- update(view: EditorView, state: EditorState): void;
32
- }
33
- export declare type Key = 'toggleStrong' | 'toggleEm' | 'toggleCode' | 'toggleLink' | 'wrapBulletList' | 'wrapOrderedList' | 'wrapBlockQuote' | 'makeParagraph' | 'makeCodeBlock' | 'makeHead1' | 'makeHead2' | 'makeHead3' | 'makeHead4' | 'makeHead5' | 'makeHead6' | 'insertHorizontalRule' | 'joinUp' | 'lift' | 'selectParentNode' | 'undo' | 'redo' | 'insertTable' | 'addColumnBefore' | 'addColumnAfter' | 'deleteColumn' | 'addRowBefore' | 'addRowAfter' | 'deleteRow' | 'deleteTable' | 'mergeCells' | 'splitCell' | 'toggleHeaderColumn' | 'toggleHeaderRow' | 'toggleHeaderCell';
3
+ import { Item } from './item';
4
+ export declare type Key = 'toggleStrong' | 'toggleEm' | 'toggleCode' | 'toggleLink' | 'wrapBulletList' | 'wrapOrderedList' | 'wrapBlockQuote' | 'makeParagraph' | 'makeCodeBlock' | 'makeHead1' | 'makeHead2' | 'makeHead3' | 'makeHead4' | 'makeHead5' | 'makeHead6' | 'alignLeft' | 'alignRight' | 'alignCenter' | 'alignJustify' | 'insertHorizontalRule' | 'joinUp' | 'lift' | 'selectParentNode' | 'undo' | 'redo' | 'insertTable' | 'addColumnBefore' | 'addColumnAfter' | 'deleteColumn' | 'addRowBefore' | 'addRowAfter' | 'deleteRow' | 'deleteTable' | 'mergeCells' | 'splitCell' | 'toggleHeaderColumn' | 'toggleHeaderRow' | 'toggleHeaderCell';
34
5
  export declare type MenuItems = Partial<Record<Key, Item>>;
35
6
  /**
36
7
  * Given a schema, look for default mark and node types in it and
@@ -0,0 +1,2 @@
1
+ import { NodeSpec } from 'prosemirror-model';
2
+ export declare const paragraphWithAlignment: NodeSpec;
@@ -0,0 +1,6 @@
1
+ import { Item } from './item';
2
+ declare type Alignment = 'left' | 'right' | 'center' | 'justify';
3
+ export declare class TextAlignItem extends Item {
4
+ constructor(alignment: Alignment);
5
+ }
6
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural-editor",
3
- "version": "41.2.1",
3
+ "version": "41.3.0",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,