@mintplayer/web-components 2.10.0 → 2.12.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/accordion/index.mjs +4 -4
- package/charts/core/index.d.ts +1 -0
- package/charts/core/index.mjs +19 -0
- package/charts/core/src/arc.d.ts +28 -0
- package/charts/core/src/color.d.ts +11 -0
- package/charts/core/src/hierarchy-layout.d.ts +68 -0
- package/charts/core/src/index.d.ts +5 -0
- package/charts/core/src/scale.d.ts +21 -0
- package/charts/core/src/types.d.ts +52 -0
- package/charts/hierarchy/index.d.ts +1 -0
- package/charts/hierarchy/index.mjs +816 -0
- package/charts/hierarchy/src/components/index.d.ts +1 -0
- package/charts/hierarchy/src/components/mp-hierarchy-chart.d.ts +188 -0
- package/charts/hierarchy/src/index.d.ts +2 -0
- package/charts/hierarchy/src/styles/hierarchy-chart.styles.d.ts +2 -0
- package/charts/hierarchy/src/styles/index.d.ts +1 -0
- package/charts/sparkline/index.d.ts +1 -0
- package/charts/sparkline/index.mjs +162 -0
- package/charts/sparkline/src/components/index.d.ts +1 -0
- package/charts/sparkline/src/components/mp-sparkline.d.ts +51 -0
- package/charts/sparkline/src/index.d.ts +1 -0
- package/charts/sparkline/src/styles/index.d.ts +1 -0
- package/charts/sparkline/src/styles/sparkline.styles.d.ts +2 -0
- package/charts/trend/index.d.ts +1 -0
- package/charts/trend/index.mjs +432 -0
- package/charts/trend/src/components/index.d.ts +1 -0
- package/charts/trend/src/components/mp-trend-chart.d.ts +104 -0
- package/charts/trend/src/index.d.ts +2 -0
- package/charts/trend/src/styles/index.d.ts +1 -0
- package/charts/trend/src/styles/trend-chart.styles.d.ts +2 -0
- package/checkbox/index.mjs +1 -1
- package/chunks/color-5yPBn70k.mjs +179 -0
- package/chunks/{form-check.styles-jBlHetYX.mjs → form-check.styles-B0pxJ6YC.mjs} +2 -2
- package/chunks/{form-control.styles-BOTBdmvg.mjs → form-control.styles-C3j87Sn3.mjs} +1 -1
- package/chunks/{mp-checkbox-6EJwdUIn.mjs → mp-checkbox-CzwS7Y_t.mjs} +2 -2
- package/chunks/{mp-datatable-25O1GtvU.mjs → mp-datatable-GmKqaN8y.mjs} +1 -1
- package/chunks/{mp-radio-DvKgrTFL.mjs → mp-radio-cL46sUA0.mjs} +2 -2
- package/chunks/{mp-select-lHP00OBH.mjs → mp-select-BNrbPwN4.mjs} +1 -1
- package/chunks/{mp-toggle-button-C4Loq_p4.mjs → mp-toggle-button-eo_aTQtu.mjs} +32 -32
- package/chunks/scale-B0bRUdc7.mjs +91 -0
- package/code-snippet/index.mjs +788 -176
- package/code-snippet/src/core/highlighter.d.ts +39 -0
- package/code-snippet/src/core/split-lines.d.ts +44 -0
- package/code-snippet/src/hljs-loaders.generated.d.ts +14 -0
- package/code-snippet/src/index.d.ts +2 -0
- package/code-snippet/src/mp-code-snippet.element.d.ts +172 -2
- package/code-snippet/src/styles/code-snippet.styles.d.ts +2 -0
- package/code-snippet/src/styles/index.d.ts +1 -0
- package/code-snippet/src/types/code-line-annotation.d.ts +29 -0
- package/code-snippet/src/types/index.d.ts +1 -0
- package/datatable/index.mjs +1 -1
- package/file-manager/index.mjs +1 -1
- package/package.json +17 -1
- package/phone-input/index.mjs +26 -12
- package/phone-input/src/components/mp-phone-input.d.ts +9 -0
- package/query-builder/index.mjs +101 -101
- package/radio/index.mjs +1 -1
- package/radio-group/index.mjs +1 -1
- package/scheduler/index.mjs +3 -3
- package/select/index.mjs +1 -1
- package/toggle-button/index.mjs +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LanguageFn } from 'highlight.js';
|
|
2
|
+
/**
|
|
3
|
+
* Distinguishes "that language does not exist" from "the chunk failed to
|
|
4
|
+
* load". Collapsing them is how a lazy highlighter silently renders plain text
|
|
5
|
+
* forever: the old synchronous code caught hljs's `Unknown language` throw and
|
|
6
|
+
* fell through to auto-detect, which under lazy loading would swallow a failed
|
|
7
|
+
* network request with no diagnostic.
|
|
8
|
+
*/
|
|
9
|
+
export type LanguageLoad = 'ready' | 'unknown-language' | 'load-failed';
|
|
10
|
+
/**
|
|
11
|
+
* Register a grammar outside the 36 the loader map covers, or a custom one.
|
|
12
|
+
* The escape hatch that keeps the lazy map from being a ceiling.
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerLanguage(name: string, language: LanguageFn): void;
|
|
15
|
+
/** Whether a language id or alias can be highlighted, now or after a load. */
|
|
16
|
+
export declare function canHighlight(key: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Ensure the grammar behind `key` is registered. Resolves to what happened
|
|
19
|
+
* rather than throwing: passing a language this build does not ship is a
|
|
20
|
+
* normal thing for a consumer to do, and normal control flow should not be an
|
|
21
|
+
* exception.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ensureLanguage(key: string): Promise<LanguageLoad>;
|
|
24
|
+
export declare function ensureCommonLanguages(): Promise<boolean>;
|
|
25
|
+
export interface HighlightOutcome {
|
|
26
|
+
/** Highlighted HTML, or '' when nothing could be highlighted. */
|
|
27
|
+
value: string;
|
|
28
|
+
/** Resolved grammar id, or null when the source was left as plain text. */
|
|
29
|
+
language: string | null;
|
|
30
|
+
load: LanguageLoad;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Highlight `source`, loading whatever grammar is needed first.
|
|
34
|
+
*
|
|
35
|
+
* Never throws: an unknown language or a failed chunk yields `value: ''` plus
|
|
36
|
+
* a `load` the caller can act on, and the element renders escaped plain text —
|
|
37
|
+
* which is also what it shows while the grammar is still in flight.
|
|
38
|
+
*/
|
|
39
|
+
export declare function highlight(source: string, language: string): Promise<HighlightOutcome>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning highlight.js output into per-line rows.
|
|
3
|
+
*
|
|
4
|
+
* highlight.js emits ONE HTML string for the whole source, and its token
|
|
5
|
+
* elements freely cross newlines — a block comment opened on line 1 and closed
|
|
6
|
+
* on line 4 is a single `<span>` containing three `\n`s. A per-line renderer
|
|
7
|
+
* cannot use that directly: every row needs to be its own element so it can
|
|
8
|
+
* carry an id, a gutter and an annotation background, and slicing the string
|
|
9
|
+
* at each `\n` would leave rows with unbalanced tags.
|
|
10
|
+
*
|
|
11
|
+
* So each row is closed at the newline and every still-open element is
|
|
12
|
+
* re-opened on the next row.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Normalize source before it is highlighted and split.
|
|
16
|
+
*
|
|
17
|
+
* Line numbers must agree with what the consumer counted, so this runs once,
|
|
18
|
+
* here, rather than being every caller's responsibility: CRLF would otherwise
|
|
19
|
+
* leave a stray `\r` at the end of every row, and a trailing newline would
|
|
20
|
+
* produce a phantom final row that no editor shows.
|
|
21
|
+
*/
|
|
22
|
+
export declare function normalizeSource(source: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Escape source for rendering as-is.
|
|
25
|
+
*
|
|
26
|
+
* The element paints escaped plain text before the grammar has loaded (and if
|
|
27
|
+
* it never loads), and that text goes through the same `unsafeHTML` path as
|
|
28
|
+
* highlighted output — so it has to be escaped here rather than trusted.
|
|
29
|
+
*/
|
|
30
|
+
export declare function escapeHtml(source: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Split highlight.js output into one well-formed HTML fragment per source
|
|
33
|
+
* line. Concatenating the rows' text content reproduces the input text
|
|
34
|
+
* exactly; every row is independently balanced.
|
|
35
|
+
*
|
|
36
|
+
* Scanning is safe on hljs output specifically — it emits only
|
|
37
|
+
* `<span class="…">` elements and HTML-escaped text, so a literal `\n` can
|
|
38
|
+
* never appear inside a tag or inside an entity, and a literal `<` is always
|
|
39
|
+
* the start of a tag. That is why this is a scanner and not an HTML parser:
|
|
40
|
+
* a parser would be strictly more machinery for the same result on this input.
|
|
41
|
+
*
|
|
42
|
+
* Do not feed it arbitrary HTML.
|
|
43
|
+
*/
|
|
44
|
+
export declare function splitHighlightedLines(html: string): string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LanguageFn } from 'highlight.js';
|
|
2
|
+
/** Every language id and alias `<mp-code-snippet>` can load on demand. */
|
|
3
|
+
export type HljsLanguageKey = 'atom' | 'bash' | 'c' | 'c#' | 'c++' | 'cc' | 'cjs' | 'console' | 'cpp' | 'cs' | 'csharp' | 'css' | 'cts' | 'cxx' | 'diff' | 'gemspec' | 'go' | 'golang' | 'gql' | 'graphql' | 'gyp' | 'h' | 'h++' | 'hh' | 'hpp' | 'html' | 'hxx' | 'ini' | 'ipython' | 'irb' | 'java' | 'javascript' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsp' | 'jsx' | 'kotlin' | 'kt' | 'kts' | 'less' | 'lua' | 'mak' | 'make' | 'makefile' | 'markdown' | 'md' | 'mjs' | 'mk' | 'mkd' | 'mkdown' | 'mm' | 'mts' | 'obj-c' | 'obj-c++' | 'objc' | 'objective-c++' | 'objectivec' | 'patch' | 'perl' | 'php' | 'php-template' | 'pl' | 'plaintext' | 'plist' | 'pluto' | 'pm' | 'podspec' | 'py' | 'pycon' | 'python' | 'python-repl' | 'r' | 'rb' | 'rs' | 'rss' | 'ruby' | 'rust' | 'scss' | 'sh' | 'shell' | 'shellsession' | 'sql' | 'svg' | 'swift' | 'text' | 'thor' | 'toml' | 'ts' | 'tsx' | 'txt' | 'typescript' | 'vb' | 'vbnet' | 'wasm' | 'wsf' | 'xhtml' | 'xjb' | 'xml' | 'xsd' | 'xsl' | 'yaml' | 'yml' | 'zsh';
|
|
4
|
+
/**
|
|
5
|
+
* One lazy loader per language id AND alias, so `language="tsx"` and
|
|
6
|
+
* `language="html"` resolve rather than falling through to auto-detect.
|
|
7
|
+
* Several keys deliberately share a target (tsx/ts/mts/cts -> typescript).
|
|
8
|
+
*
|
|
9
|
+
* Each import is a static literal on purpose — see
|
|
10
|
+
* tools/scripts/build-hljs-loaders.mjs.
|
|
11
|
+
*/
|
|
12
|
+
export declare const hljsLoaders: Record<HljsLanguageKey, () => Promise<LanguageFn>>;
|
|
13
|
+
/** Canonical grammar id for a key, so one grammar is registered once. */
|
|
14
|
+
export declare const hljsLanguageIds: Record<HljsLanguageKey, string>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement, TemplateResult, PropertyValues } from 'lit';
|
|
2
|
+
import { CodeLineAnnotation } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* `<mp-code-snippet>` — code block with syntax highlighting + copy-to-clipboard.
|
|
4
5
|
*
|
|
@@ -16,16 +17,31 @@ import { LitElement, TemplateResult, PropertyValues } from 'lit';
|
|
|
16
17
|
* - `language-detected` — fires after each highlight pass with
|
|
17
18
|
* `detail.language` containing the resolved language id (e.g. `"typescript"`).
|
|
18
19
|
*
|
|
20
|
+
* - `theme` (optional): `auto` (default) follows the page's Bootstrap theme,
|
|
21
|
+
* `light` / `dark` pin the palette regardless of the page.
|
|
22
|
+
*
|
|
19
23
|
* a11y: the copy button announces success via an `aria-live="polite"`
|
|
20
24
|
* region inside the shadow root.
|
|
21
25
|
*
|
|
22
26
|
* Source content can ALSO be projected via the default slot — useful for
|
|
23
27
|
* static HTML pages where attribute serialization of newlines is awkward.
|
|
24
28
|
* Slot content is read once on first render and on `slotchange`.
|
|
29
|
+
*
|
|
30
|
+
* No-JS tier: NONE. With scripting disabled this element renders an empty
|
|
31
|
+
* `<pre>` — the slot is hidden and only JS hoists its text into `code`. It
|
|
32
|
+
* ships no Declarative-Shadow-DOM chrome and is not part of the
|
|
33
|
+
* `codegen-ssr-chrome` aggregate.
|
|
25
34
|
*/
|
|
26
35
|
export declare class MpCodeSnippet extends LitElement {
|
|
27
|
-
static styles: import('lit').CSSResult;
|
|
36
|
+
static styles: import('lit').CSSResult[];
|
|
28
37
|
language: string;
|
|
38
|
+
/**
|
|
39
|
+
* Palette selection. `auto` inherits the page's `color-scheme` — which
|
|
40
|
+
* Bootstrap sets from `data-bs-theme` and which crosses the shadow boundary
|
|
41
|
+
* — so the default needs no wiring from the consumer. `light` / `dark`
|
|
42
|
+
* constrain `color-scheme` on the host instead of redeclaring any colour.
|
|
43
|
+
*/
|
|
44
|
+
theme: 'auto' | 'light' | 'dark';
|
|
29
45
|
/**
|
|
30
46
|
* Accessible name for the copy button. Category-2 default derived from the
|
|
31
47
|
* detected language; override for localisation. The ${language} placeholder
|
|
@@ -33,17 +49,171 @@ export declare class MpCodeSnippet extends LitElement {
|
|
|
33
49
|
*/
|
|
34
50
|
copyLabel: string;
|
|
35
51
|
code: string;
|
|
52
|
+
/** Show a line-number gutter. Off by default — a one-line install command
|
|
53
|
+
* gains nothing from a `1` beside it. */
|
|
54
|
+
lineNumbers: boolean;
|
|
55
|
+
/** Number of the first rendered line, for excerpts lifted out of a file. */
|
|
56
|
+
startLine: number;
|
|
57
|
+
/** Wrap long lines instead of scrolling them horizontally. */
|
|
58
|
+
wrap: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Per-line markers. Sparse — most lines carry none. Property only: an array
|
|
61
|
+
* of objects has no sensible attribute form.
|
|
62
|
+
*/
|
|
63
|
+
annotations: CodeLineAnnotation[];
|
|
64
|
+
/**
|
|
65
|
+
* The line drawn as current. Composes OVER an annotation rather than
|
|
66
|
+
* replacing it (an outline, not a background swap), because "which line am I
|
|
67
|
+
* looking at" and "what is the coverage of this line" are independent facts.
|
|
68
|
+
*/
|
|
69
|
+
activeLine: number | null;
|
|
70
|
+
/**
|
|
71
|
+
* Turns each line number into a real `<a href>`. Given as a function because
|
|
72
|
+
* only the consumer knows what a link to a line means in their app.
|
|
73
|
+
*
|
|
74
|
+
* The href buys the browser affordances a click handler cannot fake:
|
|
75
|
+
* middle-click, open-in-new-tab, copy-link-address, and a native link for the
|
|
76
|
+
* roving-focus layer to move between.
|
|
77
|
+
*
|
|
78
|
+
* It does NOT scroll to the line. A fragment cannot reach a row inside a
|
|
79
|
+
* shadow root — `document.getElementById('L7')` is null — so deep-linking
|
|
80
|
+
* means reading the fragment yourself on navigation and calling
|
|
81
|
+
* `scrollToLine()`.
|
|
82
|
+
*
|
|
83
|
+
* Returning a bare fragment (`#L7`) is safe: it is resolved against the
|
|
84
|
+
* current URL, not against `document.baseURI`. See `resolveLineHref`.
|
|
85
|
+
*/
|
|
86
|
+
lineHref: ((line: number) => string) | null;
|
|
87
|
+
/**
|
|
88
|
+
* Accessible name pattern for a line anchor; `${line}` is substituted.
|
|
89
|
+
* Localisable, because an accessible name that only exists as an English
|
|
90
|
+
* literal is a translation bug.
|
|
91
|
+
*/
|
|
92
|
+
lineLabel: string;
|
|
93
|
+
/**
|
|
94
|
+
* Accessible name for the code region. Defaults to a pattern derived from
|
|
95
|
+
* the detected language; set it when the page has several snippets and
|
|
96
|
+
* "typescript code sample" three times over is not navigable.
|
|
97
|
+
*/
|
|
98
|
+
label: string;
|
|
99
|
+
/** Region name pattern used when `label` is empty. `${language}` is substituted. */
|
|
100
|
+
regionLabel: string;
|
|
101
|
+
/** Visible confirmation in the toast after a successful copy. */
|
|
102
|
+
copiedLabel: string;
|
|
103
|
+
/** What a screen reader hears after a successful copy. */
|
|
104
|
+
copiedAnnouncement: string;
|
|
105
|
+
/**
|
|
106
|
+
* Keyboard help for the line-anchor list, exposed as the region's
|
|
107
|
+
* description so entering it reads the keymap once. Only rendered when
|
|
108
|
+
* `lineHref` makes the anchors exist.
|
|
109
|
+
*/
|
|
110
|
+
keymapHint: string;
|
|
36
111
|
private detectedLanguage;
|
|
37
|
-
|
|
112
|
+
/** One highlighted HTML fragment per source line. */
|
|
113
|
+
private lines;
|
|
38
114
|
private toastVisible;
|
|
115
|
+
/** Line whose anchor currently holds the roving tabindex. */
|
|
116
|
+
private rovingLine;
|
|
39
117
|
private toastTimer;
|
|
118
|
+
/** Rebuilt only when `annotations` changes — a per-row `.find()` would be
|
|
119
|
+
* quadratic on a file with an annotation per line. */
|
|
120
|
+
private annotationsByLine;
|
|
121
|
+
/** Guards against an out-of-order highlight resolving over a newer one. */
|
|
122
|
+
private highlightToken;
|
|
123
|
+
/**
|
|
124
|
+
* Explicit `label` wins; otherwise the pattern, so the region is never
|
|
125
|
+
* nameless. The keymap is NOT folded in here — it belongs to the
|
|
126
|
+
* description, and a name that grows a paragraph of help is unusable in a
|
|
127
|
+
* landmark list.
|
|
128
|
+
*/
|
|
129
|
+
private get regionName();
|
|
130
|
+
/** Settles when the in-flight highlight has been applied. */
|
|
131
|
+
private highlightPending;
|
|
132
|
+
/**
|
|
133
|
+
* Keeps `await el.updateComplete` meaning what it has always meant: the
|
|
134
|
+
* rendered output is on screen. Highlighting now resolves a chunk load AFTER
|
|
135
|
+
* the first paint, so without this every consumer and every spec would have
|
|
136
|
+
* to know to await something extra.
|
|
137
|
+
*/
|
|
138
|
+
protected getUpdateComplete(): Promise<boolean>;
|
|
40
139
|
connectedCallback(): void;
|
|
41
140
|
disconnectedCallback(): void;
|
|
42
141
|
willUpdate(changed: PropertyValues<this>): void;
|
|
142
|
+
/**
|
|
143
|
+
* Highlighting is asynchronous because the grammar is fetched on demand, so
|
|
144
|
+
* this paints escaped plain text FIRST and upgrades in place when the
|
|
145
|
+
* grammar lands. A block that flashes empty is worse than one that flashes
|
|
146
|
+
* unstyled, and if the grammar never arrives the plain text is the final,
|
|
147
|
+
* still-readable state rather than a blank box.
|
|
148
|
+
*/
|
|
43
149
|
private runHighlight;
|
|
150
|
+
private setDetectedLanguage;
|
|
44
151
|
private handleCopy;
|
|
45
152
|
private showToast;
|
|
46
153
|
render(): TemplateResult;
|
|
154
|
+
/**
|
|
155
|
+
* Rows to render. Normally one per source line, but annotations may name
|
|
156
|
+
* lines beyond the source's extent — a coverage report for a file whose
|
|
157
|
+
* source could not be fetched still renders its full gutter — so the count
|
|
158
|
+
* is the larger of the two.
|
|
159
|
+
*/
|
|
160
|
+
private get rowCount();
|
|
161
|
+
/** Scroll a line into view. A method, not a side effect of `activeLine`, so
|
|
162
|
+
* re-requesting the line the user is already on still scrolls. */
|
|
163
|
+
scrollToLine(line: number): void;
|
|
164
|
+
/**
|
|
165
|
+
* A bare fragment resolves against `document.baseURI`, and every Angular app
|
|
166
|
+
* sets that to `/` with `<base href="/">` — so the obvious `#L7` means "the
|
|
167
|
+
* ROOT document, anchor L7" and navigates away from the current route
|
|
168
|
+
* entirely. Resolving it against the current URL here means the obvious thing
|
|
169
|
+
* is also the correct thing, instead of a trap each consumer has to be warned
|
|
170
|
+
* about.
|
|
171
|
+
*
|
|
172
|
+
* Absolute and path-relative hrefs are left exactly as given.
|
|
173
|
+
*/
|
|
174
|
+
private resolveLineHref;
|
|
175
|
+
private onLineActivate;
|
|
176
|
+
/**
|
|
177
|
+
* One row per line.
|
|
178
|
+
*
|
|
179
|
+
* Each cell is a DIRECT child of the row and is placed on a named column by
|
|
180
|
+
* the stylesheet, because the row is a `subgrid` of column tracks defined
|
|
181
|
+
* once on `code`. That is what keeps the code text in one vertical line
|
|
182
|
+
* whether or not a given row happens to carry a gutter label: a row missing a
|
|
183
|
+
* cell leaves that track empty instead of shifting everything left. Wrapping
|
|
184
|
+
* the two marks in a container would defeat it — the container would be one
|
|
185
|
+
* content-sized cell, and every row would size it differently.
|
|
186
|
+
*
|
|
187
|
+
* Written with no whitespace between the cells: under `white-space: pre` a
|
|
188
|
+
* whitespace-only text node between grid items does NOT collapse away and
|
|
189
|
+
* would become an anonymous item in its own track.
|
|
190
|
+
*/
|
|
191
|
+
private renderLine;
|
|
192
|
+
/**
|
|
193
|
+
* The gutter is a real link when `lineHref` is set and inert text otherwise.
|
|
194
|
+
* Inert text is `aria-hidden`: an unlinked line number is decoration, and
|
|
195
|
+
* announcing "42" before every line would drown the code.
|
|
196
|
+
*
|
|
197
|
+
* The links carry a ROVING tabindex — exactly one is tabbable and the arrow
|
|
198
|
+
* keys move between them. A file view puts one anchor per line in the DOM,
|
|
199
|
+
* so without this a 2 000-line file would be 2 000 tab stops between the
|
|
200
|
+
* reader and the rest of the page.
|
|
201
|
+
*/
|
|
202
|
+
private renderGutter;
|
|
203
|
+
/**
|
|
204
|
+
* The single tabbable line link: wherever the user last was, else the active
|
|
205
|
+
* line, else the first. Landing on the active line means Tab reaches the
|
|
206
|
+
* line the consumer considers current rather than the top of a long file.
|
|
207
|
+
*/
|
|
208
|
+
private get tabbableLine();
|
|
209
|
+
private onGutterKeydown;
|
|
210
|
+
/**
|
|
211
|
+
* Focus follows the roving index by stable LINE NUMBER, never by DOM index:
|
|
212
|
+
* the rows are rebuilt on every highlight, and an index would land on
|
|
213
|
+
* whatever now occupies that position.
|
|
214
|
+
*/
|
|
215
|
+
private moveFocusToLine;
|
|
216
|
+
private annotationFor;
|
|
47
217
|
private onSlotChange;
|
|
48
218
|
}
|
|
49
219
|
declare global {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { codeSnippetStyles } from './code-snippet.styles';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A marker attached to one rendered line.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately coverage-agnostic: `kind` is an opaque string the consumer
|
|
5
|
+
* chooses, exposed as a CSS part (`annotation-<kind>`) so the consumer styles
|
|
6
|
+
* it from their own stylesheet. The component ships no built-in kinds and no
|
|
7
|
+
* colours for them.
|
|
8
|
+
*
|
|
9
|
+
* The array is sparse by design — most lines of a file carry no annotation, so
|
|
10
|
+
* this is keyed by line number rather than being one entry per rendered row.
|
|
11
|
+
* Lines may also point BEYOND the extent of `code`: a coverage report for a
|
|
12
|
+
* file whose source could not be fetched still renders a full gutter.
|
|
13
|
+
*/
|
|
14
|
+
export interface CodeLineAnnotation {
|
|
15
|
+
/** 1-based, and compared against the rendered number (so it honours `start-line`). */
|
|
16
|
+
line: number;
|
|
17
|
+
/** Opaque category. Exposed as the CSS part `annotation-<kind>`. */
|
|
18
|
+
kind?: string;
|
|
19
|
+
/** Primary gutter label, e.g. a hit count `5×`. Rendered when present — including `0`. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Second gutter label, e.g. a branch ratio `3/4`. */
|
|
22
|
+
secondaryLabel?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Long form of what the labels mean, e.g. `Branches: 3/4`. Becomes the row's
|
|
25
|
+
* tooltip AND the text a screen reader hears for the line, because a colour
|
|
26
|
+
* and a bare `3/4` are not an accessible substitute for either.
|
|
27
|
+
*/
|
|
28
|
+
description?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './code-line-annotation';
|
package/datatable/index.mjs
CHANGED
package/file-manager/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { createRef as $, ref as x } from "lit/directives/ref.js";
|
|
|
8
8
|
import { styleMap as C } from "lit/directives/style-map.js";
|
|
9
9
|
import "../chunks/mp-splitter-LszuRDbR.mjs";
|
|
10
10
|
import "../chunks/mp-treeview-tkWu28iF.mjs";
|
|
11
|
-
import "../chunks/mp-datatable-
|
|
11
|
+
import "../chunks/mp-datatable-GmKqaN8y.mjs";
|
|
12
12
|
const k = g(`:host {
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/web-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Framework-agnostic Lit web components for the @mintplayer/bootstrap design system. Consumed by @mintplayer/ng-bootstrap, @mintplayer/react-bootstrap, and @mintplayer/vue-bootstrap.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -45,6 +45,22 @@
|
|
|
45
45
|
"types": "./carousel/index.d.ts",
|
|
46
46
|
"import": "./carousel/index.mjs"
|
|
47
47
|
},
|
|
48
|
+
"./charts/core": {
|
|
49
|
+
"types": "./charts/core/index.d.ts",
|
|
50
|
+
"import": "./charts/core/index.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./charts/hierarchy": {
|
|
53
|
+
"types": "./charts/hierarchy/index.d.ts",
|
|
54
|
+
"import": "./charts/hierarchy/index.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./charts/sparkline": {
|
|
57
|
+
"types": "./charts/sparkline/index.d.ts",
|
|
58
|
+
"import": "./charts/sparkline/index.mjs"
|
|
59
|
+
},
|
|
60
|
+
"./charts/trend": {
|
|
61
|
+
"types": "./charts/trend/index.d.ts",
|
|
62
|
+
"import": "./charts/trend/index.mjs"
|
|
63
|
+
},
|
|
48
64
|
"./checkbox": {
|
|
49
65
|
"types": "./checkbox/index.d.ts",
|
|
50
66
|
"import": "./checkbox/index.mjs"
|
package/phone-input/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { unsafeCSS as
|
|
1
|
+
import { unsafeCSS as b, LitElement as p, nothing as h, html as v } from "lit";
|
|
2
2
|
import { createRef as f, ref as m } from "lit/directives/ref.js";
|
|
3
3
|
import { unsafeHTML as C } from "lit/directives/unsafe-html.js";
|
|
4
4
|
import "../chunks/mp-input-group-CQ55efCq.mjs";
|
|
5
|
-
import "../chunks/mp-select-
|
|
5
|
+
import "../chunks/mp-select-BNrbPwN4.mjs";
|
|
6
6
|
import { c as g, b as $, l as k } from "../chunks/validation-ChktfuxI.mjs";
|
|
7
7
|
import { l as R } from "../chunks/all-flags-BtYcfgjy.mjs";
|
|
8
|
-
import { H as
|
|
9
|
-
import { a as
|
|
8
|
+
import { H as w } from "../chunks/host-aria-WSGs7SPQ.mjs";
|
|
9
|
+
import { a as q, e as L } from "../chunks/error-text-B45eDAt1.mjs";
|
|
10
10
|
import { F as U } from "../chunks/form-associated-BR-fUvZ1.mjs";
|
|
11
|
-
import { f as A } from "../chunks/form-control.styles-
|
|
11
|
+
import { f as A } from "../chunks/form-control.styles-C3j87Sn3.mjs";
|
|
12
12
|
import { i as S } from "../chunks/invalid-feedback.styles-he0JYrJm.mjs";
|
|
13
|
-
const E =
|
|
13
|
+
const E = b(`:host {
|
|
14
14
|
display: block;
|
|
15
15
|
container-type: inline-size;
|
|
16
16
|
}
|
|
@@ -93,16 +93,16 @@ function x(a, t, e) {
|
|
|
93
93
|
function n(a) {
|
|
94
94
|
return a.replace(/\D/g, "");
|
|
95
95
|
}
|
|
96
|
-
let
|
|
97
|
-
const T = 352,
|
|
96
|
+
let y = 0;
|
|
97
|
+
const T = 352, P = (a) => a.replace(/[&<>"']/g, (t) => `&#${t.charCodeAt(0)};`);
|
|
98
98
|
class d extends U(p) {
|
|
99
99
|
constructor() {
|
|
100
|
-
super(...arguments), this._country = null, this._digits = "", this._rulesWanted = !1, this._locale = null, this._preferred = [], this._only = null, this._placeholder = null, this._autocomplete = "tel-national", this._inputLabel = null, this._countryLabel = null, this._errorText = null, this._errorId = `mp-phone-input-${++
|
|
100
|
+
super(...arguments), this._country = null, this._digits = "", this._rulesWanted = !1, this._rulesPending = Promise.resolve(), this._locale = null, this._preferred = [], this._only = null, this._placeholder = null, this._autocomplete = "tel-national", this._inputLabel = null, this._countryLabel = null, this._errorText = null, this._errorId = `mp-phone-input-${++y}-error`, this._dialId = `mp-phone-input-${y}-dial`, this._list = [], this._listKey = "", this._flagsRequested = !1, this._composing = !1, this._preEdit = null, this._inputRef = f(), this._selectRef = f(), this.hostAria = new w(this, {
|
|
101
101
|
referenceTarget: () => this._inputRef.value ?? null,
|
|
102
|
-
describedByExtras: () =>
|
|
102
|
+
describedByExtras: () => q(this.renderRoot)
|
|
103
103
|
}), this.renderCountryOption = (t) => {
|
|
104
104
|
const e = this.countryList().find((i) => i.iso2 === t.value);
|
|
105
|
-
return e ? `<span class="flag-box" aria-hidden="true">${this._flags?.[e.iso2] ?? ""}</span><span class="rich-label" data-list-only>${
|
|
105
|
+
return e ? `<span class="flag-box" aria-hidden="true">${this._flags?.[e.iso2] ?? ""}</span><span class="rich-label" data-list-only>${P(e.name)}</span><span data-list-only>+${e.dialCode}</span><span data-closed-only>${e.iso2.toUpperCase()}</span>` : void 0;
|
|
106
106
|
}, this.onCountryPicked = (t) => {
|
|
107
107
|
t.stopPropagation();
|
|
108
108
|
const e = t.detail.value;
|
|
@@ -429,8 +429,22 @@ class d extends U(p) {
|
|
|
429
429
|
#e() {
|
|
430
430
|
this._rulesWanted || (this._rulesWanted = !0, this.#a(this.country));
|
|
431
431
|
}
|
|
432
|
+
/**
|
|
433
|
+
* `valid` is `undefined` until the selected country's rules have loaded, and
|
|
434
|
+
* loading is a lazy chunk — so without this, "the rules have landed" is not
|
|
435
|
+
* observable and callers (and tests) can only guess a timeout. Awaiting the
|
|
436
|
+
* in-flight load here makes `await el.updateComplete` mean what it says.
|
|
437
|
+
*/
|
|
438
|
+
async getUpdateComplete() {
|
|
439
|
+
return await super.getUpdateComplete(), await this._rulesPending, super.getUpdateComplete();
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Assigned rather than fire-and-forget so `updateComplete` can await it —
|
|
443
|
+
* see `getUpdateComplete`. Without an observable settle, the only way to
|
|
444
|
+
* wait for rules is to guess a timeout, which is what made D17 flaky.
|
|
445
|
+
*/
|
|
432
446
|
#a(t) {
|
|
433
|
-
k(t).then((e) => {
|
|
447
|
+
this._rulesPending = k(t).then((e) => {
|
|
434
448
|
!e || this.country !== t || (this._rules = e, this.requestUpdate(), this.#r());
|
|
435
449
|
});
|
|
436
450
|
}
|
|
@@ -52,6 +52,8 @@ export declare class MpPhoneInput extends MpPhoneInput_base {
|
|
|
52
52
|
/** Rules are fetched lazily; nothing loads until the field is interacted with
|
|
53
53
|
* or receives a non-empty initial value. */
|
|
54
54
|
private _rulesWanted;
|
|
55
|
+
/** Settles when the in-flight rules chunk has been applied. */
|
|
56
|
+
private _rulesPending;
|
|
55
57
|
private _locale;
|
|
56
58
|
private _preferred;
|
|
57
59
|
private _only;
|
|
@@ -127,6 +129,13 @@ export declare class MpPhoneInput extends MpPhoneInput_base {
|
|
|
127
129
|
private renderCountryOption;
|
|
128
130
|
private countryList;
|
|
129
131
|
private formatted;
|
|
132
|
+
/**
|
|
133
|
+
* `valid` is `undefined` until the selected country's rules have loaded, and
|
|
134
|
+
* loading is a lazy chunk — so without this, "the rules have landed" is not
|
|
135
|
+
* observable and callers (and tests) can only guess a timeout. Awaiting the
|
|
136
|
+
* in-flight load here makes `await el.updateComplete` mean what it says.
|
|
137
|
+
*/
|
|
138
|
+
protected getUpdateComplete(): Promise<boolean>;
|
|
130
139
|
private onCountryPicked;
|
|
131
140
|
private onFocus;
|
|
132
141
|
private onCompositionStart;
|