@foblex/m-render 2.6.9 → 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 +469 -421
  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
@@ -0,0 +1,39 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { LOCAL_STORAGE, GTagService } from './foblex-m-render.mjs';
4
+
5
+ const F_ACCEPT_COOKIES_KEY = 'm-accepts-cookies';
6
+ class CookiePopupComponent {
7
+ _localStorage = inject(LOCAL_STORAGE);
8
+ _gtag = inject(GTagService, { optional: true });
9
+ _consentValue = signal(null);
10
+ showPopup = computed(() => this._gtag !== null &&
11
+ this._consentValue() !== 'true' &&
12
+ this._consentValue() !== 'false');
13
+ constructor() {
14
+ try {
15
+ const value = this._localStorage?.getItem(F_ACCEPT_COOKIES_KEY);
16
+ this._consentValue.set(value);
17
+ }
18
+ catch {
19
+ this._consentValue.set(null);
20
+ }
21
+ }
22
+ accept() {
23
+ try {
24
+ this._localStorage?.setItem(F_ACCEPT_COOKIES_KEY, 'true');
25
+ }
26
+ catch { /* empty */ }
27
+ this._gtag?.updateConsent(true);
28
+ this._consentValue.set('true');
29
+ }
30
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: CookiePopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
31
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: CookiePopupComponent, isStandalone: true, selector: "cookie-popup", ngImport: i0, template: "@if (showPopup()) {\n <div class=\"docs-cookies-popup docs-invert-mode\">\n <p>This site uses cookies from Google to deliver its services and to analyze traffic.</p>\n\n <div>\n <a href=\"https://policies.google.com/technologies/cookies\" target=\"_blank\" rel=\"noopener\">\n <button class=\"f-button\" [attr.text]=\"'Learn more'\" aria-label=\"Learn More\">\n Learn more\n </button>\n </a>\n <button\n (click)=\"accept()\"\n class=\"f-button\"\n [attr.text]=\"'Ok, Got it'\"\n aria-label=\"Ok, Got it\">\n Ok, Got it\n </button>\n </div>\n </div>\n}\n", styles: [":host{position:fixed;bottom:16px;right:16px;z-index:99999;opacity:0;visibility:hidden;animation:1s linear forwards .5s fadeIn}.docs-cookies-popup{padding:1rem;background-color:var(--background-color);border:1px solid var(--divider-color);color:var(--primary-text);border-radius:var(--border-radius);font-size:14px;max-width:310px;transition:background-color .3s ease,border-color .3s ease,color .3s ease;box-shadow:var(--shadow-3)}.docs-cookies-popup>div{display:flex;gap:8px;align-items:center;width:100%;margin-block-start:1rem}.f-button{outline:none;border:none;height:unset;line-height:26px;font-size:14px;font-weight:500;border-radius:var(--border-radius)}@keyframes fadeIn{to{opacity:100%;visibility:visible}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: CookiePopupComponent, decorators: [{
34
+ type: Component,
35
+ args: [{ selector: 'cookie-popup', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (showPopup()) {\n <div class=\"docs-cookies-popup docs-invert-mode\">\n <p>This site uses cookies from Google to deliver its services and to analyze traffic.</p>\n\n <div>\n <a href=\"https://policies.google.com/technologies/cookies\" target=\"_blank\" rel=\"noopener\">\n <button class=\"f-button\" [attr.text]=\"'Learn more'\" aria-label=\"Learn More\">\n Learn more\n </button>\n </a>\n <button\n (click)=\"accept()\"\n class=\"f-button\"\n [attr.text]=\"'Ok, Got it'\"\n aria-label=\"Ok, Got it\">\n Ok, Got it\n </button>\n </div>\n </div>\n}\n", styles: [":host{position:fixed;bottom:16px;right:16px;z-index:99999;opacity:0;visibility:hidden;animation:1s linear forwards .5s fadeIn}.docs-cookies-popup{padding:1rem;background-color:var(--background-color);border:1px solid var(--divider-color);color:var(--primary-text);border-radius:var(--border-radius);font-size:14px;max-width:310px;transition:background-color .3s ease,border-color .3s ease,color .3s ease;box-shadow:var(--shadow-3)}.docs-cookies-popup>div{display:flex;gap:8px;align-items:center;width:100%;margin-block-start:1rem}.f-button{outline:none;border:none;height:unset;line-height:26px;font-size:14px;font-weight:500;border-radius:var(--border-radius)}@keyframes fadeIn{to{opacity:100%;visibility:visible}}\n"] }]
36
+ }], ctorParameters: () => [] });
37
+
38
+ export { CookiePopupComponent, F_ACCEPT_COOKIES_KEY };
39
+ //# sourceMappingURL=foblex-m-render-cookie-popup.component-BZZxqp3j.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foblex-m-render-cookie-popup.component-BZZxqp3j.mjs","sources":["../../../../libs/m-render/src/lib/analytics/cookie-popup/cookie-popup.component.ts","../../../../libs/m-render/src/lib/analytics/cookie-popup/cookie-popup.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { LOCAL_STORAGE } from '../../common';\nimport { GTagService } from '../g-tag.service';\n\nexport const F_ACCEPT_COOKIES_KEY = 'm-accepts-cookies';\n\n@Component({\n selector: 'cookie-popup',\n standalone: true,\n templateUrl: './cookie-popup.component.html',\n styleUrls: ['./cookie-popup.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CookiePopupComponent {\n private readonly _localStorage = inject(LOCAL_STORAGE);\n private readonly _gtag = inject(GTagService, { optional: true });\n\n private readonly _consentValue = signal<string | null>(null);\n\n protected readonly showPopup = computed(() =>\n this._gtag !== null &&\n this._consentValue() !== 'true' &&\n this._consentValue() !== 'false',\n );\n\n constructor() {\n try {\n const value = this._localStorage?.getItem(F_ACCEPT_COOKIES_KEY);\n this._consentValue.set(value);\n } catch {\n this._consentValue.set(null);\n }\n }\n\n protected accept(): void {\n try {\n this._localStorage?.setItem(F_ACCEPT_COOKIES_KEY, 'true');\n } catch { /* empty */ }\n\n this._gtag?.updateConsent(true);\n this._consentValue.set('true');\n }\n}\n\n","@if (showPopup()) {\n <div class=\"docs-cookies-popup docs-invert-mode\">\n <p>This site uses cookies from Google to deliver its services and to analyze traffic.</p>\n\n <div>\n <a href=\"https://policies.google.com/technologies/cookies\" target=\"_blank\" rel=\"noopener\">\n <button class=\"f-button\" [attr.text]=\"'Learn more'\" aria-label=\"Learn More\">\n Learn more\n </button>\n </a>\n <button\n (click)=\"accept()\"\n class=\"f-button\"\n [attr.text]=\"'Ok, Got it'\"\n aria-label=\"Ok, Got it\">\n Ok, Got it\n </button>\n </div>\n </div>\n}\n"],"names":[],"mappings":";;;;AAIO,MAAM,oBAAoB,GAAG;MASvB,oBAAoB,CAAA;AACd,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IACrC,KAAK,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAE/C,IAAA,aAAa,GAAG,MAAM,CAAgB,IAAI,CAAC;IAEzC,SAAS,GAAG,QAAQ,CA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