@liquid-js/lyr-extras 22.0.0-alpha.4 → 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,214 +1,19 @@
1
1
  import * as i0 from "@angular/core";
2
- import { ChangeDetectionStrategy, Component, ElementRef, ViewEncapsulation, booleanAttribute, computed, contentChildren, inject, input, viewChild, viewChildren } from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, ViewEncapsulation, input } from "@angular/core";
3
+ import { NbMarkdownRendering } from "@liquid-js/lyr-extras/markdown-renderer";
3
4
  import { RemarkNodeComponent, RemarkTemplateDirective, RemarkTemplatesService } from "ngx-remark";
4
- import { HighlightDirective, NXT_HIGHLIGHT_OPTIONS } from "nxt-highlightjs";
5
+ import { HighlightDirective } from "nxt-highlightjs";
5
6
  import { remark } from "remark";
6
7
  import remarkGfm from "remark-gfm";
7
8
  import remarkSmartypants from "remark-smartypants";
8
- import { injectNbTexts } from "@liquid-js/lyr-core";
9
- const voidElements = /* @__PURE__ */ new Set([
10
- "br",
11
- "wbr",
12
- "img",
13
- "hr"
14
- ]);
15
- const openingTag = /^<([a-z][a-z0-9-]*)(?:\s[^>]*)?>$/i;
16
- const selfClosingTag = /^<([a-z][a-z0-9-]*)(?:\s[^>]*)?\/>$/i;
17
- const closingTag = /^<\/([a-z][a-z0-9-]*)\s*>$/i;
18
- const blockParents$1 = /* @__PURE__ */ new Set([
19
- "root",
20
- "blockquote",
21
- "listItem",
22
- "footnoteDefinition",
23
- "nbFootnotes"
24
- ]);
25
- function tagName(node, pattern) {
26
- return node.type === "html" ? pattern.exec(node.value)?.[1].toLowerCase() : void 0;
27
- }
28
- function pairTags(children) {
29
- const paired = new Array();
30
- for (let index = 0; index < children.length; index++) {
31
- const child = children[index];
32
- const name = tagName(child, openingTag);
33
- const selfClosing = tagName(child, selfClosingTag);
34
- if (selfClosing || name && voidElements.has(name)) {
35
- paired.push({
36
- type: "nbHtmlElement",
37
- tagName: selfClosing ?? name ?? "",
38
- children: []
39
- });
40
- continue;
41
- }
42
- if (!name) {
43
- paired.push(child);
44
- continue;
45
- }
46
- let depth = 0;
47
- let end = index + 1;
48
- for (; end < children.length; end++) if (tagName(children[end], openingTag) === name) depth++;
49
- else if (tagName(children[end], closingTag) === name && depth-- === 0) break;
50
- if (end === children.length) {
51
- paired.push(child);
52
- continue;
53
- }
54
- const content = pairTags(children.slice(index + 1, end));
55
- paired.push({
56
- type: "nbHtmlElement",
57
- tagName: name,
58
- children: content
59
- });
60
- index = end;
61
- }
62
- return paired;
63
- }
64
- function isTight(node) {
65
- if (node.type !== "list" || node.spread) return false;
66
- return node.children.every((item) => !(item.spread ?? item.children.length > 1));
67
- }
68
- function prepareTree(tree) {
69
- const definitions = /* @__PURE__ */ new Map();
70
- const footnotes = new Array();
71
- const collect = (node) => {
72
- if (node.type === "definition") definitions.set(node.identifier, node);
73
- if ("children" in node) node.children.forEach(collect);
74
- };
75
- collect(tree);
76
- const transform = (node) => {
77
- if (!("children" in node)) return;
78
- const children = new Array();
79
- for (const child of node.children) {
80
- if (child.type === "definition") continue;
81
- if (child.type === "footnoteDefinition") {
82
- footnotes.push(child);
83
- transform(child);
84
- continue;
85
- }
86
- if (child.type === "linkReference") {
87
- const { url = "", title } = definitions.get(child.identifier) ?? {};
88
- const link = {
89
- type: "link",
90
- url,
91
- title,
92
- children: child.children
93
- };
94
- transform(link);
95
- children.push(link);
96
- continue;
97
- }
98
- if (child.type === "imageReference") {
99
- const { url = "", title } = definitions.get(child.identifier) ?? {};
100
- children.push({
101
- type: "image",
102
- url,
103
- title,
104
- alt: child.alt
105
- });
106
- continue;
107
- }
108
- transform(child);
109
- if (child.type === "listItem" && isTight(node)) child.children = child.children.flatMap((content) => content.type === "paragraph" ? content.children : [content]);
110
- children.push(child);
111
- }
112
- node.children = children.some((child) => child.type === "html") && !blockParents$1.has(node.type) ? pairTags(children) : children;
113
- };
114
- transform(tree);
115
- if (footnotes.length) {
116
- for (const footnote of footnotes) {
117
- const back = {
118
- type: "nbFootnoteBack",
119
- identifier: footnote.identifier
120
- };
121
- const last = footnote.children.at(-1);
122
- if (last?.type === "paragraph") last.children.push(back);
123
- else footnote.children.push({
124
- type: "paragraph",
125
- children: [back]
126
- });
127
- }
128
- tree.children.push({
129
- type: "nbFootnotes",
130
- children: footnotes
131
- });
132
- }
133
- return tree;
134
- }
135
- function injectNbMarkdownViewerTexts() {
136
- return injectNbTexts("markdownViewer", () => ({
137
- footnotes: $localize`:@@nb.markdownViewer.footnotes:Footnotes`,
138
- backToText: $localize`:@@nb.markdownViewer.backToText:Back to the text`
139
- }));
140
- }
141
9
  const defaultProcessor = remark().use(remarkGfm).use(remarkSmartypants, { dashes: "oldschool" }).freeze();
142
- const htmlElements = /* @__PURE__ */ new Set([
143
- "abbr",
144
- "b",
145
- "br",
146
- "cite",
147
- "code",
148
- "del",
149
- "em",
150
- "i",
151
- "ins",
152
- "kbd",
153
- "mark",
154
- "s",
155
- "samp",
156
- "small",
157
- "span",
158
- "strong",
159
- "sub",
160
- "sup",
161
- "u",
162
- "var",
163
- "wbr"
164
- ]);
165
- const blockParents = /* @__PURE__ */ new Set([
166
- "root",
167
- "blockquote",
168
- "listItem",
169
- "footnoteDefinition"
170
- ]);
171
- let nextId = 0;
172
- var NbMarkdownViewerComponent = class NbMarkdownViewerComponent {
10
+ var NbMarkdownViewerComponent = class NbMarkdownViewerComponent extends NbMarkdownRendering {
173
11
  constructor() {
174
- this.markdown = input("", ...ngDevMode ? [{ debugName: "markdown" }] : /* istanbul ignore next */ []);
12
+ super(...arguments);
175
13
  this.processor = input(...ngDevMode ? [void 0, { debugName: "processor" }] : /* istanbul ignore next */ []);
176
- this.autoDirection = input(false, {
177
- ...ngDevMode ? { debugName: "autoDirection" } : /* istanbul ignore next */ {},
178
- transform: booleanAttribute
179
- });
180
- this.tree = computed(() => {
181
- const processor = this.processor() ?? defaultProcessor;
182
- return prepareTree(processor.runSync(processor.parse(this.markdown())));
183
- }, ...ngDevMode ? [{ debugName: "tree" }] : /* istanbul ignore next */ []);
184
- this.id = `nb-markdown-${nextId++}`;
185
- this.texts = injectNbMarkdownViewerTexts();
186
- this.htmlElements = htmlElements;
187
- this.blockParents = blockParents;
188
- this.element = inject(ElementRef);
189
- this.highlighting = !!inject(NXT_HIGHLIGHT_OPTIONS, { optional: true });
190
- this.defaultTemplates = viewChildren(RemarkTemplateDirective, ...ngDevMode ? [{ debugName: "defaultTemplates" }] : /* istanbul ignore next */ []);
191
- this.customTemplates = contentChildren(RemarkTemplateDirective, ...ngDevMode ? [{ debugName: "customTemplates" }] : /* istanbul ignore next */ []);
192
- this.fallback = viewChild.required("fallback", ...ngDevMode ? [{ debugName: "fallback" }] : /* istanbul ignore next */ []);
193
- inject(RemarkTemplatesService).templates = computed(() => {
194
- const templates = {};
195
- for (const template of [...this.defaultTemplates(), ...this.customTemplates()]) templates[template.nodeType()] = template.template;
196
- const fallback = this.fallback();
197
- return new Proxy(templates, { get: (target, type) => target[type] ?? fallback });
198
- }, ...ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []);
199
- }
200
- direction(parent) {
201
- return this.autoDirection() && parent.type === "root" ? "auto" : null;
202
14
  }
203
- footnoteId(identifier, reference = false) {
204
- return `${this.id}-${reference ? "fnref" : "fn"}-${identifier}`;
205
- }
206
- showFootnote(event, id) {
207
- const target = this.element.nativeElement.querySelector(`#${CSS.escape(id)}`);
208
- if (target) {
209
- event.preventDefault();
210
- target.scrollIntoView();
211
- }
15
+ parser() {
16
+ return this.processor() ?? defaultProcessor;
212
17
  }
213
18
  static {
214
19
  this.ɵfac = i0.ɵɵngDeclareFactory({
@@ -216,7 +21,7 @@ var NbMarkdownViewerComponent = class NbMarkdownViewerComponent {
216
21
  version: "22.3.0",
217
22
  ngImport: i0,
218
23
  type: NbMarkdownViewerComponent,
219
- deps: [],
24
+ deps: null,
220
25
  target: i0.ɵɵFactoryTarget.Component
221
26
  });
222
27
  }
@@ -227,48 +32,16 @@ var NbMarkdownViewerComponent = class NbMarkdownViewerComponent {
227
32
  type: NbMarkdownViewerComponent,
228
33
  isStandalone: true,
229
34
  selector: "nb-markdown-viewer",
230
- inputs: {
231
- markdown: {
232
- classPropertyName: "markdown",
233
- publicName: "markdown",
234
- isSignal: true,
235
- isRequired: false,
236
- transformFunction: null
237
- },
238
- processor: {
239
- classPropertyName: "processor",
240
- publicName: "processor",
241
- isSignal: true,
242
- isRequired: false,
243
- transformFunction: null
244
- },
245
- autoDirection: {
246
- classPropertyName: "autoDirection",
247
- publicName: "autoDirection",
248
- isSignal: true,
249
- isRequired: false,
250
- transformFunction: null
251
- }
252
- },
35
+ inputs: { processor: {
36
+ classPropertyName: "processor",
37
+ publicName: "processor",
38
+ isSignal: true,
39
+ isRequired: false,
40
+ transformFunction: null
41
+ } },
253
42
  host: { classAttribute: "nb-markdown" },
254
43
  providers: [RemarkTemplatesService],
255
- queries: [{
256
- propertyName: "customTemplates",
257
- predicate: RemarkTemplateDirective,
258
- isSignal: true
259
- }],
260
- viewQueries: [{
261
- propertyName: "defaultTemplates",
262
- predicate: RemarkTemplateDirective,
263
- descendants: true,
264
- isSignal: true
265
- }, {
266
- propertyName: "fallback",
267
- first: true,
268
- predicate: ["fallback"],
269
- descendants: true,
270
- isSignal: true
271
- }],
44
+ usesInheritance: true,
272
45
  ngImport: i0,
273
46
  template: "<div class=\"uf-contents\"\n [remarkNode]=\"tree()\"></div>\n\n<ng-template #fallback\n let-node>\n @if (node.children) {\n <remark-node [remarkNode]=\"node\" />\n }\n</ng-template>\n\n<!-- Blocks -->\n\n<p *remarkTemplate=\"'paragraph'; let node; let parent = parent\"\n [attr.dir]=\"direction(parent)\"\n [remarkNode]=\"node\"></p>\n\n<ng-template remarkTemplate=\"heading\"\n let-node\n let-parent=\"parent\">\n @let dir = direction(parent);\n @switch (node.depth) {\n @case (1) {\n <h1 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h1>\n }\n @case (2) {\n <h2 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h2>\n }\n @case (3) {\n <h3 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h3>\n }\n @case (4) {\n <h4 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h4>\n }\n @case (5) {\n <h5 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h5>\n }\n @default {\n <h6 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h6>\n }\n }\n</ng-template>\n\n<blockquote *remarkTemplate=\"'blockquote'; let node; let parent = parent\"\n [attr.dir]=\"direction(parent)\"\n [remarkNode]=\"node\"></blockquote>\n\n<ng-template remarkTemplate=\"list\"\n let-node\n let-parent=\"parent\">\n @if (node.ordered) {\n <ol [remarkNode]=\"node\"\n [attr.dir]=\"direction(parent)\"\n [attr.start]=\"node.start === 1 ? null : node.start\"></ol>\n } @else {\n <ul [attr.dir]=\"direction(parent)\"\n [remarkNode]=\"node\"></ul>\n }\n</ng-template>\n\n<ng-template remarkTemplate=\"listItem\"\n let-node>\n @if (node.checked === true || node.checked === false) {\n <li class=\"task-list-item\"\n [class.checked]=\"node.checked\">\n <!-- The state for assistive technology; the box is drawn in the item's styles. -->\n <input type=\"checkbox\"\n class=\"visually-hidden\"\n disabled\n [checked]=\"node.checked\" />\n <remark-node [remarkNode]=\"node\" />\n </li>\n } @else {\n <li [remarkNode]=\"node\"></li>\n }\n</ng-template>\n\n<ng-template remarkTemplate=\"code\"\n let-node>\n @if (highlighting) {\n <pre><code [nxtHighlight]=\"node.value\" [language]=\"node.lang ?? undefined\" [attr.data-language]=\"node.lang\"></code></pre>\n } @else {\n <pre><code [attr.data-language]=\"node.lang\">{{ node.value }}</code></pre>\n }\n</ng-template>\n\n<hr *remarkTemplate=\"'thematicBreak'\" />\n\n<ng-template remarkTemplate=\"html\"\n let-node\n let-parent=\"parent\">\n <!-- Tags in a line of text that aren't paired into an element are left out. -->\n @if (blockParents.has(parent.type)) {\n <div [attr.dir]=\"direction(parent)\"\n [innerHTML]=\"node.value\"></div>\n }\n</ng-template>\n\n<table *remarkTemplate=\"'table'; let node; let parent = parent\"\n [attr.dir]=\"direction(parent)\">\n <thead>\n @if (node.children[0]; as row) {\n <tr>\n @for (cell of row.children; track $index) {\n <th [remarkNode]=\"cell\"\n [style.text-align]=\"node.align?.[$index]\"></th>\n }\n </tr>\n }\n </thead>\n <tbody>\n @for (row of node.children.slice(1); track $index) {\n <tr>\n @for (cell of row.children; track $index) {\n <td [remarkNode]=\"cell\"\n [style.text-align]=\"node.align?.[$index]\"></td>\n }\n </tr>\n }\n </tbody>\n</table>\n\n<section *remarkTemplate=\"'nbFootnotes'; let node; let parent = parent\"\n class=\"nb-markdown-footnotes\"\n [attr.aria-label]=\"texts().footnotes\"\n [attr.dir]=\"direction(parent)\">\n <hr />\n <ol [remarkNode]=\"node\"></ol>\n</section>\n\n<!-- The way back from a footnote to its reference, after its text. -->\n<ng-template remarkTemplate=\"nbFootnoteBack\"\n let-node><a class=\"nb-markdown-footnote-back\"\n [href]=\"'#' + footnoteId(node.identifier, true)\"\n [attr.aria-label]=\"texts().backToText\"\n (click)=\"showFootnote($event, footnoteId(node.identifier, true))\">↩&#xFE0E;</a></ng-template>\n\n<li *remarkTemplate=\"'footnoteDefinition'; let node\"\n [id]=\"footnoteId(node.identifier)\"\n [remarkNode]=\"node\"></li>\n\n<!-- Text -->\n\n<ng-container *remarkTemplate=\"'text'; let node\">{{ node.value }}</ng-container>\n\n<em *remarkTemplate=\"'emphasis'; let node\"\n [remarkNode]=\"node\"></em>\n\n<strong *remarkTemplate=\"'strong'; let node\"\n [remarkNode]=\"node\"></strong>\n\n<del *remarkTemplate=\"'delete'; let node\"\n [remarkNode]=\"node\"></del>\n\n<code *remarkTemplate=\"'inlineCode'; let node\">{{ node.value }}</code>\n\n<br *remarkTemplate=\"'break'\" />\n\n<a *remarkTemplate=\"'link'; let node\"\n [href]=\"node.url\"\n [attr.title]=\"node.title\"\n [remarkNode]=\"node\"></a>\n\n<img *remarkTemplate=\"'image'; let node\"\n [src]=\"node.url\"\n [alt]=\"node.alt ?? ''\"\n [attr.title]=\"node.title\" />\n\n<sup *remarkTemplate=\"'footnoteReference'; let node\">\n <a [id]=\"footnoteId(node.identifier, true)\"\n [href]=\"'#' + footnoteId(node.identifier)\"\n (click)=\"showFootnote($event, footnoteId(node.identifier))\">{{ node.label }}</a>\n</sup>\n\n<ng-template remarkTemplate=\"nbHtmlElement\"\n let-node>\n @switch (htmlElements.has(node.tagName) ? node.tagName : '') {\n @case ('abbr') {\n <abbr [remarkNode]=\"node\"></abbr>\n }\n @case ('b') {\n <b [remarkNode]=\"node\"></b>\n }\n @case ('br') {\n <br />\n }\n @case ('cite') {\n <cite [remarkNode]=\"node\"></cite>\n }\n @case ('code') {\n <code [remarkNode]=\"node\"></code>\n }\n @case ('del') {\n <del [remarkNode]=\"node\"></del>\n }\n @case ('em') {\n <em [remarkNode]=\"node\"></em>\n }\n @case ('i') {\n <i [remarkNode]=\"node\"></i>\n }\n @case ('ins') {\n <ins [remarkNode]=\"node\"></ins>\n }\n @case ('kbd') {\n <kbd [remarkNode]=\"node\"></kbd>\n }\n @case ('mark') {\n <mark [remarkNode]=\"node\"></mark>\n }\n @case ('s') {\n <s [remarkNode]=\"node\"></s>\n }\n @case ('samp') {\n <samp [remarkNode]=\"node\"></samp>\n }\n @case ('small') {\n <small [remarkNode]=\"node\"></small>\n }\n @case ('span') {\n <span [remarkNode]=\"node\"></span>\n }\n @case ('strong') {\n <strong [remarkNode]=\"node\"></strong>\n }\n @case ('sub') {\n <sub [remarkNode]=\"node\"></sub>\n }\n @case ('sup') {\n <sup [remarkNode]=\"node\"></sup>\n }\n @case ('u') {\n <u [remarkNode]=\"node\"></u>\n }\n @case ('var') {\n <var [remarkNode]=\"node\"></var>\n }\n @case ('wbr') {\n <wbr />\n }\n @default {\n <remark-node [remarkNode]=\"node\" />\n }\n }\n</ng-template>\n",
274
47
  styles: ["@charset \"UTF-8\";.ProseMirror{font-family:Open Sans,Helvetica Neue,Helvetica,Arial,\\b098\\b214\\bc14\\b978\\ace0\\b515,Nanum Barun Gothic,\\b9d1\\c740\\ace0\\b515,Malgun Gothic,sans-serif;color:#222;font-size:13px;overflow-y:auto;overflow-x:hidden;height:calc(100% - 36px)}.ProseMirror .placeholder{color:#999}.ProseMirror:focus{outline:none}.ProseMirror-selectednode{outline:none}table.ProseMirror-selectednode,.html-block.ProseMirror-selectednode{border-radius:2px;outline:2px solid #3469d1}.uf-contents{margin:0;padding:0;font-size:13px;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,\\b098\\b214\\bc14\\b978\\ace0\\b515,Nanum Barun Gothic,\\b9d1\\c740\\ace0\\b515,Malgun Gothic,sans-serif;z-index:20}.uf-contents *:not(table){line-height:160%;box-sizing:content-box}.uf-contents i,.uf-contents cite,.uf-contents em,.uf-contents var,.uf-contents address,.uf-contents dfn{font-style:italic}.uf-contents strong{font-weight:700}.uf-contents p{margin:10px 0;color:#222}.uf-contents>h1:first-of-type,.uf-contents>div>div:first-of-type h1{margin-top:14px}.uf-contents h1,.uf-contents h2,.uf-contents h3,.uf-contents h4,.uf-contents h5,.uf-contents h6{font-weight:700;color:#222}.uf-contents h1{font-size:24px;line-height:28px;border-bottom:3px double #999;margin:52px 0 15px;padding-bottom:7px}.uf-contents h2{font-size:22px;line-height:23px;border-bottom:1px solid #dbdbdb;margin:20px 0 13px;padding-bottom:7px}.uf-contents h3{font-size:20px;margin:18px 0 2px}.uf-contents h4{font-size:18px;margin:10px 0 2px}.uf-contents h3,.uf-contents h4{line-height:18px}.uf-contents h5{font-size:16px}.uf-contents h6{font-size:14px}.uf-contents h5,.uf-contents h6{line-height:17px;margin:9px 0 -4px}.uf-contents del{color:#999}.uf-contents blockquote{margin:14px 0;border-inline-start:4px solid #e5e5e5;padding:0 16px;color:#999}.uf-contents blockquote p,.uf-contents blockquote ul,.uf-contents blockquote ol{color:#999}.uf-contents blockquote>:first-child{margin-top:0}.uf-contents blockquote>:last-child{margin-bottom:0}.uf-contents pre,.uf-contents code{font-family:Consolas,Courier,Apple SD \\c0b0\\b3cc\\ace0\\b515 Neo,-apple-system,Lucida Grande,Apple SD Gothic Neo,\\b9d1\\c740 \\ace0\\b515,Malgun Gothic,Segoe UI,\\b3cb\\c6c0,dotum,sans-serif;border:0;border-radius:0}.uf-contents pre{direction:ltr;text-align:left;margin:2px 0 8px;padding:18px;background-color:#f4f7f8}.uf-contents pre code{padding:0;color:inherit;white-space:pre-wrap;background-color:transparent;unicode-bidi:normal}.uf-contents code{unicode-bidi:plaintext;color:#c1798b;background-color:#f9f2f4;padding:2px 3px;letter-spacing:-.3px;border-radius:2px}.uf-contents img{margin:4px 0 10px;box-sizing:border-box;vertical-align:top;max-width:100%}.uf-contents table{border:1px solid rgba(0,0,0,.1);margin:12px 0 14px;color:#222;width:auto;border-collapse:collapse;box-sizing:border-box}.uf-contents table th,.uf-contents table td{border:1px solid rgba(0,0,0,.1);padding:5px 14px 5px 12px;height:32px}.uf-contents table th{background-color:#555;font-weight:300;color:#fff;padding-top:6px}.uf-contents th p{margin:0;color:#fff}.uf-contents th.uf-cell-selected{background-color:#908f8f}.uf-contents td p{margin:0;padding:0 2px}.uf-contents td.uf-cell-selected{background-color:#c0cff0}.uf-contents ul,.uf-contents menu,.uf-contents ol,.uf-contents dir{display:block;list-style-type:none;padding-inline-start:24px;margin:6px 0 10px;color:#222}.uf-contents ol{list-style-type:none;counter-reset:li}.uf-contents ol>li{counter-increment:li}.uf-contents ul>li:before,.uf-contents ol>li:before{display:inline-block;position:absolute}.uf-contents ul>li:before{content:\"\";margin-top:6px;margin-inline-start:-17px;width:5px;height:5px;border-radius:50%;background-color:#ccc}.uf-contents ol>li:before{content:counter(li) \".\";display:inline-flex;justify-content:flex-end;margin-inline-start:-28px;width:24px;color:#aaa}.uf-contents ul ul,.uf-contents ul ol,.uf-contents ol ul,.uf-contents ol ol{margin-top:0!important;margin-bottom:0!important}.uf-contents ul li,.uf-contents ol li{position:relative}.uf-contents ul p,.uf-contents ol p{margin:0}.uf-contents hr{border-top:1px solid #eee;margin:16px 0}.uf-contents a{text-decoration:underline;color:#3060c7}.uf-contents a:hover{color:#2852b5}.uf-contents .image-link{position:relative}.uf-contents .image-link:hover .uf-image-link-button{display:flex}.uf-contents .uf-image-link-button{display:none;position:absolute;top:0;inset-inline-end:0;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border-radius:50%;border:1px solid #b9c1d0;background-color:#fff;color:var(--uf-icon-color);box-shadow:0 2px 4px #00000014;cursor:pointer}.uf-contents .uf-image-link-button .uf-icon{width:18px;height:18px}.uf-contents .task-list-item{border:0;list-style:none;padding-inline-start:24px;margin-inline-start:-24px}.uf-contents .task-list-item:before{content:\"\";box-sizing:border-box;margin-inline-start:0;margin-top:0;border:1px solid #ccc;border-radius:2px;background-color:#fff;height:18px;width:18px;position:absolute;inset-inline-start:0;top:1px}.uf-contents .task-list-item.checked:before{border:none;background-color:#3060c7;clip-path:path(evenodd,\"M16 0c1.105 0 2 .895 2 2v14c0 1.105-.895 2-2 2H2c-1.105 0-2-.895-2-2V2C0 .895.895 0 2 0h14zm-1.793 5.293c-.39-.39-1.024-.39-1.414 0L7.5 10.585 5.207 8.293l-.094-.083c-.392-.305-.96-.278-1.32.083-.39.39-.39 1.024 0 1.414l3 3 .094.083c.392.305.96.278 1.32-.083l6-6 .083-.094c.305-.392.278-.96-.083-1.32z\")}.uf-contents .uf-ww-code-block{position:relative}.uf-contents .uf-code-block-label{position:absolute;top:10px;right:10px;display:inline-flex;align-items:center;gap:4px;height:27px;margin:0;padding-block:0;padding-inline:10px 6px;border:none;border-radius:2px;font-family:inherit;font-weight:700;font-size:13px;color:#333;background-color:#e5e9ea;cursor:pointer}.uf-contents .uf-code-block-label .uf-icon{width:16px;height:16px;color:var(--uf-icon-color)}.uf-default-ui.uf-disabled .uf-main .ProseMirror,.uf-default-ui.uf-disabled .uf-main .ProseMirror *,.uf-default-ui.uf-disabled .uf-main .uf-md-preview,.uf-default-ui.uf-disabled .uf-main .uf-md-preview *{color:var(--uf-disabled-text-color)}.uf-contents.uf-readonly .uf-code-block-label,.uf-contents.uf-readonly .image-link:hover .uf-image-link-button,.uf-contents.uf-readonly .uf-custom-block.ProseMirror-selectednode .uf-custom-block-view .tool,.uf-contents.uf-disabled .uf-code-block-label,.uf-contents.uf-disabled .image-link:hover .uf-image-link-button,.uf-contents.uf-disabled .uf-custom-block.ProseMirror-selectednode .uf-custom-block-view .tool{display:none}.uf-custom-block .uf-custom-block-editor{background:#f9f7fd;color:#452d6b;border:solid 1px #dbd4ea}.uf-custom-block .uf-custom-block-view{position:relative;padding:9px 13px 8px 12px}.uf-custom-block .uf-custom-block-view .tool{position:absolute;inset-inline-end:10px;top:7px;display:none}.uf-custom-block.ProseMirror-selectednode .uf-custom-block-view{border:solid 1px #dbd4ea;border-radius:2px}.uf-custom-block.ProseMirror-selectednode .uf-custom-block-view .tool{display:block}.uf-custom-block-view button{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;width:23px;height:23px;margin-inline-start:8px;padding:0;border:solid 1px #cccccc;background-color:transparent;color:var(--uf-icon-color);cursor:pointer}.uf-custom-block-view button .uf-icon{width:16px;height:16px}.uf-custom-block-view .info{font-size:13px;font-weight:700;color:#5200d0;vertical-align:middle}.uf-ww-code-block-language{position:fixed;display:inline-block;width:100px;height:27px;right:35px;border:1px solid #ccc;border-radius:2px;background-color:#fff;z-index:30}.uf-ww-code-block-language input{box-sizing:border-box;margin:0;padding:0 10px;height:100%;width:100%;background-color:transparent;border:none;outline:none}.uf-contents-placeholder:before{content:attr(data-placeholder);color:gray;line-height:160%;position:absolute}.uf-md-preview .uf-contents h1{min-height:28px}.uf-md-preview .uf-contents h2{min-height:23px}.uf-md-preview .uf-contents blockquote{min-height:20px}.uf-md-preview .uf-contents li{min-height:22px}.nb-markdown .uf-contents,.nb-markdown .ProseMirror{font-family:var(--text-paragraph-font-family);font-size:var(--text-paragraph-font-size);color:var(--text-basic-color)}.nb-markdown .ProseMirror .placeholder{color:var(--input-basic-placeholder-text-color)}.nb-markdown .uf-contents p,.nb-markdown .uf-contents ul,.nb-markdown .uf-contents ol,.nb-markdown .uf-contents table,.nb-markdown .uf-contents h1,.nb-markdown .uf-contents h2,.nb-markdown .uf-contents h3,.nb-markdown .uf-contents h4,.nb-markdown .uf-contents h5,.nb-markdown .uf-contents h6{color:inherit}.nb-markdown .uf-contents h1{font-family:var(--text-heading-1-font-family)}.nb-markdown .uf-contents h2{font-family:var(--text-heading-2-font-family)}.nb-markdown .uf-contents h3{font-family:var(--text-heading-3-font-family)}.nb-markdown .uf-contents h4{font-family:var(--text-heading-4-font-family)}.nb-markdown .uf-contents h5{font-family:var(--text-heading-5-font-family)}.nb-markdown .uf-contents h6{font-family:var(--text-heading-6-font-family)}.nb-markdown .uf-contents h1{border-bottom-color:var(--border-basic-color-4)}.nb-markdown .uf-contents h2{border-bottom-color:var(--divider-color)}.nb-markdown .uf-contents del,.nb-markdown .uf-contents blockquote,.nb-markdown .uf-contents blockquote p,.nb-markdown .uf-contents blockquote ul,.nb-markdown .uf-contents blockquote ol{color:var(--text-hint-color)}.nb-markdown .uf-contents blockquote{border-inline-start-color:var(--border-basic-color-4)}.nb-markdown .uf-contents pre{background-color:var(--nb-markdown-code-background, var(--background-basic-color-2))}.nb-markdown .uf-contents code{color:var(--nb-markdown-code-color, inherit);background-color:var(--nb-markdown-code-background, var(--background-basic-color-2))}.nb-markdown .uf-contents pre code{color:inherit;background-color:transparent;white-space:inherit}.nb-markdown .uf-contents kbd{padding:0 .25rem;border:1px solid var(--border-basic-color-4);border-bottom-width:2px;border-radius:.25rem;font-family:inherit;font-size:.875em;background-color:var(--nb-markdown-code-background, var(--background-basic-color-2))}.nb-markdown .uf-contents .hljs-comment,.nb-markdown .uf-contents .hljs-quote,.nb-markdown .uf-contents .hljs-meta{color:var(--text-hint-color)}.nb-markdown .uf-contents .hljs-comment,.nb-markdown .uf-contents .hljs-quote,.nb-markdown .uf-contents .hljs-emphasis{font-style:italic}.nb-markdown .uf-contents .hljs-keyword,.nb-markdown .uf-contents .hljs-selector-tag,.nb-markdown .uf-contents .hljs-literal,.nb-markdown .uf-contents .hljs-doctag,.nb-markdown .uf-contents .hljs-built_in{color:var(--text-primary-color)}.nb-markdown .uf-contents .hljs-string,.nb-markdown .uf-contents .hljs-regexp,.nb-markdown .uf-contents .hljs-addition,.nb-markdown .uf-contents .hljs-selector-attr,.nb-markdown .uf-contents .hljs-selector-pseudo{color:var(--text-success-color)}.nb-markdown .uf-contents .hljs-number,.nb-markdown .uf-contents .hljs-symbol,.nb-markdown .uf-contents .hljs-bullet,.nb-markdown .uf-contents .hljs-variable,.nb-markdown .uf-contents .hljs-template-variable,.nb-markdown .uf-contents .hljs-link{color:var(--text-warning-color)}.nb-markdown .uf-contents .hljs-title,.nb-markdown .uf-contents .hljs-section,.nb-markdown .uf-contents .hljs-name,.nb-markdown .uf-contents .hljs-selector-id,.nb-markdown .uf-contents .hljs-selector-class{color:var(--text-info-color)}.nb-markdown .uf-contents .hljs-attr,.nb-markdown .uf-contents .hljs-attribute,.nb-markdown .uf-contents .hljs-property,.nb-markdown .uf-contents .hljs-type,.nb-markdown .uf-contents .hljs-deletion{color:var(--text-danger-color)}.nb-markdown .uf-contents .hljs-strong{font-weight:700}.nb-markdown .uf-contents table,.nb-markdown .uf-contents th,.nb-markdown .uf-contents td{border-color:var(--table-cell-border-color)}.nb-markdown .uf-contents th{font-family:var(--table-header-text-font-family);font-weight:var(--table-header-text-font-weight);color:var(--table-header-text-color);background-color:var(--background-basic-color-3)}.nb-markdown .uf-contents th p{color:inherit}.nb-markdown .uf-contents th.uf-cell-selected,.nb-markdown .uf-contents td.uf-cell-selected{background-color:var(--color-primary-transparent-hover)}.nb-markdown .uf-contents ul>li:before{background-color:var(--text-hint-color)}.nb-markdown .uf-contents ol>li:before{color:var(--text-hint-color)}.nb-markdown .uf-contents hr{border-top-color:var(--divider-color)}.nb-markdown .uf-contents a{color:var(--link-text-color);text-decoration:var(--link-text-decoration)}.nb-markdown .uf-contents a:focus{color:var(--link-text-focus-color)}.nb-markdown .uf-contents a:hover{color:var(--link-text-hover-color)}.nb-markdown .uf-contents .uf-image-link-button{border-color:var(--border-basic-color-4);background-color:var(--background-basic-color-1);box-shadow:var(--shadow)}.nb-markdown .uf-contents .task-list-item:before{border-color:var(--border-basic-color-5);background-color:var(--background-basic-color-1)}.nb-markdown .uf-contents .task-list-item.checked:before{background-color:var(--color-primary-default)}.nb-markdown .uf-contents .uf-code-block-label{color:var(--text-basic-color);background-color:var(--background-basic-color-3)}.nb-markdown .uf-contents .uf-md-preview-highlight:after,.nb-markdown .uf-contents th.uf-md-preview-highlight,.nb-markdown .uf-contents td.uf-md-preview-highlight{background-color:var(--color-warning-transparent-hover)}.nb-markdown .uf-contents th.uf-md-preview-highlight{color:var(--text-basic-color)}.nb-markdown .uf-custom-block .uf-custom-block-editor{color:var(--text-basic-color);background-color:var(--background-basic-color-2);border-color:var(--border-basic-color-4)}.nb-markdown .uf-custom-block.ProseMirror-selectednode .uf-custom-block-view,.nb-markdown .uf-custom-block-view button{border-color:var(--border-basic-color-4)}.nb-markdown .uf-custom-block-view .info{color:var(--text-primary-color)}.nb-markdown .uf-ww-code-block-language{border-color:var(--input-basic-border-color);background-color:var(--input-basic-background-color)}.nb-markdown .uf-ww-code-block-language input{color:var(--text-basic-color)}nb-markdown-viewer{display:block}nb-markdown-viewer remark-node{display:contents}nb-markdown-viewer .nb-markdown-footnotes{font-size:var(--text-caption-font-size)}nb-markdown-viewer .uf-contents a.nb-markdown-footnote-back{margin-inline-start:.25em;text-decoration:none}\n"],
@@ -324,45 +97,14 @@ i0.ɵɵngDeclareClassMetadata({
324
97
  styles: ["@charset \"UTF-8\";.ProseMirror{font-family:Open Sans,Helvetica Neue,Helvetica,Arial,\\b098\\b214\\bc14\\b978\\ace0\\b515,Nanum Barun Gothic,\\b9d1\\c740\\ace0\\b515,Malgun Gothic,sans-serif;color:#222;font-size:13px;overflow-y:auto;overflow-x:hidden;height:calc(100% - 36px)}.ProseMirror .placeholder{color:#999}.ProseMirror:focus{outline:none}.ProseMirror-selectednode{outline:none}table.ProseMirror-selectednode,.html-block.ProseMirror-selectednode{border-radius:2px;outline:2px solid #3469d1}.uf-contents{margin:0;padding:0;font-size:13px;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,\\b098\\b214\\bc14\\b978\\ace0\\b515,Nanum Barun Gothic,\\b9d1\\c740\\ace0\\b515,Malgun Gothic,sans-serif;z-index:20}.uf-contents *:not(table){line-height:160%;box-sizing:content-box}.uf-contents i,.uf-contents cite,.uf-contents em,.uf-contents var,.uf-contents address,.uf-contents dfn{font-style:italic}.uf-contents strong{font-weight:700}.uf-contents p{margin:10px 0;color:#222}.uf-contents>h1:first-of-type,.uf-contents>div>div:first-of-type h1{margin-top:14px}.uf-contents h1,.uf-contents h2,.uf-contents h3,.uf-contents h4,.uf-contents h5,.uf-contents h6{font-weight:700;color:#222}.uf-contents h1{font-size:24px;line-height:28px;border-bottom:3px double #999;margin:52px 0 15px;padding-bottom:7px}.uf-contents h2{font-size:22px;line-height:23px;border-bottom:1px solid #dbdbdb;margin:20px 0 13px;padding-bottom:7px}.uf-contents h3{font-size:20px;margin:18px 0 2px}.uf-contents h4{font-size:18px;margin:10px 0 2px}.uf-contents h3,.uf-contents h4{line-height:18px}.uf-contents h5{font-size:16px}.uf-contents h6{font-size:14px}.uf-contents h5,.uf-contents h6{line-height:17px;margin:9px 0 -4px}.uf-contents del{color:#999}.uf-contents blockquote{margin:14px 0;border-inline-start:4px solid #e5e5e5;padding:0 16px;color:#999}.uf-contents blockquote p,.uf-contents blockquote ul,.uf-contents blockquote ol{color:#999}.uf-contents blockquote>:first-child{margin-top:0}.uf-contents blockquote>:last-child{margin-bottom:0}.uf-contents pre,.uf-contents code{font-family:Consolas,Courier,Apple SD \\c0b0\\b3cc\\ace0\\b515 Neo,-apple-system,Lucida Grande,Apple SD Gothic Neo,\\b9d1\\c740 \\ace0\\b515,Malgun Gothic,Segoe UI,\\b3cb\\c6c0,dotum,sans-serif;border:0;border-radius:0}.uf-contents pre{direction:ltr;text-align:left;margin:2px 0 8px;padding:18px;background-color:#f4f7f8}.uf-contents pre code{padding:0;color:inherit;white-space:pre-wrap;background-color:transparent;unicode-bidi:normal}.uf-contents code{unicode-bidi:plaintext;color:#c1798b;background-color:#f9f2f4;padding:2px 3px;letter-spacing:-.3px;border-radius:2px}.uf-contents img{margin:4px 0 10px;box-sizing:border-box;vertical-align:top;max-width:100%}.uf-contents table{border:1px solid rgba(0,0,0,.1);margin:12px 0 14px;color:#222;width:auto;border-collapse:collapse;box-sizing:border-box}.uf-contents table th,.uf-contents table td{border:1px solid rgba(0,0,0,.1);padding:5px 14px 5px 12px;height:32px}.uf-contents table th{background-color:#555;font-weight:300;color:#fff;padding-top:6px}.uf-contents th p{margin:0;color:#fff}.uf-contents th.uf-cell-selected{background-color:#908f8f}.uf-contents td p{margin:0;padding:0 2px}.uf-contents td.uf-cell-selected{background-color:#c0cff0}.uf-contents ul,.uf-contents menu,.uf-contents ol,.uf-contents dir{display:block;list-style-type:none;padding-inline-start:24px;margin:6px 0 10px;color:#222}.uf-contents ol{list-style-type:none;counter-reset:li}.uf-contents ol>li{counter-increment:li}.uf-contents ul>li:before,.uf-contents ol>li:before{display:inline-block;position:absolute}.uf-contents ul>li:before{content:\"\";margin-top:6px;margin-inline-start:-17px;width:5px;height:5px;border-radius:50%;background-color:#ccc}.uf-contents ol>li:before{content:counter(li) \".\";display:inline-flex;justify-content:flex-end;margin-inline-start:-28px;width:24px;color:#aaa}.uf-contents ul ul,.uf-contents ul ol,.uf-contents ol ul,.uf-contents ol ol{margin-top:0!important;margin-bottom:0!important}.uf-contents ul li,.uf-contents ol li{position:relative}.uf-contents ul p,.uf-contents ol p{margin:0}.uf-contents hr{border-top:1px solid #eee;margin:16px 0}.uf-contents a{text-decoration:underline;color:#3060c7}.uf-contents a:hover{color:#2852b5}.uf-contents .image-link{position:relative}.uf-contents .image-link:hover .uf-image-link-button{display:flex}.uf-contents .uf-image-link-button{display:none;position:absolute;top:0;inset-inline-end:0;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border-radius:50%;border:1px solid #b9c1d0;background-color:#fff;color:var(--uf-icon-color);box-shadow:0 2px 4px #00000014;cursor:pointer}.uf-contents .uf-image-link-button .uf-icon{width:18px;height:18px}.uf-contents .task-list-item{border:0;list-style:none;padding-inline-start:24px;margin-inline-start:-24px}.uf-contents .task-list-item:before{content:\"\";box-sizing:border-box;margin-inline-start:0;margin-top:0;border:1px solid #ccc;border-radius:2px;background-color:#fff;height:18px;width:18px;position:absolute;inset-inline-start:0;top:1px}.uf-contents .task-list-item.checked:before{border:none;background-color:#3060c7;clip-path:path(evenodd,\"M16 0c1.105 0 2 .895 2 2v14c0 1.105-.895 2-2 2H2c-1.105 0-2-.895-2-2V2C0 .895.895 0 2 0h14zm-1.793 5.293c-.39-.39-1.024-.39-1.414 0L7.5 10.585 5.207 8.293l-.094-.083c-.392-.305-.96-.278-1.32.083-.39.39-.39 1.024 0 1.414l3 3 .094.083c.392.305.96.278 1.32-.083l6-6 .083-.094c.305-.392.278-.96-.083-1.32z\")}.uf-contents .uf-ww-code-block{position:relative}.uf-contents .uf-code-block-label{position:absolute;top:10px;right:10px;display:inline-flex;align-items:center;gap:4px;height:27px;margin:0;padding-block:0;padding-inline:10px 6px;border:none;border-radius:2px;font-family:inherit;font-weight:700;font-size:13px;color:#333;background-color:#e5e9ea;cursor:pointer}.uf-contents .uf-code-block-label .uf-icon{width:16px;height:16px;color:var(--uf-icon-color)}.uf-default-ui.uf-disabled .uf-main .ProseMirror,.uf-default-ui.uf-disabled .uf-main .ProseMirror *,.uf-default-ui.uf-disabled .uf-main .uf-md-preview,.uf-default-ui.uf-disabled .uf-main .uf-md-preview *{color:var(--uf-disabled-text-color)}.uf-contents.uf-readonly .uf-code-block-label,.uf-contents.uf-readonly .image-link:hover .uf-image-link-button,.uf-contents.uf-readonly .uf-custom-block.ProseMirror-selectednode .uf-custom-block-view .tool,.uf-contents.uf-disabled .uf-code-block-label,.uf-contents.uf-disabled .image-link:hover .uf-image-link-button,.uf-contents.uf-disabled .uf-custom-block.ProseMirror-selectednode .uf-custom-block-view .tool{display:none}.uf-custom-block .uf-custom-block-editor{background:#f9f7fd;color:#452d6b;border:solid 1px #dbd4ea}.uf-custom-block .uf-custom-block-view{position:relative;padding:9px 13px 8px 12px}.uf-custom-block .uf-custom-block-view .tool{position:absolute;inset-inline-end:10px;top:7px;display:none}.uf-custom-block.ProseMirror-selectednode .uf-custom-block-view{border:solid 1px #dbd4ea;border-radius:2px}.uf-custom-block.ProseMirror-selectednode .uf-custom-block-view .tool{display:block}.uf-custom-block-view button{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;width:23px;height:23px;margin-inline-start:8px;padding:0;border:solid 1px #cccccc;background-color:transparent;color:var(--uf-icon-color);cursor:pointer}.uf-custom-block-view button .uf-icon{width:16px;height:16px}.uf-custom-block-view .info{font-size:13px;font-weight:700;color:#5200d0;vertical-align:middle}.uf-ww-code-block-language{position:fixed;display:inline-block;width:100px;height:27px;right:35px;border:1px solid #ccc;border-radius:2px;background-color:#fff;z-index:30}.uf-ww-code-block-language input{box-sizing:border-box;margin:0;padding:0 10px;height:100%;width:100%;background-color:transparent;border:none;outline:none}.uf-contents-placeholder:before{content:attr(data-placeholder);color:gray;line-height:160%;position:absolute}.uf-md-preview .uf-contents h1{min-height:28px}.uf-md-preview .uf-contents h2{min-height:23px}.uf-md-preview .uf-contents blockquote{min-height:20px}.uf-md-preview .uf-contents li{min-height:22px}.nb-markdown .uf-contents,.nb-markdown .ProseMirror{font-family:var(--text-paragraph-font-family);font-size:var(--text-paragraph-font-size);color:var(--text-basic-color)}.nb-markdown .ProseMirror .placeholder{color:var(--input-basic-placeholder-text-color)}.nb-markdown .uf-contents p,.nb-markdown .uf-contents ul,.nb-markdown .uf-contents ol,.nb-markdown .uf-contents table,.nb-markdown .uf-contents h1,.nb-markdown .uf-contents h2,.nb-markdown .uf-contents h3,.nb-markdown .uf-contents h4,.nb-markdown .uf-contents h5,.nb-markdown .uf-contents h6{color:inherit}.nb-markdown .uf-contents h1{font-family:var(--text-heading-1-font-family)}.nb-markdown .uf-contents h2{font-family:var(--text-heading-2-font-family)}.nb-markdown .uf-contents h3{font-family:var(--text-heading-3-font-family)}.nb-markdown .uf-contents h4{font-family:var(--text-heading-4-font-family)}.nb-markdown .uf-contents h5{font-family:var(--text-heading-5-font-family)}.nb-markdown .uf-contents h6{font-family:var(--text-heading-6-font-family)}.nb-markdown .uf-contents h1{border-bottom-color:var(--border-basic-color-4)}.nb-markdown .uf-contents h2{border-bottom-color:var(--divider-color)}.nb-markdown .uf-contents del,.nb-markdown .uf-contents blockquote,.nb-markdown .uf-contents blockquote p,.nb-markdown .uf-contents blockquote ul,.nb-markdown .uf-contents blockquote ol{color:var(--text-hint-color)}.nb-markdown .uf-contents blockquote{border-inline-start-color:var(--border-basic-color-4)}.nb-markdown .uf-contents pre{background-color:var(--nb-markdown-code-background, var(--background-basic-color-2))}.nb-markdown .uf-contents code{color:var(--nb-markdown-code-color, inherit);background-color:var(--nb-markdown-code-background, var(--background-basic-color-2))}.nb-markdown .uf-contents pre code{color:inherit;background-color:transparent;white-space:inherit}.nb-markdown .uf-contents kbd{padding:0 .25rem;border:1px solid var(--border-basic-color-4);border-bottom-width:2px;border-radius:.25rem;font-family:inherit;font-size:.875em;background-color:var(--nb-markdown-code-background, var(--background-basic-color-2))}.nb-markdown .uf-contents .hljs-comment,.nb-markdown .uf-contents .hljs-quote,.nb-markdown .uf-contents .hljs-meta{color:var(--text-hint-color)}.nb-markdown .uf-contents .hljs-comment,.nb-markdown .uf-contents .hljs-quote,.nb-markdown .uf-contents .hljs-emphasis{font-style:italic}.nb-markdown .uf-contents .hljs-keyword,.nb-markdown .uf-contents .hljs-selector-tag,.nb-markdown .uf-contents .hljs-literal,.nb-markdown .uf-contents .hljs-doctag,.nb-markdown .uf-contents .hljs-built_in{color:var(--text-primary-color)}.nb-markdown .uf-contents .hljs-string,.nb-markdown .uf-contents .hljs-regexp,.nb-markdown .uf-contents .hljs-addition,.nb-markdown .uf-contents .hljs-selector-attr,.nb-markdown .uf-contents .hljs-selector-pseudo{color:var(--text-success-color)}.nb-markdown .uf-contents .hljs-number,.nb-markdown .uf-contents .hljs-symbol,.nb-markdown .uf-contents .hljs-bullet,.nb-markdown .uf-contents .hljs-variable,.nb-markdown .uf-contents .hljs-template-variable,.nb-markdown .uf-contents .hljs-link{color:var(--text-warning-color)}.nb-markdown .uf-contents .hljs-title,.nb-markdown .uf-contents .hljs-section,.nb-markdown .uf-contents .hljs-name,.nb-markdown .uf-contents .hljs-selector-id,.nb-markdown .uf-contents .hljs-selector-class{color:var(--text-info-color)}.nb-markdown .uf-contents .hljs-attr,.nb-markdown .uf-contents .hljs-attribute,.nb-markdown .uf-contents .hljs-property,.nb-markdown .uf-contents .hljs-type,.nb-markdown .uf-contents .hljs-deletion{color:var(--text-danger-color)}.nb-markdown .uf-contents .hljs-strong{font-weight:700}.nb-markdown .uf-contents table,.nb-markdown .uf-contents th,.nb-markdown .uf-contents td{border-color:var(--table-cell-border-color)}.nb-markdown .uf-contents th{font-family:var(--table-header-text-font-family);font-weight:var(--table-header-text-font-weight);color:var(--table-header-text-color);background-color:var(--background-basic-color-3)}.nb-markdown .uf-contents th p{color:inherit}.nb-markdown .uf-contents th.uf-cell-selected,.nb-markdown .uf-contents td.uf-cell-selected{background-color:var(--color-primary-transparent-hover)}.nb-markdown .uf-contents ul>li:before{background-color:var(--text-hint-color)}.nb-markdown .uf-contents ol>li:before{color:var(--text-hint-color)}.nb-markdown .uf-contents hr{border-top-color:var(--divider-color)}.nb-markdown .uf-contents a{color:var(--link-text-color);text-decoration:var(--link-text-decoration)}.nb-markdown .uf-contents a:focus{color:var(--link-text-focus-color)}.nb-markdown .uf-contents a:hover{color:var(--link-text-hover-color)}.nb-markdown .uf-contents .uf-image-link-button{border-color:var(--border-basic-color-4);background-color:var(--background-basic-color-1);box-shadow:var(--shadow)}.nb-markdown .uf-contents .task-list-item:before{border-color:var(--border-basic-color-5);background-color:var(--background-basic-color-1)}.nb-markdown .uf-contents .task-list-item.checked:before{background-color:var(--color-primary-default)}.nb-markdown .uf-contents .uf-code-block-label{color:var(--text-basic-color);background-color:var(--background-basic-color-3)}.nb-markdown .uf-contents .uf-md-preview-highlight:after,.nb-markdown .uf-contents th.uf-md-preview-highlight,.nb-markdown .uf-contents td.uf-md-preview-highlight{background-color:var(--color-warning-transparent-hover)}.nb-markdown .uf-contents th.uf-md-preview-highlight{color:var(--text-basic-color)}.nb-markdown .uf-custom-block .uf-custom-block-editor{color:var(--text-basic-color);background-color:var(--background-basic-color-2);border-color:var(--border-basic-color-4)}.nb-markdown .uf-custom-block.ProseMirror-selectednode .uf-custom-block-view,.nb-markdown .uf-custom-block-view button{border-color:var(--border-basic-color-4)}.nb-markdown .uf-custom-block-view .info{color:var(--text-primary-color)}.nb-markdown .uf-ww-code-block-language{border-color:var(--input-basic-border-color);background-color:var(--input-basic-background-color)}.nb-markdown .uf-ww-code-block-language input{color:var(--text-basic-color)}nb-markdown-viewer{display:block}nb-markdown-viewer remark-node{display:contents}nb-markdown-viewer .nb-markdown-footnotes{font-size:var(--text-caption-font-size)}nb-markdown-viewer .uf-contents a.nb-markdown-footnote-back{margin-inline-start:.25em;text-decoration:none}\n"]
325
98
  }]
326
99
  }],
327
- ctorParameters: () => [],
328
- propDecorators: {
329
- markdown: [{
330
- type: i0.Input,
331
- args: [{
332
- isSignal: true,
333
- alias: "markdown",
334
- required: false
335
- }]
336
- }],
337
- processor: [{
338
- type: i0.Input,
339
- args: [{
340
- isSignal: true,
341
- alias: "processor",
342
- required: false
343
- }]
344
- }],
345
- autoDirection: [{
346
- type: i0.Input,
347
- args: [{
348
- isSignal: true,
349
- alias: "autoDirection",
350
- required: false
351
- }]
352
- }],
353
- defaultTemplates: [{
354
- type: i0.ViewChildren,
355
- args: [i0.forwardRef(() => RemarkTemplateDirective), { isSignal: true }]
356
- }],
357
- customTemplates: [{
358
- type: i0.ContentChildren,
359
- args: [i0.forwardRef(() => RemarkTemplateDirective), { isSignal: true }]
360
- }],
361
- fallback: [{
362
- type: i0.ViewChild,
363
- args: ["fallback", { isSignal: true }]
100
+ propDecorators: { processor: [{
101
+ type: i0.Input,
102
+ args: [{
103
+ isSignal: true,
104
+ alias: "processor",
105
+ required: false
364
106
  }]
365
- }
107
+ }] }
366
108
  });
367
109
  export { NbMarkdownViewerComponent };
368
110
 
@@ -1 +1 @@
1
- {"version":3,"file":"liquid-js-lyr-extras-markdown-viewer.mjs","names":["blockParents"],"sources":["../../../packages/extras/markdown-viewer/src/markdown-tree.ts","../../../packages/extras/markdown-viewer/src/texts.ts","../../../packages/extras/markdown-viewer/src/markdown-viewer.component.ts","../../../packages/extras/markdown-viewer/src/markdown-viewer.component.html"],"sourcesContent":["import type { Definition, FootnoteDefinition, Html, Node, Nodes, Parent, Root, RootContent } from 'mdast'\n\n/** An inline HTML element of the markdown, e.g. `<kbd>Ctrl</kbd>`, with the markdown between its tags. */\nexport interface NbMarkdownHtmlElement extends Parent {\n type: 'nbHtmlElement'\n tagName: string\n}\n\n/** A link from a footnote back to where the text refers to it, at the end of the footnote. */\nexport interface NbMarkdownFootnoteBack extends Node {\n type: 'nbFootnoteBack'\n identifier: string\n}\n\n/** The footnotes, at the end of the document. */\nexport interface NbMarkdownFootnotes extends Parent {\n type: 'nbFootnotes'\n children: FootnoteDefinition[]\n}\n\ndeclare module 'mdast' {\n interface PhrasingContentMap {\n nbHtmlElement: NbMarkdownHtmlElement\n nbFootnoteBack: NbMarkdownFootnoteBack\n }\n interface RootContentMap {\n nbHtmlElement: NbMarkdownHtmlElement\n nbFootnoteBack: NbMarkdownFootnoteBack\n nbFootnotes: NbMarkdownFootnotes\n }\n}\n\nconst voidElements = new Set(['br', 'wbr', 'img', 'hr'])\nconst openingTag = /^<([a-z][a-z0-9-]*)(?:\\s[^>]*)?>$/i\nconst selfClosingTag = /^<([a-z][a-z0-9-]*)(?:\\s[^>]*)?\\/>$/i\nconst closingTag = /^<\\/([a-z][a-z0-9-]*)\\s*>$/i\n/** Parents of block content, whose HTML is a block of its own rather than tags in a line of text. */\nconst blockParents = new Set(['root', 'blockquote', 'listItem', 'footnoteDefinition', 'nbFootnotes'])\n\nfunction tagName(node: RootContent, pattern: RegExp) {\n return node.type === 'html' ? pattern.exec(node.value)?.[1].toLowerCase() : undefined\n}\n\n/** Pairs the opening and closing tags of HTML in a line of text into elements, with the content between them. */\nfunction pairTags(children: RootContent[]): RootContent[] {\n const paired = new Array<RootContent>()\n for (let index = 0; index < children.length; index++) {\n const child = children[index]\n const name = tagName(child, openingTag)\n const selfClosing = tagName(child, selfClosingTag)\n if (selfClosing || (name && voidElements.has(name))) {\n paired.push({ type: 'nbHtmlElement', tagName: selfClosing ?? name ?? '', children: [] })\n continue\n }\n if (!name) {\n paired.push(child)\n continue\n }\n let depth = 0\n let end = index + 1\n for (; end < children.length; end++) {\n if (tagName(children[end], openingTag) === name) {\n depth++\n } else if (tagName(children[end], closingTag) === name && depth-- === 0) {\n break\n }\n }\n if (end === children.length) {\n paired.push(child)\n continue\n }\n const content = pairTags(children.slice(index + 1, end)) as NbMarkdownHtmlElement['children']\n paired.push({ type: 'nbHtmlElement', tagName: name, children: content })\n index = end\n }\n return paired\n}\n\n/** Whether a list's items hold their text without paragraphs, as in `mdast-util-to-hast`. */\nfunction isTight(node: Nodes) {\n if (node.type !== 'list' || node.spread) {\n return false\n }\n return node.children.every((item) => !(item.spread ?? item.children.length > 1))\n}\n\n/**\n * Prepares the markdown's syntax tree for its templates, as `remark-rehype` prepares it for HTML: references become\n * links and images, a tight list's items lose their paragraphs, footnotes move to the end, and the tags of HTML in a\n * line of text are paired into elements.\n */\nexport function prepareTree(tree: Root) {\n const definitions = new Map<string, Definition>()\n const footnotes = new Array<FootnoteDefinition>()\n const collect = (node: Nodes) => {\n if (node.type === 'definition') {\n definitions.set(node.identifier, node)\n }\n if ('children' in node) {\n node.children.forEach(collect)\n }\n }\n collect(tree)\n\n const transform = (node: Nodes) => {\n if (!('children' in node)) {\n return\n }\n const children = new Array<RootContent>()\n for (const child of node.children as RootContent[]) {\n if (child.type === 'definition') {\n continue\n }\n if (child.type === 'footnoteDefinition') {\n footnotes.push(child)\n transform(child)\n continue\n }\n if (child.type === 'linkReference') {\n const { url = '', title } = definitions.get(child.identifier) ?? {}\n const link = { type: 'link', url, title, children: child.children } as const\n transform(link)\n children.push(link)\n continue\n }\n if (child.type === 'imageReference') {\n const { url = '', title } = definitions.get(child.identifier) ?? {}\n children.push({ type: 'image', url, title, alt: child.alt })\n continue\n }\n transform(child)\n if (child.type === 'listItem' && isTight(node)) {\n child.children = child.children.flatMap((content) =>\n content.type === 'paragraph' ? (content.children as typeof child.children) : [content]\n )\n }\n children.push(child)\n }\n const hasHtml = children.some((child): child is Html => child.type === 'html')\n node.children = (hasHtml && !blockParents.has(node.type) ? pairTags(children) : children) as typeof node.children\n }\n transform(tree)\n\n if (footnotes.length) {\n // Each footnote ends with a link back to where the text refers to it, as GitHub's do.\n for (const footnote of footnotes) {\n const back: NbMarkdownFootnoteBack = { type: 'nbFootnoteBack', identifier: footnote.identifier }\n const last = footnote.children.at(-1)\n if (last?.type === 'paragraph') {\n last.children.push(back)\n } else {\n footnote.children.push({ type: 'paragraph', children: [back] })\n }\n }\n tree.children.push({ type: 'nbFootnotes', children: footnotes })\n }\n return tree\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 viewer. `provideNbTexts({ markdownViewer: { ... } })` changes them, and they're translated\n * with Angular's i18n, as `$localize` messages with ids like `@@nb.markdownViewer.footnotes`.\n */\nexport interface NbMarkdownViewerTexts {\n /** Names the footnotes at the end of the text. */\n footnotes: string\n /** Names the link at the end of a footnote back to where the text refers to it. */\n backToText: string\n}\n\ndeclare module '@liquid-js/lyr-core' {\n interface NbTexts {\n markdownViewer: NbMarkdownViewerTexts\n }\n}\n\n/** @internal */\nexport function injectNbMarkdownViewerTexts() {\n return injectNbTexts('markdownViewer', () => ({\n footnotes: $localize`:@@nb.markdownViewer.footnotes:Footnotes`,\n backToText: $localize`:@@nb.markdownViewer.backToText:Back to the text`\n }))\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n ElementRef,\n inject,\n input,\n TemplateRef,\n viewChild,\n viewChildren,\n ViewEncapsulation\n} from '@angular/core'\nimport type { Node, Root } from 'mdast'\nimport { RemarkNodeComponent, RemarkTemplateDirective, RemarkTemplatesService } from 'ngx-remark'\nimport { HighlightDirective, NXT_HIGHLIGHT_OPTIONS } from 'nxt-highlightjs'\nimport { remark } from 'remark'\nimport remarkGfm from 'remark-gfm'\nimport remarkSmartypants from 'remark-smartypants'\n\nimport { prepareTree } from './markdown-tree'\nimport { injectNbMarkdownViewerTexts } from './texts'\n\n/** A unified processor that parses markdown, with its plugins, e.g. `remark().use(remarkGfm)`. */\nexport interface NbMarkdownProcessor {\n parse(markdown: string): Node\n runSync(tree: Node): Node\n}\n\n/** Typographic characters for the plain ones the markdown editor's Format button writes: `--` and `---` are dashes. */\nconst typography = { dashes: 'oldschool' } as const\n\nconst defaultProcessor: NbMarkdownProcessor = remark().use(remarkGfm).use(remarkSmartypants, typography).freeze()\n\n/** HTML elements the markdown can use in a line of text, without their attributes. */\nconst htmlElements = new Set([\n 'abbr',\n 'b',\n 'br',\n 'cite',\n 'code',\n 'del',\n 'em',\n 'i',\n 'ins',\n 'kbd',\n 'mark',\n 's',\n 'samp',\n 'small',\n 'span',\n 'strong',\n 'sub',\n 'sup',\n 'u',\n 'var',\n 'wbr'\n])\n\nconst blockParents = new Set(['root', 'blockquote', 'listItem', 'footnoteDefinition'])\n\nlet nextId = 0\n\n/**\n * Shows markdown, in the theme's text styles:\n *\n * ```html\n * <nb-markdown-viewer [markdown]=\"text\" />\n * ```\n *\n * @stacked-example(Showcase, markdown/markdown-viewer-showcase.component)\n *\n * ### Installation\n *\n * It renders the markdown with Angular's templates through [`ngx-remark`](https://www.npmjs.com/package/ngx-remark),\n * which parses it with [`remark`](https://remark.js.org), [`remark-gfm`](https://www.npmjs.com/package/remark-gfm) and\n * [`remark-smartypants`](https://www.npmjs.com/package/remark-smartypants), and highlights code with\n * [`nxt-highlightjs`](https://www.npmjs.com/package/nxt-highlightjs); install them and import\n * `NbMarkdownViewerComponent` from `@liquid-js/lyr-extras/markdown-viewer`.\n *\n * ```sh\n * npm install ngx-remark remark remark-gfm remark-smartypants nxt-highlightjs highlight.js\n * ```\n *\n * `remark` uses a CommonJS module, `extend`, which Angular's build warns about unless it's in\n * `allowedCommonJsDependencies` in `angular.json`.\n *\n * ### Usage\n *\n * The markdown is CommonMark with GitHub's extensions: tables, task lists, strikethrough, autolinks and footnotes. It\n * renders as the editor's preview shows it, on the server too, so a prerendered page has the text before scripts run.\n * The text's straight quotes, `--`, `---` and `...` show as typographic quotes, en and em dashes and ellipses, so the\n * markdown can keep the plain characters that the editor's Format button writes; code shows them as they are.\n *\n * HTML blocks in the markdown are sanitized by Angular. In a line of text, only formatting elements such as `<kbd>`,\n * `<sup>` or `<mark>` apply, without their attributes.\n *\n * Each element is rendered by an Angular template, which a template of your own can replace, e.g. to render links\n * with the router or code with a highlighter. Import `RemarkModule` from `ngx-remark`, and put the templates in the\n * viewer, named by the [type of node](https://github.com/syntax-tree/mdast#nodes) they render; `[remarkNode]` renders\n * the node's content in an element, or `<remark-node [remarkNode]=\"node\" />` in a component:\n *\n * ```html\n * <nb-markdown-viewer [markdown]=\"text\">\n * <a *remarkTemplate=\"'link'; let node\" [routerLink]=\"node.url\" [remarkNode]=\"node\"></a>\n * </nb-markdown-viewer>\n * ```\n * @stacked-example(Templates, markdown/markdown-viewer-templates.component)\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`, as in the editor: each block of the document, i.e. a paragraph, heading, list, quote, table,\n * HTML block or the footnotes, takes the direction of its own text, as `dir=\"auto\"` does. Blocks in a quote or a list\n * share its direction, and code blocks read left to right. Templates of your own render their elements as they are, so\n * they need `dir=\"auto\"` themselves.\n *\n * `processor` replaces the parser, e.g. to add remark plugins, whose new types of nodes need templates of their own.\n *\n * ### Code highlighting\n *\n * Code blocks are highlighted in the theme's colours once the app loads highlight.js, with the languages it uses:\n *\n * ```ts\n * import { provideHighlightOptions } from 'nxt-highlightjs';\n *\n * provideHighlightOptions({\n * coreLibraryLoader: () => import('highlight.js/lib/core').then((m) => m.default),\n * languages: {\n * typescript: () => import('highlight.js/lib/languages/typescript').then((m) => m.default),\n * xml: () => import('highlight.js/lib/languages/xml').then((m) => m.default),\n * },\n * });\n * ```\n *\n * Code in other languages, or without one, shows as plain text. The server waits for highlight.js, so a prerendered\n * page has highlighted code. `nb-markdown-editor` highlights its preview and WYSIWYG code the same way.\n */\n@Component({\n selector: 'nb-markdown-viewer',\n templateUrl: './markdown-viewer.component.html',\n styleUrl: './markdown-viewer.component.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [RemarkTemplatesService],\n imports: [RemarkNodeComponent, RemarkTemplateDirective, HighlightDirective],\n host: {\n class: 'nb-markdown'\n }\n})\nexport class NbMarkdownViewerComponent {\n /** The markdown to show. */\n readonly markdown = input('')\n /** Parses the markdown, `remark().use(remarkGfm).use(remarkSmartypants, { dashes: 'oldschool' })` by default. */\n readonly processor = input<NbMarkdownProcessor>()\n /**\n * Gives each block of the document, e.g. a paragraph or a list, the direction of its own text (`dir=\"auto\"`), for\n * text in more than one direction; `false` by default.\n */\n readonly autoDirection = input(false, { transform: booleanAttribute })\n\n /** The markdown's syntax tree, as its templates render it. */\n readonly tree = computed(() => {\n const processor = this.processor() ?? defaultProcessor\n return prepareTree(processor.runSync(processor.parse(this.markdown())) as Root)\n })\n\n protected readonly id = `nb-markdown-${nextId++}`\n protected readonly texts = injectNbMarkdownViewerTexts()\n protected readonly htmlElements = htmlElements\n protected readonly blockParents = blockParents\n protected readonly element = inject<ElementRef<HTMLElement>>(ElementRef)\n /** Whether the app loads highlight.js for code, the same on the server and in the browser. */\n protected readonly highlighting = !!inject(NXT_HIGHLIGHT_OPTIONS, { optional: true })\n protected readonly defaultTemplates = viewChildren(RemarkTemplateDirective)\n protected readonly customTemplates = contentChildren(RemarkTemplateDirective)\n protected readonly fallback = viewChild.required<TemplateRef<unknown>>('fallback')\n\n constructor() {\n // A node without a template, e.g. of a plugin, shows its content.\n inject(RemarkTemplatesService).templates = computed(() => {\n const templates: Record<string, TemplateRef<unknown> | undefined> = {}\n for (const template of [...this.defaultTemplates(), ...this.customTemplates()]) {\n templates[template.nodeType()] = template.template\n }\n const fallback = this.fallback()\n return new Proxy(templates, { get: (target, type: string) => target[type] ?? fallback })\n })\n }\n\n /** `auto` for a block of the document, with `autoDirection`, which a block in a quote or a list shares. */\n protected direction(parent: Node) {\n return this.autoDirection() && parent.type === 'root' ? 'auto' : null\n }\n\n protected footnoteId(identifier: string, reference = false) {\n return `${this.id}-${reference ? 'fnref' : 'fn'}-${identifier}`\n }\n\n /** Moves to a footnote in the page, whose address the document's base would otherwise change. */\n protected showFootnote(event: Event, id: string) {\n const target = this.element.nativeElement.querySelector<HTMLElement>(`#${CSS.escape(id)}`)\n if (target) {\n event.preventDefault()\n target.scrollIntoView()\n }\n }\n}\n","<div class=\"uf-contents\"\n [remarkNode]=\"tree()\"></div>\n\n<ng-template #fallback\n let-node>\n @if (node.children) {\n <remark-node [remarkNode]=\"node\" />\n }\n</ng-template>\n\n<!-- Blocks -->\n\n<p *remarkTemplate=\"'paragraph'; let node; let parent = parent\"\n [attr.dir]=\"direction(parent)\"\n [remarkNode]=\"node\"></p>\n\n<ng-template remarkTemplate=\"heading\"\n let-node\n let-parent=\"parent\">\n @let dir = direction(parent);\n @switch (node.depth) {\n @case (1) {\n <h1 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h1>\n }\n @case (2) {\n <h2 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h2>\n }\n @case (3) {\n <h3 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h3>\n }\n @case (4) {\n <h4 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h4>\n }\n @case (5) {\n <h5 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h5>\n }\n @default {\n <h6 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h6>\n }\n }\n</ng-template>\n\n<blockquote *remarkTemplate=\"'blockquote'; let node; let parent = parent\"\n [attr.dir]=\"direction(parent)\"\n [remarkNode]=\"node\"></blockquote>\n\n<ng-template remarkTemplate=\"list\"\n let-node\n let-parent=\"parent\">\n @if (node.ordered) {\n <ol [remarkNode]=\"node\"\n [attr.dir]=\"direction(parent)\"\n [attr.start]=\"node.start === 1 ? null : node.start\"></ol>\n } @else {\n <ul [attr.dir]=\"direction(parent)\"\n [remarkNode]=\"node\"></ul>\n }\n</ng-template>\n\n<ng-template remarkTemplate=\"listItem\"\n let-node>\n @if (node.checked === true || node.checked === false) {\n <li class=\"task-list-item\"\n [class.checked]=\"node.checked\">\n <!-- The state for assistive technology; the box is drawn in the item's styles. -->\n <input type=\"checkbox\"\n class=\"visually-hidden\"\n disabled\n [checked]=\"node.checked\" />\n <remark-node [remarkNode]=\"node\" />\n </li>\n } @else {\n <li [remarkNode]=\"node\"></li>\n }\n</ng-template>\n\n<ng-template remarkTemplate=\"code\"\n let-node>\n @if (highlighting) {\n <pre><code [nxtHighlight]=\"node.value\" [language]=\"node.lang ?? undefined\" [attr.data-language]=\"node.lang\"></code></pre>\n } @else {\n <pre><code [attr.data-language]=\"node.lang\">{{ node.value }}</code></pre>\n }\n</ng-template>\n\n<hr *remarkTemplate=\"'thematicBreak'\" />\n\n<ng-template remarkTemplate=\"html\"\n let-node\n let-parent=\"parent\">\n <!-- Tags in a line of text that aren't paired into an element are left out. -->\n @if (blockParents.has(parent.type)) {\n <div [attr.dir]=\"direction(parent)\"\n [innerHTML]=\"node.value\"></div>\n }\n</ng-template>\n\n<table *remarkTemplate=\"'table'; let node; let parent = parent\"\n [attr.dir]=\"direction(parent)\">\n <thead>\n @if (node.children[0]; as row) {\n <tr>\n @for (cell of row.children; track $index) {\n <th [remarkNode]=\"cell\"\n [style.text-align]=\"node.align?.[$index]\"></th>\n }\n </tr>\n }\n </thead>\n <tbody>\n @for (row of node.children.slice(1); track $index) {\n <tr>\n @for (cell of row.children; track $index) {\n <td [remarkNode]=\"cell\"\n [style.text-align]=\"node.align?.[$index]\"></td>\n }\n </tr>\n }\n </tbody>\n</table>\n\n<section *remarkTemplate=\"'nbFootnotes'; let node; let parent = parent\"\n class=\"nb-markdown-footnotes\"\n [attr.aria-label]=\"texts().footnotes\"\n [attr.dir]=\"direction(parent)\">\n <hr />\n <ol [remarkNode]=\"node\"></ol>\n</section>\n\n<!-- The way back from a footnote to its reference, after its text. -->\n<ng-template remarkTemplate=\"nbFootnoteBack\"\n let-node><a class=\"nb-markdown-footnote-back\"\n [href]=\"'#' + footnoteId(node.identifier, true)\"\n [attr.aria-label]=\"texts().backToText\"\n (click)=\"showFootnote($event, footnoteId(node.identifier, true))\">↩&#xFE0E;</a></ng-template>\n\n<li *remarkTemplate=\"'footnoteDefinition'; let node\"\n [id]=\"footnoteId(node.identifier)\"\n [remarkNode]=\"node\"></li>\n\n<!-- Text -->\n\n<ng-container *remarkTemplate=\"'text'; let node\">{{ node.value }}</ng-container>\n\n<em *remarkTemplate=\"'emphasis'; let node\"\n [remarkNode]=\"node\"></em>\n\n<strong *remarkTemplate=\"'strong'; let node\"\n [remarkNode]=\"node\"></strong>\n\n<del *remarkTemplate=\"'delete'; let node\"\n [remarkNode]=\"node\"></del>\n\n<code *remarkTemplate=\"'inlineCode'; let node\">{{ node.value }}</code>\n\n<br *remarkTemplate=\"'break'\" />\n\n<a *remarkTemplate=\"'link'; let node\"\n [href]=\"node.url\"\n [attr.title]=\"node.title\"\n [remarkNode]=\"node\"></a>\n\n<img *remarkTemplate=\"'image'; let node\"\n [src]=\"node.url\"\n [alt]=\"node.alt ?? ''\"\n [attr.title]=\"node.title\" />\n\n<sup *remarkTemplate=\"'footnoteReference'; let node\">\n <a [id]=\"footnoteId(node.identifier, true)\"\n [href]=\"'#' + footnoteId(node.identifier)\"\n (click)=\"showFootnote($event, footnoteId(node.identifier))\">{{ node.label }}</a>\n</sup>\n\n<ng-template remarkTemplate=\"nbHtmlElement\"\n let-node>\n @switch (htmlElements.has(node.tagName) ? node.tagName : '') {\n @case ('abbr') {\n <abbr [remarkNode]=\"node\"></abbr>\n }\n @case ('b') {\n <b [remarkNode]=\"node\"></b>\n }\n @case ('br') {\n <br />\n }\n @case ('cite') {\n <cite [remarkNode]=\"node\"></cite>\n }\n @case ('code') {\n <code [remarkNode]=\"node\"></code>\n }\n @case ('del') {\n <del [remarkNode]=\"node\"></del>\n }\n @case ('em') {\n <em [remarkNode]=\"node\"></em>\n }\n @case ('i') {\n <i [remarkNode]=\"node\"></i>\n }\n @case ('ins') {\n <ins [remarkNode]=\"node\"></ins>\n }\n @case ('kbd') {\n <kbd [remarkNode]=\"node\"></kbd>\n }\n @case ('mark') {\n <mark [remarkNode]=\"node\"></mark>\n }\n @case ('s') {\n <s [remarkNode]=\"node\"></s>\n }\n @case ('samp') {\n <samp [remarkNode]=\"node\"></samp>\n }\n @case ('small') {\n <small [remarkNode]=\"node\"></small>\n }\n @case ('span') {\n <span [remarkNode]=\"node\"></span>\n }\n @case ('strong') {\n <strong [remarkNode]=\"node\"></strong>\n }\n @case ('sub') {\n <sub [remarkNode]=\"node\"></sub>\n }\n @case ('sup') {\n <sup [remarkNode]=\"node\"></sup>\n }\n @case ('u') {\n <u [remarkNode]=\"node\"></u>\n }\n @case ('var') {\n <var [remarkNode]=\"node\"></var>\n }\n @case ('wbr') {\n <wbr />\n }\n @default {\n <remark-node [remarkNode]=\"node\" />\n }\n }\n</ng-template>\n"],"mapp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AAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"liquid-js-lyr-extras-markdown-viewer.mjs","names":[],"sources":["../../../packages/extras/markdown-viewer/src/markdown-viewer.component.ts","../../../packages/extras/markdown-renderer/src/markdown-renderer.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, ViewEncapsulation } from '@angular/core'\nimport { NbMarkdownProcessor, NbMarkdownRendering } from '@liquid-js/lyr-extras/markdown-renderer'\nimport { RemarkNodeComponent, RemarkTemplateDirective, RemarkTemplatesService } from 'ngx-remark'\nimport { HighlightDirective } from 'nxt-highlightjs'\nimport { remark } from 'remark'\nimport remarkGfm from 'remark-gfm'\nimport remarkSmartypants from 'remark-smartypants'\n\n/** Typographic characters for the plain ones the markdown editor's Format button writes: `--` and `---` are dashes. */\nconst typography = { dashes: 'oldschool' } as const\n\nconst defaultProcessor: NbMarkdownProcessor = remark().use(remarkGfm).use(remarkSmartypants, typography).freeze()\n\n/**\n * Shows markdown, in the theme's text styles:\n *\n * ```html\n * <nb-markdown-viewer [markdown]=\"text\" />\n * ```\n *\n * @stacked-example(Showcase, markdown/markdown-viewer-showcase.component)\n *\n * ### Installation\n *\n * It renders the markdown with Angular's templates through [`ngx-remark`](https://www.npmjs.com/package/ngx-remark),\n * which parses it with [`remark`](https://remark.js.org), [`remark-gfm`](https://www.npmjs.com/package/remark-gfm) and\n * [`remark-smartypants`](https://www.npmjs.com/package/remark-smartypants), and highlights code with\n * [`nxt-highlightjs`](https://www.npmjs.com/package/nxt-highlightjs); install them and import\n * `NbMarkdownViewerComponent` from `@liquid-js/lyr-extras/markdown-viewer`.\n *\n * ```sh\n * npm install ngx-remark remark remark-gfm remark-smartypants nxt-highlightjs highlight.js\n * ```\n *\n * `remark` uses a CommonJS module, `extend`, which Angular's build warns about unless it's in\n * `allowedCommonJsDependencies` in `angular.json`.\n *\n * ### Usage\n *\n * The markdown is CommonMark with GitHub's extensions: tables, task lists, strikethrough, autolinks and footnotes. It\n * renders as the editor's preview shows it, on the server too, so a prerendered page has the text before scripts run.\n * The text's straight quotes, `--`, `---` and `...` show as typographic quotes, en and em dashes and ellipses, so the\n * markdown can keep the plain characters that the editor's Format button writes; code shows them as they are.\n *\n * HTML blocks in the markdown are sanitized by Angular. In a line of text, only formatting elements such as `<kbd>`,\n * `<sup>` or `<mark>` apply, without their attributes.\n *\n * Each element is rendered by an Angular template, which a template of your own can replace, e.g. to render links\n * with the router or code with a highlighter. Import `RemarkModule` from `ngx-remark`, and put the templates in the\n * viewer, named by the [type of node](https://github.com/syntax-tree/mdast#nodes) they render; `[remarkNode]` renders\n * the node's content in an element, or `<remark-node [remarkNode]=\"node\" />` in a component:\n *\n * ```html\n * <nb-markdown-viewer [markdown]=\"text\">\n * <a *remarkTemplate=\"'link'; let node\" [routerLink]=\"node.url\" [remarkNode]=\"node\"></a>\n * </nb-markdown-viewer>\n * ```\n * @stacked-example(Templates, markdown/markdown-viewer-templates.component)\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`, as in the editor: each block of the document, i.e. a paragraph, heading, list, quote, table,\n * HTML block or the footnotes, takes the direction of its own text, as `dir=\"auto\"` does. Blocks in a quote or a list\n * share its direction, and code blocks read left to right. Templates of your own render their elements as they are, so\n * they need `dir=\"auto\"` themselves.\n *\n * `processor` replaces the parser, e.g. to add remark plugins, whose new types of nodes need templates of their own.\n * An app with a processor and content styles of its own can use `nb-markdown-renderer` instead, which renders the same\n * way without loading the default processor's packages or these styles.\n *\n * ### Code highlighting\n *\n * Code blocks are highlighted in the theme's colours once the app loads highlight.js, with the languages it uses:\n *\n * ```ts\n * import { provideHighlightOptions } from 'nxt-highlightjs';\n *\n * provideHighlightOptions({\n * coreLibraryLoader: () => import('highlight.js/lib/core').then((m) => m.default),\n * languages: {\n * typescript: () => import('highlight.js/lib/languages/typescript').then((m) => m.default),\n * xml: () => import('highlight.js/lib/languages/xml').then((m) => m.default),\n * },\n * });\n * ```\n *\n * Code in other languages, or without one, shows as plain text. The server waits for highlight.js, so a prerendered\n * page has highlighted code. `nb-markdown-editor` highlights its preview and WYSIWYG code the same way.\n */\n@Component({\n selector: 'nb-markdown-viewer',\n // The renderer's templates, so both render the markdown the same way.\n templateUrl: '../../markdown-renderer/src/markdown-renderer.component.html',\n styleUrl: './markdown-viewer.component.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [RemarkTemplatesService],\n imports: [RemarkNodeComponent, RemarkTemplateDirective, HighlightDirective],\n host: {\n class: 'nb-markdown'\n }\n})\nexport class NbMarkdownViewerComponent extends NbMarkdownRendering {\n /** Parses the markdown, `remark().use(remarkGfm).use(remarkSmartypants, { dashes: 'oldschool' })` by default. */\n readonly processor = input<NbMarkdownProcessor>()\n\n protected parser() {\n return this.processor() ?? defaultProcessor\n }\n}\n","<div class=\"uf-contents\"\n [remarkNode]=\"tree()\"></div>\n\n<ng-template #fallback\n let-node>\n @if (node.children) {\n <remark-node [remarkNode]=\"node\" />\n }\n</ng-template>\n\n<!-- Blocks -->\n\n<p *remarkTemplate=\"'paragraph'; let node; let parent = parent\"\n [attr.dir]=\"direction(parent)\"\n [remarkNode]=\"node\"></p>\n\n<ng-template remarkTemplate=\"heading\"\n let-node\n let-parent=\"parent\">\n @let dir = direction(parent);\n @switch (node.depth) {\n @case (1) {\n <h1 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h1>\n }\n @case (2) {\n <h2 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h2>\n }\n @case (3) {\n <h3 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h3>\n }\n @case (4) {\n <h4 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h4>\n }\n @case (5) {\n <h5 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h5>\n }\n @default {\n <h6 [attr.dir]=\"dir\"\n [remarkNode]=\"node\"></h6>\n }\n }\n</ng-template>\n\n<blockquote *remarkTemplate=\"'blockquote'; let node; let parent = parent\"\n [attr.dir]=\"direction(parent)\"\n [remarkNode]=\"node\"></blockquote>\n\n<ng-template remarkTemplate=\"list\"\n let-node\n let-parent=\"parent\">\n @if (node.ordered) {\n <ol [remarkNode]=\"node\"\n [attr.dir]=\"direction(parent)\"\n [attr.start]=\"node.start === 1 ? null : node.start\"></ol>\n } @else {\n <ul [attr.dir]=\"direction(parent)\"\n [remarkNode]=\"node\"></ul>\n }\n</ng-template>\n\n<ng-template remarkTemplate=\"listItem\"\n let-node>\n @if (node.checked === true || node.checked === false) {\n <li class=\"task-list-item\"\n [class.checked]=\"node.checked\">\n <!-- The state for assistive technology; the box is drawn in the item's styles. -->\n <input type=\"checkbox\"\n class=\"visually-hidden\"\n disabled\n [checked]=\"node.checked\" />\n <remark-node [remarkNode]=\"node\" />\n </li>\n } @else {\n <li [remarkNode]=\"node\"></li>\n }\n</ng-template>\n\n<ng-template remarkTemplate=\"code\"\n let-node>\n @if (highlighting) {\n <pre><code [nxtHighlight]=\"node.value\" [language]=\"node.lang ?? undefined\" [attr.data-language]=\"node.lang\"></code></pre>\n } @else {\n <pre><code [attr.data-language]=\"node.lang\">{{ node.value }}</code></pre>\n }\n</ng-template>\n\n<hr *remarkTemplate=\"'thematicBreak'\" />\n\n<ng-template remarkTemplate=\"html\"\n let-node\n let-parent=\"parent\">\n <!-- Tags in a line of text that aren't paired into an element are left out. -->\n @if (blockParents.has(parent.type)) {\n <div [attr.dir]=\"direction(parent)\"\n [innerHTML]=\"node.value\"></div>\n }\n</ng-template>\n\n<table *remarkTemplate=\"'table'; let node; let parent = parent\"\n [attr.dir]=\"direction(parent)\">\n <thead>\n @if (node.children[0]; as row) {\n <tr>\n @for (cell of row.children; track $index) {\n <th [remarkNode]=\"cell\"\n [style.text-align]=\"node.align?.[$index]\"></th>\n }\n </tr>\n }\n </thead>\n <tbody>\n @for (row of node.children.slice(1); track $index) {\n <tr>\n @for (cell of row.children; track $index) {\n <td [remarkNode]=\"cell\"\n [style.text-align]=\"node.align?.[$index]\"></td>\n }\n </tr>\n }\n </tbody>\n</table>\n\n<section *remarkTemplate=\"'nbFootnotes'; let node; let parent = parent\"\n class=\"nb-markdown-footnotes\"\n [attr.aria-label]=\"texts().footnotes\"\n [attr.dir]=\"direction(parent)\">\n <hr />\n <ol [remarkNode]=\"node\"></ol>\n</section>\n\n<!-- The way back from a footnote to its reference, after its text. -->\n<ng-template remarkTemplate=\"nbFootnoteBack\"\n let-node><a class=\"nb-markdown-footnote-back\"\n [href]=\"'#' + footnoteId(node.identifier, true)\"\n [attr.aria-label]=\"texts().backToText\"\n (click)=\"showFootnote($event, footnoteId(node.identifier, true))\">↩&#xFE0E;</a></ng-template>\n\n<li *remarkTemplate=\"'footnoteDefinition'; let node\"\n [id]=\"footnoteId(node.identifier)\"\n [remarkNode]=\"node\"></li>\n\n<!-- Text -->\n\n<ng-container *remarkTemplate=\"'text'; let node\">{{ node.value }}</ng-container>\n\n<em *remarkTemplate=\"'emphasis'; let node\"\n [remarkNode]=\"node\"></em>\n\n<strong *remarkTemplate=\"'strong'; let node\"\n [remarkNode]=\"node\"></strong>\n\n<del *remarkTemplate=\"'delete'; let node\"\n [remarkNode]=\"node\"></del>\n\n<code *remarkTemplate=\"'inlineCode'; let node\">{{ node.value }}</code>\n\n<br *remarkTemplate=\"'break'\" />\n\n<a *remarkTemplate=\"'link'; let node\"\n [href]=\"node.url\"\n [attr.title]=\"node.title\"\n [remarkNode]=\"node\"></a>\n\n<img *remarkTemplate=\"'image'; let node\"\n [src]=\"node.url\"\n [alt]=\"node.alt ?? ''\"\n [attr.title]=\"node.title\" />\n\n<sup *remarkTemplate=\"'footnoteReference'; let node\">\n <a [id]=\"footnoteId(node.identifier, true)\"\n [href]=\"'#' + footnoteId(node.identifier)\"\n (click)=\"showFootnote($event, footnoteId(node.identifier))\">{{ node.label }}</a>\n</sup>\n\n<ng-template remarkTemplate=\"nbHtmlElement\"\n let-node>\n @switch (htmlElements.has(node.tagName) ? node.tagName : '') {\n @case ('abbr') {\n <abbr [remarkNode]=\"node\"></abbr>\n }\n @case ('b') {\n <b [remarkNode]=\"node\"></b>\n }\n @case ('br') {\n <br />\n }\n @case ('cite') {\n <cite [remarkNode]=\"node\"></cite>\n }\n @case ('code') {\n <code [remarkNode]=\"node\"></code>\n }\n @case ('del') {\n <del [remarkNode]=\"node\"></del>\n }\n @case ('em') {\n <em [remarkNode]=\"node\"></em>\n }\n @case ('i') {\n <i [remarkNode]=\"node\"></i>\n }\n @case ('ins') {\n <ins [remarkNode]=\"node\"></ins>\n }\n @case ('kbd') {\n <kbd [remarkNode]=\"node\"></kbd>\n }\n @case ('mark') {\n <mark [remarkNode]=\"node\"></mark>\n }\n @case ('s') {\n <s [remarkNode]=\"node\"></s>\n }\n @case ('samp') {\n <samp [remarkNode]=\"node\"></samp>\n }\n @case ('small') {\n <small [remarkNode]=\"node\"></small>\n }\n @case ('span') {\n <span [remarkNode]=\"node\"></span>\n }\n @case ('strong') {\n <strong [remarkNode]=\"node\"></strong>\n }\n @case ('sub') {\n <sub [remarkNode]=\"node\"></sub>\n }\n @case ('sup') {\n <sup [remarkNode]=\"node\"></sup>\n }\n @case ('u') {\n <u [remarkNode]=\"node\"></u>\n }\n @case ('var') {\n <var [remarkNode]=\"node\"></var>\n }\n @case ('wbr') {\n <wbr />\n }\n @default {\n <remark-node [remarkNode]=\"node\" />\n }\n }\n</ng-template>\n"],"mappings":";;;;;;;;AAWA,MAAM,mBAAwC,OAAM,CAAE,CAAC,IAAI,SAAS,CAAC,CAAC,IAAI,mBAAmB,EAFxE,QAAQ,YAEgE,CAAU,CAAC,CAAC,OAAM;AA0F/G,IAAa,4BAAb,MAAa,kCAAkC,oBAAmB;CAblE,cAAA;;EAea,KAAA,YAAY,MAA4B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAKpD;CAHa,SAAM;EACZ,OAAO,KAAK,UAAS,KAAM;CAC/B;CANS;E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0-alpha.4",
7
+ "version": "22.0.0-alpha.5",
8
8
  "license": "MIT",
9
9
  "author": "HitkoDev <development@hitko.si>",
10
10
  "type": "module",
@@ -113,8 +113,6 @@
113
113
  }
114
114
  },
115
115
  "sideEffects": false,
116
- "module": "fesm2022/liquid-js-lyr-extras.mjs",
117
- "typings": "types/liquid-js-lyr-extras.d.ts",
118
116
  "exports": {
119
117
  "./package.json": {
120
118
  "default": "./package.json"
@@ -135,6 +133,10 @@
135
133
  "types": "./types/liquid-js-lyr-extras-markdown-editor.d.ts",
136
134
  "default": "./fesm2022/liquid-js-lyr-extras-markdown-editor.mjs"
137
135
  },
136
+ "./markdown-renderer": {
137
+ "types": "./types/liquid-js-lyr-extras-markdown-renderer.d.ts",
138
+ "default": "./fesm2022/liquid-js-lyr-extras-markdown-renderer.mjs"
139
+ },
138
140
  "./markdown-viewer": {
139
141
  "types": "./types/liquid-js-lyr-extras-markdown-viewer.d.ts",
140
142
  "default": "./fesm2022/liquid-js-lyr-extras-markdown-viewer.mjs"
@@ -156,6 +158,8 @@
156
158
  "default": "./fesm2022/liquid-js-lyr-extras-qr-code.mjs"
157
159
  }
158
160
  },
161
+ "module": "fesm2022/liquid-js-lyr-extras.mjs",
162
+ "typings": "types/liquid-js-lyr-extras.d.ts",
159
163
  "dependencies": {
160
164
  "tslib": "^2.9.1"
161
165
  }