@foblex/m-render 2.7.0 → 2.7.2

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.
Files changed (43) hide show
  1. package/fesm2022/foblex-m-render-cookie-popup.component-BZZxqp3j.mjs +39 -0
  2. package/fesm2022/foblex-m-render-cookie-popup.component-BZZxqp3j.mjs.map +1 -0
  3. package/fesm2022/foblex-m-render.mjs +466 -418
  4. package/fesm2022/foblex-m-render.mjs.map +1 -1
  5. package/index.d.ts +2 -0
  6. package/lib/analytics/cookie-popup/cookie-popup.component.d.ts +12 -0
  7. package/lib/analytics/g-tag.service.d.ts +13 -0
  8. package/lib/analytics/index.d.ts +2 -0
  9. package/lib/analytics/provide-g-tag.d.ts +6 -0
  10. package/lib/common/components/index.d.ts +0 -1
  11. package/lib/common/services/index.d.ts +1 -1
  12. package/lib/common/utils/document-element.d.ts +2 -0
  13. package/lib/common/utils/index.d.ts +5 -0
  14. package/lib/common/utils/local-storage.d.ts +2 -0
  15. package/lib/common/utils/location.d.ts +2 -0
  16. package/lib/common/utils/platform.d.ts +2 -0
  17. package/lib/common/utils/window.d.ts +2 -0
  18. package/lib/documentation-page/analytics/common-services/f-meta.service.d.ts +1 -1
  19. package/lib/documentation-page/analytics/index.d.ts +0 -1
  20. package/lib/documentation-page/components/markdown-container/f-markdown/components/f-markdown-footer/f-markdown-footer.component.d.ts +1 -1
  21. package/lib/documentation-page/components/markdown-container/f-markdown/components/f-preview-group/f-preview/f-preview.component.d.ts +1 -1
  22. package/lib/documentation-page/components/markdown-container/f-markdown/f-markdown-renderer.component.d.ts +2 -1
  23. package/lib/documentation-page/components/markdown-container/f-markdown/highlight/highlight.service.d.ts +2 -1
  24. package/lib/documentation-page/components/markdown-container/f-markdown/highlight/mark-code-focused-blocks.post-processor.d.ts +2 -3
  25. package/lib/documentation-page/components/navigation-panel/navigation-panel.component.d.ts +1 -1
  26. package/lib/documentation-page/components/scrollable-container/components/table-of-content/table-of-content.component.d.ts +1 -1
  27. package/lib/documentation-page/components/scrollable-container/domain/calculate-hash-from-scroll-position-and-activate-toc/calculate-hash-from-scroll-position-and-activate-toc.handler.d.ts +2 -1
  28. package/lib/documentation-page/documentation-root.component.d.ts +3 -0
  29. package/lib/documentation-page/domain/handle-navigation-links/handle-navigation-links.handler.d.ts +0 -1
  30. package/lib/documentation-page/domain/handle-navigation-links/handle-navigation-links.request.d.ts +2 -3
  31. package/lib/home-page/home-root.component.d.ts +7 -3
  32. package/lib/theme/index.d.ts +3 -0
  33. package/lib/theme/provide-theme.d.ts +2 -0
  34. package/lib/theme/theme-button/theme-button.component.d.ts +14 -0
  35. package/lib/{common/services → theme}/theme.service.d.ts +7 -1
  36. package/package.json +1 -2
  37. package/lib/common/components/f-theme-button/f-theme-button.component.d.ts +0 -14
  38. package/lib/documentation-page/analytics/analytics/f-accept-cookies-key.d.ts +0 -1
  39. package/lib/documentation-page/analytics/analytics/f-analytics.service.d.ts +0 -10
  40. package/lib/documentation-page/analytics/analytics/f-cookie-popup/f-cookie-popup.component.d.ts +0 -9
  41. package/lib/documentation-page/analytics/analytics/i-window-with-analytics.d.ts +0 -5
  42. package/lib/documentation-page/analytics/analytics/index.d.ts +0 -5
  43. package/lib/documentation-page/analytics/analytics/set-cookie-consent.d.ts +0 -6
package/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from './lib/analytics';
1
2
  export * from './lib/common';
2
3
  export * from './lib/documentation-page';
3
4
  export * from './lib/home-page';
5
+ export * from './lib/theme';
@@ -0,0 +1,12 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare const F_ACCEPT_COOKIES_KEY = "m-accepts-cookies";
3
+ export declare class CookiePopupComponent {
4
+ private readonly _localStorage;
5
+ private readonly _gtag;
6
+ private readonly _consentValue;
7
+ protected readonly showPopup: import("@angular/core").Signal<boolean>;
8
+ constructor();
9
+ protected accept(): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<CookiePopupComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<CookiePopupComponent, "cookie-popup", never, {}, {}, never, never, true, never>;
12
+ }
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class GTagService {
3
+ private readonly _config;
4
+ private readonly _document;
5
+ private _initialized;
6
+ initialize(): void;
7
+ private _getGtagWindow;
8
+ private _loadGtagScript;
9
+ updateConsent(granted: boolean): void;
10
+ trackEvent(action: string, params?: Record<string, unknown>): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<GTagService, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<GTagService>;
13
+ }
@@ -0,0 +1,2 @@
1
+ export * from './provide-g-tag';
2
+ export * from './g-tag.service';
@@ -0,0 +1,6 @@
1
+ import { InjectionToken, Provider } from '@angular/core';
2
+ export declare function provideGTag(config: GTagConfig): Provider[];
3
+ export interface GTagConfig {
4
+ id: string;
5
+ }
6
+ export declare const GTAG_CONFIG: InjectionToken<GTagConfig>;
@@ -1,6 +1,5 @@
1
1
  export * from './f-checkbox/f-checkbox.component';
2
2
  export * from './f-radio-button/f-radio-button.component';
3
3
  export * from './f-social-links';
4
- export * from './f-theme-button/f-theme-button.component';
5
4
  export * from './menus/npm-version';
6
5
  export * from './menus';
@@ -1,2 +1,2 @@
1
1
  export * from './popover.service';
2
- export * from './theme.service';
2
+ export * from '../../theme/theme.service';
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export declare const DOCUMENT_ELEMENT: InjectionToken<HTMLElement>;
@@ -1 +1,6 @@
1
1
  export * from './copy-to-clipboard';
2
+ export * from './document-element';
3
+ export * from './local-storage';
4
+ export * from './location';
5
+ export * from './platform';
6
+ export * from './window';
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export declare const LOCAL_STORAGE: InjectionToken<Storage>;
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export declare const LOCATION: InjectionToken<Location>;
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export declare const IS_BROWSER_PLATFORM: InjectionToken<boolean>;
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export declare const WINDOW: InjectionToken<Window>;
@@ -1,9 +1,9 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class FMetaService {
4
+ private readonly _location;
4
5
  private readonly _router;
5
6
  private readonly _headTag;
6
- private readonly _browser;
7
7
  private readonly _configuration;
8
8
  changes(): Observable<void>;
9
9
  dispose(): void;
@@ -1,2 +1 @@
1
- export * from './analytics';
2
1
  export * from './common-services';
@@ -7,7 +7,7 @@ export declare class FMarkdownFooterComponent implements OnInit {
7
7
  private readonly _activatedRoute;
8
8
  private readonly _changeDetectorRef;
9
9
  private readonly _destroyRef;
10
- private readonly _browser;
10
+ private readonly _window;
11
11
  protected navigation: IMarkdownFooterNavigation;
12
12
  protected editLink: string | undefined;
13
13
  protected previousLink: IMarkdownFooterLink | undefined;
@@ -6,7 +6,7 @@ export declare class FPreviewComponent extends FPreviewBase implements OnInit, O
6
6
  private _elementReference;
7
7
  private _fEnvironment;
8
8
  private _fPreviewGroupService;
9
- private _fState;
9
+ private _themeService;
10
10
  private _router;
11
11
  private _destroyRef;
12
12
  item: string | undefined;
@@ -8,7 +8,8 @@ export declare class FMarkdownRendererComponent implements OnInit, OnDestroy {
8
8
  private readonly _activatedRoute;
9
9
  private readonly _destroyRef;
10
10
  private readonly _injector;
11
- private readonly _browser;
11
+ private readonly _isBrowser;
12
+ private readonly _window;
12
13
  private readonly _markdown;
13
14
  private readonly _provider;
14
15
  private get _markdownPath();
@@ -1,7 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class HighlightService {
4
- private readonly _browser;
4
+ private readonly _isBrowser;
5
+ private readonly _window;
5
6
  private readonly _highlighter$;
6
7
  highlight(element: HTMLElement, lang: string, content: string): Observable<HTMLElement>;
7
8
  private _highlightCodeBlock;
@@ -1,8 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
- import { BrowserService } from '@foblex/platform';
3
2
  export declare class MarkCodeFocusedBlocksPostProcessor {
4
- private _browser;
5
- constructor(_browser: BrowserService);
3
+ private _window;
4
+ constructor(_window: Window);
6
5
  handle(element: HTMLElement): Observable<HTMLElement>;
7
6
  private _applyOpacity;
8
7
  private _getElementColor;
@@ -6,7 +6,7 @@ export declare class NavigationPanelComponent implements OnInit, AfterViewInit {
6
6
  private readonly _router;
7
7
  private readonly _changeDetectorRef;
8
8
  private readonly _destroyRef;
9
- private readonly _browser;
9
+ private readonly _window;
10
10
  protected value: string | undefined;
11
11
  protected navigation: import("./domain").INavigationGroup[];
12
12
  protected title: string;
@@ -1,9 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
2
  export declare class TableOfContentComponent {
3
3
  private readonly _elementRef;
4
- private readonly _browser;
5
4
  private readonly _provider;
6
5
  private readonly _injector;
6
+ private readonly _window;
7
7
  protected readonly tocData: import("@angular/core").Signal<import("../../index").TableOfContentData>;
8
8
  protected readonly activeMarkerPosition: import("@angular/core").Signal<number>;
9
9
  protected readonly title: string | undefined;
@@ -1,7 +1,8 @@
1
1
  import { Injector } from '@angular/core';
2
2
  export declare class CalculateHashFromScrollPositionAndActivateTocHandler {
3
3
  private _injector;
4
- private readonly _browser;
4
+ private readonly _docElement;
5
+ private readonly _window;
5
6
  private readonly _provider;
6
7
  private readonly _scrollableContainer;
7
8
  constructor(_injector: Injector);
@@ -6,6 +6,9 @@ export declare class DocumentationRootComponent implements IToggleNavigationComp
6
6
  protected readonly popover: import("@angular/core").Signal<string | null>;
7
7
  private readonly _metaService;
8
8
  private readonly _destroyRef;
9
+ private readonly _gTagService;
10
+ private readonly _themeService;
11
+ protected readonly isBrowser: boolean;
9
12
  ngOnInit(): void;
10
13
  onToggleNavigation(value: boolean): void;
11
14
  ngOnDestroy(): void;
@@ -6,5 +6,4 @@ export declare class HandleNavigationLinksHandler {
6
6
  private _hasHref;
7
7
  private _isExternalLink;
8
8
  private _navigateInternalLink;
9
- private _navigateExternalLink;
10
9
  }
@@ -1,8 +1,7 @@
1
- import { BrowserService } from '@foblex/platform';
2
1
  import { Router } from '@angular/router';
3
2
  export declare class HandleNavigationLinksRequest {
4
3
  event: MouseEvent;
5
- browser: BrowserService;
4
+ window: Window;
6
5
  router: Router;
7
- constructor(event: MouseEvent, browser: BrowserService, router: Router);
6
+ constructor(event: MouseEvent, window: Window, router: Router);
8
7
  }
@@ -1,9 +1,13 @@
1
- import { AfterViewInit } from '@angular/core';
1
+ import { AfterViewInit, OnInit } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- export declare class HomeRootComponent implements AfterViewInit {
4
- private _environment;
3
+ export declare class HomeRootComponent implements AfterViewInit, OnInit {
4
+ private readonly _environment;
5
+ private readonly _gTagService;
6
+ private readonly _themeService;
7
+ protected readonly isBrowser: boolean;
5
8
  private _backgroundContainer;
6
9
  private _heroImageContainer;
10
+ ngOnInit(): void;
7
11
  ngAfterViewInit(): void;
8
12
  private _renderImageComponent;
9
13
  private _renderBackgroundComponent;
@@ -0,0 +1,3 @@
1
+ export * from './theme-button/theme-button.component';
2
+ export * from './provide-theme';
3
+ export * from './theme.service';
@@ -0,0 +1,2 @@
1
+ import { Provider } from '@angular/core';
2
+ export declare function provideTheme(): Provider[];
@@ -0,0 +1,14 @@
1
+ import { OnInit } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ThemeButtonComponent implements OnInit {
4
+ private readonly _renderer;
5
+ private readonly _themeService;
6
+ private readonly _localStorage;
7
+ private readonly _documentElement;
8
+ private readonly _isBrowser;
9
+ ngOnInit(): void;
10
+ private _isDocumentContainsDarkTheme;
11
+ protected _onClick(): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ThemeButtonComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<ThemeButtonComponent, "button[theme-button]", never, {}, {}, never, never, true, never>;
14
+ }
@@ -1,11 +1,17 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class ThemeService {
4
- private readonly _browser;
4
+ private readonly _localStorage;
5
+ private readonly _window;
5
6
  private readonly _theme;
7
+ private readonly _docElement;
6
8
  get theme$(): Observable<void>;
9
+ initialize(): void;
7
10
  updateTheme(): void;
8
11
  getPreferredTheme(): string;
12
+ private _getItem;
13
+ private _matchMedia;
14
+ private _isDocumentContainsDarkTheme;
9
15
  static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
10
16
  static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
11
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foblex/m-render",
3
- "version": "2.7.0",
3
+ "version": "2.7.2",
4
4
  "description": "MRender is a static site generator designed for creating fast and user-friendly documentation sites based on Markdown files. MarkEngine supports extended Markdown syntax and can render Angular components directly from Markdown files.",
5
5
  "author": "Siarhei Huzarevich",
6
6
  "license": "MIT",
@@ -22,7 +22,6 @@
22
22
  "@angular/common": ">=12.0.0",
23
23
  "@angular/core": ">=12.0.0",
24
24
  "@angular/cdk": ">=12.0.0",
25
- "@foblex/platform": "^1.0.4",
26
25
  "markdown-it": ">=14.1.0",
27
26
  "markdown-it-container": ">=4.0.0",
28
27
  "shiki": "^3.4.2"
@@ -1,14 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class FThemeButtonComponent implements OnInit {
4
- private readonly _renderer;
5
- private readonly _fState;
6
- private readonly _browser;
7
- private get _localStorage();
8
- private get _documentElement();
9
- ngOnInit(): void;
10
- private _isDocumentContainsDarkTheme;
11
- protected _onClick(): void;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<FThemeButtonComponent, never>;
13
- static ɵcmp: i0.ɵɵComponentDeclaration<FThemeButtonComponent, "button[f-theme-button]", never, {}, {}, never, never, true, never>;
14
- }
@@ -1 +0,0 @@
1
- export declare const F_ACCEPT_COOKIES_KEY = "m-render-accepts-cookies";
@@ -1,10 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class FAnalyticsService {
3
- private readonly fLocalStorage;
4
- private readonly document;
5
- initialize(analyticsId: string): void;
6
- private _installGtag;
7
- private _getGtmScript;
8
- static ɵfac: i0.ɵɵFactoryDeclaration<FAnalyticsService, never>;
9
- static ɵprov: i0.ɵɵInjectableDeclaration<FAnalyticsService>;
10
- }
@@ -1,9 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class FCookiePopupComponent {
3
- private readonly _storage;
4
- protected readonly hasAccepted: import("@angular/core").WritableSignal<boolean>;
5
- constructor();
6
- protected accept(): void;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<FCookiePopupComponent, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<FCookiePopupComponent, "f-cookie-popup", never, {}, {}, never, never, true, never>;
9
- }
@@ -1,5 +0,0 @@
1
- import { IWindowService } from '@foblex/platform';
2
- export interface IWindowWithAnalytics extends IWindowService {
3
- dataLayer?: any[];
4
- gtag?(...args: any[]): void;
5
- }
@@ -1,5 +0,0 @@
1
- export * from './f-cookie-popup/f-cookie-popup.component';
2
- export * from './f-accept-cookies-key';
3
- export * from './f-analytics.service';
4
- export * from './i-window-with-analytics';
5
- export * from './set-cookie-consent';
@@ -1,6 +0,0 @@
1
- declare global {
2
- interface Window {
3
- gtag: (...args: any[]) => void;
4
- }
5
- }
6
- export declare const setCookieConsent: (state: "denied" | "granted") => void;