1ch 0.4.0 → 0.5.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/README.md CHANGED
@@ -33,8 +33,8 @@ function DeployPanel() {
33
33
  <term-ui width="60" mode="dark">
34
34
  <section gap="1">
35
35
  <article title="deploy v2.4.1">
36
- <progress data-label="build" value={build} max="100"></progress>
37
- <progress data-label="tests" value="94" max="100"></progress>
36
+ <progress label="build" value={build} max="100"></progress>
37
+ <progress label="tests" value="94" max="100"></progress>
38
38
  </article>
39
39
  <figure height="4" fill>
40
40
  {metrics.map(v => <data value={v} />)}
@@ -67,7 +67,7 @@ Zero dependencies. Also does markdown and JSON (`source-format="markdown"` on th
67
67
  | Element | Becomes |
68
68
  |---------|---------|
69
69
  | `<article title="X">` | box |
70
- | `<figure>` | chart (text content, `<data>` children, or `data-values`) |
70
+ | `<figure>` | chart (text content, `<data>` children, or `values`) |
71
71
  | `<footer left="X" right="Y">` | status bar |
72
72
  | `<nav>` | horizontal stack |
73
73
  | `<progress>` | bar |
@@ -76,7 +76,7 @@ Zero dependencies. Also does markdown and JSON (`source-format="markdown"` on th
76
76
  | `<table>` | table |
77
77
  | `<section>`, `<div>` | container (layout from CSS) |
78
78
 
79
- `data-term="..."` and `term-*` tags available when you need to be explicit. Custom tag compilers via `registerHtmlTagCompiler()`. Full details in the [docs](https://1ch.app/docs).
79
+ Need custom behavior? Register your own compiler via `registerHtmlTagCompiler()`. Full details in the [docs](https://1ch.app/docs).
80
80
 
81
81
  ## License
82
82
 
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ type Style = {
6
6
  dim?: boolean;
7
7
  inverted?: boolean;
8
8
  blink?: boolean;
9
+ interactionId?: string;
9
10
  onClick?: () => void;
10
11
  noSelect?: boolean;
11
12
  cell?: number;
@@ -208,6 +209,7 @@ declare function tabs(names: string[], active: number, opts?: {
208
209
  separatorColor?: string;
209
210
  onSelect?: (index: number) => void;
210
211
  onClicks?: ((() => void) | undefined)[];
212
+ interactionIds?: (string | undefined)[];
211
213
  theme?: Theme;
212
214
  }): LayoutFn;
213
215
  declare function badge(label: string, opts?: {
@@ -360,6 +362,7 @@ type MarkdownThemeOverrides = Partial<ThemeMarkdown>;
360
362
 
361
363
  type TermAction = {
362
364
  type: "action";
365
+ key: string;
363
366
  id?: string;
364
367
  text: string;
365
368
  tag: string;
@@ -367,6 +370,7 @@ type TermAction = {
367
370
  sourceElement?: Element;
368
371
  } | {
369
372
  type: "link";
373
+ key: string;
370
374
  href?: string;
371
375
  text: string;
372
376
  tag: string;
@@ -584,9 +588,11 @@ declare class TermUIElement extends HTMLElement {
584
588
  private layoutOverride?;
585
589
  private resizeObserver?;
586
590
  private mutationObserver?;
591
+ private observedShadowRoots;
587
592
  private mediaQuery?;
588
593
  private mediaQueryListener?;
589
- private scheduled;
594
+ private renderQueued;
595
+ private renderFrameId;
590
596
  constructor();
591
597
  connectedCallback(): void;
592
598
  disconnectedCallback(): void;
@@ -595,6 +601,7 @@ declare class TermUIElement extends HTMLElement {
595
601
  get layout(): LayoutFn | undefined;
596
602
  set layout(next: LayoutFn | null | undefined);
597
603
  private queueRender;
604
+ private observeOpenShadowRoots;
598
605
  private onAction;
599
606
  private measureCharacterWidth;
600
607
  private resolveColumns;