@life-cockpit/angular-ui-kit 2.4.0 → 2.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@life-cockpit/angular-ui-kit",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "description": "Life Cockpit Design System - Angular UI component library",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -6732,6 +6732,10 @@ interface MarkdownLinkClick {
6732
6732
  interface MarkdownRendered {
6733
6733
  headings: MarkdownHeading[];
6734
6734
  }
6735
+ interface MarkdownChangesHighlighted {
6736
+ /** Number of changed/added blocks highlighted in the current render. */
6737
+ changedBlocks: number;
6738
+ }
6735
6739
  interface RenderPart {
6736
6740
  type: 'html' | 'code' | 'mermaid';
6737
6741
  index: number;
@@ -6745,16 +6749,33 @@ interface RenderPart {
6745
6749
  * Renders GitHub-Flavored Markdown (GFM) to sanitized HTML with
6746
6750
  * optional syntax highlighting via `<lc-code-block>`.
6747
6751
  *
6752
+ * Supports headings (+ anchors), paragraphs, ordered/unordered lists, task lists
6753
+ * (`- [ ]` / `- [x]` → accessible checkbox), blockquotes, horizontal rules,
6754
+ * images, GFM tables (column alignment + horizontal scroll), bold/italic/
6755
+ * strikethrough, inline code, fenced code (incl. `mermaid`), explicit links and
6756
+ * autolinks (bare URLs / `www.` / emails, never inside code).
6757
+ *
6758
+ * Optionally highlights *changed* blocks in place: pass the pre-edit markdown as
6759
+ * `previousContent` and set `highlightChanges` — added/edited blocks (diffed at
6760
+ * block / list-item level) gain a left accent bar + subtle tint, can auto-fade
6761
+ * (`changeHighlightFadeMs`) and scroll into view (`scrollToFirstChange`).
6762
+ *
6748
6763
  * @example
6749
6764
  * ```html
6750
6765
  * <lc-markdown [content]="'# Hello World'" />
6751
6766
  * <lc-markdown [src]="'/docs/readme.md'" />
6767
+ * <lc-markdown
6768
+ * [content]="current" [previousContent]="prev"
6769
+ * [highlightChanges]="true" [changeHighlightFadeMs]="3000" />
6752
6770
  * ```
6753
6771
  */
6754
6772
  declare class MarkdownComponent implements OnDestroy {
6755
6773
  private readonly sanitizer;
6756
6774
  private readonly http;
6775
+ private readonly host;
6757
6776
  private httpSub?;
6777
+ private fadeTimer?;
6778
+ private scrollTimer?;
6758
6779
  private mermaidApiPromise?;
6759
6780
  private mermaidInitialized;
6760
6781
  private mermaidRenderRun;
@@ -6774,14 +6795,39 @@ declare class MarkdownComponent implements OnDestroy {
6774
6795
  readonly showHeadingAnchors: _angular_core.InputSignal<boolean>;
6775
6796
  /** Base URL for resolving relative links/images */
6776
6797
  readonly baseUrl: _angular_core.InputSignal<string | undefined>;
6798
+ /** Enable change highlighting (requires `previousContent` to compute a diff). */
6799
+ readonly highlightChanges: _angular_core.InputSignal<boolean>;
6800
+ /**
6801
+ * The prior Markdown. When it differs from `content`, the changed/added blocks
6802
+ * in `content` are highlighted. The caller passes the pre-edit markdown.
6803
+ */
6804
+ readonly previousContent: _angular_core.InputSignal<string | undefined>;
6805
+ /** Auto-fade the highlight after N ms. 0 / undefined ⇒ persist until content changes. */
6806
+ readonly changeHighlightFadeMs: _angular_core.InputSignal<number | undefined>;
6807
+ /** Scroll the first changed block into view when highlights appear. */
6808
+ readonly scrollToFirstChange: _angular_core.InputSignal<boolean>;
6777
6809
  /** Emitted when a link is clicked */
6778
6810
  readonly linkClick: _angular_core.OutputEmitterRef<MarkdownLinkClick>;
6779
6811
  /** Emitted after rendering with heading TOC */
6780
6812
  readonly rendered: _angular_core.OutputEmitterRef<MarkdownRendered>;
6813
+ /** Emitted after a render that produced change highlights. */
6814
+ readonly changesHighlighted: _angular_core.OutputEmitterRef<MarkdownChangesHighlighted>;
6781
6815
  /** Internal resolved markdown source */
6782
6816
  protected resolvedMarkdown: _angular_core.WritableSignal<string>;
6783
6817
  /** Parsed result (computed once from resolvedMarkdown) */
6784
6818
  private parsed;
6819
+ /**
6820
+ * Rendered HTML after applying change highlights. When highlighting is off (or
6821
+ * there is no differing `previousContent`) this returns the parsed HTML
6822
+ * unchanged, so the non-highlight path is byte-for-byte identical to before.
6823
+ */
6824
+ private readonly highlightResult;
6825
+ /** Number of changed/added blocks highlighted in the current render. */
6826
+ protected readonly changedCount: _angular_core.Signal<number>;
6827
+ /** Visually-hidden polite summary announced when highlights appear. */
6828
+ protected readonly changeSummary: _angular_core.Signal<string>;
6829
+ /** Whether the current highlights have faded out (after `changeHighlightFadeMs`). */
6830
+ protected readonly highlightsFaded: _angular_core.WritableSignal<boolean>;
6785
6831
  /** Computed render parts (HTML chunks + code blocks interleaved) */
6786
6832
  protected renderParts: _angular_core.Signal<RenderPart[]>;
6787
6833
  protected containerClasses: _angular_core.Signal<string>;
@@ -6791,17 +6837,45 @@ declare class MarkdownComponent implements OnDestroy {
6791
6837
  constructor();
6792
6838
  ngOnDestroy(): void;
6793
6839
  protected onLinkClick(event: MouseEvent): void;
6840
+ /** Side-effects for a render: emit, (re)arm the fade timer, optional scroll. */
6841
+ private onHighlightResult;
6842
+ private scrollToFirstChanged;
6843
+ /**
6844
+ * Wraps the changed/added top-level blocks of `html` with
6845
+ * `.lc-markdown__block--changed`. A block is "changed" when its normalized
6846
+ * text is not present among the blocks of `prevMarkdown`. Lists are diffed
6847
+ * per `<li>` and tables per `<tr>` so a single edited item highlights alone.
6848
+ */
6849
+ private applyChangeHighlights;
6850
+ /** Normalized text set of the logical blocks within an HTML fragment. */
6851
+ private collectBlockKeys;
6852
+ /**
6853
+ * Visits each diffable block under `root`: top-level elements, but descending
6854
+ * into `<ul>`/`<ol>` (per `<li>`) and `<table>` (per `<tr>`).
6855
+ */
6856
+ private eachLogicalBlock;
6857
+ private blockTextKey;
6858
+ private htmlToElement;
6794
6859
  private loadFromUrl;
6795
6860
  private splitIntoParts;
6796
6861
  private parseMarkdown;
6797
6862
  private parseTables;
6863
+ /** Splits a pipe-table row into trimmed cells, dropping the leading/trailing edges. */
6864
+ private splitTableRow;
6798
6865
  private escapeHtml;
6866
+ /**
6867
+ * Linkifies bare URLs (`http(s)://…`, `www.…`) and email addresses in text,
6868
+ * leaving anything inside an existing `<a>` or `<code>` (and all tag
6869
+ * attributes) untouched. The HTML is tokenized into tags vs. text so only
6870
+ * top-level text runs are linkified.
6871
+ */
6872
+ private autolink;
6799
6873
  protected mermaidSvgFor(index: number): SafeHtml | null;
6800
6874
  protected mermaidErrorFor(index: number): string | null;
6801
6875
  private renderMermaidParts;
6802
6876
  private getMermaidApi;
6803
6877
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MarkdownComponent, never>;
6804
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MarkdownComponent, "lc-markdown", never, { "src": { "alias": "src"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "linkTarget": { "alias": "linkTarget"; "required": false; "isSignal": true; }; "sanitize": { "alias": "sanitize"; "required": false; "isSignal": true; }; "syntaxHighlight": { "alias": "syntaxHighlight"; "required": false; "isSignal": true; }; "showHeadingAnchors": { "alias": "showHeadingAnchors"; "required": false; "isSignal": true; }; "baseUrl": { "alias": "baseUrl"; "required": false; "isSignal": true; }; }, { "linkClick": "linkClick"; "rendered": "rendered"; }, never, never, true, never>;
6878
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MarkdownComponent, "lc-markdown", never, { "src": { "alias": "src"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "linkTarget": { "alias": "linkTarget"; "required": false; "isSignal": true; }; "sanitize": { "alias": "sanitize"; "required": false; "isSignal": true; }; "syntaxHighlight": { "alias": "syntaxHighlight"; "required": false; "isSignal": true; }; "showHeadingAnchors": { "alias": "showHeadingAnchors"; "required": false; "isSignal": true; }; "baseUrl": { "alias": "baseUrl"; "required": false; "isSignal": true; }; "highlightChanges": { "alias": "highlightChanges"; "required": false; "isSignal": true; }; "previousContent": { "alias": "previousContent"; "required": false; "isSignal": true; }; "changeHighlightFadeMs": { "alias": "changeHighlightFadeMs"; "required": false; "isSignal": true; }; "scrollToFirstChange": { "alias": "scrollToFirstChange"; "required": false; "isSignal": true; }; }, { "linkClick": "linkClick"; "rendered": "rendered"; "changesHighlighted": "changesHighlighted"; }, never, never, true, never>;
6805
6879
  }
6806
6880
 
6807
6881
  type LogLevel = 'debug' | 'info' | 'warn' | 'error';
@@ -7171,4 +7245,4 @@ declare class StageListComponent {
7171
7245
  }
7172
7246
 
7173
7247
  export { AccordionComponent, AccordionGroupComponent, AlertComponent, AnimationDurationFast, AnimationEasingEaseIn, AnimationEasingEaseInOut, AnimationEasingEaseOut, AreaChartComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, BarChartComponent, BorderRadius2xl, BorderRadiusFull, BorderRadiusLg, BorderRadiusMd, BorderRadiusNone, BorderRadiusSm, BorderRadiusXl, BreadcrumbsComponent, ButtonComponent, CalendarComponent, CalloutComponent, CardComponent, ChatComponent, CheckboxComponent, ChipComponent, CodeBlockComponent, ColorAccentOrange, ColorAccentPurple, ColorAccentRed, ColorAccentRust, ColorAccentViolet, ColorBackgroundDark, ColorErrorDark, ColorErrorDefault, ColorErrorLight, ColorInfoDark, ColorInfoDefault, ColorInfoLight, ColorNeutral100, ColorNeutral200, ColorNeutral300, ColorNeutral400, ColorNeutral50, ColorNeutral500, ColorNeutral600, ColorNeutral700, ColorNeutral800, ColorNeutral900, ColorPickerComponent, ColorPrimary100, ColorPrimary200, ColorPrimary300, ColorPrimary400, ColorPrimary50, ColorPrimary500, ColorPrimary600, ColorPrimary700, ColorPrimary800, ColorPrimary900, ColorSecondary100, ColorSecondary200, ColorSecondary300, ColorSecondary400, ColorSecondary50, ColorSecondary500, ColorSecondary600, ColorSecondary700, ColorSecondary800, ColorSecondary900, ColorSuccessDark, ColorSuccessDefault, ColorSuccessLight, ColorSurfaceDarkBase, ColorSurfaceDarkRaised, ColorSurfaceDarkSunken, ColorTextDarkPrimary, ColorTextDarkSecondary, ColorTextDarkTertiary, ColorWarningDark, ColorWarningDefault, ColorWarningLight, ComboboxComponent, ConfirmDialogComponent, ConfirmService, ContainerComponent, DateRangePickerComponent, DatepickerComponent, DependencyViewerComponent, DiffViewerComponent, DividerComponent, DocumentViewerComponent, DonutChartComponent, DrawerComponent, Elevation1, Elevation2, Elevation3, Elevation4, EmailInputComponent, EmptyStateComponent, ErrorDisplayComponent, FILE_FALLBACK_ICON, FOLDER_ICON, FOLDER_OPEN_ICON, FieldGroupComponent, FileUploadComponent, FilterBarComponent, FooterComponent, FunnelChartComponent, GalleryComponent, GanttChartComponent, GaugeComponent, HeaderComponent, HeatmapComponent, HeroComponent, IconComponent, InputComponent, KanbanBoardComponent, LC_LOGO_BASE_PATH, LineChartComponent, ListComponent, ListItemTemplateDirective, LogViewerComponent, LogoComponent, MarkdownComponent, MenuComponent, ModalComponent, NotificationCenterComponent, NumberInputComponent, PageHeaderComponent, PageLayoutComponent, PaginationComponent, PasswordInputComponent, PieChartComponent, PopoverComponent, ProgressBarComponent, ProgressRingComponent, RadarChartComponent, RadioComponent, RatingComponent, RichTextEditorComponent, ScatterPlotComponent, SearchInputComponent, SectionComponent, SelectComponent, SidenavComponent, SizeInteractiveLgFontSize, SizeInteractiveLgHeight, SizeInteractiveLgPadding, SizeInteractiveMdFontSize, SizeInteractiveMdHeight, SizeInteractiveMdPadding, SizeInteractiveSmFontSize, SizeInteractiveSmHeight, SizeInteractiveSmPadding, SizeInteractiveXsFontSize, SizeInteractiveXsHeight, SizeInteractiveXsPadding, SizeMinTouchHeight, SizeMinTouchWidth, SkeletonComponent, SliderComponent, SpacerComponent, Spacing0, Spacing05, Spacing1, Spacing10, Spacing11, Spacing12, Spacing14, Spacing15, Spacing16, Spacing2, Spacing25, Spacing3, Spacing35, Spacing4, Spacing5, Spacing6, Spacing7, Spacing8, Spacing9, SparklineComponent, SpinnerComponent, StackComponent, StackedBarChartComponent, StageListComponent, StatTrendComponent, StepperComponent, SwitchComponent, TabComponent, TableCellDirective, TableComponent, TabsComponent, TagInputComponent, TextareaComponent, ThemeService, TimelineComponent, ToastComponent, ToastService, ToggleGroupComponent, ToolbarComponent, TooltipContentComponent, TooltipDirective, TreeViewComponent, TypographyComponent, TypographyFontFamilyBase, TypographyFontFamilyMono, TypographyFontSize2xl, TypographyFontSize3xl, TypographyFontSize4xl, TypographyFontSize5xl, TypographyFontSize6xl, TypographyFontSizeBase, TypographyFontSizeLg, TypographyFontSizeSm, TypographyFontSizeXl, TypographyFontSizeXs, TypographyFontWeightBold, TypographyFontWeightMedium, TypographyFontWeightNormal, TypographyFontWeightSemibold, TypographyLineHeightNormal, TypographyLineHeightRelaxed, TypographyLineHeightTight, VerificationCodeInputComponent, WaterfallChartComponent, resolveFileIcon };
7174
- export type { ActionClickEvent, AlertVariant, AreaChartSeries, AvatarGroupItem, AvatarSize, AvatarStatus, BadgeSize, BadgeVariant, BarChartItem, BarChartOrientation, BreadcrumbItem, BreadcrumbSize, ButtonSize, ButtonType, ButtonVariant, CalendarEvent, CalendarView, CalloutVariant, CellEditEvent, ChatAttachment, ChatFileAttachEvent, ChatMessage, ChatMessageRole, ChatMessageStatus, ChatRenderMarkdown, ChatSendEvent, CheckboxSize, ChipSize, ChipVariant, CodeBlockLanguage, ComboboxOption, ComboboxSize, ComboboxValue, ConfirmDialogVariant, ConfirmOptions, ContainerSize, DateRange, DateValue, DependencyDirection, DependencyEdgeDef, DependencyNode, DependencyNodeStatus, DependencyRelation, DiffViewMode, DividerOrientation, DividerSpacing, DividerVariant, DocumentType, DonutChartSize, DonutSegment, DrawerPosition, DrawerSize, EmptyStateSize, ErrorSeverity, FileUploadFile, FilterConfig, FilterOption, FilterValues, FooterLink, FooterSection, FooterVariant, FunnelStep, GalleryItem, GalleryLayout, GallerySize, GanttDependency, GanttTask, GaugeColor, GaugeSize, HeatmapCell, HeroColor, HeroSize, HeroVariant, IconSize, IconVariant, KanbanCard, KanbanColumn, KanbanLabel, KanbanMoveEvent, LineChartSeries, ListItem, ListOrientation, ListSize, ListVariant, LogLevel, LogLine, LogViewerVariant, MarkdownHeading, MarkdownLinkClick, MarkdownRendered, MenuItem, ModalSize, NavigationItem, Notification, NotificationPriority, NotificationType, PageLayoutFill, PaginationSize, PasswordRequirement, PasswordStrength, PieChartSize, PieSegment, PopoverPosition, PopoverTrigger, ProgressBarColor, ProgressBarSize, ProgressBarVariant, ProgressRingColor, ProgressRingSize, RadarChartSeries, RadioSize, RatingSize, RenderPart, RequireTextConfig, RichTextEditorMode, RowToggleEvent, ScatterPoint, ScatterSeries, SearchInputSize, SectionBackground, SectionSpacing, SelectOption, SelectOptionGroup, SelectValue, SelectionChangeEvent, SidenavMode, SidenavPosition, SkeletonVariant, SortEvent, SpacerSize, SparklineColor, SparklineCurve, SpinnerSize, StackAlign, StackDirection, StackGap, StackJustify, StackedBarCategory, StackedBarLegend, StackedBarOrientation, StageItem, StageListSize, StatTrendDirection, StepState, StepperStep, TabOrientation, TableAction, TableActionsAlign, TableColumn, TableSize, TableTreeConfig, TableVariant, ThemeConfig, ThemeMode, ThemeState, TimelineItem, TimelineOrientation, Toast, ToastAction, ToastConfig, ToastPosition, ToastVariant, ToggleOption, ToolbarAction, ToolbarConfig, TooltipPosition, TreeNode, TreeNodeType, WaterfallItem };
7248
+ export type { ActionClickEvent, AlertVariant, AreaChartSeries, AvatarGroupItem, AvatarSize, AvatarStatus, BadgeSize, BadgeVariant, BarChartItem, BarChartOrientation, BreadcrumbItem, BreadcrumbSize, ButtonSize, ButtonType, ButtonVariant, CalendarEvent, CalendarView, CalloutVariant, CellEditEvent, ChatAttachment, ChatFileAttachEvent, ChatMessage, ChatMessageRole, ChatMessageStatus, ChatRenderMarkdown, ChatSendEvent, CheckboxSize, ChipSize, ChipVariant, CodeBlockLanguage, ComboboxOption, ComboboxSize, ComboboxValue, ConfirmDialogVariant, ConfirmOptions, ContainerSize, DateRange, DateValue, DependencyDirection, DependencyEdgeDef, DependencyNode, DependencyNodeStatus, DependencyRelation, DiffViewMode, DividerOrientation, DividerSpacing, DividerVariant, DocumentType, DonutChartSize, DonutSegment, DrawerPosition, DrawerSize, EmptyStateSize, ErrorSeverity, FileUploadFile, FilterConfig, FilterOption, FilterValues, FooterLink, FooterSection, FooterVariant, FunnelStep, GalleryItem, GalleryLayout, GallerySize, GanttDependency, GanttTask, GaugeColor, GaugeSize, HeatmapCell, HeroColor, HeroSize, HeroVariant, IconSize, IconVariant, KanbanCard, KanbanColumn, KanbanLabel, KanbanMoveEvent, LineChartSeries, ListItem, ListOrientation, ListSize, ListVariant, LogLevel, LogLine, LogViewerVariant, MarkdownChangesHighlighted, MarkdownHeading, MarkdownLinkClick, MarkdownRendered, MenuItem, ModalSize, NavigationItem, Notification, NotificationPriority, NotificationType, PageLayoutFill, PaginationSize, PasswordRequirement, PasswordStrength, PieChartSize, PieSegment, PopoverPosition, PopoverTrigger, ProgressBarColor, ProgressBarSize, ProgressBarVariant, ProgressRingColor, ProgressRingSize, RadarChartSeries, RadioSize, RatingSize, RenderPart, RequireTextConfig, RichTextEditorMode, RowToggleEvent, ScatterPoint, ScatterSeries, SearchInputSize, SectionBackground, SectionSpacing, SelectOption, SelectOptionGroup, SelectValue, SelectionChangeEvent, SidenavMode, SidenavPosition, SkeletonVariant, SortEvent, SpacerSize, SparklineColor, SparklineCurve, SpinnerSize, StackAlign, StackDirection, StackGap, StackJustify, StackedBarCategory, StackedBarLegend, StackedBarOrientation, StageItem, StageListSize, StatTrendDirection, StepState, StepperStep, TabOrientation, TableAction, TableActionsAlign, TableColumn, TableSize, TableTreeConfig, TableVariant, ThemeConfig, ThemeMode, ThemeState, TimelineItem, TimelineOrientation, Toast, ToastAction, ToastConfig, ToastPosition, ToastVariant, ToggleOption, ToolbarAction, ToolbarConfig, TooltipPosition, TreeNode, TreeNodeType, WaterfallItem };