@foblex/m-render 2.8.8 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/foblex-m-render.mjs +66 -74
- package/fesm2022/foblex-m-render.mjs.map +1 -1
- package/index.d.ts +5 -10
- package/package.json +1 -1
|
@@ -1725,12 +1725,12 @@ class ExternalComponent {
|
|
|
1725
1725
|
this._mediatr.execute(new RenderExternalComponentRequest(this.data().value, this._viewContainerRef()));
|
|
1726
1726
|
}
|
|
1727
1727
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: ExternalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1728
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.8", type: ExternalComponent, isStandalone: true, selector: "external-component", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style.height": "data().height" }, classAttribute: "
|
|
1728
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.8", type: ExternalComponent, isStandalone: true, selector: "external-component", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style.height": "data().height" }, classAttribute: "f-example-view" }, viewQueries: [{ propertyName: "_viewContainerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<ng-container #container />\n\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1729
1729
|
}
|
|
1730
1730
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: ExternalComponent, decorators: [{
|
|
1731
1731
|
type: Component,
|
|
1732
1732
|
args: [{ selector: 'external-component', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1733
|
-
class: '
|
|
1733
|
+
class: 'f-example-view',
|
|
1734
1734
|
'[style.height]': 'data().height',
|
|
1735
1735
|
}, template: "<ng-container #container />\n\n" }]
|
|
1736
1736
|
}] });
|
|
@@ -2590,68 +2590,6 @@ class TableOfContentData {
|
|
|
2590
2590
|
}
|
|
2591
2591
|
}
|
|
2592
2592
|
|
|
2593
|
-
let CalculateTableOfContent = class CalculateTableOfContent {
|
|
2594
|
-
_dataProvider = inject(DocumentationStore);
|
|
2595
|
-
_mediatr = inject(Mediatr);
|
|
2596
|
-
handle(request) {
|
|
2597
|
-
const flat = [];
|
|
2598
|
-
const tree = [];
|
|
2599
|
-
const stack = [];
|
|
2600
|
-
this._getNavigationSelectors(request.hostElement, this._dataProvider.getTableOfContent()?.range).forEach((element) => {
|
|
2601
|
-
const tocItem = this._createItem(element);
|
|
2602
|
-
this._insertItemIntoTree(tocItem, tree, stack);
|
|
2603
|
-
flat.push(tocItem);
|
|
2604
|
-
});
|
|
2605
|
-
this._dataProvider.tocData.set(new TableOfContentData(flat, tree));
|
|
2606
|
-
//this._mediatr.execute(new CalculateHashFromScrollPositionRequest());
|
|
2607
|
-
}
|
|
2608
|
-
_getNavigationSelectors(fMarkdownPage, tocRange) {
|
|
2609
|
-
if (!tocRange || tocRange.start < 1 || tocRange.end > 6) {
|
|
2610
|
-
tocRange = { start: 2, end: 6 };
|
|
2611
|
-
}
|
|
2612
|
-
const selectors = [];
|
|
2613
|
-
for (let i = tocRange.start; i <= tocRange.end; i++) {
|
|
2614
|
-
selectors.push(`h${i}`);
|
|
2615
|
-
}
|
|
2616
|
-
return Array.from(fMarkdownPage.querySelectorAll(selectors.join(', ')));
|
|
2617
|
-
}
|
|
2618
|
-
_createItem(element) {
|
|
2619
|
-
element.id = this._createNavigationId(element);
|
|
2620
|
-
return {
|
|
2621
|
-
hash: `#${CSS.escape(element.id)}`,
|
|
2622
|
-
title: element.innerHTML,
|
|
2623
|
-
element,
|
|
2624
|
-
children: [],
|
|
2625
|
-
};
|
|
2626
|
-
}
|
|
2627
|
-
_createNavigationId(element) {
|
|
2628
|
-
return element.innerHTML.toLowerCase().replaceAll(' ', '-');
|
|
2629
|
-
}
|
|
2630
|
-
_getLevel(element) {
|
|
2631
|
-
return parseInt(element.tagName.substring(1));
|
|
2632
|
-
}
|
|
2633
|
-
_insertItemIntoTree(tocItem, tree, stack) {
|
|
2634
|
-
while (stack.length > 0 && this._getLevel(stack[stack.length - 1].element) >= this._getLevel(tocItem.element)) {
|
|
2635
|
-
stack.pop();
|
|
2636
|
-
}
|
|
2637
|
-
if (stack.length === 0) {
|
|
2638
|
-
tree.push(tocItem);
|
|
2639
|
-
}
|
|
2640
|
-
else {
|
|
2641
|
-
stack[stack.length - 1].children.push(tocItem);
|
|
2642
|
-
}
|
|
2643
|
-
stack.push(tocItem);
|
|
2644
|
-
}
|
|
2645
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2646
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent });
|
|
2647
|
-
};
|
|
2648
|
-
CalculateTableOfContent = __decorate([
|
|
2649
|
-
MExecution(CalculateTableOfContentRequest)
|
|
2650
|
-
], CalculateTableOfContent);
|
|
2651
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent, decorators: [{
|
|
2652
|
-
type: Injectable
|
|
2653
|
-
}] });
|
|
2654
|
-
|
|
2655
2593
|
class CalculateAbsoluteTopToContainerRequest {
|
|
2656
2594
|
element;
|
|
2657
2595
|
static requestToken = Symbol('CalculateAbsoluteTopToContainerRequest');
|
|
@@ -2683,14 +2621,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
2683
2621
|
type: Injectable
|
|
2684
2622
|
}] });
|
|
2685
2623
|
|
|
2686
|
-
// @MExecution(CalculateHashFromScrollPositionRequest)
|
|
2687
2624
|
class CalculateHashFromScrollPosition {
|
|
2688
2625
|
_docElement = inject(DOCUMENT_ELEMENT);
|
|
2689
2626
|
_window = inject(WINDOW);
|
|
2690
2627
|
_provider = inject(DocumentationStore);
|
|
2691
2628
|
_scrollableContainer = inject(SCROLLABLE_CONTAINER);
|
|
2692
2629
|
_mediatr = inject(Mediatr);
|
|
2693
|
-
handle(
|
|
2630
|
+
handle() {
|
|
2694
2631
|
let result;
|
|
2695
2632
|
const containerScrollTop = this._getContainerScrollTop();
|
|
2696
2633
|
const elementsWithTopPosition = this._calculateElementsTopPositions();
|
|
@@ -2742,11 +2679,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
2742
2679
|
type: Injectable
|
|
2743
2680
|
}] });
|
|
2744
2681
|
|
|
2745
|
-
class
|
|
2746
|
-
|
|
2747
|
-
|
|
2682
|
+
let CalculateTableOfContent = class CalculateTableOfContent {
|
|
2683
|
+
_dataProvider = inject(DocumentationStore);
|
|
2684
|
+
_injector = inject(Injector);
|
|
2685
|
+
handle(request) {
|
|
2686
|
+
const flat = [];
|
|
2687
|
+
const tree = [];
|
|
2688
|
+
const stack = [];
|
|
2689
|
+
this._getNavigationSelectors(request.hostElement, this._dataProvider.getTableOfContent()?.range).forEach((element) => {
|
|
2690
|
+
const tocItem = this._createItem(element);
|
|
2691
|
+
this._insertItemIntoTree(tocItem, tree, stack);
|
|
2692
|
+
flat.push(tocItem);
|
|
2693
|
+
});
|
|
2694
|
+
this._dataProvider.tocData.set(new TableOfContentData(flat, tree));
|
|
2695
|
+
this._injector.get(CalculateHashFromScrollPosition).handle();
|
|
2748
2696
|
}
|
|
2749
|
-
|
|
2697
|
+
_getNavigationSelectors(fMarkdownPage, tocRange) {
|
|
2698
|
+
if (!tocRange || tocRange.start < 1 || tocRange.end > 6) {
|
|
2699
|
+
tocRange = { start: 2, end: 6 };
|
|
2700
|
+
}
|
|
2701
|
+
const selectors = [];
|
|
2702
|
+
for (let i = tocRange.start; i <= tocRange.end; i++) {
|
|
2703
|
+
selectors.push(`h${i}`);
|
|
2704
|
+
}
|
|
2705
|
+
return Array.from(fMarkdownPage.querySelectorAll(selectors.join(', ')));
|
|
2706
|
+
}
|
|
2707
|
+
_createItem(element) {
|
|
2708
|
+
element.id = this._createNavigationId(element);
|
|
2709
|
+
return {
|
|
2710
|
+
hash: `#${CSS.escape(element.id)}`,
|
|
2711
|
+
title: element.innerHTML,
|
|
2712
|
+
element,
|
|
2713
|
+
children: [],
|
|
2714
|
+
};
|
|
2715
|
+
}
|
|
2716
|
+
_createNavigationId(element) {
|
|
2717
|
+
return element.innerHTML.toLowerCase().replaceAll(' ', '-');
|
|
2718
|
+
}
|
|
2719
|
+
_getLevel(element) {
|
|
2720
|
+
return parseInt(element.tagName.substring(1));
|
|
2721
|
+
}
|
|
2722
|
+
_insertItemIntoTree(tocItem, tree, stack) {
|
|
2723
|
+
while (stack.length > 0 && this._getLevel(stack[stack.length - 1].element) >= this._getLevel(tocItem.element)) {
|
|
2724
|
+
stack.pop();
|
|
2725
|
+
}
|
|
2726
|
+
if (stack.length === 0) {
|
|
2727
|
+
tree.push(tocItem);
|
|
2728
|
+
}
|
|
2729
|
+
else {
|
|
2730
|
+
stack[stack.length - 1].children.push(tocItem);
|
|
2731
|
+
}
|
|
2732
|
+
stack.push(tocItem);
|
|
2733
|
+
}
|
|
2734
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2735
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent });
|
|
2736
|
+
};
|
|
2737
|
+
CalculateTableOfContent = __decorate([
|
|
2738
|
+
MExecution(CalculateTableOfContentRequest)
|
|
2739
|
+
], CalculateTableOfContent);
|
|
2740
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CalculateTableOfContent, decorators: [{
|
|
2741
|
+
type: Injectable
|
|
2742
|
+
}] });
|
|
2750
2743
|
|
|
2751
2744
|
class ScrollToElementInContainerRequest {
|
|
2752
2745
|
hash;
|
|
@@ -2867,7 +2860,7 @@ const SCROLLABLE_CONTAINER = new InjectionToken('SCROLLABLE_CONTAINER');
|
|
|
2867
2860
|
|
|
2868
2861
|
class ScrollableContainer {
|
|
2869
2862
|
_destroyRef = inject(DestroyRef);
|
|
2870
|
-
|
|
2863
|
+
_injector = inject(Injector);
|
|
2871
2864
|
tableOfContent = inject(DOCUMENTATION_CONFIGURATION).tableOfContent;
|
|
2872
2865
|
htmlElement = inject((ElementRef)).nativeElement;
|
|
2873
2866
|
ngOnInit() {
|
|
@@ -2880,7 +2873,7 @@ class ScrollableContainer {
|
|
|
2880
2873
|
.subscribe(() => this._calculateHashAndActivate());
|
|
2881
2874
|
}
|
|
2882
2875
|
_calculateHashAndActivate() {
|
|
2883
|
-
|
|
2876
|
+
this._injector.get(CalculateHashFromScrollPosition).handle();
|
|
2884
2877
|
}
|
|
2885
2878
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: ScrollableContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2886
2879
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: ScrollableContainer, isStandalone: true, selector: "scrollable-container", providers: [
|
|
@@ -3123,7 +3116,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
3123
3116
|
get CalculateAbsoluteTopToContainer () { return CalculateAbsoluteTopToContainer; },
|
|
3124
3117
|
CalculateAbsoluteTopToContainerRequest: CalculateAbsoluteTopToContainerRequest,
|
|
3125
3118
|
CalculateHashFromScrollPosition: CalculateHashFromScrollPosition,
|
|
3126
|
-
CalculateHashFromScrollPositionRequest: CalculateHashFromScrollPositionRequest,
|
|
3127
3119
|
get CalculateTableOfContent () { return CalculateTableOfContent; },
|
|
3128
3120
|
CalculateTableOfContentRequest: CalculateTableOfContentRequest,
|
|
3129
3121
|
DOCUMENTATION_CONFIGURATION: DOCUMENTATION_CONFIGURATION,
|
|
@@ -3437,5 +3429,5 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
3437
3429
|
* Generated bundle index. Do not edit.
|
|
3438
3430
|
*/
|
|
3439
3431
|
|
|
3440
|
-
export { AVAILABLE_LANGUAGES, ActivateTocByHash, ActivateTocByHashRequest, CalculateAbsoluteTopToContainer, CalculateAbsoluteTopToContainerRequest, CalculateHashFromScrollPosition,
|
|
3432
|
+
export { AVAILABLE_LANGUAGES, ActivateTocByHash, ActivateTocByHashRequest, CalculateAbsoluteTopToContainer, CalculateAbsoluteTopToContainerRequest, CalculateHashFromScrollPosition, CalculateTableOfContent, CalculateTableOfContentRequest, CodeGroup, CodeView, DOCUMENTATION_CONFIGURATION, DOCUMENTATION_ROUTES, DOCUMENT_ELEMENT, DYNAMIC_COMPONENTS_MODULE_PROVIDERS, Documentation, DocumentationStore, DropdownMenu, DynamicComponentsStore, EMarkdownContainerType, EParsedContainerType, EXTERNAL_COMPONENT_PROVIDER, ExternalComponent, FCheckboxComponent, FHomePageButtonsRowComponent, FHomePageFeaturesComponent, FHomePageFooterComponent, FHomePageHeaderComponent, FHomePageHeroComponent, FHomePageMembershipsComponent, FMetaService, FNavigationItemComponent, FRadioButtonComponent, FSearchButtonComponent, F_PREVIEW_NAVIGATION_PROVIDER, FooterNavigationButton, GTAG_CONFIG, GTagService, GetPreviousNextPageNavigationHandler, GetPreviousNextPageNavigationRequest, GetPreviousNextPageNavigationResponse, HEADER_CONFIGURATION_PROVIDER, HOME_PAGE_CONFIGURATION, HOME_ROUTES, HamburgerButton, HandleNavigationLinksHandler, HandleNavigationLinksRequest, HeaderComponent, HeaderMenuBase, Highlight, HighlightService, HomeRootComponent, HomeStore, IS_BROWSER_PLATFORM, InlineMenu, LOCAL_STORAGE, LOCATION, MEDIA_LINKS_PROVIDER, MExecution, MarkCodeFocusedBlocksPostProcessor, MarkdownFooter, MarkdownRenderer, MarkdownRouter, MarkdownService, MediaLinks, Mediatr, NavigationGroupComponent, NavigationPanelComponent, ParseAlerts, ParseAngularExampleWithCodeLinks, ParseGroupedCodeItems, ParsePreviewGroup, ParseShowcase, ParseSingleCodeItem, PopoverService, PreviewActionBar, PreviewCard, PreviewCardBase, PreviewGroupService, RenderDynamicComponent, RenderDynamicComponentRequest, RenderExternalComponent, RenderExternalComponentRequest, RenderInternalComponents, RenderInternalComponentsRequest, SCROLLABLE_CONTAINER, SHOWCASE_DATA, ScrollToElementInContainer, ScrollToElementInContainerRequest, ScrollableContainer, Showcase, ShowcaseItem, TABLE_OF_CONTENT_MODULE_PROVIDERS, TOGGLE_NAVIGATION_COMPONENT, TableOfContent, TableOfContentData, TableOfContentItemsComponent, ThemeButtonComponent, ThemeService, UNIVERSAL_THEME, WINDOW, calculateMarkdownUrl, coerceComponentHeight$1 as coerceComponentHeight, copyToClipboard, defineLazyComponent, defineNavigationGroup, encodeDataAttr, extractComponent, getContent, isClosingToken, isOpeningToken, parseComponentTag, parseFileLinkLine, parseSingleBracketText, provide404Markdown, provideBackground, provideComponents, provideDirectory, provideDocumentation, provideFooterNavigation, provideGTag, provideHeader, provideHeaderMediaLinks, provideHeaderNavigation, provideHeaderSearch, provideHero, provideHomeButtons, provideHomeFeatures, provideHomeFooter, provideHomePage, provideImage, provideLanguage, provideLogo, provideMeta, provideNavigation, provideShowcase, provideTableOfContent, provideTheme, provideTitle };
|
|
3441
3433
|
//# sourceMappingURL=foblex-m-render.mjs.map
|