@liquid-js/lyr-extras 22.0.0-alpha.3 → 22.0.0-alpha.5

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":"liquid-js-lyr-extras-markdown-editor.mjs","names":[],"sources":["../../../packages/extras/markdown-editor/src/format-style.ts","../../../packages/extras/markdown-editor/src/format.ts","../../../packages/extras/markdown-editor/src/texts.ts","../../../packages/extras/markdown-editor/src/markdown-editor.component.ts"],"sourcesContent":["// The formatter's style and plugin, which `scripts/remark-config.ts` uses too, for `yarn format:md` and VS Code's\n// remark extension: this module only has type imports, so Node runs it as it is.\nimport type { Nodes, Root } from 'mdast'\nimport type { Options } from 'remark-stringify'\n\n/**\n * How formatted markdown is written: `-` bullets, `1.` numbers, `_emphasis_`, `**strong**`, fenced code with\n * backticks, `#` headings, `---` rules, and tables with their columns lined up.\n */\nexport const NB_MARKDOWN_STYLE: Options = {\n bullet: '-',\n bulletOrdered: '.',\n emphasis: '_',\n strong: '*',\n fence: '`',\n fences: true,\n rule: '-',\n setext: false,\n closeAtx: false,\n listItemIndent: 'one',\n incrementListMarker: true,\n quote: '\"'\n}\n\n/** Typographic characters and the plain ones they're written as: the renderer decides how to show them. */\nconst PLAIN: Array<[RegExp, string]> = [\n [/[‘’′]/g, \"'\"],\n [/[“”″]/g, '\"'],\n [/—/g, '---'],\n [/–/g, '--'],\n [/…/g, '...']\n]\n\nfunction plain(value: string): string {\n return PLAIN.reduce((text, [pattern, replacement]) => text.replace(pattern, replacement), value)\n}\n\n/** A rule written as HTML, `<hr>`, on a line of its own; the formatter writes it as markdown's. */\nconst HR = /^<hr\\s*\\/?>$/i\n\n/** The nodes whose children are blocks, where an `<hr>` is a rule rather than a tag in the text. */\nconst BLOCKS = new Set(['root', 'blockquote', 'listItem'])\n\n/** An HTML block as markdown's rule where it is, or ends with, an `<hr>`: e.g. one right after a `</div>`. */\nfunction rules(node: Nodes): Nodes[] {\n if (node.type !== 'html') {\n return [node]\n }\n const lines = node.value.trimEnd().split('\\n')\n if (!HR.test(lines[lines.length - 1].trim())) {\n return [node]\n }\n const html = lines.slice(0, -1).join('\\n')\n return [...(html.trim() ? [{ ...node, value: html }] : []), { type: 'thematicBreak' }]\n}\n\n/**\n * Writes prose in plain characters, text and the titles and alt text of links and images, and rules as markdown's;\n * code and other HTML stay.\n */\nfunction normalise(node: Nodes): void {\n if (node.type === 'text') {\n node.value = plain(node.value)\n }\n if ((node.type === 'link' || node.type === 'image' || node.type === 'definition') && node.title) {\n node.title = plain(node.title)\n }\n if ((node.type === 'image' || node.type === 'imageReference') && node.alt) {\n node.alt = plain(node.alt)\n }\n if ('children' in node) {\n node.children.forEach(normalise)\n if (BLOCKS.has(node.type)) {\n node.children = node.children.flatMap(rules) as typeof node.children\n }\n }\n}\n\n/**\n * A remark plugin that writes prose in plain characters and rules written as `<hr>` as markdown's, as the formatter\n * does.\n */\nexport function nbRemarkNormalise() {\n return (tree: Root) => normalise(tree)\n}\n","import { NB_MARKDOWN_STYLE, nbRemarkNormalise } from './format-style'\n\n/**\n * Formats markdown, CommonMark with GitHub's extensions, in one style, as `nb-markdown-editor`'s Format button does:\n * the same document, written the same way wherever it came from. Prose is written in plain characters, quotes,\n * dashes and ellipses as `'`, `\"`, `--`, `---` and `...`, leaving how they look to the renderer, and a rule written\n * as `<hr>` as `---`. Code stays as it is, and so does front matter, YAML between `---` lines or TOML between `+++`\n * lines. It loads `remark`, `remark-gfm` and `remark-frontmatter` when first called.\n *\n * ```ts\n * import { nbFormatMarkdown } from '@liquid-js/lyr-extras/markdown-editor';\n *\n * const formatted = await nbFormatMarkdown('* one\\n* two\\n\\n__it’s bold__');\n * // \"- one\\n- two\\n\\n**it's bold**\\n\"\n * ```\n */\nexport async function nbFormatMarkdown(markdown: string): Promise<string> {\n const [{ remark }, { default: remarkGfm }, { default: remarkFrontmatter }] = await Promise.all([\n import('remark'),\n import('remark-gfm'),\n import('remark-frontmatter')\n ])\n const file = await remark()\n .use(remarkFrontmatter, ['yaml', 'toml'])\n .use(remarkGfm)\n .use(nbRemarkNormalise)\n .data('settings', NB_MARKDOWN_STYLE)\n .process(markdown)\n return String(file)\n}\n","import { injectNbTexts, NbLocalize } from '@liquid-js/lyr-core'\n\n/** @internal */\ndeclare const $localize: NbLocalize\n\n/**\n * The texts of the markdown editor's toolbar, tabs and popups. `provideNbTexts({ markdownEditor: { ... } })` changes\n * them, and they're translated with Angular's i18n, as `$localize` messages with ids like\n * `@@nb.markdownEditor.bold`.\n */\nexport interface NbMarkdownEditorTexts {\n /** The markdown mode's tab. */\n markdown: string\n /** The WYSIWYG mode's tab. */\n wysiwyg: string\n /** The tab with the markdown, when the preview is a tab. */\n write: string\n preview: string\n /** The toolbar button that opens the headings. */\n headings: string\n /** A level in the list of headings, given the level, e.g. \"Heading 2\". */\n headingLevel: (level: string) => string\n paragraph: string\n bold: string\n italic: string\n strike: string\n code: string\n line: string\n blockquote: string\n unorderedList: string\n orderedList: string\n task: string\n indent: string\n outdent: string\n insertLink: string\n insertCodeBlock: string\n insertTable: string\n insertImage: string\n /** The toolbar button that writes the markdown in one style, with its shortcut. */\n format: string\n /** The toolbar button that shows the items that don't fit. */\n more: string\n /** Names the toolbar. */\n textFormatting: string\n /** Describes the toolbar button whose format the text at the cursor has. */\n activeButton: string\n autoScrollEnabled: string\n autoScrollDisabled: string\n\n imageUrl: string\n selectImageFile: string\n chooseFile: string\n noFile: string\n description: string\n file: string\n url: string\n linkText: string\n linkTextRequired: string\n urlRequired: string\n ok: string\n cancel: string\n edit: string\n editLink: string\n removeLink: string\n editImage: string\n removeImage: string\n /** Asked when tabular text is pasted. */\n pasteAsTable: string\n textColor: string\n /** Edits the language of a code block. */\n chooseLanguage: string\n\n addRowAbove: string\n addRowBelow: string\n addColumnLeft: string\n addColumnRight: string\n removeRow: string\n removeColumn: string\n alignColumnLeft: string\n alignColumnCenter: string\n alignColumnRight: string\n removeTable: string\n}\n\ndeclare module '@liquid-js/lyr-core' {\n interface NbTexts {\n markdownEditor: NbMarkdownEditorTexts\n }\n}\n\n/** The editor's names of its texts; the Format button is the component's. */\nconst keys: Record<Exclude<keyof NbMarkdownEditorTexts, 'format'>, string> = {\n markdown: 'Markdown',\n wysiwyg: 'WYSIWYG',\n write: 'Write',\n preview: 'Preview',\n headings: 'Headings',\n headingLevel: 'Heading {level}',\n paragraph: 'Paragraph',\n bold: 'Bold',\n italic: 'Italic',\n strike: 'Strike',\n code: 'Code',\n line: 'Line',\n blockquote: 'Blockquote',\n unorderedList: 'Unordered list',\n orderedList: 'Ordered list',\n task: 'Task',\n indent: 'Indent',\n outdent: 'Outdent',\n insertLink: 'Insert link',\n insertCodeBlock: 'Insert CodeBlock',\n insertTable: 'Insert table',\n insertImage: 'Insert image',\n more: 'More',\n textFormatting: 'Text Formatting',\n activeButton: 'Active Button',\n autoScrollEnabled: 'Auto scroll enabled',\n autoScrollDisabled: 'Auto scroll disabled',\n imageUrl: 'Image URL',\n selectImageFile: 'Select image file',\n chooseFile: 'Choose a file',\n noFile: 'No file',\n description: 'Description',\n file: 'File',\n url: 'URL',\n linkText: 'Link text',\n linkTextRequired: 'Link text required',\n urlRequired: 'URL required',\n ok: 'OK',\n cancel: 'Cancel',\n edit: 'Edit',\n editLink: 'Edit link',\n removeLink: 'Remove link',\n editImage: 'Edit image',\n removeImage: 'Remove image',\n pasteAsTable: 'Would you like to paste as table?',\n textColor: 'Text color',\n chooseLanguage: 'Choose language',\n addRowAbove: 'Add row to up',\n addRowBelow: 'Add row to down',\n addColumnLeft: 'Add column to left',\n addColumnRight: 'Add column to right',\n removeRow: 'Remove row',\n removeColumn: 'Remove column',\n alignColumnLeft: 'Align column to left',\n alignColumnCenter: 'Align column to center',\n alignColumnRight: 'Align column to right',\n removeTable: 'Remove table'\n}\n\n/** The texts under the editor's names, to register as its language. @internal */\nexport function nbMarkdownEditorLanguage(texts: NbMarkdownEditorTexts): Record<string, string> {\n return Object.fromEntries(\n Object.entries(keys).map(([key, name]) => {\n const text = texts[key as keyof typeof keys]\n // The editor puts the level where `{level}` is.\n return [name, typeof text === 'function' ? text('{level}') : text]\n })\n )\n}\n\n/** @internal */\nexport function injectNbMarkdownEditorTexts() {\n return injectNbTexts('markdownEditor', () => ({\n markdown: $localize`:@@nb.markdownEditor.markdown:Markdown`,\n wysiwyg: $localize`:@@nb.markdownEditor.wysiwyg:WYSIWYG`,\n write: $localize`:@@nb.markdownEditor.write:Write`,\n preview: $localize`:@@nb.markdownEditor.preview:Preview`,\n headings: $localize`:@@nb.markdownEditor.headings:Headings`,\n headingLevel: (level: string) => $localize`:@@nb.markdownEditor.headingLevel:Heading ${level}:level:`,\n paragraph: $localize`:@@nb.markdownEditor.paragraph:Paragraph`,\n bold: $localize`:@@nb.markdownEditor.bold:Bold`,\n italic: $localize`:@@nb.markdownEditor.italic:Italic`,\n strike: $localize`:@@nb.markdownEditor.strike:Strikethrough`,\n code: $localize`:@@nb.markdownEditor.code:Inline code`,\n line: $localize`:@@nb.markdownEditor.line:Horizontal line`,\n blockquote: $localize`:@@nb.markdownEditor.blockquote:Blockquote`,\n unorderedList: $localize`:@@nb.markdownEditor.unorderedList:Unordered list`,\n orderedList: $localize`:@@nb.markdownEditor.orderedList:Ordered list`,\n task: $localize`:@@nb.markdownEditor.task:Task list`,\n indent: $localize`:@@nb.markdownEditor.indent:Indent`,\n outdent: $localize`:@@nb.markdownEditor.outdent:Outdent`,\n insertLink: $localize`:@@nb.markdownEditor.insertLink:Insert link`,\n insertCodeBlock: $localize`:@@nb.markdownEditor.insertCodeBlock:Insert code block`,\n insertTable: $localize`:@@nb.markdownEditor.insertTable:Insert table`,\n insertImage: $localize`:@@nb.markdownEditor.insertImage:Insert image`,\n format: $localize`:@@nb.markdownEditor.format:Format (Shift+Alt+F)`,\n more: $localize`:@@nb.markdownEditor.more:More`,\n textFormatting: $localize`:@@nb.markdownEditor.textFormatting:Text formatting`,\n activeButton: $localize`:@@nb.markdownEditor.activeButton:Active`,\n autoScrollEnabled: $localize`:@@nb.markdownEditor.autoScrollEnabled:Auto scroll enabled`,\n autoScrollDisabled: $localize`:@@nb.markdownEditor.autoScrollDisabled:Auto scroll disabled`,\n\n imageUrl: $localize`:@@nb.markdownEditor.imageUrl:Image URL`,\n selectImageFile: $localize`:@@nb.markdownEditor.selectImageFile:Select image file`,\n chooseFile: $localize`:@@nb.markdownEditor.chooseFile:Choose a file`,\n noFile: $localize`:@@nb.markdownEditor.noFile:No file`,\n description: $localize`:@@nb.markdownEditor.description:Description`,\n file: $localize`:@@nb.markdownEditor.file:File`,\n url: $localize`:@@nb.markdownEditor.url:URL`,\n linkText: $localize`:@@nb.markdownEditor.linkText:Link text`,\n linkTextRequired: $localize`:@@nb.markdownEditor.linkTextRequired:The field \"Link text\" is required`,\n urlRequired: $localize`:@@nb.markdownEditor.urlRequired:The field \"URL\" is required`,\n ok: $localize`:@@nb.markdownEditor.ok:OK`,\n cancel: $localize`:@@nb.markdownEditor.cancel:Cancel`,\n edit: $localize`:@@nb.markdownEditor.edit:Edit`,\n editLink: $localize`:@@nb.markdownEditor.editLink:Edit link`,\n removeLink: $localize`:@@nb.markdownEditor.removeLink:Remove link`,\n editImage: $localize`:@@nb.markdownEditor.editImage:Edit image`,\n removeImage: $localize`:@@nb.markdownEditor.removeImage:Remove image`,\n pasteAsTable: $localize`:@@nb.markdownEditor.pasteAsTable:Paste as a table?`,\n textColor: $localize`:@@nb.markdownEditor.textColor:Text color`,\n chooseLanguage: $localize`:@@nb.markdownEditor.chooseLanguage:Choose language`,\n\n addRowAbove: $localize`:@@nb.markdownEditor.addRowAbove:Add row above`,\n addRowBelow: $localize`:@@nb.markdownEditor.addRowBelow:Add row below`,\n addColumnLeft: $localize`:@@nb.markdownEditor.addColumnLeft:Add column left`,\n addColumnRight: $localize`:@@nb.markdownEditor.addColumnRight:Add column right`,\n removeRow: $localize`:@@nb.markdownEditor.removeRow:Remove row`,\n removeColumn: $localize`:@@nb.markdownEditor.removeColumn:Remove column`,\n alignColumnLeft: $localize`:@@nb.markdownEditor.alignColumnLeft:Align column left`,\n alignColumnCenter: $localize`:@@nb.markdownEditor.alignColumnCenter:Align column center`,\n alignColumnRight: $localize`:@@nb.markdownEditor.alignColumnRight:Align column right`,\n removeTable: $localize`:@@nb.markdownEditor.removeTable:Remove table`\n }))\n}\n","import { isPlatformBrowser } from '@angular/common'\nimport {\n afterRenderEffect,\n booleanAttribute,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n forwardRef,\n inject,\n input,\n linkedSignal,\n model,\n PLATFORM_ID,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport {\n injectNbDefaults,\n NbComponentOrCustomStatus,\n NbComponentShape,\n NbIconConfig,\n NbIconLibraries,\n NbValidationDirective\n} from '@liquid-js/lyr-core'\nimport type {\n Editor,\n EditorOptions,\n EditorPlugin,\n EditorType,\n IconName,\n PreviewStyle,\n ToolbarItemOptions\n} from '@liquid-js/underflow'\nimport type { HLJSApi } from 'highlight.js'\nimport { HighlightLoader, NXT_HIGHLIGHT_OPTIONS } from 'nxt-highlightjs'\nimport { nbFormatMarkdown } from './format'\nimport { injectNbMarkdownEditorTexts, nbMarkdownEditorLanguage, NbMarkdownEditorTexts } from './texts'\n\n/** Options of `@liquid-js/underflow`'s editor that the component's inputs don't set. */\nexport type NbMarkdownEditorOptions = Omit<\n EditorOptions,\n | 'el'\n | 'initialValue'\n | 'initialEditType'\n | 'height'\n | 'minHeight'\n | 'previewStyle'\n | 'placeholder'\n | 'toolbarItems'\n | 'hideModeSwitch'\n | 'toolbarStyle'\n | 'language'\n | 'theme'\n | 'autofocus'\n | 'viewer'\n | 'readonly'\n | 'disabled'\n | 'autoDirection'\n>\n\n/** Groups of toolbar items: the names of the editor's items, e.g. `bold`, `format`, or items of your own. */\nexport type NbMarkdownEditorToolbar = Array<Array<string | ToolbarItemOptions>>\n\n/** What the editor is made with. */\ninterface Setup {\n texts: NbMarkdownEditorTexts\n toolbarItems?: NbMarkdownEditorToolbar\n hideModeSwitch: boolean\n autoDirection: boolean\n options: NbMarkdownEditorOptions\n /** Highlights code, once it's loaded. */\n highlighter?: HLJSApi\n}\n\n/**\n * The editor's icons, by UnderFlow's names: Lyra's, from the `essentials` pack, written out whole so the pack has them.\n * Every name is here, so a name UnderFlow adds doesn't compile until it has one of Lyra's.\n */\nconst ICONS: Record<IconName, NbIconConfig> = {\n 'heading': { icon: 'heading-outline', pack: 'essentials' },\n 'bold': { icon: 'bold-outline', pack: 'essentials' },\n 'italic': { icon: 'italic-outline', pack: 'essentials' },\n 'strike': { icon: 'strikethrough-outline', pack: 'essentials' },\n 'hrline': { icon: 'minus-outline', pack: 'essentials' },\n 'quote': { icon: 'quote-outline', pack: 'essentials' },\n 'bullet-list': { icon: 'list-outline', pack: 'essentials' },\n 'ordered-list': { icon: 'list-numbered-outline', pack: 'essentials' },\n 'task-list': { icon: 'list-checked-outline', pack: 'essentials' },\n 'indent': { icon: 'indent-outline', pack: 'essentials' },\n 'outdent': { icon: 'outdent-outline', pack: 'essentials' },\n 'table': { icon: 'table-outline', pack: 'essentials' },\n 'image': { icon: 'image-outline', pack: 'essentials' },\n 'link': { icon: 'link-outline', pack: 'essentials' },\n 'code': { icon: 'code-outline', pack: 'essentials' },\n 'codeblock': { icon: 'code-block-outline', pack: 'essentials' },\n 'more': { icon: 'more-horizontal-outline', pack: 'essentials' },\n 'add-row-up': { icon: 'table-row-add-above-outline', pack: 'essentials' },\n 'add-row-down': { icon: 'table-row-add-below-outline', pack: 'essentials' },\n 'add-column-left': { icon: 'table-column-add-left-outline', pack: 'essentials' },\n 'add-column-right': { icon: 'table-column-add-right-outline', pack: 'essentials' },\n 'remove-row': { icon: 'table-row-remove-outline', pack: 'essentials' },\n 'remove-column': { icon: 'table-column-remove-outline', pack: 'essentials' },\n 'align-column-left': { icon: 'align-left-outline', pack: 'essentials' },\n 'align-column-center': { icon: 'align-center-outline', pack: 'essentials' },\n 'align-column-right': { icon: 'align-right-outline', pack: 'essentials' },\n 'remove-table': { icon: 'table-remove-outline', pack: 'essentials' },\n 'chevron-down': { icon: 'chevron-down-outline', pack: 'essentials' },\n 'pencil': { icon: 'edit-outline', pack: 'essentials' }\n}\n\n/** The Format button's icon. */\nconst FORMAT_ICON: NbIconConfig = { icon: 'brush-outline', pack: 'essentials' }\n\n/** The command the Format button runs, in either mode. */\nconst FORMAT_COMMAND = 'nbFormat'\n\n/** UnderFlow's toolbar, with the Format button before the scroll sync switch. */\nconst TOOLBAR: NbMarkdownEditorToolbar = [\n ['heading', 'bold', 'italic', 'strike'],\n ['hr', 'quote'],\n ['ul', 'ol', 'task', 'indent', 'outdent'],\n ['table', 'image', 'link'],\n ['code', 'codeblock'],\n ['format'],\n ['scrollSync']\n]\n\n/** The checkmark of the scroll sync switch, which looks like Lyra's toggle. */\nconst SWITCH_CHECKMARK: NbIconConfig = { icon: 'checkmark-bold-outline', pack: 'essentials' }\n\n// The editor's texts are registered by language code for all editors, so editors with the same texts share a code.\nconst languages = new Map<string, string>()\n\nfunction languageCode(library: typeof Editor, texts: NbMarkdownEditorTexts) {\n const language = nbMarkdownEditorLanguage(texts)\n const key = JSON.stringify(language)\n let code = languages.get(key)\n if (!code) {\n code = `x-nb-markdown-${languages.size}`\n languages.set(key, code)\n library.setLanguage(code, language)\n }\n return code\n}\n\n/**\n * A markdown editor, with a toolbar, a preview and a WYSIWYG mode:\n *\n * ```html\n * <nb-markdown-editor [formControl]=\"text\" aria-label=\"Description\" />\n * ```\n *\n * @stacked-example(Showcase, markdown/markdown-editor-showcase.component)\n *\n * ### Installation\n *\n * Install [`@liquid-js/underflow`](https://www.npmjs.com/package/@liquid-js/underflow), which is the editor, with the\n * ProseMirror and DOMPurify packages it uses, and import `NbMarkdownEditorComponent` from\n * `@liquid-js/lyr-extras/markdown-editor`:\n *\n * ```bash\n * npm install @liquid-js/underflow prosemirror-commands prosemirror-history prosemirror-inputrules \\\n * prosemirror-keymap prosemirror-model prosemirror-state prosemirror-transform prosemirror-view dompurify\n * ```\n *\n * The Format button formats with [`remark`](https://remark.js.org), which it loads when it's first used, with\n * `remark-gfm` and `remark-frontmatter`:\n *\n * ```bash\n * npm install remark remark-gfm remark-frontmatter\n * ```\n *\n * The editor loads when the first one shows; its styles come with the component. It highlights code with the\n * highlight.js that [`nxt-highlightjs`](https://www.npmjs.com/package/nxt-highlightjs) loads, when the app sets it up\n * as in `nb-markdown-viewer`, so install them too:\n *\n * ```bash\n * npm install nxt-highlightjs highlight.js\n * ```\n *\n * ### Usage\n *\n * It's a form control whose value is the markdown, CommonMark with GitHub's extensions, e.g. tables and task lists.\n * Its frame has the colours of a field and its `status`, and the text the theme's styles:\n * @stacked-example(States, markdown/markdown-editor-status.component)\n *\n * The preview shows the text's straight quotes, `--`, `---` and `...` as typographic quotes, en and em dashes and\n * ellipses, as `nb-markdown-viewer` does, while the markdown and the WYSIWYG mode keep them as written.\n *\n * In the markdown mode the preview is a tab, or next to the markdown with `previewStyle=\"vertical\"`; the WYSIWYG mode\n * edits the formatted text, and `mode` is the one that shows. The toolbar wraps onto more lines when it doesn't fit,\n * so all of its buttons can be reached with Tab; `toolbarItems` picks them.\n *\n * The Format button, and Shift+Alt+F in the text, writes the markdown in one style with `nbFormatMarkdown`, which\n * also writes typographic quotes, dashes and ellipses as plain characters; Undo brings the text back. It's `format` in\n * `toolbarItems`.\n *\n * In the text, Tab indents list items and moves between table cells, so Escape and then Tab or Shift+Tab moves focus\n * out of it, as in code editors. Name the text with `aria-label`, `aria-labelledby` for a `label`, or an `nbLabel` with\n * `nbValidation`, which also gives it the field's status and errors, as it does an input.\n *\n * With `readonly` the text can be read, selected and copied, but not changed, as in a read-only field: the toolbar\n * and the mode switch are disabled, while the Write and Preview tabs still switch. Disabled, the editor is read-only\n * too, in the colours of a disabled field, and Tab skips it.\n *\n * Text that mixes right-to-left and left-to-right languages, e.g. Arabic or Hebrew quoted in English, reads right\n * with `autoDirection`: each paragraph, heading, list, quote and table takes the direction of its own text, as\n * `dir=\"auto\"` does, in the preview and the WYSIWYG mode, and so does each line of the markdown. Code blocks read left\n * to right. The markdown itself doesn't change.\n *\n * `options` takes the [editor's other options](https://liquid-js.github.io/underflow/docs/), e.g. plugins, widgets\n * or `hooks.addImageBlobHook` to upload pasted images, and `editor()` is the editor, for its methods. It's made again\n * when the options, the toolbar, the texts or `autoDirection` change, keeping the markdown.\n */\n@Component({\n selector: 'nb-markdown-editor',\n template: '<div #container></div>',\n styleUrl: './markdown-editor.component.scss',\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NbMarkdownEditorComponent), multi: true }],\n host: {\n 'class': 'nb-markdown',\n '(keydown)': 'onKeydown($event)',\n '[attr.aria-disabled]': 'isDisabled() || null',\n '[style]': 'statusStyles()',\n // Keeps the editor's place until it loads.\n '[style.min-height]': \"editor() ? null : height() === 'auto' ? minHeight() : height()\"\n }\n})\nexport class NbMarkdownEditorComponent implements ControlValueAccessor {\n protected readonly texts = injectNbMarkdownEditorTexts()\n protected readonly iconLibraries = inject(NbIconLibraries)\n\n /** The editor's height with the toolbar, e.g. `300px` (default) or `auto`, which grows with the text. */\n readonly height = input('300px')\n /** `200px` by default. */\n readonly minHeight = input('200px')\n /** The preview in a `tab` (default), or `vertical`, next to the markdown. */\n readonly previewStyle = input<PreviewStyle>('tab')\n /** `markdown` (default) or `wysiwyg`, and the mode the user picks. */\n readonly mode = model<EditorType>('markdown')\n readonly placeholder = input('')\n /** Field status: `basic` (default), `primary`, `info`, `success`, `warning`, `danger` or `control`. */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n // The app's defaults for fields, which the shape starts from, as a textarea's does.\n protected readonly nbDefaults = injectNbDefaults('input')\n /** Field shape: `rectangle` (default), `semi-round` or `round`, only as round as a textarea gets. */\n readonly shapeInput = input<NbComponentShape | undefined>(undefined, { alias: 'shape' })\n /** The shape in use: the input's, the app's default, or 'rectangle'. */\n readonly shape = linkedSignal<NbComponentShape>(() => this.shapeInput() ?? this.nbDefaults().shape ?? 'rectangle')\n /** Groups of toolbar items, e.g. `[['heading', 'bold', 'italic'], ['link']]`. */\n readonly toolbarItems = input<NbMarkdownEditorToolbar>()\n /** Hides the Markdown and WYSIWYG tabs. */\n readonly hideModeSwitch = input(false, { transform: booleanAttribute })\n /**\n * Gives each paragraph, heading, list, quote and table the direction of its own text (`dir=\"auto\"`), for text in\n * more than one direction; `false` by default.\n */\n readonly autoDirection = input(false, { transform: booleanAttribute })\n /** Options of `@liquid-js/underflow`'s editor, e.g. plugins. */\n readonly options = input<NbMarkdownEditorOptions>({})\n /** Names the text area when there's no `aria-labelledby`. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' })\n /** The id of the element that names the text area, e.g. a `label`. */\n readonly ariaLabelledBy = input<string | undefined>(undefined, { alias: 'aria-labelledby' })\n readonly disabled = input(false, { transform: booleanAttribute })\n /** Lets the user read the text, but not change it. */\n readonly readonly = input(false, { transform: booleanAttribute })\n\n /** The editor, once it's loaded. */\n readonly editor = signal<Editor | undefined>(undefined)\n\n protected readonly validation = inject(NbValidationDirective, { self: true, optional: true })\n // With `nbValidation`, the status it gives while the control shows errors or success.\n protected readonly resolvedStatus = computed(() => this.validation?.status() ?? this.status())\n\n protected readonly value = signal('')\n protected readonly isDisabled = linkedSignal(() => this.disabled())\n protected readonly container = viewChild.required<ElementRef<HTMLElement>>('container')\n /** Loads highlight.js, when the app highlights code. */\n protected readonly highlightLoader = inject(NXT_HIGHLIGHT_OPTIONS, { optional: true })\n ? inject(HighlightLoader)\n : undefined\n\n protected readonly statusStyles = computed(() => {\n const status = this.resolvedStatus()\n const shape = this.shape()\n return {\n '--nb-markdown-border-radius': `min(var(--input-${shape}-border-radius), var(--input-textarea-max-border-radius))`,\n '--nb-markdown-field-border-radius': `var(--input-${shape}-border-radius)`,\n // At rest; the styles pick the background by state, which an inline value would override.\n '--nb-markdown-rest-background': `var(--input-${status}-background-color)`,\n '--nb-markdown-border-color': `var(--input-${status}-border-color)`,\n '--nb-markdown-hover-background': `var(--input-${status}-hover-background-color)`,\n '--nb-markdown-hover-border-color': `var(--input-${status}-hover-border-color)`,\n '--nb-markdown-focus-background': `var(--input-${status}-focus-background-color)`,\n '--nb-markdown-focus-border-color': `var(--input-${status}-focus-border-color)`,\n '--nb-markdown-focus-and-hover-background': `var(--input-${status}-focus-and-hover-background-color)`,\n '--nb-markdown-focus-and-hover-border-color': `var(--input-${status}-focus-and-hover-border-color)`,\n '--nb-markdown-disabled-background': `var(--input-${status}-disabled-background-color)`,\n '--nb-markdown-disabled-border-color': `var(--input-${status}-disabled-border-color)`\n }\n })\n\n /** What the editor is made with; it's made again when this changes. */\n protected readonly setup = computed<Setup | undefined>(() => {\n const highlight = this.highlightLoader?.hljs\n // The editor waits for highlight.js rather than being made again when it loads.\n if (highlight?.isLoading()) {\n return undefined\n }\n return {\n texts: this.texts(),\n toolbarItems: this.toolbarItems(),\n hideModeSwitch: this.hideModeSwitch(),\n autoDirection: this.autoDirection(),\n options: this.options(),\n highlighter: highlight?.hasValue() ? highlight.value() : undefined\n }\n })\n\n protected creating = 0\n protected destroyed = false\n /** Set while the form's value is written, which isn't a change to report. */\n protected writing = false\n\n protected onChange: (value: string) => void = () => {}\n /** @internal */\n onTouched: () => void = () => {}\n\n constructor() {\n // The text is the control: it gets the validation's ARIA, and the focus from an `nbLabel`, not the host.\n this.validation?.delegateAria(() => this.editor()?.focus())\n if (!isPlatformBrowser(inject(PLATFORM_ID))) {\n return\n }\n afterRenderEffect(() => {\n const setup = this.setup()\n if (setup) {\n untracked(() => void this.create(setup))\n }\n })\n afterRenderEffect(() => {\n const editor = this.editor()\n const [height, minHeight, previewStyle, placeholder, mode] = [\n this.height(),\n this.minHeight(),\n this.previewStyle(),\n this.placeholder(),\n this.mode()\n ]\n if (!editor) {\n return\n }\n if (editor.getHeight() !== height) {\n editor.setHeight(height)\n }\n if (editor.getMinHeight() !== minHeight) {\n editor.setMinHeight(minHeight)\n }\n if (editor.getCurrentPreviewStyle() !== previewStyle) {\n editor.changePreviewStyle(previewStyle)\n // The vertical preview brings the scroll sync switch.\n this.markSwitch()\n }\n editor.setPlaceholder(placeholder)\n if (editor.isWysiwygMode() !== (mode === 'wysiwyg')) {\n editor.changeMode(mode, true)\n }\n })\n afterRenderEffect(() => {\n const editor = this.editor()\n const [disabled, readonly] = [this.isDisabled(), this.readonly()]\n if (editor) {\n editor.setDisabled(disabled)\n editor.setReadonly(readonly)\n }\n })\n afterRenderEffect(() => {\n const editor = this.editor()\n const validation = this.validation\n const labelledBy = [this.ariaLabelledBy(), validation?.labelledBy()].filter(Boolean).join(' ') || undefined\n const attributes = {\n 'aria-label': labelledBy ? undefined : this.ariaLabel(),\n 'aria-labelledby': labelledBy,\n 'aria-invalid': validation?.ariaInvalid() ?? undefined,\n 'aria-describedby': validation?.describedBy() ?? undefined,\n 'aria-required': validation?.ariaRequired() ?? undefined\n }\n if (editor) {\n this.label(editor, attributes)\n }\n })\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true\n this.editor()?.destroy()\n })\n }\n\n // Untracked, as forms write values from wherever the app sets them, e.g. an effect that mustn't come to depend\n // on the control.\n writeValue(value?: string | null) {\n untracked(() => {\n const markdown = value ?? ''\n this.value.set(markdown)\n const editor = this.editor()\n if (editor && editor.getMarkdown() !== markdown) {\n this.writing = true\n try {\n editor.setMarkdown(markdown, false, false)\n } finally {\n this.writing = false\n }\n }\n })\n }\n\n registerOnChange(fn: (value: string) => void) {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn\n }\n\n setDisabledState(disabled: boolean) {\n this.isDisabled.set(disabled)\n }\n\n /** Moves focus to the text. */\n focus() {\n this.editor()?.focus()\n }\n\n protected async create(setup: Setup) {\n const creating = ++this.creating\n const [{ Editor }, highlight] = await Promise.all([\n import('@liquid-js/underflow'),\n setup.highlighter ? import('@liquid-js/underflow/plugins/code-syntax-highlight') : undefined\n ])\n if (creating !== this.creating || this.destroyed) {\n return\n }\n const plugins: EditorPlugin[] = [...(setup.options.plugins ?? [])]\n if (highlight && setup.highlighter) {\n plugins.push([highlight.codeSyntaxHighlightPlugin, { highlighter: setup.highlighter }])\n }\n\n const previous = this.editor()\n previous?.destroy()\n Editor.setIcons(this.icons())\n const editor = new Editor({\n // The preview shows quotes, dashes and ellipses as nb-markdown-viewer does.\n smartPunctuation: true,\n ...setup.options,\n plugins,\n el: this.container().nativeElement,\n initialValue: this.value(),\n initialEditType: this.mode(),\n height: this.height(),\n minHeight: this.minHeight(),\n previewStyle: this.previewStyle(),\n placeholder: this.placeholder(),\n language: languageCode(Editor, setup.texts),\n autofocus: false,\n disabled: this.isDisabled(),\n readonly: this.readonly(),\n // Every button stays in the toolbar, where Tab reaches it, instead of a menu that opens on hover.\n toolbarStyle: 'wrap',\n toolbarItems: this.toolbar(setup),\n hideModeSwitch: setup.hideModeSwitch,\n autoDirection: setup.autoDirection\n })\n editor.on('change', () => this.changed(editor))\n editor.on('blur', () => this.onTouched())\n editor.on('changeMode', (mode: EditorType) => this.mode.set(mode))\n for (const type of ['markdown', 'wysiwyg'] as const) {\n editor.addCommand(type, FORMAT_COMMAND, () => {\n void this.format(editor)\n return true\n })\n }\n this.markSwitch()\n this.editor.set(editor)\n }\n\n /** The toolbar's groups, with the Format button for `format`. */\n protected toolbar(setup: Setup): NbMarkdownEditorToolbar {\n const button = {\n name: 'format',\n // UnderFlow's class for a toolbar button with an icon, which its own buttons have.\n className: 'nb-markdown-format uf-toolbar-icons',\n tooltip: setup.texts.format,\n icon: this.iconLibraries.getSvgIcon(FORMAT_ICON.icon, FORMAT_ICON.pack)?.icon.getContent(),\n command: FORMAT_COMMAND\n }\n return (setup.toolbarItems ?? TOOLBAR).map((group) => group.map((item) => (item === 'format' ? button : item)))\n }\n\n /** Formats the markdown, with Shift+Alt+F too, unless the user can't change it. */\n protected onKeydown(event: KeyboardEvent) {\n const editor = this.editor()\n if (event.code === 'KeyF' && event.shiftKey && event.altKey && !event.ctrlKey && !event.metaKey && editor) {\n // The key would type a character, e.g. Ï on a Mac.\n event.preventDefault()\n void this.format(editor)\n }\n }\n\n /**\n * Writes the markdown in one style, as an edit Undo takes back, keeping the cursor's line; the text stays if the\n * user changes it while the formatter loads.\n */\n protected async format(editor: Editor) {\n if (editor.isReadonly() || editor.isDisabled()) {\n return\n }\n const markdown = editor.getMarkdown()\n const formatted = await nbFormatMarkdown(markdown)\n if (formatted === markdown || editor !== this.editor() || editor.getMarkdown() !== markdown) {\n return\n }\n const line = editor.getCursorLine()\n editor.setMarkdown(formatted, false, false)\n editor.moveCursorTo(Math.min(line, formatted.split('\\n').length), true)\n }\n\n protected changed(editor: Editor) {\n const markdown = editor.getMarkdown()\n if (markdown === this.value()) {\n return\n }\n this.value.set(markdown)\n if (!this.writing) {\n this.onChange(markdown)\n }\n }\n\n /**\n * The editor's icons as the `essentials` pack has them, so an app that replaces one there replaces it here too; one\n * the pack doesn't have keeps UnderFlow's own.\n */\n protected icons(): Partial<Record<IconName, string>> {\n return Object.fromEntries(\n Object.entries(ICONS).map(([name, { icon, pack }]) => [\n name,\n this.iconLibraries.getSvgIcon(icon, pack)?.icon.getContent() || undefined\n ])\n )\n }\n\n /** Gives the scroll sync switch the checkmark of Lyra's toggle, which shows when it's on. */\n protected markSwitch() {\n const toggle = this.container().nativeElement.querySelector('.scroll-sync .switch')\n if (!toggle || toggle.querySelector('.nb-markdown-switch-checkmark')) {\n return\n }\n const checkmark = toggle.ownerDocument.createElement('span')\n checkmark.className = 'nb-markdown-switch-checkmark'\n checkmark.setAttribute('aria-hidden', 'true')\n checkmark.innerHTML =\n this.iconLibraries.getSvgIcon(SWITCH_CHECKMARK.icon, SWITCH_CHECKMARK.pack)?.icon.getContent() ?? ''\n toggle.append(checkmark)\n }\n\n /** Names the texts, the markdown and the WYSIWYG one, leaving out the attributes without a value. */\n protected label(editor: Editor, attributes: Record<string, string | undefined>) {\n const { mdEditor, wwEditor } = editor.getEditorElements()\n for (const text of [mdEditor, wwEditor].map((element) => element.querySelector('.ProseMirror'))) {\n for (const [name, value] of Object.entries(attributes)) {\n if (value) {\n text?.setAttribute(name, value)\n } else {\n text?.removeAttribute(name)\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;AASA,MAAa,oBAA6B;CACtC,QAAQ;CACR,eAAe;CACf,UAAU;CACV,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,UAAU;CACV,gBAAgB;CAChB,qBAAqB;CACrB,OAAO;AACV;AAGD,MAAM,QAAiC;CACnC,CAAC,UAAU,GAAG;CACd,CAAC,UAAU,IAAG;CACd,CAAC,MAAM,KAAK;CACZ,CAAC,MAAM,IAAI;CACX,CAAC,MAAM,KAAK;AACf;AAED,SAAS,MAAM,OAAa;CACxB,OAAO,MAAM,QAAQ,MAAM,CAAC,SAAS,iBAAiB,KAAK,QAAQ,SAAS,WAAW,GAAG,KAAK;AACnG;AAGA,MAAM,KAAK;AAGX,MAAM,yBAAS,IAAI,IAAI;CAAC;CAAQ;CAAc;AAAU,CAAC;AAGzD,SAAS,MAAM,MAAW;CACtB,IAAI,KAAK,SAAS,QACd,OAAO,CAAC,IAAI;CAEhB,MAAM,QAAQ,KAAK,MAAM,QAAO,CAAE,CAAC,MAAM,IAAI;CAC7C,IAAI,CAAC,GAAG,KAAK,MAAM,MAAM,SAAS,EAAE,CAAC,KAAI,CAAE,GACvC,OAAO,CAAC,IAAI;CAEhB,MAAM,OAAO,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,IAAI;CACzC,OAAO,CAAC,GAAI,KAAK,KAAI,IAAK,CAAC;EAAE,GAAG;EAAM,OAAO;CAAI,CAAE,IAAI,CAAA,GAAK,EAAE,MAAM,gBAAe,CAAE;AACzF;AAMA,SAAS,UAAU,MAAW;CAC1B,IAAI,KAAK,SAAS,QACd,KAAK,QAAQ,MAAM,KAAK,KAAK;CAEjC,K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,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAW,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"liquid-js-lyr-extras-markdown-editor.mjs","names":[],"sources":["../../../packages/extras/markdown-editor/src/format-style.ts","../../../packages/extras/markdown-editor/src/format.ts","../../../packages/extras/markdown-editor/src/texts.ts","../../../packages/extras/markdown-editor/src/markdown-editor.component.ts"],"sourcesContent":["// The formatter's style and plugin, which `scripts/remark-config.ts` uses too, for `yarn format:md` and VS Code's\n// remark extension: this module only has type imports, so Node runs it as it is.\nimport type { Nodes, Root } from 'mdast'\nimport type { Options } from 'remark-stringify'\n\n/**\n * How formatted markdown is written: `-` bullets, `1.` numbers, `_emphasis_`, `**strong**`, fenced code with\n * backticks, `#` headings, `---` rules, and tables with their columns lined up.\n */\nexport const NB_MARKDOWN_STYLE: Options = {\n bullet: '-',\n bulletOrdered: '.',\n emphasis: '_',\n strong: '*',\n fence: '`',\n fences: true,\n rule: '-',\n setext: false,\n closeAtx: false,\n listItemIndent: 'one',\n incrementListMarker: true,\n quote: '\"'\n}\n\n/** Typographic characters and the plain ones they're written as: the renderer decides how to show them. */\nconst PLAIN: Array<[RegExp, string]> = [\n [/[‘’′]/g, \"'\"],\n [/[“”″]/g, '\"'],\n [/—/g, '---'],\n [/–/g, '--'],\n [/…/g, '...']\n]\n\nfunction plain(value: string): string {\n return PLAIN.reduce((text, [pattern, replacement]) => text.replace(pattern, replacement), value)\n}\n\n/** A rule written as HTML, `<hr>`, on a line of its own; the formatter writes it as markdown's. */\nconst HR = /^<hr\\s*\\/?>$/i\n\n/** The nodes whose children are blocks, where an `<hr>` is a rule rather than a tag in the text. */\nconst BLOCKS = new Set(['root', 'blockquote', 'listItem'])\n\n/** An HTML block as markdown's rule where it is, or ends with, an `<hr>`: e.g. one right after a `</div>`. */\nfunction rules(node: Nodes): Nodes[] {\n if (node.type !== 'html') {\n return [node]\n }\n const lines = node.value.trimEnd().split('\\n')\n if (!HR.test(lines[lines.length - 1].trim())) {\n return [node]\n }\n const html = lines.slice(0, -1).join('\\n')\n return [...(html.trim() ? [{ ...node, value: html }] : []), { type: 'thematicBreak' }]\n}\n\n/**\n * Writes prose in plain characters, text and the titles and alt text of links and images, and rules as markdown's;\n * code and other HTML stay.\n */\nfunction normalise(node: Nodes): void {\n if (node.type === 'text') {\n node.value = plain(node.value)\n }\n if ((node.type === 'link' || node.type === 'image' || node.type === 'definition') && node.title) {\n node.title = plain(node.title)\n }\n if ((node.type === 'image' || node.type === 'imageReference') && node.alt) {\n node.alt = plain(node.alt)\n }\n if ('children' in node) {\n node.children.forEach(normalise)\n if (BLOCKS.has(node.type)) {\n node.children = node.children.flatMap(rules) as typeof node.children\n }\n }\n}\n\n/**\n * A remark plugin that writes prose in plain characters and rules written as `<hr>` as markdown's, as the formatter\n * does.\n */\nexport function nbRemarkNormalise() {\n return (tree: Root) => normalise(tree)\n}\n","import { NB_MARKDOWN_STYLE, nbRemarkNormalise } from './format-style'\n\n/**\n * Formats markdown, CommonMark with GitHub's extensions, in one style, as `nb-markdown-editor`'s Format button does:\n * the same document, written the same way wherever it came from. Prose is written in plain characters, quotes,\n * dashes and ellipses as `'`, `\"`, `--`, `---` and `...`, leaving how they look to the renderer, and a rule written\n * as `<hr>` as `---`. Code stays as it is, and so does front matter, YAML between `---` lines or TOML between `+++`\n * lines. It loads `remark`, `remark-gfm` and `remark-frontmatter` when first called.\n *\n * ```ts\n * import { nbFormatMarkdown } from '@liquid-js/lyr-extras/markdown-editor';\n *\n * const formatted = await nbFormatMarkdown('* one\\n* two\\n\\n__it’s bold__');\n * // \"- one\\n- two\\n\\n**it's bold**\\n\"\n * ```\n */\nexport async function nbFormatMarkdown(markdown: string): Promise<string> {\n const [{ remark }, { default: remarkGfm }, { default: remarkFrontmatter }] = await Promise.all([\n import('remark'),\n import('remark-gfm'),\n import('remark-frontmatter')\n ])\n const file = await remark()\n .use(remarkFrontmatter, ['yaml', 'toml'])\n .use(remarkGfm)\n .use(nbRemarkNormalise)\n .data('settings', NB_MARKDOWN_STYLE)\n .process(markdown)\n return String(file)\n}\n","import { injectNbTexts, NbLocalize } from '@liquid-js/lyr-core'\n\n/** @internal */\ndeclare const $localize: NbLocalize\n\n/**\n * The texts of the markdown editor's toolbar, tabs and popups. `provideNbTexts({ markdownEditor: { ... } })` changes\n * them, and they're translated with Angular's i18n, as `$localize` messages with ids like\n * `@@nb.markdownEditor.bold`.\n */\nexport interface NbMarkdownEditorTexts {\n /** The markdown mode's tab. */\n markdown: string\n /** The WYSIWYG mode's tab. */\n wysiwyg: string\n /** The tab with the markdown, when the preview is a tab. */\n write: string\n preview: string\n /** The toolbar button that opens the headings. */\n headings: string\n /** A level in the list of headings, given the level, e.g. \"Heading 2\". */\n headingLevel: (level: string) => string\n paragraph: string\n bold: string\n italic: string\n strike: string\n code: string\n line: string\n blockquote: string\n unorderedList: string\n orderedList: string\n task: string\n indent: string\n outdent: string\n insertLink: string\n insertCodeBlock: string\n insertTable: string\n insertImage: string\n /** The toolbar button that writes the markdown in one style, with its shortcut. */\n format: string\n /** The toolbar button that shows the items that don't fit. */\n more: string\n /** Names the toolbar. */\n textFormatting: string\n /** Describes the toolbar button whose format the text at the cursor has. */\n activeButton: string\n autoScrollEnabled: string\n autoScrollDisabled: string\n\n imageUrl: string\n selectImageFile: string\n chooseFile: string\n noFile: string\n description: string\n file: string\n url: string\n linkText: string\n linkTextRequired: string\n urlRequired: string\n ok: string\n cancel: string\n edit: string\n editLink: string\n removeLink: string\n editImage: string\n removeImage: string\n /** Asked when tabular text is pasted. */\n pasteAsTable: string\n textColor: string\n /** Edits the language of a code block. */\n chooseLanguage: string\n\n addRowAbove: string\n addRowBelow: string\n addColumnLeft: string\n addColumnRight: string\n removeRow: string\n removeColumn: string\n alignColumnLeft: string\n alignColumnCenter: string\n alignColumnRight: string\n removeTable: string\n}\n\ndeclare module '@liquid-js/lyr-core' {\n interface NbTexts {\n markdownEditor: NbMarkdownEditorTexts\n }\n}\n\n/** The editor's names of its texts; the Format button is the component's. */\nconst keys: Record<Exclude<keyof NbMarkdownEditorTexts, 'format'>, string> = {\n markdown: 'Markdown',\n wysiwyg: 'WYSIWYG',\n write: 'Write',\n preview: 'Preview',\n headings: 'Headings',\n headingLevel: 'Heading {level}',\n paragraph: 'Paragraph',\n bold: 'Bold',\n italic: 'Italic',\n strike: 'Strike',\n code: 'Code',\n line: 'Line',\n blockquote: 'Blockquote',\n unorderedList: 'Unordered list',\n orderedList: 'Ordered list',\n task: 'Task',\n indent: 'Indent',\n outdent: 'Outdent',\n insertLink: 'Insert link',\n insertCodeBlock: 'Insert CodeBlock',\n insertTable: 'Insert table',\n insertImage: 'Insert image',\n more: 'More',\n textFormatting: 'Text Formatting',\n activeButton: 'Active Button',\n autoScrollEnabled: 'Auto scroll enabled',\n autoScrollDisabled: 'Auto scroll disabled',\n imageUrl: 'Image URL',\n selectImageFile: 'Select image file',\n chooseFile: 'Choose a file',\n noFile: 'No file',\n description: 'Description',\n file: 'File',\n url: 'URL',\n linkText: 'Link text',\n linkTextRequired: 'Link text required',\n urlRequired: 'URL required',\n ok: 'OK',\n cancel: 'Cancel',\n edit: 'Edit',\n editLink: 'Edit link',\n removeLink: 'Remove link',\n editImage: 'Edit image',\n removeImage: 'Remove image',\n pasteAsTable: 'Would you like to paste as table?',\n textColor: 'Text color',\n chooseLanguage: 'Choose language',\n addRowAbove: 'Add row to up',\n addRowBelow: 'Add row to down',\n addColumnLeft: 'Add column to left',\n addColumnRight: 'Add column to right',\n removeRow: 'Remove row',\n removeColumn: 'Remove column',\n alignColumnLeft: 'Align column to left',\n alignColumnCenter: 'Align column to center',\n alignColumnRight: 'Align column to right',\n removeTable: 'Remove table'\n}\n\n/** The texts under the editor's names, to register as its language. @internal */\nexport function nbMarkdownEditorLanguage(texts: NbMarkdownEditorTexts): Record<string, string> {\n return Object.fromEntries(\n Object.entries(keys).map(([key, name]) => {\n const text = texts[key as keyof typeof keys]\n // The editor puts the level where `{level}` is.\n return [name, typeof text === 'function' ? text('{level}') : text]\n })\n )\n}\n\n/** @internal */\nexport function injectNbMarkdownEditorTexts() {\n return injectNbTexts('markdownEditor', () => ({\n markdown: $localize`:@@nb.markdownEditor.markdown:Markdown`,\n wysiwyg: $localize`:@@nb.markdownEditor.wysiwyg:WYSIWYG`,\n write: $localize`:@@nb.markdownEditor.write:Write`,\n preview: $localize`:@@nb.markdownEditor.preview:Preview`,\n headings: $localize`:@@nb.markdownEditor.headings:Headings`,\n headingLevel: (level: string) => $localize`:@@nb.markdownEditor.headingLevel:Heading ${level}:level:`,\n paragraph: $localize`:@@nb.markdownEditor.paragraph:Paragraph`,\n bold: $localize`:@@nb.markdownEditor.bold:Bold`,\n italic: $localize`:@@nb.markdownEditor.italic:Italic`,\n strike: $localize`:@@nb.markdownEditor.strike:Strikethrough`,\n code: $localize`:@@nb.markdownEditor.code:Inline code`,\n line: $localize`:@@nb.markdownEditor.line:Horizontal line`,\n blockquote: $localize`:@@nb.markdownEditor.blockquote:Blockquote`,\n unorderedList: $localize`:@@nb.markdownEditor.unorderedList:Unordered list`,\n orderedList: $localize`:@@nb.markdownEditor.orderedList:Ordered list`,\n task: $localize`:@@nb.markdownEditor.task:Task list`,\n indent: $localize`:@@nb.markdownEditor.indent:Indent`,\n outdent: $localize`:@@nb.markdownEditor.outdent:Outdent`,\n insertLink: $localize`:@@nb.markdownEditor.insertLink:Insert link`,\n insertCodeBlock: $localize`:@@nb.markdownEditor.insertCodeBlock:Insert code block`,\n insertTable: $localize`:@@nb.markdownEditor.insertTable:Insert table`,\n insertImage: $localize`:@@nb.markdownEditor.insertImage:Insert image`,\n format: $localize`:@@nb.markdownEditor.format:Format (Shift+Alt+F)`,\n more: $localize`:@@nb.markdownEditor.more:More`,\n textFormatting: $localize`:@@nb.markdownEditor.textFormatting:Text formatting`,\n activeButton: $localize`:@@nb.markdownEditor.activeButton:Active`,\n autoScrollEnabled: $localize`:@@nb.markdownEditor.autoScrollEnabled:Auto scroll enabled`,\n autoScrollDisabled: $localize`:@@nb.markdownEditor.autoScrollDisabled:Auto scroll disabled`,\n\n imageUrl: $localize`:@@nb.markdownEditor.imageUrl:Image URL`,\n selectImageFile: $localize`:@@nb.markdownEditor.selectImageFile:Select image file`,\n chooseFile: $localize`:@@nb.markdownEditor.chooseFile:Choose a file`,\n noFile: $localize`:@@nb.markdownEditor.noFile:No file`,\n description: $localize`:@@nb.markdownEditor.description:Description`,\n file: $localize`:@@nb.markdownEditor.file:File`,\n url: $localize`:@@nb.markdownEditor.url:URL`,\n linkText: $localize`:@@nb.markdownEditor.linkText:Link text`,\n linkTextRequired: $localize`:@@nb.markdownEditor.linkTextRequired:The field \"Link text\" is required`,\n urlRequired: $localize`:@@nb.markdownEditor.urlRequired:The field \"URL\" is required`,\n ok: $localize`:@@nb.markdownEditor.ok:OK`,\n cancel: $localize`:@@nb.markdownEditor.cancel:Cancel`,\n edit: $localize`:@@nb.markdownEditor.edit:Edit`,\n editLink: $localize`:@@nb.markdownEditor.editLink:Edit link`,\n removeLink: $localize`:@@nb.markdownEditor.removeLink:Remove link`,\n editImage: $localize`:@@nb.markdownEditor.editImage:Edit image`,\n removeImage: $localize`:@@nb.markdownEditor.removeImage:Remove image`,\n pasteAsTable: $localize`:@@nb.markdownEditor.pasteAsTable:Paste as a table?`,\n textColor: $localize`:@@nb.markdownEditor.textColor:Text color`,\n chooseLanguage: $localize`:@@nb.markdownEditor.chooseLanguage:Choose language`,\n\n addRowAbove: $localize`:@@nb.markdownEditor.addRowAbove:Add row above`,\n addRowBelow: $localize`:@@nb.markdownEditor.addRowBelow:Add row below`,\n addColumnLeft: $localize`:@@nb.markdownEditor.addColumnLeft:Add column left`,\n addColumnRight: $localize`:@@nb.markdownEditor.addColumnRight:Add column right`,\n removeRow: $localize`:@@nb.markdownEditor.removeRow:Remove row`,\n removeColumn: $localize`:@@nb.markdownEditor.removeColumn:Remove column`,\n alignColumnLeft: $localize`:@@nb.markdownEditor.alignColumnLeft:Align column left`,\n alignColumnCenter: $localize`:@@nb.markdownEditor.alignColumnCenter:Align column center`,\n alignColumnRight: $localize`:@@nb.markdownEditor.alignColumnRight:Align column right`,\n removeTable: $localize`:@@nb.markdownEditor.removeTable:Remove table`\n }))\n}\n","import { isPlatformBrowser } from '@angular/common'\nimport {\n afterRenderEffect,\n booleanAttribute,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n forwardRef,\n inject,\n input,\n linkedSignal,\n model,\n PLATFORM_ID,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport {\n injectNbDefaults,\n NbComponentOrCustomStatus,\n NbComponentShape,\n NbIconConfig,\n NbIconLibraries,\n NbValidationDirective\n} from '@liquid-js/lyr-core'\nimport type {\n Editor,\n EditorOptions,\n EditorPlugin,\n EditorType,\n IconName,\n PreviewStyle,\n ToolbarItemOptions\n} from '@liquid-js/underflow'\nimport type { HLJSApi } from 'highlight.js'\nimport { HighlightLoader, NXT_HIGHLIGHT_OPTIONS } from 'nxt-highlightjs'\nimport { nbFormatMarkdown } from './format'\nimport { injectNbMarkdownEditorTexts, nbMarkdownEditorLanguage, NbMarkdownEditorTexts } from './texts'\n\n/** Options of `@liquid-js/underflow`'s editor that the component's inputs don't set. */\nexport type NbMarkdownEditorOptions = Omit<\n EditorOptions,\n | 'el'\n | 'initialValue'\n | 'initialEditType'\n | 'height'\n | 'minHeight'\n | 'previewStyle'\n | 'placeholder'\n | 'toolbarItems'\n | 'hideModeSwitch'\n | 'toolbarStyle'\n | 'language'\n | 'theme'\n | 'autofocus'\n | 'viewer'\n | 'readonly'\n | 'disabled'\n | 'autoDirection'\n>\n\n/** Groups of toolbar items: the names of the editor's items, e.g. `bold`, `format`, or items of your own. */\nexport type NbMarkdownEditorToolbar = Array<Array<string | ToolbarItemOptions>>\n\n/** What the editor is made with. */\ninterface Setup {\n texts: NbMarkdownEditorTexts\n toolbarItems?: NbMarkdownEditorToolbar\n hideModeSwitch: boolean\n autoDirection: boolean\n options: NbMarkdownEditorOptions\n /** Highlights code, once it's loaded. */\n highlighter?: HLJSApi\n}\n\n/**\n * The editor's icons, by UnderFlow's names: Lyra's, from the `essentials` pack, written out whole so the pack has them.\n * Every name is here, so a name UnderFlow adds doesn't compile until it has one of Lyra's.\n */\nconst ICONS: Record<IconName, NbIconConfig> = {\n 'heading': { icon: 'heading-outline', pack: 'essentials' },\n 'bold': { icon: 'bold-outline', pack: 'essentials' },\n 'italic': { icon: 'italic-outline', pack: 'essentials' },\n 'strike': { icon: 'strikethrough-outline', pack: 'essentials' },\n 'hrline': { icon: 'minus-outline', pack: 'essentials' },\n 'quote': { icon: 'quote-outline', pack: 'essentials' },\n 'bullet-list': { icon: 'list-outline', pack: 'essentials' },\n 'ordered-list': { icon: 'list-numbered-outline', pack: 'essentials' },\n 'task-list': { icon: 'list-checked-outline', pack: 'essentials' },\n 'indent': { icon: 'indent-outline', pack: 'essentials' },\n 'outdent': { icon: 'outdent-outline', pack: 'essentials' },\n 'table': { icon: 'table-outline', pack: 'essentials' },\n 'image': { icon: 'image-outline', pack: 'essentials' },\n 'link': { icon: 'link-outline', pack: 'essentials' },\n 'code': { icon: 'code-outline', pack: 'essentials' },\n 'codeblock': { icon: 'code-block-outline', pack: 'essentials' },\n 'more': { icon: 'more-horizontal-outline', pack: 'essentials' },\n 'add-row-up': { icon: 'table-row-add-above-outline', pack: 'essentials' },\n 'add-row-down': { icon: 'table-row-add-below-outline', pack: 'essentials' },\n 'add-column-left': { icon: 'table-column-add-left-outline', pack: 'essentials' },\n 'add-column-right': { icon: 'table-column-add-right-outline', pack: 'essentials' },\n 'remove-row': { icon: 'table-row-remove-outline', pack: 'essentials' },\n 'remove-column': { icon: 'table-column-remove-outline', pack: 'essentials' },\n 'align-column-left': { icon: 'align-left-outline', pack: 'essentials' },\n 'align-column-center': { icon: 'align-center-outline', pack: 'essentials' },\n 'align-column-right': { icon: 'align-right-outline', pack: 'essentials' },\n 'remove-table': { icon: 'table-remove-outline', pack: 'essentials' },\n 'chevron-down': { icon: 'chevron-down-outline', pack: 'essentials' },\n 'pencil': { icon: 'edit-outline', pack: 'essentials' }\n}\n\n/** The Format button's icon. */\nconst FORMAT_ICON: NbIconConfig = { icon: 'brush-outline', pack: 'essentials' }\n\n/** The command the Format button runs, in either mode. */\nconst FORMAT_COMMAND = 'nbFormat'\n\n/** UnderFlow's toolbar, with the Format button before the scroll sync switch. */\nconst TOOLBAR: NbMarkdownEditorToolbar = [\n ['heading', 'bold', 'italic', 'strike'],\n ['hr', 'quote'],\n ['ul', 'ol', 'task', 'indent', 'outdent'],\n ['table', 'image', 'link'],\n ['code', 'codeblock'],\n ['format'],\n ['scrollSync']\n]\n\n/** The checkmark of the scroll sync switch, which looks like Lyra's toggle. */\nconst SWITCH_CHECKMARK: NbIconConfig = { icon: 'checkmark-bold-outline', pack: 'essentials' }\n\n// The editor's texts are registered by language code for all editors, so editors with the same texts share a code.\nconst languages = new Map<string, string>()\n\nfunction languageCode(library: typeof Editor, texts: NbMarkdownEditorTexts) {\n const language = nbMarkdownEditorLanguage(texts)\n const key = JSON.stringify(language)\n let code = languages.get(key)\n if (!code) {\n code = `x-nb-markdown-${languages.size}`\n languages.set(key, code)\n library.setLanguage(code, language)\n }\n return code\n}\n\n/**\n * A markdown editor, with a toolbar, a preview and a WYSIWYG mode:\n *\n * ```html\n * <nb-markdown-editor [formControl]=\"text\" aria-label=\"Description\" />\n * ```\n *\n * @stacked-example(Showcase, markdown/markdown-editor-showcase.component)\n *\n * ### Installation\n *\n * Install [`@liquid-js/underflow`](https://www.npmjs.com/package/@liquid-js/underflow), which is the editor, with the\n * ProseMirror and DOMPurify packages it uses, and import `NbMarkdownEditorComponent` from\n * `@liquid-js/lyr-extras/markdown-editor`:\n *\n * ```bash\n * npm install @liquid-js/underflow prosemirror-commands prosemirror-history prosemirror-inputrules \\\n * prosemirror-keymap prosemirror-model prosemirror-state prosemirror-transform prosemirror-view dompurify\n * ```\n *\n * The Format button formats with [`remark`](https://remark.js.org), which it loads when it's first used, with\n * `remark-gfm` and `remark-frontmatter`:\n *\n * ```bash\n * npm install remark remark-gfm remark-frontmatter\n * ```\n *\n * The editor loads when the first one shows; its styles come with the component. It highlights code with the\n * highlight.js that [`nxt-highlightjs`](https://www.npmjs.com/package/nxt-highlightjs) loads, when the app sets it up\n * as in `nb-markdown-viewer`, so install them too:\n *\n * ```bash\n * npm install nxt-highlightjs highlight.js\n * ```\n *\n * ### Usage\n *\n * It's a form control whose value is the markdown, CommonMark with GitHub's extensions, e.g. tables and task lists.\n * Its frame has the colours of a field and its `status`, and the text the theme's styles:\n * @stacked-example(States, markdown/markdown-editor-status.component)\n *\n * The preview shows the text's straight quotes, `--`, `---` and `...` as typographic quotes, en and em dashes and\n * ellipses, as `nb-markdown-viewer` does, while the markdown and the WYSIWYG mode keep them as written.\n *\n * In the markdown mode the preview is a tab, or next to the markdown with `previewStyle=\"vertical\"`; the WYSIWYG mode\n * edits the formatted text, and `mode` is the one that shows. The toolbar wraps onto more lines when it doesn't fit,\n * so all of its buttons can be reached with Tab; `toolbarItems` picks them.\n *\n * The Format button, and Shift+Alt+F in the text, writes the markdown in one style with `nbFormatMarkdown`, which\n * also writes typographic quotes, dashes and ellipses as plain characters; Undo brings the text back. It's `format` in\n * `toolbarItems`.\n *\n * In the text, Tab indents list items and moves between table cells, so Escape and then Tab or Shift+Tab moves focus\n * out of it, as in code editors. Name the text with `aria-label`, `aria-labelledby` for a `label`, or an `nbLabel` with\n * `nbValidation`, which also gives it the field's status and errors, as it does an input.\n *\n * With `readonly` the text can be read, selected and copied, but not changed, as in a read-only field: the toolbar\n * and the mode switch are disabled, while the Write and Preview tabs still switch. Disabled, the editor is read-only\n * too, in the colours of a disabled field, and Tab skips it.\n *\n * Text that mixes right-to-left and left-to-right languages, e.g. Arabic or Hebrew quoted in English, reads right\n * with `autoDirection`: each paragraph, heading, list, quote and table takes the direction of its own text, as\n * `dir=\"auto\"` does, in the preview and the WYSIWYG mode, and so does each line of the markdown. Code blocks read left\n * to right. The markdown itself doesn't change.\n *\n * `options` takes the [editor's other options](https://liquid-js.github.io/underflow/docs/), e.g. plugins, widgets\n * or `hooks.addImageBlobHook` to upload pasted images, and `editor()` is the editor, for its methods. It's made again\n * when the options, the toolbar, the texts or `autoDirection` change, keeping the markdown.\n */\n@Component({\n selector: 'nb-markdown-editor',\n template: '<div #container></div>',\n styleUrl: './markdown-editor.component.scss',\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NbMarkdownEditorComponent), multi: true }],\n host: {\n 'class': 'nb-markdown',\n '(keydown)': 'onKeydown($event)',\n '[attr.aria-disabled]': 'isDisabled() || null',\n '[style]': 'statusStyles()',\n // Keeps the editor's place until it loads.\n '[style.min-height]': \"editor() ? null : height() === 'auto' ? minHeight() : height()\"\n }\n})\nexport class NbMarkdownEditorComponent implements ControlValueAccessor {\n protected readonly texts = injectNbMarkdownEditorTexts()\n protected readonly iconLibraries = inject(NbIconLibraries)\n\n /** The editor's height with the toolbar, e.g. `300px` (default) or `auto`, which grows with the text. */\n readonly height = input('300px')\n /** `200px` by default. */\n readonly minHeight = input('200px')\n /** The preview in a `tab` (default), or `vertical`, next to the markdown. */\n readonly previewStyle = input<PreviewStyle>('tab')\n /** `markdown` (default) or `wysiwyg`, and the mode the user picks. */\n readonly mode = model<EditorType>('markdown')\n readonly placeholder = input('')\n /** Field status: `basic` (default), `primary`, `info`, `success`, `warning`, `danger` or `control`. */\n readonly status = input<NbComponentOrCustomStatus>('basic')\n\n // The app's defaults for fields, which the shape starts from, as a textarea's does.\n protected readonly nbDefaults = injectNbDefaults('input')\n /** Field shape: `rectangle` (default), `semi-round` or `round`, only as round as a textarea gets. */\n readonly shapeInput = input<NbComponentShape | undefined>(undefined, { alias: 'shape' })\n /** The shape in use: the input's, the app's default, or 'rectangle'. */\n readonly shape = linkedSignal<NbComponentShape>(() => this.shapeInput() ?? this.nbDefaults().shape ?? 'rectangle')\n /** Groups of toolbar items, e.g. `[['heading', 'bold', 'italic'], ['link']]`. */\n readonly toolbarItems = input<NbMarkdownEditorToolbar>()\n /** Hides the Markdown and WYSIWYG tabs. */\n readonly hideModeSwitch = input(false, { transform: booleanAttribute })\n /**\n * Gives each paragraph, heading, list, quote and table the direction of its own text (`dir=\"auto\"`), for text in\n * more than one direction; `false` by default.\n */\n readonly autoDirection = input(false, { transform: booleanAttribute })\n /** Options of `@liquid-js/underflow`'s editor, e.g. plugins. */\n readonly options = input<NbMarkdownEditorOptions>({})\n /** Names the text area when there's no `aria-labelledby`. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' })\n /** The id of the element that names the text area, e.g. a `label`. */\n readonly ariaLabelledBy = input<string | undefined>(undefined, { alias: 'aria-labelledby' })\n readonly disabled = input(false, { transform: booleanAttribute })\n /** Lets the user read the text, but not change it. */\n readonly readonly = input(false, { transform: booleanAttribute })\n\n /** The editor, once it's loaded. */\n readonly editor = signal<Editor | undefined>(undefined)\n\n protected readonly validation = inject(NbValidationDirective, { self: true, optional: true })\n // With `nbValidation`, the status it gives while the control shows errors or success.\n protected readonly resolvedStatus = computed(() => this.validation?.status() ?? this.status())\n\n protected readonly value = signal('')\n protected readonly isDisabled = linkedSignal(() => this.disabled())\n protected readonly container = viewChild.required<ElementRef<HTMLElement>>('container')\n /** Loads highlight.js, when the app highlights code. */\n protected readonly highlightLoader = inject(NXT_HIGHLIGHT_OPTIONS, { optional: true })\n ? inject(HighlightLoader)\n : undefined\n\n protected readonly statusStyles = computed(() => {\n const status = this.resolvedStatus()\n const shape = this.shape()\n return {\n '--nb-markdown-border-radius': `min(var(--input-${shape}-border-radius), var(--input-textarea-max-border-radius))`,\n '--nb-markdown-field-border-radius': `var(--input-${shape}-border-radius)`,\n // At rest; the styles pick the background by state, which an inline value would override.\n '--nb-markdown-rest-background': `var(--input-${status}-background-color)`,\n '--nb-markdown-border-color': `var(--input-${status}-border-color)`,\n '--nb-markdown-hover-background': `var(--input-${status}-hover-background-color)`,\n '--nb-markdown-hover-border-color': `var(--input-${status}-hover-border-color)`,\n '--nb-markdown-focus-background': `var(--input-${status}-focus-background-color)`,\n '--nb-markdown-focus-border-color': `var(--input-${status}-focus-border-color)`,\n '--nb-markdown-focus-and-hover-background': `var(--input-${status}-focus-and-hover-background-color)`,\n '--nb-markdown-focus-and-hover-border-color': `var(--input-${status}-focus-and-hover-border-color)`,\n '--nb-markdown-disabled-background': `var(--input-${status}-disabled-background-color)`,\n '--nb-markdown-disabled-border-color': `var(--input-${status}-disabled-border-color)`\n }\n })\n\n /** What the editor is made with; it's made again when this changes. */\n protected readonly setup = computed<Setup | undefined>(() => {\n const highlight = this.highlightLoader?.hljs\n // The editor waits for highlight.js rather than being made again when it loads.\n if (highlight?.isLoading()) {\n return undefined\n }\n return {\n texts: this.texts(),\n toolbarItems: this.toolbarItems(),\n hideModeSwitch: this.hideModeSwitch(),\n autoDirection: this.autoDirection(),\n options: this.options(),\n highlighter: highlight?.hasValue() ? highlight.value() : undefined\n }\n })\n\n protected creating = 0\n protected destroyed = false\n /** Set while the form's value is written, which isn't a change to report. */\n protected writing = false\n\n protected onChange: (value: string) => void = () => {}\n /** @internal */\n onTouched: () => void = () => {}\n\n constructor() {\n // The text is the control: it gets the validation's ARIA, and the focus from an `nbLabel`, not the host.\n this.validation?.delegateAria(() => this.editor()?.focus())\n if (!isPlatformBrowser(inject(PLATFORM_ID))) {\n return\n }\n afterRenderEffect(() => {\n const setup = this.setup()\n if (setup) {\n untracked(() => void this.create(setup))\n }\n })\n afterRenderEffect(() => {\n const editor = this.editor()\n const [height, minHeight, previewStyle, placeholder, mode] = [\n this.height(),\n this.minHeight(),\n this.previewStyle(),\n this.placeholder(),\n this.mode()\n ]\n if (!editor) {\n return\n }\n if (editor.getHeight() !== height) {\n editor.setHeight(height)\n }\n if (editor.getMinHeight() !== minHeight) {\n editor.setMinHeight(minHeight)\n }\n if (editor.getCurrentPreviewStyle() !== previewStyle) {\n editor.changePreviewStyle(previewStyle)\n // The vertical preview brings the scroll sync switch.\n this.markSwitch()\n }\n editor.setPlaceholder(placeholder)\n if (editor.isWysiwygMode() !== (mode === 'wysiwyg')) {\n editor.changeMode(mode, true)\n }\n })\n afterRenderEffect(() => {\n const editor = this.editor()\n const [disabled, readonly] = [this.isDisabled(), this.readonly()]\n if (editor) {\n editor.setDisabled(disabled)\n editor.setReadonly(readonly)\n }\n })\n afterRenderEffect(() => {\n const editor = this.editor()\n const validation = this.validation\n const labelledBy = [this.ariaLabelledBy(), validation?.labelledBy()].filter(Boolean).join(' ') || undefined\n const attributes = {\n 'aria-label': labelledBy ? undefined : this.ariaLabel(),\n 'aria-labelledby': labelledBy,\n 'aria-invalid': validation?.ariaInvalid() ?? undefined,\n 'aria-describedby': validation?.describedBy() ?? undefined,\n 'aria-required': validation?.ariaRequired() ?? undefined\n }\n if (editor) {\n this.label(editor, attributes)\n }\n })\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true\n this.editor()?.destroy()\n })\n }\n\n // Untracked, as forms write values from wherever the app sets them, e.g. an effect that mustn't come to depend\n // on the control.\n writeValue(value?: string | null) {\n untracked(() => {\n const markdown = value ?? ''\n this.value.set(markdown)\n const editor = this.editor()\n if (editor && editor.getMarkdown() !== markdown) {\n this.writing = true\n try {\n editor.setMarkdown(markdown, false, false)\n } finally {\n this.writing = false\n }\n }\n })\n }\n\n registerOnChange(fn: (value: string) => void) {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void) {\n this.onTouched = fn\n }\n\n setDisabledState(disabled: boolean) {\n this.isDisabled.set(disabled)\n }\n\n /** Moves focus to the text. */\n focus() {\n this.editor()?.focus()\n }\n\n protected async create(setup: Setup) {\n const creating = ++this.creating\n const [{ Editor }, highlight] = await Promise.all([\n import('@liquid-js/underflow'),\n setup.highlighter ? import('@liquid-js/underflow/plugins/code-syntax-highlight') : undefined\n ])\n if (creating !== this.creating || this.destroyed) {\n return\n }\n const plugins: EditorPlugin[] = [...(setup.options.plugins ?? [])]\n if (highlight && setup.highlighter) {\n plugins.push([highlight.codeSyntaxHighlightPlugin, { highlighter: setup.highlighter }])\n }\n\n const previous = this.editor()\n previous?.destroy()\n Editor.setIcons(this.icons())\n const editor = new Editor({\n // The preview shows quotes, dashes and ellipses as nb-markdown-viewer does.\n smartPunctuation: true,\n ...setup.options,\n plugins,\n el: this.container().nativeElement,\n initialValue: this.value(),\n initialEditType: this.mode(),\n height: this.height(),\n minHeight: this.minHeight(),\n previewStyle: this.previewStyle(),\n placeholder: this.placeholder(),\n language: languageCode(Editor, setup.texts),\n autofocus: false,\n disabled: this.isDisabled(),\n readonly: this.readonly(),\n // Every button stays in the toolbar, where Tab reaches it, instead of a menu that opens on hover.\n toolbarStyle: 'wrap',\n toolbarItems: this.toolbar(setup),\n hideModeSwitch: setup.hideModeSwitch,\n autoDirection: setup.autoDirection\n })\n editor.on('change', () => this.changed(editor))\n editor.on('blur', () => this.onTouched())\n editor.on('changeMode', (mode: EditorType) => this.mode.set(mode))\n for (const type of ['markdown', 'wysiwyg'] as const) {\n editor.addCommand(type, FORMAT_COMMAND, () => {\n void this.format(editor)\n return true\n })\n }\n this.markSwitch()\n this.editor.set(editor)\n }\n\n /** The toolbar's groups, with the Format button for `format`. */\n protected toolbar(setup: Setup): NbMarkdownEditorToolbar {\n const button = {\n name: 'format',\n // UnderFlow's class for a toolbar button with an icon, which its own buttons have.\n className: 'nb-markdown-format uf-toolbar-icons',\n tooltip: setup.texts.format,\n icon: this.iconLibraries.getSvgIcon(FORMAT_ICON.icon, FORMAT_ICON.pack)?.icon.getContent(),\n command: FORMAT_COMMAND\n }\n return (setup.toolbarItems ?? TOOLBAR).map((group) => group.map((item) => (item === 'format' ? button : item)))\n }\n\n /** Formats the markdown, with Shift+Alt+F too, unless the user can't change it. */\n protected onKeydown(event: KeyboardEvent) {\n const editor = this.editor()\n if (event.code === 'KeyF' && event.shiftKey && event.altKey && !event.ctrlKey && !event.metaKey && editor) {\n // The key would type a character, e.g. Ï on a Mac.\n event.preventDefault()\n void this.format(editor)\n }\n }\n\n /**\n * Writes the markdown in one style, as an edit Undo takes back, keeping the cursor's line; the text stays if the\n * user changes it while the formatter loads.\n */\n protected async format(editor: Editor) {\n if (editor.isReadonly() || editor.isDisabled()) {\n return\n }\n const markdown = editor.getMarkdown()\n const formatted = await nbFormatMarkdown(markdown)\n if (formatted === markdown || editor !== this.editor() || editor.getMarkdown() !== markdown) {\n return\n }\n const line = editor.getCursorLine()\n editor.setMarkdown(formatted, false, false)\n editor.moveCursorTo(Math.min(line, formatted.split('\\n').length), true)\n }\n\n protected changed(editor: Editor) {\n const markdown = editor.getMarkdown()\n if (markdown === this.value()) {\n return\n }\n this.value.set(markdown)\n if (!this.writing) {\n this.onChange(markdown)\n }\n }\n\n /**\n * The editor's icons as the `essentials` pack has them, so an app that replaces one there replaces it here too; one\n * the pack doesn't have keeps UnderFlow's own.\n */\n protected icons(): Partial<Record<IconName, string>> {\n return Object.fromEntries(\n Object.entries(ICONS).map(([name, { icon, pack }]) => [\n name,\n this.iconLibraries.getSvgIcon(icon, pack)?.icon.getContent() || undefined\n ])\n )\n }\n\n /** Gives the scroll sync switch the checkmark of Lyra's toggle, which shows when it's on. */\n protected markSwitch() {\n const toggle = this.container().nativeElement.querySelector('.scroll-sync .switch')\n if (!toggle || toggle.querySelector('.nb-markdown-switch-checkmark')) {\n return\n }\n const checkmark = toggle.ownerDocument.createElement('span')\n checkmark.className = 'nb-markdown-switch-checkmark'\n checkmark.setAttribute('aria-hidden', 'true')\n checkmark.innerHTML =\n this.iconLibraries.getSvgIcon(SWITCH_CHECKMARK.icon, SWITCH_CHECKMARK.pack)?.icon.getContent() ?? ''\n toggle.append(checkmark)\n }\n\n /** Names the texts, the markdown and the WYSIWYG one, leaving out the attributes without a value. */\n protected label(editor: Editor, attributes: Record<string, string | undefined>) {\n const { mdEditor, wwEditor } = editor.getEditorElements()\n for (const text of [mdEditor, wwEditor].map((element) => element.querySelector('.ProseMirror'))) {\n for (const [name, value] of Object.entries(attributes)) {\n if (value) {\n text?.setAttribute(name, value)\n } else {\n text?.removeAttribute(name)\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;AASA,MAAa,oBAA6B;CACtC,QAAQ;CACR,eAAe;CACf,UAAU;CACV,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,UAAU;CACV,gBAAgB;CAChB,qBAAqB;CACrB,OAAO;AACV;AAGD,MAAM,QAAiC;CACnC,CAAC,UAAU,GAAG;CACd,CAAC,UAAU,IAAG;CACd,CAAC,MAAM,KAAK;CACZ,CAAC,MAAM,IAAI;CACX,CAAC,MAAM,KAAK;AACf;AAED,SAAS,MAAM,OAAa;CACxB,OAAO,MAAM,QAAQ,MAAM,CAAC,SAAS,iBAAiB,KAAK,QAAQ,SAAS,WAAW,GAAG,KAAK;AACnG;AAGA,MAAM,KAAK;AAGX,MAAM,yBAAS,IAAI,IAAI;CAAC;CAAQ;CAAc;AAAU,CAAC;AAGzD,SAAS,MAAM,MAAW;CACtB,IAAI,KAAK,SAAS,QACd,OAAO,CAAC,IAAI;CAEhB,MAAM,QAAQ,KAAK,MAAM,QAAO,CAAE,CAAC,MAAM,IAAI;CAC7C,IAAI,CAAC,GAAG,KAAK,MAAM,MAAM,SAAS,EAAE,CAAC,KAAI,CAAE,GACvC,OAAO,CAAC,IAAI;CAEhB,MAAM,OAAO,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,IAAI;CACzC,OAAO,CAAC,GAAI,KAAK,K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