@foblex/m-render 2.6.3 → 2.6.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.
- 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/_code-view.scss +1 -0
- package/assets/styles/_table.scss +51 -0
- package/assets/styles/styles.scss +1 -0
- package/fesm2022/foblex-m-render.mjs +116 -186
- package/fesm2022/foblex-m-render.mjs.map +1 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/components/f-code-group/f-code-view/f-code-view.component.d.ts +1 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/components/f-code-group/f-example-view/utils/coerce-component-height.d.ts +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,26 @@ 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
|
+
console.warn('[MarkCodeFocusedBlocksPostProcessor] No focus markers found in the code block.', html);
|
1024
|
+
return of(element);
|
1025
|
+
}
|
1026
|
+
element.innerHTML = html.replace(FOCUS_REGEX, (_match, content) => {
|
1027
|
+
return `<focus class="focused"><div class="inline-focus">${content}</div></focus>`;
|
1068
1028
|
});
|
1029
|
+
const focused = element.querySelector('.focused');
|
1030
|
+
if (focused) {
|
1031
|
+
this._applyOpacity(element.parentElement);
|
1032
|
+
}
|
1069
1033
|
return of(element);
|
1070
1034
|
}
|
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
1035
|
_applyOpacity(element) {
|
1078
1036
|
if (!element.classList.contains('focused')) {
|
1079
1037
|
element.style.color = this._createRgbaString(this._getElementColor(element), 0.5);
|
@@ -1099,12 +1057,7 @@ class MarkCodeFocusedBlocksPostProcessor {
|
|
1099
1057
|
return color.match(/\d+/g);
|
1100
1058
|
}
|
1101
1059
|
}
|
1102
|
-
const
|
1103
|
-
regex: /\|foc-\|(.*?)\|-foc\|/g,
|
1104
|
-
replacer: (match, p1) => {
|
1105
|
-
return `<focus class="focused"><span>${p1}</span></focus>`;
|
1106
|
-
},
|
1107
|
-
};
|
1060
|
+
const FOCUS_REGEX = /ƒƒƒ([\s\S]*?)¢¢¢/g;
|
1108
1061
|
|
1109
1062
|
const UNIVERSAL_THEME = {
|
1110
1063
|
name: 'universal',
|
@@ -1388,42 +1341,36 @@ const UNIVERSAL_THEME = {
|
|
1388
1341
|
};
|
1389
1342
|
|
1390
1343
|
class HighlightService {
|
1391
|
-
_highlighter;
|
1392
1344
|
_browser = inject(BrowserService);
|
1345
|
+
_highlighter$ = defer(() => from(createHighlighter({ themes: [UNIVERSAL_THEME], langs: LANGUAGES }))).pipe(shareReplay(1));
|
1393
1346
|
highlight(element, lang, content) {
|
1394
|
-
|
1347
|
+
if (!this._browser.isBrowser()) {
|
1348
|
+
console.warn('[HighlightService] Skipping highlight on server.');
|
1349
|
+
return of(element);
|
1350
|
+
}
|
1351
|
+
return this._highlightCodeBlock(element, lang, content).pipe(switchMap((x) => this._postProcess(x)), catchError((err) => {
|
1352
|
+
console.error('[HighlightService] Failed to highlight:', err);
|
1353
|
+
return of(element);
|
1354
|
+
}));
|
1395
1355
|
}
|
1396
|
-
|
1356
|
+
_highlightCodeBlock(element, lang, content) {
|
1357
|
+
return this._highlighter$.pipe(switchMap((highlighter) => this._renderCode(element, highlighter, lang, content)));
|
1358
|
+
}
|
1359
|
+
_renderCode(element, highlighter, lang, content) {
|
1397
1360
|
return new Observable((observer) => {
|
1398
|
-
|
1361
|
+
const processedContent = this._preprocessFocus(content);
|
1362
|
+
element.innerHTML = highlighter.codeToHtml(processedContent, { lang, theme: 'universal', defaultColor: false });
|
1363
|
+
requestAnimationFrame(() => {
|
1364
|
+
observer.next(element);
|
1365
|
+
observer.complete();
|
1366
|
+
});
|
1399
1367
|
});
|
1400
1368
|
}
|
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;
|
1369
|
+
_preprocessFocus(code) {
|
1370
|
+
return code.replace(/\|\:\|([\s\S]*?)\|\:\|/g, (_, p1) => `ƒƒƒ${p1}¢¢¢`);
|
1420
1371
|
}
|
1421
|
-
|
1422
|
-
|
1423
|
-
x.classList.add('language-none');
|
1424
|
-
x.innerHTML = x.textContent ?? '';
|
1425
|
-
});
|
1426
|
-
return of(element);
|
1372
|
+
_postProcess(element) {
|
1373
|
+
return of(element).pipe(switchMap((x) => new MarkCodeFocusedBlocksPostProcessor(this._browser).handle(x)));
|
1427
1374
|
}
|
1428
1375
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HighlightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1429
1376
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HighlightService, providedIn: 'root' });
|
@@ -1546,13 +1493,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
1546
1493
|
|
1547
1494
|
function coerceComponentHeight(value) {
|
1548
1495
|
if (value === undefined) {
|
1549
|
-
return
|
1496
|
+
return undefined;
|
1550
1497
|
}
|
1551
1498
|
value = Number(value);
|
1552
1499
|
if (value) {
|
1553
1500
|
return value + 'px';
|
1554
1501
|
}
|
1555
|
-
return
|
1502
|
+
return undefined;
|
1556
1503
|
}
|
1557
1504
|
|
1558
1505
|
function parseComponentTag(html) {
|
@@ -1698,23 +1645,6 @@ var EParsedContainerType;
|
|
1698
1645
|
|
1699
1646
|
const F_PREVIEW_NAVIGATION_PROVIDER = new InjectionToken('F_PREVIEW_NAVIGATION_PROVIDER');
|
1700
1647
|
|
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
1648
|
class MarkdownService {
|
1719
1649
|
_markdown = new MarkdownIt({ html: true, linkify: true });
|
1720
1650
|
_httpClient = inject(HttpClient);
|
@@ -1770,13 +1700,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
1770
1700
|
type: Injectable
|
1771
1701
|
}], ctorParameters: () => [] });
|
1772
1702
|
|
1703
|
+
function getContent(tokens, index, eContainerType) {
|
1704
|
+
let result;
|
1705
|
+
for (let i = index + 1; i < tokens.length; i++) {
|
1706
|
+
if (tokens[i].type === `container_${eContainerType}_close`) {
|
1707
|
+
break;
|
1708
|
+
}
|
1709
|
+
if (isInlineToken(tokens[i])) {
|
1710
|
+
result = tokens[i].content;
|
1711
|
+
break;
|
1712
|
+
}
|
1713
|
+
}
|
1714
|
+
return result;
|
1715
|
+
}
|
1716
|
+
function isInlineToken(token) {
|
1717
|
+
return token.type === 'inline' && !token.tag;
|
1718
|
+
}
|
1719
|
+
function encodeDataAttr(data) {
|
1720
|
+
return JSON.stringify(data).replace(/"/g, '"');
|
1721
|
+
}
|
1722
|
+
function isOpeningToken(token) {
|
1723
|
+
return token.nesting === 1;
|
1724
|
+
}
|
1725
|
+
function isClosingToken(token) {
|
1726
|
+
return token.nesting === -1;
|
1727
|
+
}
|
1728
|
+
function parseFileLinkLine(line) {
|
1729
|
+
const match = line.match(/\[(.+?)\] <<< (.+)/);
|
1730
|
+
return match ? { fileName: match[1], url: match[2] } : null;
|
1731
|
+
}
|
1732
|
+
function parseSingleBracketText(line) {
|
1733
|
+
const match = line.match(/\[(.+?)\]/);
|
1734
|
+
return match ? match[1] : null;
|
1735
|
+
}
|
1736
|
+
|
1773
1737
|
class ParseAlerts {
|
1774
1738
|
render(type, markdown) {
|
1775
1739
|
return [container, type, {
|
1776
1740
|
render: (tokens, index) => {
|
1777
1741
|
const token = tokens[index];
|
1778
1742
|
const info = token.info.trim().slice(type.length).trim();
|
1779
|
-
if (token
|
1743
|
+
if (isOpeningToken(token)) {
|
1780
1744
|
const title = markdown.renderInline(info);
|
1781
1745
|
return `<div class="f-alert ${type}"><p class="f-alert-title">${title}</p>\n`;
|
1782
1746
|
}
|
@@ -1793,16 +1757,13 @@ class ParseGroupedCodeItems {
|
|
1793
1757
|
render() {
|
1794
1758
|
return [container, EMarkdownContainerType.CODE_GROUP, {
|
1795
1759
|
render: (tokens, index) => {
|
1796
|
-
if (
|
1760
|
+
if (isOpeningToken(tokens[index])) {
|
1797
1761
|
return this._openingExampleGroupHTML(this._generateData(tokens, index));
|
1798
1762
|
}
|
1799
1763
|
return '</f-code-group>';
|
1800
1764
|
},
|
1801
1765
|
}];
|
1802
1766
|
}
|
1803
|
-
_isOpeningToken(tokens, index) {
|
1804
|
-
return tokens[index].nesting === 1;
|
1805
|
-
}
|
1806
1767
|
_generateData(tokens, index) {
|
1807
1768
|
const result = [];
|
1808
1769
|
for (let i = index + 1; !this._isClosingToken(tokens, i); i++) {
|
@@ -1820,14 +1781,13 @@ class ParseGroupedCodeItems {
|
|
1820
1781
|
return result;
|
1821
1782
|
}
|
1822
1783
|
_isClosingToken(token, index) {
|
1823
|
-
return token[index]
|
1784
|
+
return isClosingToken(token[index]) && token[index].type === F_CONTAINER_CLOSE_TAG;
|
1824
1785
|
}
|
1825
1786
|
_isCodeFenceToken(token) {
|
1826
1787
|
return token.type === 'fence' && token.tag === 'code';
|
1827
1788
|
}
|
1828
1789
|
_openingExampleGroupHTML(data) {
|
1829
|
-
|
1830
|
-
return `<f-code-group data-data="${jsonData}">`;
|
1790
|
+
return `<f-code-group data-data="${encodeDataAttr(data)}">`;
|
1831
1791
|
}
|
1832
1792
|
_getCodeBlockTitle(data) {
|
1833
1793
|
return data.match(/\[(.*)\]/)?.[1] || this._getCodeLanguage(data) || 'txt';
|
@@ -1846,15 +1806,12 @@ class ParseSingleCodeItem {
|
|
1846
1806
|
}
|
1847
1807
|
markdown.renderer.rules.fence = (tokens, index) => {
|
1848
1808
|
const data = this._getTokenData(tokens[index]);
|
1849
|
-
return (`<f-code-group data-data="${
|
1809
|
+
return (`<f-code-group data-data="${encodeDataAttr([this._createCodeData(data)])}"></f-code-group>`);
|
1850
1810
|
};
|
1851
1811
|
}
|
1852
1812
|
_getTokenData(token) {
|
1853
1813
|
return { value: token.content, language: token.info };
|
1854
1814
|
}
|
1855
|
-
_coerceData(data) {
|
1856
|
-
return JSON.stringify([data]).replace(/"/g, '"');
|
1857
|
-
}
|
1858
1815
|
_createCodeData({ value, language }) {
|
1859
1816
|
return {
|
1860
1817
|
tab: '',
|
@@ -1869,73 +1826,47 @@ class ParseAngularExampleWithCodeLinks {
|
|
1869
1826
|
render() {
|
1870
1827
|
return [container, EMarkdownContainerType.EXAMPLE_GROUP, {
|
1871
1828
|
render: (tokens, index) => {
|
1872
|
-
|
1873
|
-
return this._openingExampleGroupHTML(this._generateData(tokens, index));
|
1874
|
-
}
|
1875
|
-
return '</f-code-group>';
|
1829
|
+
return isOpeningToken(tokens[index]) ? this._opening(tokens, index) : '</f-code-group>';
|
1876
1830
|
},
|
1877
1831
|
}];
|
1878
1832
|
}
|
1879
|
-
|
1880
|
-
|
1833
|
+
_opening(tokens, index) {
|
1834
|
+
const data = this._collectData(tokens, index);
|
1835
|
+
return `<f-code-group data-data="${encodeDataAttr(data)}">`;
|
1881
1836
|
}
|
1882
|
-
|
1837
|
+
_collectData(tokens, index) {
|
1883
1838
|
const result = [];
|
1884
1839
|
const component = this._parseNgComponent(tokens[index]);
|
1885
1840
|
const height = component?.height || 'auto';
|
1886
1841
|
if (component) {
|
1887
|
-
result.push(
|
1842
|
+
result.push({
|
1843
|
+
tab: 'Example',
|
1844
|
+
value: component.tag,
|
1845
|
+
type: EParsedContainerType.EXAMPLE,
|
1846
|
+
height: component.height || 'auto',
|
1847
|
+
});
|
1888
1848
|
}
|
1889
1849
|
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,
|
1850
|
+
const items = (content || '').split('\n').map(parseFileLinkLine).filter(Boolean);
|
1851
|
+
items.forEach(({ fileName, url }) => result.push({
|
1852
|
+
tab: fileName,
|
1853
|
+
value: url,
|
1907
1854
|
isLink: true,
|
1908
1855
|
type: EParsedContainerType.CODE,
|
1909
1856
|
height,
|
1910
|
-
};
|
1857
|
+
}));
|
1858
|
+
return result;
|
1911
1859
|
}
|
1912
1860
|
_parseNgComponent(token) {
|
1913
|
-
if (!this._isNgComponent(token)) {
|
1914
|
-
return null;
|
1915
|
-
}
|
1916
1861
|
const cleanedInput = token.info.replace(/ng-component\s*/, '');
|
1917
1862
|
const tagMatch = cleanedInput.match(/<([a-zA-Z0-9-]+)>.*<\/\1>/);
|
1918
1863
|
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}">`;
|
1864
|
+
if (!tagMatch)
|
1865
|
+
return null;
|
1866
|
+
return {
|
1867
|
+
tag: tagMatch[0],
|
1868
|
+
height: heightMatch?.[1],
|
1869
|
+
};
|
1939
1870
|
}
|
1940
1871
|
}
|
1941
1872
|
|
@@ -1947,16 +1878,13 @@ class ParsePreviewGroup {
|
|
1947
1878
|
render() {
|
1948
1879
|
return [container, EMarkdownContainerType.PREVIEW_GROUP, {
|
1949
1880
|
render: (tokens, index) => {
|
1950
|
-
if (
|
1881
|
+
if (isOpeningToken(tokens[index])) {
|
1951
1882
|
return this._getGroupsHTML(this._generateData(tokens, index));
|
1952
1883
|
}
|
1953
1884
|
return '';
|
1954
1885
|
},
|
1955
1886
|
}];
|
1956
1887
|
}
|
1957
|
-
_isOpeningToken(tokens, index) {
|
1958
|
-
return tokens[index].nesting === 1;
|
1959
|
-
}
|
1960
1888
|
_generateData(tokens, index) {
|
1961
1889
|
const groups = [];
|
1962
1890
|
this._parseData(getContent(tokens, index, EMarkdownContainerType.PREVIEW_GROUP) || '').forEach((x) => {
|
@@ -1968,11 +1896,7 @@ class ParsePreviewGroup {
|
|
1968
1896
|
return groups;
|
1969
1897
|
}
|
1970
1898
|
_parseData(data) {
|
1971
|
-
return data.split('\n').map(
|
1972
|
-
}
|
1973
|
-
_extractFileData(line) {
|
1974
|
-
const match = line.match(/\[(.+?)\]/);
|
1975
|
-
return match ? match[1] : null;
|
1899
|
+
return data.split('\n').map(parseSingleBracketText).filter(Boolean);
|
1976
1900
|
}
|
1977
1901
|
_getGroupsHTML(groups) {
|
1978
1902
|
const result = (groups || []).map((x) => {
|
@@ -2865,7 +2789,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
2865
2789
|
|
2866
2790
|
var index$2 = /*#__PURE__*/Object.freeze({
|
2867
2791
|
__proto__: null,
|
2868
|
-
ChangeCodeFocusedSyntaxPreProcessor: ChangeCodeFocusedSyntaxPreProcessor,
|
2869
2792
|
get EMarkdownContainerType () { return EMarkdownContainerType; },
|
2870
2793
|
get EParsedContainerType () { return EParsedContainerType; },
|
2871
2794
|
FCodeGroupComponent: FCodeGroupComponent,
|
@@ -2892,16 +2815,20 @@ var index$2 = /*#__PURE__*/Object.freeze({
|
|
2892
2815
|
MarkCodeFocusedBlocksPostProcessor: MarkCodeFocusedBlocksPostProcessor,
|
2893
2816
|
MarkdownContainerComponent: MarkdownContainerComponent,
|
2894
2817
|
MarkdownService: MarkdownService,
|
2895
|
-
ModifyPunctuationHighlightPostProcessor: ModifyPunctuationHighlightPostProcessor,
|
2896
2818
|
ParseAlerts: ParseAlerts,
|
2897
2819
|
ParseAngularExampleWithCodeLinks: ParseAngularExampleWithCodeLinks,
|
2898
2820
|
ParseGroupedCodeItems: ParseGroupedCodeItems,
|
2899
2821
|
ParsePreviewGroup: ParsePreviewGroup,
|
2900
2822
|
ParseSingleCodeItem: ParseSingleCodeItem,
|
2901
2823
|
coerceComponentHeight: coerceComponentHeight,
|
2824
|
+
encodeDataAttr: encodeDataAttr,
|
2902
2825
|
getContent: getContent,
|
2826
|
+
isClosingToken: isClosingToken,
|
2827
|
+
isOpeningToken: isOpeningToken,
|
2903
2828
|
parseComponentTag: parseComponentTag,
|
2829
|
+
parseFileLinkLine: parseFileLinkLine,
|
2904
2830
|
parseLanguageFromFileExtension: parseLanguageFromFileExtension,
|
2831
|
+
parseSingleBracketText: parseSingleBracketText,
|
2905
2832
|
parseSyntaxLanguage: parseSyntaxLanguage
|
2906
2833
|
});
|
2907
2834
|
|
@@ -3000,7 +2927,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
3000
2927
|
CalculateHashFromScrollPositionAndActivateTocRequest: CalculateHashFromScrollPositionAndActivateTocRequest,
|
3001
2928
|
get CalculateTableOfContentDataHandler () { return CalculateTableOfContentDataHandler; },
|
3002
2929
|
CalculateTableOfContentDataRequest: CalculateTableOfContentDataRequest,
|
3003
|
-
ChangeCodeFocusedSyntaxPreProcessor: ChangeCodeFocusedSyntaxPreProcessor,
|
3004
2930
|
DOCUMENTATION_CONFIGURATION: DOCUMENTATION_CONFIGURATION,
|
3005
2931
|
DOCUMENTATION_ROUTES: DOCUMENTATION_ROUTES,
|
3006
2932
|
DocumentationRootComponent: DocumentationRootComponent,
|
@@ -3042,7 +2968,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
3042
2968
|
MarkCodeFocusedBlocksPostProcessor: MarkCodeFocusedBlocksPostProcessor,
|
3043
2969
|
MarkdownContainerComponent: MarkdownContainerComponent,
|
3044
2970
|
MarkdownService: MarkdownService,
|
3045
|
-
ModifyPunctuationHighlightPostProcessor: ModifyPunctuationHighlightPostProcessor,
|
3046
2971
|
NavigationGroupComponent: NavigationGroupComponent,
|
3047
2972
|
NavigationPanelComponent: NavigationPanelComponent,
|
3048
2973
|
ParseAlerts: ParseAlerts,
|
@@ -3064,10 +2989,15 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
3064
2989
|
coerceComponentHeight: coerceComponentHeight,
|
3065
2990
|
defineLazyComponent: defineLazyComponent,
|
3066
2991
|
defineNavigationGroup: defineNavigationGroup,
|
2992
|
+
encodeDataAttr: encodeDataAttr,
|
3067
2993
|
extractComponent: extractComponent,
|
3068
2994
|
getContent: getContent,
|
2995
|
+
isClosingToken: isClosingToken,
|
2996
|
+
isOpeningToken: isOpeningToken,
|
3069
2997
|
parseComponentTag: parseComponentTag,
|
2998
|
+
parseFileLinkLine: parseFileLinkLine,
|
3070
2999
|
parseLanguageFromFileExtension: parseLanguageFromFileExtension,
|
3000
|
+
parseSingleBracketText: parseSingleBracketText,
|
3071
3001
|
parseSyntaxLanguage: parseSyntaxLanguage,
|
3072
3002
|
provide404Markdown: provide404Markdown,
|
3073
3003
|
provideComponents: provideComponents,
|
@@ -3166,7 +3096,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
3166
3096
|
class FHomePageButtonsRowComponent {
|
3167
3097
|
viewModel = inject(HomeStore).getButtons();
|
3168
3098
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FHomePageButtonsRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
3169
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FHomePageButtonsRowComponent, isStandalone: true, selector: "f-home-page-buttons-row", host: { properties: { "class.display-none": "!viewModel.length" } }, ngImport: i0, template: "@for (button of viewModel; track button.text) {\n @if (button.routerLink) {\n <a class=\"f-button\" [class.primary]=\"button.primary\" routerLink=\"{{ button.routerLink }}\">\n @if (button.icon) {\n <span class=\"f-icon {{ button.icon }}\"></span>\n }\n {{ button.text }}\n </a>\n } @else if(button.href) {\n <a class=\"f-button\" [class.primary]=\"button.primary\" href=\"{{ button.href }}\">\n @if (button.icon) {\n <span class=\"f-icon {{ button.icon }}\"></span>\n }\n {{ button.text }}\n </a>\n }\n}\n\n", styles: [":host{display:flex;flex-wrap:wrap;justify-content:center;padding-top:32px;gap:12px;width:fit-content;margin:0 auto}@media (min-width: 960px){:host{margin:0;justify-content:flex-start}}.f-button{display:flex;align-items:center;gap:6px}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
3099
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FHomePageButtonsRowComponent, isStandalone: true, selector: "f-home-page-buttons-row", host: { properties: { "class.display-none": "!viewModel.length" } }, ngImport: i0, template: "@for (button of viewModel; track button.text) {\n @if (button.routerLink) {\n <a class=\"f-button\" [class.primary]=\"button.primary\" routerLink=\"{{ button.routerLink }}\">\n @if (button.icon) {\n <span class=\"f-icon {{ button.icon }}\"></span>\n }\n {{ button.text }}\n </a>\n } @else if(button.href) {\n <a class=\"f-button\" [class.primary]=\"button.primary\" href=\"{{ button.href }}\" target=\"_blank\" rel=\"noopener noreferrer\">\n @if (button.icon) {\n <span class=\"f-icon {{ button.icon }}\"></span>\n }\n {{ button.text }}\n </a>\n }\n}\n\n", styles: [":host{display:flex;flex-wrap:wrap;justify-content:center;padding-top:32px;gap:12px;width:fit-content;margin:0 auto}@media (min-width: 960px){:host{margin:0;justify-content:flex-start}}.f-button{display:flex;align-items:center;gap:6px}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
3170
3100
|
}
|
3171
3101
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FHomePageButtonsRowComponent, decorators: [{
|
3172
3102
|
type: Component,
|
@@ -3174,7 +3104,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
3174
3104
|
RouterLink,
|
3175
3105
|
], host: {
|
3176
3106
|
'[class.display-none]': '!viewModel.length',
|
3177
|
-
}, template: "@for (button of viewModel; track button.text) {\n @if (button.routerLink) {\n <a class=\"f-button\" [class.primary]=\"button.primary\" routerLink=\"{{ button.routerLink }}\">\n @if (button.icon) {\n <span class=\"f-icon {{ button.icon }}\"></span>\n }\n {{ button.text }}\n </a>\n } @else if(button.href) {\n <a class=\"f-button\" [class.primary]=\"button.primary\" href=\"{{ button.href }}\">\n @if (button.icon) {\n <span class=\"f-icon {{ button.icon }}\"></span>\n }\n {{ button.text }}\n </a>\n }\n}\n\n", styles: [":host{display:flex;flex-wrap:wrap;justify-content:center;padding-top:32px;gap:12px;width:fit-content;margin:0 auto}@media (min-width: 960px){:host{margin:0;justify-content:flex-start}}.f-button{display:flex;align-items:center;gap:6px}\n"] }]
|
3107
|
+
}, template: "@for (button of viewModel; track button.text) {\n @if (button.routerLink) {\n <a class=\"f-button\" [class.primary]=\"button.primary\" routerLink=\"{{ button.routerLink }}\">\n @if (button.icon) {\n <span class=\"f-icon {{ button.icon }}\"></span>\n }\n {{ button.text }}\n </a>\n } @else if(button.href) {\n <a class=\"f-button\" [class.primary]=\"button.primary\" href=\"{{ button.href }}\" target=\"_blank\" rel=\"noopener noreferrer\">\n @if (button.icon) {\n <span class=\"f-icon {{ button.icon }}\"></span>\n }\n {{ button.text }}\n </a>\n }\n}\n\n", styles: [":host{display:flex;flex-wrap:wrap;justify-content:center;padding-top:32px;gap:12px;width:fit-content;margin:0 auto}@media (min-width: 960px){:host{margin:0;justify-content:flex-start}}.f-button{display:flex;align-items:center;gap:6px}\n"] }]
|
3178
3108
|
}] });
|
3179
3109
|
|
3180
3110
|
class FHomePageFeaturesComponent {
|
@@ -3327,5 +3257,5 @@ var index = /*#__PURE__*/Object.freeze({
|
|
3327
3257
|
* Generated bundle index. Do not edit.
|
3328
3258
|
*/
|
3329
3259
|
|
3330
|
-
export { ActivateTocByHashHandler, ActivateTocByHashRequest, COMMON_FEATURES, CalculateHashFromScrollPositionAndActivateTocHandler, CalculateHashFromScrollPositionAndActivateTocRequest, CalculateTableOfContentDataHandler, CalculateTableOfContentDataRequest,
|
3260
|
+
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
3261
|
//# sourceMappingURL=foblex-m-render.mjs.map
|