valtech-components 2.0.544 → 2.0.545

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 (26) hide show
  1. package/esm2022/lib/components/molecules/docs-api-table/docs-api-table.component.mjs +7 -5
  2. package/esm2022/lib/components/molecules/docs-breadcrumb/docs-breadcrumb.component.mjs +166 -0
  3. package/esm2022/lib/components/molecules/docs-breadcrumb/types.mjs +2 -0
  4. package/esm2022/lib/components/molecules/docs-code-example/docs-code-example.component.mjs +16 -6
  5. package/esm2022/lib/components/molecules/docs-nav-links/docs-nav-links.component.mjs +3 -3
  6. package/esm2022/lib/components/molecules/docs-search/docs-search.component.mjs +268 -0
  7. package/esm2022/lib/components/molecules/docs-search/types.mjs +2 -0
  8. package/esm2022/lib/components/organisms/docs-sidebar/docs-sidebar.component.mjs +25 -11
  9. package/esm2022/lib/components/organisms/docs-toc/docs-toc.component.mjs +5 -3
  10. package/esm2022/lib/components/templates/docs-layout/docs-layout.component.mjs +20 -2
  11. package/esm2022/lib/services/syntax-highlight/index.mjs +2 -0
  12. package/esm2022/lib/services/syntax-highlight/syntax-highlight.service.mjs +106 -0
  13. package/esm2022/public-api.mjs +7 -1
  14. package/fesm2022/valtech-components.mjs +586 -26
  15. package/fesm2022/valtech-components.mjs.map +1 -1
  16. package/lib/components/molecules/docs-breadcrumb/docs-breadcrumb.component.d.ts +31 -0
  17. package/lib/components/molecules/docs-breadcrumb/types.d.ts +18 -0
  18. package/lib/components/molecules/docs-code-example/docs-code-example.component.d.ts +2 -0
  19. package/lib/components/molecules/docs-search/docs-search.component.d.ts +47 -0
  20. package/lib/components/molecules/docs-search/types.d.ts +27 -0
  21. package/lib/components/organisms/article/article.component.d.ts +1 -1
  22. package/lib/components/templates/docs-layout/docs-layout.component.d.ts +1 -0
  23. package/lib/services/syntax-highlight/index.d.ts +1 -0
  24. package/lib/services/syntax-highlight/syntax-highlight.service.d.ts +52 -0
  25. package/package.json +1 -1
  26. package/public-api.d.ts +5 -0
@@ -0,0 +1,31 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { Router } from '@angular/router';
3
+ import { DocsBreadcrumbMetadata } from './types';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * val-docs-breadcrumb
7
+ *
8
+ * A breadcrumb navigation component for documentation.
9
+ *
10
+ * @example
11
+ * ```html
12
+ * <val-docs-breadcrumb
13
+ * [props]="{
14
+ * showHome: true,
15
+ * items: [
16
+ * { label: 'Components', route: ['/docs', 'components'] },
17
+ * { label: 'Button' }
18
+ * ]
19
+ * }"
20
+ * ></val-docs-breadcrumb>
21
+ * ```
22
+ */
23
+ export declare class DocsBreadcrumbComponent {
24
+ private router;
25
+ props: DocsBreadcrumbMetadata;
26
+ navigate: EventEmitter<string[]>;
27
+ constructor(router: Router);
28
+ onNavigate(route: string[]): void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocsBreadcrumbComponent, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocsBreadcrumbComponent, "val-docs-breadcrumb", never, { "props": { "alias": "props"; "required": false; }; }, { "navigate": "navigate"; }, never, never, true, never>;
31
+ }
@@ -0,0 +1,18 @@
1
+ export interface DocsBreadcrumbMetadata {
2
+ /** Breadcrumb items */
3
+ items: DocsBreadcrumbItem[];
4
+ /** Separator character */
5
+ separator?: string;
6
+ /** Show home icon at start */
7
+ showHome?: boolean;
8
+ /** Home route */
9
+ homeRoute?: string[];
10
+ /** Custom CSS class */
11
+ cssClass?: string;
12
+ }
13
+ export interface DocsBreadcrumbItem {
14
+ /** Display label */
15
+ label: string;
16
+ /** Route array for navigation (omit for current page) */
17
+ route?: string[];
18
+ }
@@ -26,9 +26,11 @@ import * as i0 from "@angular/core";
26
26
  export declare class DocsCodeExampleComponent {
27
27
  props: DocsCodeExampleMetadata;
28
28
  previewTpl?: TemplateRef<any>;
29
+ private syntaxService;
29
30
  protected activeTab: import("@angular/core").WritableSignal<number>;
30
31
  protected copied: import("@angular/core").WritableSignal<boolean>;
31
32
  protected currentTab(): DocsCodeTab;
33
+ protected highlightedCode(): string;
32
34
  copyCode(): Promise<void>;
33
35
  static ɵfac: i0.ɵɵFactoryDeclaration<DocsCodeExampleComponent, never>;
34
36
  static ɵcmp: i0.ɵɵComponentDeclaration<DocsCodeExampleComponent, "val-docs-code-example", never, { "props": { "alias": "props"; "required": false; }; }, {}, ["previewTpl"], never, true, never>;
@@ -0,0 +1,47 @@
1
+ import { EventEmitter, ElementRef, OnDestroy } from '@angular/core';
2
+ import { Router } from '@angular/router';
3
+ import { DocsSearchMetadata, DocsSearchResult } from './types';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * val-docs-search
7
+ *
8
+ * A search component for documentation with keyboard navigation support.
9
+ * Supports Cmd+K / Ctrl+K shortcut to open.
10
+ *
11
+ * @example
12
+ * ```html
13
+ * <val-docs-search
14
+ * [props]="{
15
+ * placeholder: 'Search docs...',
16
+ * sections: sidebarSections,
17
+ * showShortcut: true
18
+ * }"
19
+ * (navigate)="onNavigate($event)"
20
+ * ></val-docs-search>
21
+ * ```
22
+ */
23
+ export declare class DocsSearchComponent implements OnDestroy {
24
+ private router;
25
+ props: DocsSearchMetadata;
26
+ navigate: EventEmitter<string[]>;
27
+ search: EventEmitter<string>;
28
+ searchInputEl?: ElementRef<HTMLInputElement>;
29
+ protected searchQuery: import("@angular/core").WritableSignal<string>;
30
+ protected showResults: import("@angular/core").WritableSignal<boolean>;
31
+ protected selectedIndex: import("@angular/core").WritableSignal<number>;
32
+ private searchSubject;
33
+ private destroy$;
34
+ readonly isMac: boolean;
35
+ protected results: import("@angular/core").Signal<DocsSearchResult[]>;
36
+ constructor(router: Router);
37
+ ngOnDestroy(): void;
38
+ onGlobalKeydown(event: KeyboardEvent): void;
39
+ onQueryChange(query: string): void;
40
+ onFocus(): void;
41
+ onBlur(): void;
42
+ onInputKeydown(event: KeyboardEvent): void;
43
+ selectResult(result: DocsSearchResult): void;
44
+ clearSearch(): void;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocsSearchComponent, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocsSearchComponent, "val-docs-search", never, { "props": { "alias": "props"; "required": false; }; }, { "navigate": "navigate"; "search": "search"; }, never, never, true, never>;
47
+ }
@@ -0,0 +1,27 @@
1
+ export interface DocsSearchMetadata {
2
+ /** Placeholder text for the search input */
3
+ placeholder?: string;
4
+ /** Sections to search through */
5
+ sections?: DocsSearchSection[];
6
+ /** Debounce time in milliseconds */
7
+ debounceMs?: number;
8
+ /** Show keyboard shortcut hint (Cmd+K / Ctrl+K) */
9
+ showShortcut?: boolean;
10
+ /** Custom CSS class */
11
+ cssClass?: string;
12
+ }
13
+ export interface DocsSearchSection {
14
+ title: string;
15
+ items: DocsSearchItem[];
16
+ }
17
+ export interface DocsSearchItem {
18
+ label: string;
19
+ route: string[];
20
+ description?: string;
21
+ keywords?: string[];
22
+ }
23
+ export interface DocsSearchResult {
24
+ section: string;
25
+ item: DocsSearchItem;
26
+ matchType: 'label' | 'description' | 'keyword';
27
+ }
@@ -90,7 +90,7 @@ export declare class ArticleComponent implements OnInit {
90
90
  contentInterpolation?: Record<string, string | number>;
91
91
  icon?: import("valtech-components").IconMetada;
92
92
  shape?: "round";
93
- size?: "default" | "small" | "large";
93
+ size?: "small" | "large" | "default";
94
94
  fill?: "default" | "clear" | "outline" | "solid";
95
95
  type: "button" | "submit" | "reset";
96
96
  token?: string;
@@ -34,6 +34,7 @@ export declare class DocsLayoutComponent {
34
34
  protected isMobile: import("@angular/core").Signal<boolean>;
35
35
  protected isTablet: import("@angular/core").Signal<boolean>;
36
36
  onResize(): void;
37
+ onEscapeKey(): void;
37
38
  toggleSidebar(): void;
38
39
  closeSidebar(): void;
39
40
  static ɵfac: i0.ɵɵFactoryDeclaration<DocsLayoutComponent, never>;
@@ -0,0 +1 @@
1
+ export { SyntaxHighlightService } from './syntax-highlight.service';
@@ -0,0 +1,52 @@
1
+ import 'prismjs/components/prism-typescript';
2
+ import 'prismjs/components/prism-javascript';
3
+ import 'prismjs/components/prism-css';
4
+ import 'prismjs/components/prism-scss';
5
+ import 'prismjs/components/prism-json';
6
+ import 'prismjs/components/prism-bash';
7
+ import 'prismjs/components/prism-markdown';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * SyntaxHighlightService
11
+ *
12
+ * Provides syntax highlighting using Prism.js.
13
+ * Supports common web development languages.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const highlighted = syntaxService.highlight(code, 'typescript');
18
+ * ```
19
+ */
20
+ export declare class SyntaxHighlightService {
21
+ private loaded;
22
+ /**
23
+ * Check if Prism is loaded and ready
24
+ */
25
+ isLoaded(): boolean;
26
+ /**
27
+ * Highlight code string with the specified language
28
+ * @param code - The code string to highlight
29
+ * @param language - The language for syntax highlighting
30
+ * @returns HTML string with syntax highlighting classes
31
+ */
32
+ highlight(code: string, language: string): string;
33
+ /**
34
+ * Highlight all code elements in a container
35
+ * @param container - The container element or selector
36
+ */
37
+ highlightAllIn(container: HTMLElement | string): void;
38
+ /**
39
+ * Get list of supported languages
40
+ */
41
+ getSupportedLanguages(): string[];
42
+ /**
43
+ * Normalize language aliases
44
+ */
45
+ private normalizeLanguage;
46
+ /**
47
+ * Escape HTML special characters for safe display
48
+ */
49
+ private escapeHtml;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<SyntaxHighlightService, never>;
51
+ static ɵprov: i0.ɵɵInjectableDeclaration<SyntaxHighlightService>;
52
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.544",
3
+ "version": "2.0.545",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
package/public-api.d.ts CHANGED
@@ -241,6 +241,11 @@ export * from './lib/components/molecules/docs-api-table/docs-api-table.componen
241
241
  export * from './lib/components/molecules/docs-api-table/types';
242
242
  export * from './lib/components/molecules/docs-code-example/docs-code-example.component';
243
243
  export * from './lib/components/molecules/docs-code-example/types';
244
+ export * from './lib/components/molecules/docs-search/docs-search.component';
245
+ export * from './lib/components/molecules/docs-search/types';
246
+ export * from './lib/components/molecules/docs-breadcrumb/docs-breadcrumb.component';
247
+ export * from './lib/components/molecules/docs-breadcrumb/types';
248
+ export * from './lib/services/syntax-highlight';
244
249
  export * from './lib/components/types';
245
250
  export * from './lib/shared/pipes/process-links.pipe';
246
251
  export * from './lib/shared/utils/dom';