@foblex/m-render 2.6.4 → 2.6.6
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.
- package/LICENSE +3 -0
- package/README.md +164 -19
- package/assets/styles/_code-group.scss +4 -0
- package/assets/styles/_code-highlight.scss +4 -0
- package/assets/styles/_table.scss +51 -0
- package/assets/styles/styles.scss +1 -0
- package/fesm2022/foblex-m-render.mjs +111 -182
- package/fesm2022/foblex-m-render.mjs.map +1 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/highlight.service.d.ts +5 -6
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/index.d.ts +0 -2
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/mark-code-focused-blocks.post-processor.d.ts +0 -2
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/index.d.ts +1 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-angular-example-with-code-links.d.ts +2 -8
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-grouped-code-items.d.ts +0 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-preview-group.d.ts +0 -2
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-single-code-item.d.ts +0 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/utils.d.ts +10 -0
- package/package.json +1 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/change-code-focused-syntax.pre-processor.d.ts +0 -7
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/modify-punctuation-highlight.post-processor.d.ts +0 -6
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/utils/get-content.d.ts +0 -2
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/utils/index.d.ts +0 -1
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { EventEmitter, booleanAttribute, HostListener, Input, ViewChild, Output, ChangeDetectionStrategy, Component, input, output, viewChild, InjectionToken, inject, signal, Injectable, Renderer2, ElementRef, NgZone, Directive, ChangeDetectorRef, DestroyRef, computed, ViewContainerRef, forwardRef, Injector, effect, untracked } from '@angular/core';
|
3
3
|
import { BrowserService, F_LOCAL_STORAGE } from '@foblex/platform';
|
4
|
-
import { Subject, of, map, from, switchMap, startWith, filter, Observable, EMPTY, debounceTime, fromEvent } from 'rxjs';
|
4
|
+
import { Subject, of, map, from, switchMap, startWith, filter, defer, Observable, EMPTY, debounceTime, fromEvent } from 'rxjs';
|
5
5
|
import { HttpClient } from '@angular/common/http';
|
6
|
-
import { catchError, tap, filter as filter$1, take } from 'rxjs/operators';
|
6
|
+
import { catchError, tap, filter as filter$1, shareReplay, take } from 'rxjs/operators';
|
7
7
|
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
8
8
|
import { Overlay, CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
9
9
|
import { Router, RouterLink, NavigationEnd, ActivatedRoute, RouterOutlet } from '@angular/router';
|
@@ -1012,68 +1012,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
1012
1012
|
}, template: "@for (data of data(); track data) {\n <button class=\"f-tab-button\" [class.active]=\"$index === index()\"\n (click)=\"onTabClick($index)\">\n {{ data.tab }}\n </button>\n}\n" }]
|
1013
1013
|
}] });
|
1014
1014
|
|
1015
|
-
class ChangeCodeFocusedSyntaxPreProcessor {
|
1016
|
-
handle(element) {
|
1017
|
-
this._getCodeBlocks(element).forEach((block) => {
|
1018
|
-
block.innerHTML = this._replaceFocus(block.innerHTML);
|
1019
|
-
});
|
1020
|
-
return of(element);
|
1021
|
-
}
|
1022
|
-
_getCodeBlocks(element) {
|
1023
|
-
return Array.from(element.querySelectorAll('pre code'));
|
1024
|
-
}
|
1025
|
-
_replaceFocus(text) {
|
1026
|
-
return text.replace(RULE$2.regex, RULE$2.replacer);
|
1027
|
-
}
|
1028
|
-
}
|
1029
|
-
const RULE$2 = {
|
1030
|
-
regex: /\|:\|(.*?)\|:\|/g,
|
1031
|
-
replacer: (match, p1) => {
|
1032
|
-
return `|foc-|${p1}|-foc|`;
|
1033
|
-
},
|
1034
|
-
};
|
1035
|
-
|
1036
|
-
class ModifyPunctuationHighlightPostProcessor {
|
1037
|
-
handle(element) {
|
1038
|
-
element.querySelectorAll('span.token.attr-name').forEach((node) => {
|
1039
|
-
const text = node.textContent;
|
1040
|
-
if (text && text.startsWith('[') && text.endsWith(']')) {
|
1041
|
-
node.innerHTML = this._replacePunctuation(text);
|
1042
|
-
}
|
1043
|
-
});
|
1044
|
-
return of(element);
|
1045
|
-
}
|
1046
|
-
_replacePunctuation(text) {
|
1047
|
-
return text.replace(RULE$1.regex, RULE$1.replacer);
|
1048
|
-
}
|
1049
|
-
}
|
1050
|
-
const RULE$1 = {
|
1051
|
-
regex: /(\[|\])/g,
|
1052
|
-
replacer: (match) => {
|
1053
|
-
return `<span class="token punctuation">${match}</span>`;
|
1054
|
-
},
|
1055
|
-
};
|
1056
|
-
|
1057
1015
|
class MarkCodeFocusedBlocksPostProcessor {
|
1058
1016
|
_browser;
|
1059
1017
|
constructor(_browser) {
|
1060
1018
|
this._browser = _browser;
|
1061
1019
|
}
|
1062
1020
|
handle(element) {
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1021
|
+
const html = element.innerHTML;
|
1022
|
+
if (!FOCUS_REGEX.test(html)) {
|
1023
|
+
return of(element);
|
1024
|
+
}
|
1025
|
+
element.innerHTML = html.replace(FOCUS_REGEX, (_match, content) => {
|
1026
|
+
return `<focus class="focused"><div class="inline-focus">${content}</div></focus>`;
|
1068
1027
|
});
|
1028
|
+
const focused = element.querySelector('.focused');
|
1029
|
+
if (focused) {
|
1030
|
+
this._applyOpacity(element.parentElement);
|
1031
|
+
}
|
1069
1032
|
return of(element);
|
1070
1033
|
}
|
1071
|
-
_getCodeBlocks(element) {
|
1072
|
-
return Array.from(element.querySelectorAll('pre code'));
|
1073
|
-
}
|
1074
|
-
_replaceFocus(text) {
|
1075
|
-
return text.replace(RULE.regex, RULE.replacer);
|
1076
|
-
}
|
1077
1034
|
_applyOpacity(element) {
|
1078
1035
|
if (!element.classList.contains('focused')) {
|
1079
1036
|
element.style.color = this._createRgbaString(this._getElementColor(element), 0.5);
|
@@ -1099,12 +1056,7 @@ class MarkCodeFocusedBlocksPostProcessor {
|
|
1099
1056
|
return color.match(/\d+/g);
|
1100
1057
|
}
|
1101
1058
|
}
|
1102
|
-
const
|
1103
|
-
regex: /\|foc-\|(.*?)\|-foc\|/g,
|
1104
|
-
replacer: (match, p1) => {
|
1105
|
-
return `<focus class="focused"><span>${p1}</span></focus>`;
|
1106
|
-
},
|
1107
|
-
};
|
1059
|
+
const FOCUS_REGEX = /ƒƒƒ([\s\S]*?)¢¢¢/g;
|
1108
1060
|
|
1109
1061
|
const UNIVERSAL_THEME = {
|
1110
1062
|
name: 'universal',
|
@@ -1388,42 +1340,36 @@ const UNIVERSAL_THEME = {
|
|
1388
1340
|
};
|
1389
1341
|
|
1390
1342
|
class HighlightService {
|
1391
|
-
_highlighter;
|
1392
1343
|
_browser = inject(BrowserService);
|
1344
|
+
_highlighter$ = defer(() => from(createHighlighter({ themes: [UNIVERSAL_THEME], langs: LANGUAGES }))).pipe(shareReplay(1));
|
1393
1345
|
highlight(element, lang, content) {
|
1394
|
-
|
1346
|
+
if (!this._browser.isBrowser()) {
|
1347
|
+
console.warn('[HighlightService] Skipping highlight on server.');
|
1348
|
+
return of(element);
|
1349
|
+
}
|
1350
|
+
return this._highlightCodeBlock(element, lang, content).pipe(switchMap((x) => this._postProcess(x)), catchError((err) => {
|
1351
|
+
console.error('[HighlightService] Failed to highlight:', err);
|
1352
|
+
return of(element);
|
1353
|
+
}));
|
1395
1354
|
}
|
1396
|
-
|
1355
|
+
_highlightCodeBlock(element, lang, content) {
|
1356
|
+
return this._highlighter$.pipe(switchMap((highlighter) => this._renderCode(element, highlighter, lang, content)));
|
1357
|
+
}
|
1358
|
+
_renderCode(element, highlighter, lang, content) {
|
1397
1359
|
return new Observable((observer) => {
|
1398
|
-
|
1360
|
+
const processedContent = this._preprocessFocus(content);
|
1361
|
+
element.innerHTML = highlighter.codeToHtml(processedContent, { lang, theme: 'universal', defaultColor: false });
|
1362
|
+
requestAnimationFrame(() => {
|
1363
|
+
observer.next(element);
|
1364
|
+
observer.complete();
|
1365
|
+
});
|
1399
1366
|
});
|
1400
1367
|
}
|
1401
|
-
|
1402
|
-
|
1403
|
-
observer.next(element);
|
1404
|
-
observer.complete();
|
1405
|
-
}
|
1406
|
-
_codeToHtml(code, language) {
|
1407
|
-
return this._highlighter?.codeToHtml(code, {
|
1408
|
-
lang: language || 'text',
|
1409
|
-
theme: 'universal',
|
1410
|
-
defaultColor: false,
|
1411
|
-
}) || code;
|
1412
|
-
}
|
1413
|
-
async _loadHighlighter() {
|
1414
|
-
if (!this._highlighter) {
|
1415
|
-
this._highlighter = await createHighlighter({
|
1416
|
-
themes: [UNIVERSAL_THEME], langs: LANGUAGES,
|
1417
|
-
});
|
1418
|
-
}
|
1419
|
-
return this._highlighter;
|
1368
|
+
_preprocessFocus(code) {
|
1369
|
+
return code.replace(/\|\:\|([\s\S]*?)\|\:\|/g, (_, p1) => `ƒƒƒ${p1}¢¢¢`);
|
1420
1370
|
}
|
1421
|
-
|
1422
|
-
|
1423
|
-
x.classList.add('language-none');
|
1424
|
-
x.innerHTML = x.textContent ?? '';
|
1425
|
-
});
|
1426
|
-
return of(element);
|
1371
|
+
_postProcess(element) {
|
1372
|
+
return of(element).pipe(switchMap((x) => new MarkCodeFocusedBlocksPostProcessor(this._browser).handle(x)));
|
1427
1373
|
}
|
1428
1374
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HighlightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1429
1375
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HighlightService, providedIn: 'root' });
|
@@ -1698,23 +1644,6 @@ var EParsedContainerType;
|
|
1698
1644
|
|
1699
1645
|
const F_PREVIEW_NAVIGATION_PROVIDER = new InjectionToken('F_PREVIEW_NAVIGATION_PROVIDER');
|
1700
1646
|
|
1701
|
-
function getContent(tokens, index, eContainerType) {
|
1702
|
-
let result;
|
1703
|
-
for (let i = index + 1; i < tokens.length; i++) {
|
1704
|
-
if (tokens[i].type === `container_${eContainerType}_close`) {
|
1705
|
-
break;
|
1706
|
-
}
|
1707
|
-
if (isInlineToken(tokens[i])) {
|
1708
|
-
result = tokens[i].content;
|
1709
|
-
break;
|
1710
|
-
}
|
1711
|
-
}
|
1712
|
-
return result;
|
1713
|
-
}
|
1714
|
-
function isInlineToken(token) {
|
1715
|
-
return token.type === 'inline' && !token.tag;
|
1716
|
-
}
|
1717
|
-
|
1718
1647
|
class MarkdownService {
|
1719
1648
|
_markdown = new MarkdownIt({ html: true, linkify: true });
|
1720
1649
|
_httpClient = inject(HttpClient);
|
@@ -1770,13 +1699,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
1770
1699
|
type: Injectable
|
1771
1700
|
}], ctorParameters: () => [] });
|
1772
1701
|
|
1702
|
+
function getContent(tokens, index, eContainerType) {
|
1703
|
+
let result;
|
1704
|
+
for (let i = index + 1; i < tokens.length; i++) {
|
1705
|
+
if (tokens[i].type === `container_${eContainerType}_close`) {
|
1706
|
+
break;
|
1707
|
+
}
|
1708
|
+
if (isInlineToken(tokens[i])) {
|
1709
|
+
result = tokens[i].content;
|
1710
|
+
break;
|
1711
|
+
}
|
1712
|
+
}
|
1713
|
+
return result;
|
1714
|
+
}
|
1715
|
+
function isInlineToken(token) {
|
1716
|
+
return token.type === 'inline' && !token.tag;
|
1717
|
+
}
|
1718
|
+
function encodeDataAttr(data) {
|
1719
|
+
return JSON.stringify(data).replace(/"/g, '"');
|
1720
|
+
}
|
1721
|
+
function isOpeningToken(token) {
|
1722
|
+
return token.nesting === 1;
|
1723
|
+
}
|
1724
|
+
function isClosingToken(token) {
|
1725
|
+
return token.nesting === -1;
|
1726
|
+
}
|
1727
|
+
function parseFileLinkLine(line) {
|
1728
|
+
const match = line.match(/\[(.+?)\] <<< (.+)/);
|
1729
|
+
return match ? { fileName: match[1], url: match[2] } : null;
|
1730
|
+
}
|
1731
|
+
function parseSingleBracketText(line) {
|
1732
|
+
const match = line.match(/\[(.+?)\]/);
|
1733
|
+
return match ? match[1] : null;
|
1734
|
+
}
|
1735
|
+
|
1773
1736
|
class ParseAlerts {
|
1774
1737
|
render(type, markdown) {
|
1775
1738
|
return [container, type, {
|
1776
1739
|
render: (tokens, index) => {
|
1777
1740
|
const token = tokens[index];
|
1778
1741
|
const info = token.info.trim().slice(type.length).trim();
|
1779
|
-
if (token
|
1742
|
+
if (isOpeningToken(token)) {
|
1780
1743
|
const title = markdown.renderInline(info);
|
1781
1744
|
return `<div class="f-alert ${type}"><p class="f-alert-title">${title}</p>\n`;
|
1782
1745
|
}
|
@@ -1793,16 +1756,13 @@ class ParseGroupedCodeItems {
|
|
1793
1756
|
render() {
|
1794
1757
|
return [container, EMarkdownContainerType.CODE_GROUP, {
|
1795
1758
|
render: (tokens, index) => {
|
1796
|
-
if (
|
1759
|
+
if (isOpeningToken(tokens[index])) {
|
1797
1760
|
return this._openingExampleGroupHTML(this._generateData(tokens, index));
|
1798
1761
|
}
|
1799
1762
|
return '</f-code-group>';
|
1800
1763
|
},
|
1801
1764
|
}];
|
1802
1765
|
}
|
1803
|
-
_isOpeningToken(tokens, index) {
|
1804
|
-
return tokens[index].nesting === 1;
|
1805
|
-
}
|
1806
1766
|
_generateData(tokens, index) {
|
1807
1767
|
const result = [];
|
1808
1768
|
for (let i = index + 1; !this._isClosingToken(tokens, i); i++) {
|
@@ -1820,14 +1780,13 @@ class ParseGroupedCodeItems {
|
|
1820
1780
|
return result;
|
1821
1781
|
}
|
1822
1782
|
_isClosingToken(token, index) {
|
1823
|
-
return token[index]
|
1783
|
+
return isClosingToken(token[index]) && token[index].type === F_CONTAINER_CLOSE_TAG;
|
1824
1784
|
}
|
1825
1785
|
_isCodeFenceToken(token) {
|
1826
1786
|
return token.type === 'fence' && token.tag === 'code';
|
1827
1787
|
}
|
1828
1788
|
_openingExampleGroupHTML(data) {
|
1829
|
-
|
1830
|
-
return `<f-code-group data-data="${jsonData}">`;
|
1789
|
+
return `<f-code-group data-data="${encodeDataAttr(data)}">`;
|
1831
1790
|
}
|
1832
1791
|
_getCodeBlockTitle(data) {
|
1833
1792
|
return data.match(/\[(.*)\]/)?.[1] || this._getCodeLanguage(data) || 'txt';
|
@@ -1846,15 +1805,12 @@ class ParseSingleCodeItem {
|
|
1846
1805
|
}
|
1847
1806
|
markdown.renderer.rules.fence = (tokens, index) => {
|
1848
1807
|
const data = this._getTokenData(tokens[index]);
|
1849
|
-
return (`<f-code-group data-data="${
|
1808
|
+
return (`<f-code-group data-data="${encodeDataAttr([this._createCodeData(data)])}"></f-code-group>`);
|
1850
1809
|
};
|
1851
1810
|
}
|
1852
1811
|
_getTokenData(token) {
|
1853
1812
|
return { value: token.content, language: token.info };
|
1854
1813
|
}
|
1855
|
-
_coerceData(data) {
|
1856
|
-
return JSON.stringify([data]).replace(/"/g, '"');
|
1857
|
-
}
|
1858
1814
|
_createCodeData({ value, language }) {
|
1859
1815
|
return {
|
1860
1816
|
tab: '',
|
@@ -1869,73 +1825,47 @@ class ParseAngularExampleWithCodeLinks {
|
|
1869
1825
|
render() {
|
1870
1826
|
return [container, EMarkdownContainerType.EXAMPLE_GROUP, {
|
1871
1827
|
render: (tokens, index) => {
|
1872
|
-
|
1873
|
-
return this._openingExampleGroupHTML(this._generateData(tokens, index));
|
1874
|
-
}
|
1875
|
-
return '</f-code-group>';
|
1828
|
+
return isOpeningToken(tokens[index]) ? this._opening(tokens, index) : '</f-code-group>';
|
1876
1829
|
},
|
1877
1830
|
}];
|
1878
1831
|
}
|
1879
|
-
|
1880
|
-
|
1832
|
+
_opening(tokens, index) {
|
1833
|
+
const data = this._collectData(tokens, index);
|
1834
|
+
return `<f-code-group data-data="${encodeDataAttr(data)}">`;
|
1881
1835
|
}
|
1882
|
-
|
1836
|
+
_collectData(tokens, index) {
|
1883
1837
|
const result = [];
|
1884
1838
|
const component = this._parseNgComponent(tokens[index]);
|
1885
1839
|
const height = component?.height || 'auto';
|
1886
1840
|
if (component) {
|
1887
|
-
result.push(
|
1841
|
+
result.push({
|
1842
|
+
tab: 'Example',
|
1843
|
+
value: component.tag,
|
1844
|
+
type: EParsedContainerType.EXAMPLE,
|
1845
|
+
height: component.height || 'auto',
|
1846
|
+
});
|
1888
1847
|
}
|
1889
1848
|
const content = getContent(tokens, index, EMarkdownContainerType.EXAMPLE_GROUP);
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
}
|
1895
|
-
_createComponentData(component) {
|
1896
|
-
return {
|
1897
|
-
tab: 'Example',
|
1898
|
-
value: component.tag,
|
1899
|
-
type: EParsedContainerType.EXAMPLE,
|
1900
|
-
height: component.height || 'auto',
|
1901
|
-
};
|
1902
|
-
}
|
1903
|
-
_createContentData(content, height) {
|
1904
|
-
return {
|
1905
|
-
tab: content.fileName,
|
1906
|
-
value: content.url,
|
1849
|
+
const items = (content || '').split('\n').map(parseFileLinkLine).filter(Boolean);
|
1850
|
+
items.forEach(({ fileName, url }) => result.push({
|
1851
|
+
tab: fileName,
|
1852
|
+
value: url,
|
1907
1853
|
isLink: true,
|
1908
1854
|
type: EParsedContainerType.CODE,
|
1909
1855
|
height,
|
1910
|
-
};
|
1856
|
+
}));
|
1857
|
+
return result;
|
1911
1858
|
}
|
1912
1859
|
_parseNgComponent(token) {
|
1913
|
-
if (!this._isNgComponent(token)) {
|
1914
|
-
return null;
|
1915
|
-
}
|
1916
1860
|
const cleanedInput = token.info.replace(/ng-component\s*/, '');
|
1917
1861
|
const tagMatch = cleanedInput.match(/<([a-zA-Z0-9-]+)>.*<\/\1>/);
|
1918
1862
|
const heightMatch = cleanedInput.match(/\[height\]="(\d+)"/);
|
1919
|
-
if (!tagMatch)
|
1920
|
-
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
}
|
1926
|
-
_isNgComponent(token) {
|
1927
|
-
return token.info.trim().startsWith(EMarkdownContainerType.EXAMPLE_GROUP);
|
1928
|
-
}
|
1929
|
-
_parseData(data) {
|
1930
|
-
return data.split('\n').map(this._extractFileData).filter(Boolean);
|
1931
|
-
}
|
1932
|
-
_extractFileData(line) {
|
1933
|
-
const match = line.match(/\[(.+?)\] <<< (.+)/);
|
1934
|
-
return match ? { fileName: match[1], url: match[2] } : null;
|
1935
|
-
}
|
1936
|
-
_openingExampleGroupHTML(data) {
|
1937
|
-
const jsonData = JSON.stringify(data).replace(/"/g, '"');
|
1938
|
-
return `<f-code-group data-data="${jsonData}">`;
|
1863
|
+
if (!tagMatch)
|
1864
|
+
return null;
|
1865
|
+
return {
|
1866
|
+
tag: tagMatch[0],
|
1867
|
+
height: heightMatch?.[1],
|
1868
|
+
};
|
1939
1869
|
}
|
1940
1870
|
}
|
1941
1871
|
|
@@ -1947,16 +1877,13 @@ class ParsePreviewGroup {
|
|
1947
1877
|
render() {
|
1948
1878
|
return [container, EMarkdownContainerType.PREVIEW_GROUP, {
|
1949
1879
|
render: (tokens, index) => {
|
1950
|
-
if (
|
1880
|
+
if (isOpeningToken(tokens[index])) {
|
1951
1881
|
return this._getGroupsHTML(this._generateData(tokens, index));
|
1952
1882
|
}
|
1953
1883
|
return '';
|
1954
1884
|
},
|
1955
1885
|
}];
|
1956
1886
|
}
|
1957
|
-
_isOpeningToken(tokens, index) {
|
1958
|
-
return tokens[index].nesting === 1;
|
1959
|
-
}
|
1960
1887
|
_generateData(tokens, index) {
|
1961
1888
|
const groups = [];
|
1962
1889
|
this._parseData(getContent(tokens, index, EMarkdownContainerType.PREVIEW_GROUP) || '').forEach((x) => {
|
@@ -1968,11 +1895,7 @@ class ParsePreviewGroup {
|
|
1968
1895
|
return groups;
|
1969
1896
|
}
|
1970
1897
|
_parseData(data) {
|
1971
|
-
return data.split('\n').map(
|
1972
|
-
}
|
1973
|
-
_extractFileData(line) {
|
1974
|
-
const match = line.match(/\[(.+?)\]/);
|
1975
|
-
return match ? match[1] : null;
|
1898
|
+
return data.split('\n').map(parseSingleBracketText).filter(Boolean);
|
1976
1899
|
}
|
1977
1900
|
_getGroupsHTML(groups) {
|
1978
1901
|
const result = (groups || []).map((x) => {
|
@@ -2865,7 +2788,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
2865
2788
|
|
2866
2789
|
var index$2 = /*#__PURE__*/Object.freeze({
|
2867
2790
|
__proto__: null,
|
2868
|
-
ChangeCodeFocusedSyntaxPreProcessor: ChangeCodeFocusedSyntaxPreProcessor,
|
2869
2791
|
get EMarkdownContainerType () { return EMarkdownContainerType; },
|
2870
2792
|
get EParsedContainerType () { return EParsedContainerType; },
|
2871
2793
|
FCodeGroupComponent: FCodeGroupComponent,
|
@@ -2892,16 +2814,20 @@ var index$2 = /*#__PURE__*/Object.freeze({
|
|
2892
2814
|
MarkCodeFocusedBlocksPostProcessor: MarkCodeFocusedBlocksPostProcessor,
|
2893
2815
|
MarkdownContainerComponent: MarkdownContainerComponent,
|
2894
2816
|
MarkdownService: MarkdownService,
|
2895
|
-
ModifyPunctuationHighlightPostProcessor: ModifyPunctuationHighlightPostProcessor,
|
2896
2817
|
ParseAlerts: ParseAlerts,
|
2897
2818
|
ParseAngularExampleWithCodeLinks: ParseAngularExampleWithCodeLinks,
|
2898
2819
|
ParseGroupedCodeItems: ParseGroupedCodeItems,
|
2899
2820
|
ParsePreviewGroup: ParsePreviewGroup,
|
2900
2821
|
ParseSingleCodeItem: ParseSingleCodeItem,
|
2901
2822
|
coerceComponentHeight: coerceComponentHeight,
|
2823
|
+
encodeDataAttr: encodeDataAttr,
|
2902
2824
|
getContent: getContent,
|
2825
|
+
isClosingToken: isClosingToken,
|
2826
|
+
isOpeningToken: isOpeningToken,
|
2903
2827
|
parseComponentTag: parseComponentTag,
|
2828
|
+
parseFileLinkLine: parseFileLinkLine,
|
2904
2829
|
parseLanguageFromFileExtension: parseLanguageFromFileExtension,
|
2830
|
+
parseSingleBracketText: parseSingleBracketText,
|
2905
2831
|
parseSyntaxLanguage: parseSyntaxLanguage
|
2906
2832
|
});
|
2907
2833
|
|
@@ -3000,7 +2926,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
3000
2926
|
CalculateHashFromScrollPositionAndActivateTocRequest: CalculateHashFromScrollPositionAndActivateTocRequest,
|
3001
2927
|
get CalculateTableOfContentDataHandler () { return CalculateTableOfContentDataHandler; },
|
3002
2928
|
CalculateTableOfContentDataRequest: CalculateTableOfContentDataRequest,
|
3003
|
-
ChangeCodeFocusedSyntaxPreProcessor: ChangeCodeFocusedSyntaxPreProcessor,
|
3004
2929
|
DOCUMENTATION_CONFIGURATION: DOCUMENTATION_CONFIGURATION,
|
3005
2930
|
DOCUMENTATION_ROUTES: DOCUMENTATION_ROUTES,
|
3006
2931
|
DocumentationRootComponent: DocumentationRootComponent,
|
@@ -3042,7 +2967,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
3042
2967
|
MarkCodeFocusedBlocksPostProcessor: MarkCodeFocusedBlocksPostProcessor,
|
3043
2968
|
MarkdownContainerComponent: MarkdownContainerComponent,
|
3044
2969
|
MarkdownService: MarkdownService,
|
3045
|
-
ModifyPunctuationHighlightPostProcessor: ModifyPunctuationHighlightPostProcessor,
|
3046
2970
|
NavigationGroupComponent: NavigationGroupComponent,
|
3047
2971
|
NavigationPanelComponent: NavigationPanelComponent,
|
3048
2972
|
ParseAlerts: ParseAlerts,
|
@@ -3064,10 +2988,15 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
3064
2988
|
coerceComponentHeight: coerceComponentHeight,
|
3065
2989
|
defineLazyComponent: defineLazyComponent,
|
3066
2990
|
defineNavigationGroup: defineNavigationGroup,
|
2991
|
+
encodeDataAttr: encodeDataAttr,
|
3067
2992
|
extractComponent: extractComponent,
|
3068
2993
|
getContent: getContent,
|
2994
|
+
isClosingToken: isClosingToken,
|
2995
|
+
isOpeningToken: isOpeningToken,
|
3069
2996
|
parseComponentTag: parseComponentTag,
|
2997
|
+
parseFileLinkLine: parseFileLinkLine,
|
3070
2998
|
parseLanguageFromFileExtension: parseLanguageFromFileExtension,
|
2999
|
+
parseSingleBracketText: parseSingleBracketText,
|
3071
3000
|
parseSyntaxLanguage: parseSyntaxLanguage,
|
3072
3001
|
provide404Markdown: provide404Markdown,
|
3073
3002
|
provideComponents: provideComponents,
|
@@ -3327,5 +3256,5 @@ var index = /*#__PURE__*/Object.freeze({
|
|
3327
3256
|
* Generated bundle index. Do not edit.
|
3328
3257
|
*/
|
3329
3258
|
|
3330
|
-
export { ActivateTocByHashHandler, ActivateTocByHashRequest, COMMON_FEATURES, CalculateHashFromScrollPositionAndActivateTocHandler, CalculateHashFromScrollPositionAndActivateTocRequest, CalculateTableOfContentDataHandler, CalculateTableOfContentDataRequest,
|
3259
|
+
export { ActivateTocByHashHandler, ActivateTocByHashRequest, COMMON_FEATURES, CalculateHashFromScrollPositionAndActivateTocHandler, CalculateHashFromScrollPositionAndActivateTocRequest, CalculateTableOfContentDataHandler, CalculateTableOfContentDataRequest, DOCUMENTATION_CONFIGURATION, DOCUMENTATION_ROUTES, DocumentationRootComponent, DocumentationStore, DropdownMenuComponent, EMarkdownContainerType, EParsedContainerType, FAnalyticsService, FCheckboxComponent, FCodeGroupComponent, FCodeGroupTabsComponent, FCodeViewComponent, FCookiePopupComponent, FExampleViewComponent, FFooterEditInformationComponent, FFooterNavigationButtonComponent, FFooterNavigationComponent, FHomePageButtonsRowComponent, FHomePageFeaturesComponent, FHomePageFooterComponent, FHomePageHeaderComponent, FHomePageHeroComponent, FHomePageMembershipsComponent, FInsertComponentDirective, FMarkdownFooterComponent, FMarkdownRendererComponent, FMetaService, FNavigationItemComponent, FPreviewBase, FPreviewComponent, FPreviewGroupFiltersComponent, FPreviewGroupService, FRadioButtonComponent, FSocialLinksComponent, FThemeButtonComponent, F_ACCEPT_COOKIES_KEY, F_PREVIEW_NAVIGATION_PROVIDER, F_SOCIAL_LINKS_PROVIDER, GetAbsoluteTopToContainerHandler, GetAbsoluteTopToContainerRequest, GetPreviousNextPageNavigationHandler, GetPreviousNextPageNavigationRequest, GetPreviousNextPageNavigationResponse, HEADER_CONFIGURATION, HEADER_CONFIGURATION_STORE, HOME_PAGE_CONFIGURATION, HOME_ROUTES, HamburgerButtonComponent, HandleNavigationLinksHandler, HandleNavigationLinksRequest, HeaderComponent, HighlightComponent, HighlightService, HomeRootComponent, HomeStore, InlineMenuComponent, LANGUAGES, MarkCodeFocusedBlocksPostProcessor, MarkdownContainerComponent, MarkdownService, NavigationGroupComponent, NavigationPanelComponent, NpmVersionComponent, OverflowObserverDirective, ParseAlerts, ParseAngularExampleWithCodeLinks, ParseGroupedCodeItems, ParsePreviewGroup, ParseSingleCodeItem, PopoverService, RIGHT_TOP_OVERLAY_POSITION, RenderDynamicComponentsHandler, RenderDynamicComponentsRequest, SCROLLABLE_CONTAINER, SCROLLABLE_CONTAINER_FEATURES, ScrollToElementInContainerHandler, ScrollToElementInContainerRequest, ScrollableContainerComponent, TOGGLE_NAVIGATION_COMPONENT, TableOfContentComponent, TableOfContentData, TableOfContentItemsComponent, ThemeService, coerceComponentHeight, copyToClipboard, defineLazyComponent, defineNavigationGroup, encodeDataAttr, extractComponent, getContent, isClosingToken, isOpeningToken, parseComponentTag, parseFileLinkLine, parseLanguageFromFileExtension, parseSingleBracketText, parseSyntaxLanguage, provide404Markdown, provideBackground, provideComponents, provideDirectory, provideDocumentation, provideDocumentationMeta, provideFooterNavigation, provideHeader, provideHeaderMediaLinks, provideHeaderNavigation, provideHero, provideHomeButtons, provideHomeFeatures, provideHomeFooter, provideHomePage, provideImage, provideLanguage, provideLogo, provideNavigation, provideTitle, provideTocData, setCookieConsent };
|
3331
3260
|
//# sourceMappingURL=foblex-m-render.mjs.map
|