@akcelik/strct 5.20.0 → 5.22.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": "@akcelik/strct",
3
- "version": "5.20.0",
3
+ "version": "5.22.0",
4
4
  "description": "UIStruct — a standalone Angular component library with a tokenised, multi-palette theme system, built for datacenter / infrastructure management UIs.",
5
5
  "author": "Serkan Akcelik <serkan.akcelik@gmail.com>",
6
6
  "license": "MIT",
@@ -4200,6 +4200,8 @@ interface StrctDatagridLabels {
4200
4200
  * reorders every row, a page replaces them, a filter hides most of them —
4201
4201
  * none of it is visible to someone who cannot see the table.
4202
4202
  */
4203
+ /** The resize separator's name, per column. */
4204
+ resizeColumn: (column: string) => string;
4203
4205
  /** The two empty states, and the way out of the filtered one. */
4204
4206
  noMatches: string;
4205
4207
  noMatchesFor: (query: string) => string;
@@ -4545,6 +4547,7 @@ declare class StrctDatagrid {
4545
4547
  quickFilter: string;
4546
4548
  loadMore: string;
4547
4549
  showing: (shown: number, total?: number) => string;
4550
+ resizeColumn: (column: string) => string;
4548
4551
  noMatches: string;
4549
4552
  noMatchesFor: (query: string) => string;
4550
4553
  clearFilters: string;
@@ -4725,13 +4728,31 @@ declare class StrctDatagrid {
4725
4728
  private readonly selected;
4726
4729
  protected readonly selectedCount: _angular_core.Signal<number>;
4727
4730
  private readonly expandedRows;
4728
- private readonly columnWidths;
4731
+ protected readonly columnWidths: _angular_core.WritableSignal<Map<string, number>>;
4729
4732
  protected readonly hiddenColumns: _angular_core.WritableSignal<Set<string>>;
4730
4733
  protected readonly chooserOpen: _angular_core.WritableSignal<boolean>;
4731
4734
  private resizeState;
4732
4735
  private readonly onMove;
4733
4736
  private readonly onUp;
4734
4737
  colWidth(key: string): string | null;
4738
+ /**
4739
+ * A focusable separator owes ARIA a value, and a column that has never been
4740
+ * resized has no stored width — so the header's real width is swept after
4741
+ * render and whenever the grid resizes. Without it every handle was an
4742
+ * `aria-required-attr` violation (12 of them on the showcase's own page).
4743
+ */
4744
+ private readonly measuredWidths;
4745
+ protected separatorValue(key: string): number | null;
4746
+ private sweepHeaderWidths;
4747
+ /**
4748
+ * The keyboard half of a resize: the arrows step 16px (4px with Shift for a
4749
+ * fine adjustment), Home gives the column back its natural width. Steps are
4750
+ * the only way a separator can be moved without a pointer.
4751
+ */
4752
+ protected onResizeKey(event: KeyboardEvent, key: string): void;
4753
+ /** Give the column back the width the content asks for. */
4754
+ protected resetWidth(key: string): void;
4755
+ private setColumnWidth;
4735
4756
  onResizeStart(e: MouseEvent, key: string): void;
4736
4757
  private onResizeMove;
4737
4758
  private onResizeEnd;
@@ -4933,6 +4954,13 @@ declare class StrctDatagrid {
4933
4954
  private readonly vRange;
4934
4955
  /** The rows actually rendered: the virtual window, or the current page. */
4935
4956
  protected readonly renderRows: _angular_core.Signal<StrctRow[]>;
4957
+ /**
4958
+ * A virtual grid draws 23 rows of 20.000 and, without these, says it has
4959
+ * 23. The count includes the header row, as the ARIA spec asks.
4960
+ */
4961
+ protected readonly ariaRowCount: _angular_core.Signal<number | null>;
4962
+ /** 1 is the header row, so data rows start at 2. */
4963
+ protected ariaRowIndex(row: StrctRow): number | null;
4936
4964
  protected readonly topPad: _angular_core.Signal<number>;
4937
4965
  protected readonly bottomPad: _angular_core.Signal<number>;
4938
4966
  protected readonly stickyActive: _angular_core.Signal<boolean>;
@@ -4994,6 +5022,8 @@ declare class StrctDatagrid {
4994
5022
  /** Last serialized column state pushed outward (loop guard). */
4995
5023
  private lastStateKey;
4996
5024
  constructor();
5025
+ /** Whether the saved (or bound) column state has been read yet. */
5026
+ private stateRestored;
4997
5027
  private readPersistedState;
4998
5028
  private applyColumnState;
4999
5029
  /** Whether a persisted or bound state has already decided what is hidden. */
@@ -8385,6 +8415,13 @@ declare const STRCT_MD_LIMITS: {
8385
8415
  readonly depth: 8;
8386
8416
  /** Inline delimiter runs considered per text span. */
8387
8417
  readonly delimiters: 2000;
8418
+ /**
8419
+ * How far a closing delimiter or bracket is looked for. Without it every
8420
+ * unmatched opener scanned to the end of the document, once each: a 64 KiB
8421
+ * line of "*a " took 1.6 s to read, and a streamed reply is read again on
8422
+ * every token.
8423
+ */
8424
+ readonly scan: 4096;
8388
8425
  };
8389
8426
  type StrctMdAlign = 'start' | 'center' | 'end' | null;
8390
8427
  type StrctMdInline = {
@@ -8466,6 +8503,7 @@ type StrctMdTokenizer = (text: string) => StrctMdToken[];
8466
8503
  declare function strctParseMarkdown(source: string, options?: {
8467
8504
  streaming?: boolean;
8468
8505
  tokenize?: StrctMdTokenizer;
8506
+ breaks?: boolean;
8469
8507
  }): StrctMdBlock[];
8470
8508
  /**
8471
8509
  * Inline reading. Code spans win over everything (their content is literal),
@@ -8473,13 +8511,16 @@ declare function strctParseMarkdown(source: string, options?: {
8473
8511
  */
8474
8512
  declare function parseInlines(source: string, options?: {
8475
8513
  tokenize?: StrctMdTokenizer;
8514
+ breaks?: boolean;
8476
8515
  }): StrctMdInline[];
8477
8516
  /**
8478
8517
  * What a link may do. Anything that is not plainly safe stays the text the
8479
8518
  * model wrote: `javascript:`, `data:`, a protocol-relative `//host`, or
8480
8519
  * anything this does not recognise.
8481
8520
  */
8482
- declare function strctClassifyHref(href: string): 'external' | 'internal' | null;
8521
+ declare function strctClassifyHref(href: string, options?: {
8522
+ mailto?: boolean;
8523
+ }): 'external' | 'internal' | null;
8483
8524
 
8484
8525
  /**
8485
8526
  * A template for a span the consumer claimed through `tokens`, keyed by the
@@ -8539,9 +8580,25 @@ declare class StrctMarkdown {
8539
8580
  readonly linkPolicy: _angular_core.InputSignal<((href: string) => "external" | "internal" | null) | null>;
8540
8581
  /** Claim runs of plain text — an inventory id becomes an object chip. */
8541
8582
  readonly tokens: _angular_core.InputSignal<StrctMdTokenizer | null>;
8583
+ /**
8584
+ * A single newline is a line break, the way a comment box reads: a model
8585
+ * writing "Host: X\nCPU: 40 %" means two lines. Off by default, which is
8586
+ * CommonMark.
8587
+ */
8588
+ readonly breaks: _angular_core.InputSignalWithTransform<boolean, unknown>;
8589
+ /** What a screen reader hears after an external link (localisable). */
8590
+ readonly newTabLabel: _angular_core.InputSignal<string>;
8591
+ /**
8592
+ * The token templates of the view that nested this one. A list item or a
8593
+ * quote is drawn by a nested view, which has no projected content of its
8594
+ * own — without this its claimed runs fall back to plain text.
8595
+ */
8596
+ readonly inheritedTokens: _angular_core.InputSignal<readonly StrctMarkdownToken[]>;
8542
8597
  /** An in-app link was followed; the consumer routes it. */
8543
8598
  readonly navigate: _angular_core.OutputEmitterRef<string>;
8544
- private readonly tokenDefs;
8599
+ private readonly ownTokenDefs;
8600
+ /** This view's own templates, plus the ones handed down to it. */
8601
+ protected readonly allTokenDefs: _angular_core.Signal<readonly StrctMarkdownToken[]>;
8545
8602
  protected readonly blocks: _angular_core.Signal<StrctMdBlock[]>;
8546
8603
  protected level(level: number): number;
8547
8604
  protected hrefKind(href: string): 'external' | 'internal' | null;
@@ -8550,7 +8607,7 @@ declare class StrctMarkdown {
8550
8607
  protected caretOn(index: number): boolean;
8551
8608
  protected onInternal(event: Event, href: string): void;
8552
8609
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctMarkdown, never>;
8553
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctMarkdown, "strct-markdown", never, { "source": { "alias": "source"; "required": false; "isSignal": true; }; "tree": { "alias": "tree"; "required": false; "isSignal": true; }; "streaming": { "alias": "streaming"; "required": false; "isSignal": true; }; "headingOffset": { "alias": "headingOffset"; "required": false; "isSignal": true; }; "linkPolicy": { "alias": "linkPolicy"; "required": false; "isSignal": true; }; "tokens": { "alias": "tokens"; "required": false; "isSignal": true; }; }, { "navigate": "navigate"; }, ["tokenDefs"], never, true, never>;
8610
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctMarkdown, "strct-markdown", never, { "source": { "alias": "source"; "required": false; "isSignal": true; }; "tree": { "alias": "tree"; "required": false; "isSignal": true; }; "streaming": { "alias": "streaming"; "required": false; "isSignal": true; }; "headingOffset": { "alias": "headingOffset"; "required": false; "isSignal": true; }; "linkPolicy": { "alias": "linkPolicy"; "required": false; "isSignal": true; }; "tokens": { "alias": "tokens"; "required": false; "isSignal": true; }; "breaks": { "alias": "breaks"; "required": false; "isSignal": true; }; "newTabLabel": { "alias": "newTabLabel"; "required": false; "isSignal": true; }; "inheritedTokens": { "alias": "inheritedTokens"; "required": false; "isSignal": true; }; }, { "navigate": "navigate"; }, ["ownTokenDefs"], never, true, never>;
8554
8611
  }
8555
8612
 
8556
8613
  /** One product (or platform) a person may switch to. */