@fusion.dev/helix-headless 0.215.3 → 0.217.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/api.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/area-chart/root/area-chart-root.d.ts +1 -0
- package/dist/area-chart/root/area-chart-root.js +1 -1
- package/dist/bar-chart/root/bar-chart-root.d.ts +1 -0
- package/dist/bar-chart/root/bar-chart-root.js +1 -1
- package/dist/button/root/button-root.d.ts +3 -1
- package/dist/button/root/button-root.js +2 -1
- package/dist/chat/composer/chat-composer.d.ts +18 -1
- package/dist/chat/composer/chat-composer.js +8 -3
- package/dist/checkbox/root/checkbox-root.d.ts +3 -1
- package/dist/checkbox/root/checkbox-root.js +2 -1
- package/dist/code-block/highlight.d.ts +9 -0
- package/dist/code-block/highlight.js +39 -0
- package/dist/code-block/highlighter.d.ts +44 -0
- package/dist/code-block/highlighter.js +44 -0
- package/dist/code-block/index.d.ts +1 -0
- package/dist/code-block/index.js +1 -0
- package/dist/code-block/keyed-lines.d.ts +23 -0
- package/dist/code-block/keyed-lines.js +75 -0
- package/dist/code-block/root/code-block-root.d.ts +6 -23
- package/dist/code-block/root/code-block-root.js +8 -25
- package/dist/code-editor/index.d.ts +1 -0
- package/dist/code-editor/index.js +1 -0
- package/dist/code-editor/root/code-editor-root.d.ts +367 -0
- package/dist/code-editor/root/code-editor-root.js +746 -0
- package/dist/code-input/index.d.ts +1 -0
- package/dist/code-input/index.js +1 -0
- package/dist/code-input/root/code-input-root.d.ts +119 -0
- package/dist/code-input/root/code-input-root.js +142 -0
- package/dist/combobox/root/combobox-root.d.ts +6 -1
- package/dist/combobox/root/combobox-root.js +4 -2
- package/dist/command/root/command-root.d.ts +61 -11
- package/dist/command/root/command-root.js +88 -3
- package/dist/donut-chart/root/donut-chart-root.d.ts +1 -0
- package/dist/donut-chart/root/donut-chart-root.js +1 -1
- package/dist/element-events.generated.js +36 -3
- package/dist/filter-input/root/filter-input-root.d.ts +9 -1
- package/dist/filter-input/root/filter-input-root.js +7 -3
- package/dist/heatmap/root/heatmap-root.d.ts +1 -0
- package/dist/heatmap/root/heatmap-root.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/input/root/input-root.d.ts +14 -2
- package/dist/input/root/input-root.js +11 -3
- package/dist/kbd/root/kbd-root.js +9 -2
- package/dist/line-chart/root/line-chart-root.d.ts +1 -0
- package/dist/line-chart/root/line-chart-root.js +1 -1
- package/dist/listbox/root/listbox-root.d.ts +8 -1
- package/dist/listbox/root/listbox-root.js +7 -4
- package/dist/markdown/blocks.d.ts +66 -0
- package/dist/markdown/blocks.js +326 -0
- package/dist/markdown/index.d.ts +6 -0
- package/dist/markdown/index.js +5 -0
- package/dist/markdown/inline.d.ts +57 -0
- package/dist/markdown/inline.js +483 -0
- package/dist/markdown/root/markdown-root.d.ts +99 -0
- package/dist/markdown/root/markdown-root.js +93 -0
- package/dist/markdown/stream.d.ts +47 -0
- package/dist/markdown/stream.js +62 -0
- package/dist/markdown/tree.d.ts +57 -0
- package/dist/markdown/tree.js +144 -0
- package/dist/markdown/writer.d.ts +33 -0
- package/dist/markdown/writer.js +139 -0
- package/dist/menu/root/menu-root.d.ts +53 -0
- package/dist/menu/root/menu-root.js +92 -15
- package/dist/pagination/size/pagination-size.d.ts +3 -0
- package/dist/pagination/size/pagination-size.js +2 -1
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +1 -0
- package/dist/scatter-chart/root/scatter-chart-root.js +1 -1
- package/dist/select/root/select-root.d.ts +6 -1
- package/dist/select/root/select-root.js +4 -2
- package/dist/shortcut-overlay/index.d.ts +1 -0
- package/dist/shortcut-overlay/index.js +1 -0
- package/dist/shortcut-overlay/root/shortcut-overlay-root.d.ts +128 -0
- package/dist/shortcut-overlay/root/shortcut-overlay-root.js +275 -0
- package/dist/slider/root/slider-root.d.ts +3 -1
- package/dist/slider/root/slider-root.js +2 -1
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.d.ts +1 -0
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.js +1 -1
- package/dist/spatial-heatmap/root/spatial-heatmap-root.d.ts +1 -0
- package/dist/spatial-heatmap/root/spatial-heatmap-root.js +1 -1
- package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.d.ts +1 -0
- package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.js +1 -1
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.d.ts +1 -0
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.js +1 -1
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.d.ts +1 -0
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.js +1 -1
- package/dist/spatial-treemap/root/spatial-treemap-root.d.ts +1 -0
- package/dist/spatial-treemap/root/spatial-treemap-root.js +1 -1
- package/dist/switch/root/switch-root.d.ts +3 -1
- package/dist/switch/root/switch-root.js +2 -1
- package/dist/tabs/tab/tab.d.ts +3 -1
- package/dist/tabs/tab/tab.js +2 -1
- package/dist/textarea/root/textarea-root.d.ts +20 -4
- package/dist/textarea/root/textarea-root.js +31 -23
- package/dist/time-input/root/time-input-root.d.ts +6 -0
- package/dist/time-input/root/time-input-root.js +4 -2
- package/dist/time-picker/root/time-picker-root.d.ts +6 -0
- package/dist/time-picker/root/time-picker-root.js +4 -2
- package/dist/toast/root/toast-root.d.ts +64 -0
- package/dist/toast/root/toast-root.js +128 -3
- package/dist/toggle/root/toggle-root.d.ts +3 -1
- package/dist/toggle/root/toggle-root.js +2 -1
- package/dist/virtual-list/root/virtual-list-root.d.ts +18 -2
- package/dist/virtual-list/root/virtual-list-root.js +103 -5
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +6 -6
- package/types/jsx.d.ts +5315 -596
- package/types/svelte.d.ts +4 -0
- package/types/vue.d.ts +1085 -4
- package/types/words.d.ts +491 -0
|
@@ -85,7 +85,7 @@ let HelixHeadlessDonutChart = class HelixHeadlessDonutChart extends MixinChartSt
|
|
|
85
85
|
if (shares.length === 0 && (this.readingsKnown || this.loading)) {
|
|
86
86
|
return this.renderEmpty();
|
|
87
87
|
}
|
|
88
|
-
return html `${this.renderPlot(shares)}${shares.length === 0 ? nothing : this.renderSummary(shares)}${this.renderTable()}`;
|
|
88
|
+
return html `${this.renderPlot(shares)}${shares.length === 0 ? nothing : this.renderSummary(shares)}${this.renderSonify()}${this.renderTable()}`;
|
|
89
89
|
}
|
|
90
90
|
renderSummary(shares) {
|
|
91
91
|
const rows = this.sourceRows;
|
|
@@ -34,7 +34,13 @@ registerElementEvents({
|
|
|
34
34
|
],
|
|
35
35
|
'helix-headless-carousel': ['helix-activate', 'helix-select'],
|
|
36
36
|
'helix-headless-chat': ['helix-before-pin', 'helix-history', 'helix-pin', 'helix-send'],
|
|
37
|
-
'helix-headless-chat-composer': [
|
|
37
|
+
'helix-headless-chat-composer': [
|
|
38
|
+
'helix-before-listen',
|
|
39
|
+
'helix-listen',
|
|
40
|
+
'helix-send',
|
|
41
|
+
'helix-typing',
|
|
42
|
+
'input',
|
|
43
|
+
],
|
|
38
44
|
'helix-headless-chat-message': ['helix-send'],
|
|
39
45
|
'helix-headless-checkbox': ['change', 'helix-before-toggle', 'input'],
|
|
40
46
|
'helix-headless-checkbox-group': ['change', 'helix-before-change', 'input'],
|
|
@@ -46,6 +52,15 @@ registerElementEvents({
|
|
|
46
52
|
'helix-copy-error',
|
|
47
53
|
'helix-toggle',
|
|
48
54
|
],
|
|
55
|
+
'helix-headless-code-editor': ['change', 'helix-before-change', 'input'],
|
|
56
|
+
'helix-headless-code-input': [
|
|
57
|
+
'change',
|
|
58
|
+
'helix-before-change',
|
|
59
|
+
'helix-before-listen',
|
|
60
|
+
'helix-clear',
|
|
61
|
+
'helix-listen',
|
|
62
|
+
'input',
|
|
63
|
+
],
|
|
49
64
|
'helix-headless-color-input': [
|
|
50
65
|
'change',
|
|
51
66
|
'helix-before-change',
|
|
@@ -128,9 +143,11 @@ registerElementEvents({
|
|
|
128
143
|
'change',
|
|
129
144
|
'helix-before-change',
|
|
130
145
|
'helix-before-close',
|
|
146
|
+
'helix-before-listen',
|
|
131
147
|
'helix-before-open',
|
|
132
148
|
'helix-dismiss',
|
|
133
149
|
'helix-facet',
|
|
150
|
+
'helix-listen',
|
|
134
151
|
'helix-select',
|
|
135
152
|
'input',
|
|
136
153
|
'toggle',
|
|
@@ -157,7 +174,14 @@ registerElementEvents({
|
|
|
157
174
|
'helix-headless-icon': ['error', 'load'],
|
|
158
175
|
'helix-headless-icon-button': ['helix-press'],
|
|
159
176
|
'helix-headless-image': ['error', 'load'],
|
|
160
|
-
'helix-headless-input': [
|
|
177
|
+
'helix-headless-input': [
|
|
178
|
+
'change',
|
|
179
|
+
'helix-before-change',
|
|
180
|
+
'helix-before-listen',
|
|
181
|
+
'helix-clear',
|
|
182
|
+
'helix-listen',
|
|
183
|
+
'input',
|
|
184
|
+
],
|
|
161
185
|
'helix-headless-kbd': ['helix-shortcut'],
|
|
162
186
|
'helix-headless-legend': ['change', 'helix-before-change'],
|
|
163
187
|
'helix-headless-lightbox': [
|
|
@@ -181,8 +205,10 @@ registerElementEvents({
|
|
|
181
205
|
'helix-headless-listbox': [
|
|
182
206
|
'change',
|
|
183
207
|
'helix-before-change',
|
|
208
|
+
'helix-before-listen',
|
|
184
209
|
'helix-before-reorder',
|
|
185
210
|
'helix-filter',
|
|
211
|
+
'helix-listen',
|
|
186
212
|
'helix-load-more',
|
|
187
213
|
'helix-reorder',
|
|
188
214
|
'input',
|
|
@@ -358,7 +384,14 @@ registerElementEvents({
|
|
|
358
384
|
'helix-terminal-restart',
|
|
359
385
|
'helix-terminal-title',
|
|
360
386
|
],
|
|
361
|
-
'helix-headless-textarea': [
|
|
387
|
+
'helix-headless-textarea': [
|
|
388
|
+
'change',
|
|
389
|
+
'helix-before-change',
|
|
390
|
+
'helix-before-listen',
|
|
391
|
+
'helix-clear',
|
|
392
|
+
'helix-listen',
|
|
393
|
+
'input',
|
|
394
|
+
],
|
|
362
395
|
'helix-headless-time-input': [
|
|
363
396
|
'change',
|
|
364
397
|
'helix-before-change',
|
|
@@ -2,7 +2,7 @@ import { AriaForwardController, HelixFormElement, PopoverController } from '@fus
|
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import { HelixHeadlessFilterField } from '../field/filter-field.js';
|
|
4
4
|
import { type FilterSource } from '../suggest.js';
|
|
5
|
-
declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinTokensInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
5
|
+
declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@fusion.dev/helix-core").VoiceElement) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinTokensInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
6
6
|
/**
|
|
7
7
|
* @summary A text field for filters, with the active filters shown in it as tokens.
|
|
8
8
|
*
|
|
@@ -161,9 +161,11 @@ declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@f
|
|
|
161
161
|
* @event {Event} change - Fired from the input when the user finishes editing the text.
|
|
162
162
|
* @event {HelixBeforeChangeEvent} helix-before-change - Fired as the text changes. Cancelable: call `preventDefault()` to keep the current text.
|
|
163
163
|
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before the suggestions close. Cancelable: call `preventDefault()` to keep them open.
|
|
164
|
+
* @event {HelixBeforeListenEvent} helix-before-listen - The dictation button was pressed. Cancelable: cancel it to keep the field from listening.
|
|
164
165
|
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before the suggestions open. Cancelable: call `preventDefault()` to keep them closed.
|
|
165
166
|
* @event {HelixDismissEvent} helix-dismiss - Fired when the user removes a token with its remove button or with Backspace in an empty field. A `FilterChip` that names a declared field sends `helix-facet` instead. Cancelable: call `preventDefault()` to keep the token.
|
|
166
167
|
* @event {HelixFacetEvent} helix-facet - Fired when a filter changes, whether it was typed, picked, or removed. Cancelable: call `preventDefault()` to leave the text and the chip as they were.
|
|
168
|
+
* @event {HelixListenEvent} helix-listen - Dictation settled on a phrase and put it in the field, after the field's own `input`.
|
|
167
169
|
* @event {HelixSelectEvent} helix-select - Fired by an option in `suggestions` when it is chosen, and bubbles out of the field. Cancelable: call `preventDefault()` to stop other listeners acting on it. The field takes no action on an option you slotted, and you decide what it does. A suggestion from `source` is written over the term at the caret unless you cancel it.
|
|
168
170
|
* @event {Event} input - Fired when the text changes.
|
|
169
171
|
* @event {ToggleEvent} toggle - Fired when the suggestions panel opens or closes, with `newState` and `oldState`.
|
|
@@ -181,13 +183,18 @@ declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@f
|
|
|
181
183
|
* @csspart rest - The count of tokens that did not fit. It is a `<button>` with `expandable` and a `<span>` without it.
|
|
182
184
|
* @csspart surface - The floating panel the suggestions sit in.
|
|
183
185
|
* @csspart tags - The row the tokens sit in.
|
|
186
|
+
* @csspart voice - The dictation button, under `voice`.
|
|
187
|
+
* @csspart voice-listening - The dictation button while it listens. Set alongside `voice`.
|
|
188
|
+
* @csspart voice-status - What a screen reader hears as dictation starts and stops, drawn for no one else.
|
|
184
189
|
*
|
|
185
190
|
* @cssstate invalid - The field has an error to show, from the browser's validation or from your `feedback`.
|
|
191
|
+
* @cssstate listening - While the field listens for dictation. The element sets `--dictation-level` on itself meanwhile, from 0 to 1, for a meter.
|
|
186
192
|
* @cssstate loading - While `loading` is set, or a request to `source` is out.
|
|
187
193
|
* @cssstate no-results - `filter-suggestions` hid every suggestion, and `no-results-text` or the `no-results` slot says so.
|
|
188
194
|
* @cssstate open - The suggestions are open.
|
|
189
195
|
*/
|
|
190
196
|
export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_base {
|
|
197
|
+
protected static markRules: string[];
|
|
191
198
|
/**
|
|
192
199
|
* The key this family's words are registered under, its styled tag:
|
|
193
200
|
* `registerWords('de', { 'helix-filter-input': { clearLabel: 'Leeren' } })`.
|
|
@@ -658,6 +665,7 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
|
|
|
658
665
|
focus(options?: FocusOptions): void;
|
|
659
666
|
/** The cross on the clear button, behind a seam a tier can move. */
|
|
660
667
|
protected renderClearIcon(): TemplateResult;
|
|
668
|
+
protected voiceField(): HTMLInputElement | null;
|
|
661
669
|
protected render(): TemplateResult;
|
|
662
670
|
}
|
|
663
671
|
declare global {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, auditChildren, countLabel, customElement, DelayController, drawIcon, drawStatus, formatWords, HelixFacetEvent, HelixFormElement, holdCaret, howToRegister, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, PopoverController, reportRuntime, restoreValue, StatusController, scrollItemIntoView, timeConverter, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, auditChildren, countLabel, customElement, DelayController, drawIcon, drawStatus, formatWords, HelixFacetEvent, HelixFormElement, holdCaret, howToRegister, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, MixinVoice, PopoverController, reportRuntime, restoreValue, SPOKEN_RULE, StatusController, scrollItemIntoView, timeConverter, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { x } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -10,7 +10,7 @@ const picks = (element) => typeof element.apply === 'function' &&
|
|
|
10
10
|
Array.isArray(element.fields);
|
|
11
11
|
const asksToGo = (node) => typeof node?.dismiss === 'function';
|
|
12
12
|
const isOption = (node) => 'active' in node && 'value' in node;
|
|
13
|
-
let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinControllerOpen(MixinTokens(MixinControllerValue(MixinField(HelixFormElement)))) {
|
|
13
|
+
let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinVoice(MixinControllerOpen(MixinTokens(MixinControllerValue(MixinField(HelixFormElement))))) {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.aria = new AriaForwardController(this, {
|
|
@@ -249,6 +249,7 @@ let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinContr
|
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
+
static { this.markRules = [SPOKEN_RULE]; }
|
|
252
253
|
static { this.words = 'helix-filter-input'; }
|
|
253
254
|
narrow() {
|
|
254
255
|
const term = this.filterSuggestions
|
|
@@ -645,6 +646,9 @@ let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinContr
|
|
|
645
646
|
renderClearIcon() {
|
|
646
647
|
return html `<slot name="clear-icon">${drawIcon(x)}</slot>`;
|
|
647
648
|
}
|
|
649
|
+
voiceField() {
|
|
650
|
+
return this.partNamed('control');
|
|
651
|
+
}
|
|
648
652
|
render() {
|
|
649
653
|
return html `${this.renderLabel()}
|
|
650
654
|
<div part="field" @focusin=${this.handleFocusIn} @focusout=${this.handleFocusOut}>
|
|
@@ -681,7 +685,7 @@ let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinContr
|
|
|
681
685
|
>
|
|
682
686
|
${this.renderClearIcon()}
|
|
683
687
|
</button>`
|
|
684
|
-
: nothing}
|
|
688
|
+
: nothing}${this.renderVoice()}
|
|
685
689
|
</div>
|
|
686
690
|
<!-- **Always rendered, and hidden rather than absent**, for the reason the
|
|
687
691
|
token row is: a slot that is not in the tree assigns nothing, so a panel
|
|
@@ -124,6 +124,7 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
|
|
|
124
124
|
* @csspart plot - The same element as `strip`, under the name every chart gives the drawing that takes focus.
|
|
125
125
|
* @csspart row - A column of cells, which a grid reads as a row, under `selection-mode`. It draws no box.
|
|
126
126
|
* @csspart selection - A polite region that says how many cells are selected after a change, rendered from the first change. Hide it visually.
|
|
127
|
+
* @csspart sonify - The button that plays the chart as sound, under `sonify`.
|
|
127
128
|
* @csspart start - The leading slot's box.
|
|
128
129
|
* @csspart strip - The grid of cells, which takes focus to be read by key. It is named by the host's `aria-labelledby` or `aria-label`, then by `label`, then by the caption of the table.
|
|
129
130
|
* @csspart summary - The middle slot's box.
|
|
@@ -302,7 +302,7 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(M
|
|
|
302
302
|
<span part="end"><slot name="end"></slot></span>
|
|
303
303
|
</div>${readable ? this.renderOverview(cells) : nothing}${this.status.spoken
|
|
304
304
|
? html `<span part="selection" role="status">${this.status.said}</span>`
|
|
305
|
-
: nothing}${this.renderTable()}`;
|
|
305
|
+
: nothing}${this.renderSonify()}${this.renderTable()}`;
|
|
306
306
|
}
|
|
307
307
|
renderRows(cells) {
|
|
308
308
|
const size = this.rowCount === 1 ? cells.length : this.rowCount;
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export * from './checkbox/index.js';
|
|
|
29
29
|
export * from './checkbox-group/index.js';
|
|
30
30
|
export * from './code/index.js';
|
|
31
31
|
export * from './code-block/index.js';
|
|
32
|
+
export * from './code-editor/index.js';
|
|
33
|
+
export * from './code-input/index.js';
|
|
32
34
|
export * from './color-input/index.js';
|
|
33
35
|
export * from './color-picker/index.js';
|
|
34
36
|
export * from './combobox/index.js';
|
|
@@ -64,6 +66,7 @@ export * from './listbox/index.js';
|
|
|
64
66
|
export * from './loader/index.js';
|
|
65
67
|
export * from './log/index.js';
|
|
66
68
|
export * from './map/index.js';
|
|
69
|
+
export * from './markdown/index.js';
|
|
67
70
|
export * from './megamenu/index.js';
|
|
68
71
|
export * from './menu/filter/index.js';
|
|
69
72
|
export * from './menu/index.js';
|
|
@@ -86,6 +89,7 @@ export * from './rating/index.js';
|
|
|
86
89
|
export * from './scatter-chart/index.js';
|
|
87
90
|
export * from './scroll-area/index.js';
|
|
88
91
|
export * from './select/index.js';
|
|
92
|
+
export * from './shortcut-overlay/index.js';
|
|
89
93
|
export * from './skeleton/index.js';
|
|
90
94
|
export * from './skip-link/index.js';
|
|
91
95
|
export * from './slider/index.js';
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export * from './checkbox/index.js';
|
|
|
20
20
|
export * from './checkbox-group/index.js';
|
|
21
21
|
export * from './code/index.js';
|
|
22
22
|
export * from './code-block/index.js';
|
|
23
|
+
export * from './code-editor/index.js';
|
|
24
|
+
export * from './code-input/index.js';
|
|
23
25
|
export * from './color-input/index.js';
|
|
24
26
|
export * from './color-picker/index.js';
|
|
25
27
|
export * from './combobox/index.js';
|
|
@@ -55,6 +57,7 @@ export * from './listbox/index.js';
|
|
|
55
57
|
export * from './loader/index.js';
|
|
56
58
|
export * from './log/index.js';
|
|
57
59
|
export * from './map/index.js';
|
|
60
|
+
export * from './markdown/index.js';
|
|
58
61
|
export * from './megamenu/index.js';
|
|
59
62
|
export * from './menu/filter/index.js';
|
|
60
63
|
export * from './menu/index.js';
|
|
@@ -77,6 +80,7 @@ export * from './rating/index.js';
|
|
|
77
80
|
export * from './scatter-chart/index.js';
|
|
78
81
|
export * from './scroll-area/index.js';
|
|
79
82
|
export * from './select/index.js';
|
|
83
|
+
export * from './shortcut-overlay/index.js';
|
|
80
84
|
export * from './skeleton/index.js';
|
|
81
85
|
export * from './skip-link/index.js';
|
|
82
86
|
export * from './slider/index.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AriaForwardController, HelixFormElement, type OwnRule } from '@fusion.dev/helix-core';
|
|
1
|
+
import { AriaForwardController, HelixFormElement, ListedController, type OwnRule } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/** What the control accepts, which is text of one kind or another. */
|
|
4
4
|
export type InputType = 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url';
|
|
5
|
-
declare const HelixHeadlessInput_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
5
|
+
declare const HelixHeadlessInput_base: (new (...args: any[]) => import("@fusion.dev/helix-core").VoiceElement) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
6
6
|
/**
|
|
7
7
|
* @summary A field for a single line of text.
|
|
8
8
|
*
|
|
@@ -53,7 +53,9 @@ declare const HelixHeadlessInput_base: (new (...args: any[]) => import("@fusion.
|
|
|
53
53
|
*
|
|
54
54
|
* @event {Event} change - Sent when the user finishes changing the value. Relayed from the native input.
|
|
55
55
|
* @event {HelixBeforeChangeEvent} helix-before-change - The text is about to change. Cancelable: cancel it to keep the current text.
|
|
56
|
+
* @event {HelixBeforeListenEvent} helix-before-listen - The dictation button was pressed. Cancelable: cancel it to keep the field from listening.
|
|
56
57
|
* @event {HelixClearEvent} helix-clear - Fired after the clear button has emptied the field, after `input` and `change`.
|
|
58
|
+
* @event {HelixListenEvent} helix-listen - Dictation settled on a phrase and put it in the value, after the field's own `input`.
|
|
57
59
|
* @event {Event} input - Fired as the value changes.
|
|
58
60
|
*
|
|
59
61
|
* @csspart clear - The button that empties the field.
|
|
@@ -64,11 +66,18 @@ declare const HelixHeadlessInput_base: (new (...args: any[]) => import("@fusion.
|
|
|
64
66
|
* @csspart label - The label above the field.
|
|
65
67
|
* @csspart reveal - The button that shows and hides a password.
|
|
66
68
|
* @csspart reveal-pressed - The reveal button while the password is shown, added beside `reveal`.
|
|
69
|
+
* @csspart voice - The dictation button, under `voice`.
|
|
70
|
+
* @csspart voice-listening - The dictation button while it listens. Set alongside `voice`.
|
|
71
|
+
* @csspart voice-status - What a screen reader hears as dictation starts and stops, drawn for no one else.
|
|
67
72
|
*
|
|
68
73
|
* @cssstate blank - The field holds no text.
|
|
69
74
|
* @cssstate invalid - The control has an error to show, from the browser's validation, `validate`, or your `feedback`.
|
|
75
|
+
* @cssstate listening - While the field listens for dictation. The element sets `--dictation-level` on itself meanwhile, from 0 to 1, for a meter.
|
|
70
76
|
*/
|
|
71
77
|
export declare class HelixHeadlessInput extends HelixHeadlessInput_base {
|
|
78
|
+
protected static markRules: string[];
|
|
79
|
+
/** On the page's list of controls, where a command palette and a shortcut overlay find it. */
|
|
80
|
+
protected readonly listed: ListedController;
|
|
72
81
|
/**
|
|
73
82
|
* The key this family's words are registered under, its styled tag:
|
|
74
83
|
* `registerWords('de', { 'helix-input': { clearLabel: 'Leeren' } })`.
|
|
@@ -184,6 +193,8 @@ export declare class HelixHeadlessInput extends HelixHeadlessInput_base {
|
|
|
184
193
|
* the button is doing.
|
|
185
194
|
*/
|
|
186
195
|
private get effectiveType();
|
|
196
|
+
/** The type asked for, so a revealed password is still never dictated. */
|
|
197
|
+
protected get voiceType(): string;
|
|
187
198
|
/** Whether there is a clear button on screen right now. */
|
|
188
199
|
private get showsClear();
|
|
189
200
|
/** Focus is delegated to the input, so the host is never the focus target. */
|
|
@@ -323,6 +334,7 @@ export declare class HelixHeadlessInput extends HelixHeadlessInput_base {
|
|
|
323
334
|
* the password is hidden, and crossed out while it shows.
|
|
324
335
|
*/
|
|
325
336
|
protected renderRevealIcon(): TemplateResult;
|
|
337
|
+
protected voiceField(): HTMLInputElement | HTMLTextAreaElement | null;
|
|
326
338
|
protected render(): TemplateResult;
|
|
327
339
|
}
|
|
328
340
|
declare global {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, applyOwnRule, customElement, drawIcon, HelixClearEvent, HelixFormElement, holdCaret, MixinControllerValue, MixinField, numberConverter, restoreValue, submitImplicitly, words, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, applyOwnRule, customElement, drawIcon, HelixClearEvent, HelixFormElement, holdCaret, ListedController, MixinControllerValue, MixinField, MixinVoice, numberConverter, restoreValue, SPOKEN_RULE, submitImplicitly, words, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { eye, eyeSlash, x } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
6
|
-
let HelixHeadlessInput = class HelixHeadlessInput extends MixinControllerValue(MixinField(HelixFormElement)) {
|
|
6
|
+
let HelixHeadlessInput = class HelixHeadlessInput extends MixinVoice(MixinControllerValue(MixinField(HelixFormElement))) {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
+
this.listed = new ListedController(this, 'focus', () => this.internals?.ariaKeyShortcuts);
|
|
9
10
|
this.aria = new AriaForwardController(this, {
|
|
10
11
|
target: () => this.partNamed('control'),
|
|
11
12
|
});
|
|
@@ -54,10 +55,14 @@ let HelixHeadlessInput = class HelixHeadlessInput extends MixinControllerValue(M
|
|
|
54
55
|
this.step = '';
|
|
55
56
|
this.type = 'text';
|
|
56
57
|
}
|
|
58
|
+
static { this.markRules = [SPOKEN_RULE]; }
|
|
57
59
|
static { this.words = 'helix-input'; }
|
|
58
60
|
get effectiveType() {
|
|
59
61
|
return this.revealed && this.type === 'password' ? 'text' : this.type;
|
|
60
62
|
}
|
|
63
|
+
get voiceType() {
|
|
64
|
+
return this.type;
|
|
65
|
+
}
|
|
61
66
|
get showsClear() {
|
|
62
67
|
return this.clearable && this.value !== '' && !this.isDisabled && !this.readOnly;
|
|
63
68
|
}
|
|
@@ -169,6 +174,9 @@ let HelixHeadlessInput = class HelixHeadlessInput extends MixinControllerValue(M
|
|
|
169
174
|
? html `<slot name="conceal-icon">${drawIcon(eyeSlash)}</slot>`
|
|
170
175
|
: html `<slot name="reveal-icon">${drawIcon(eye)}</slot>`;
|
|
171
176
|
}
|
|
177
|
+
voiceField() {
|
|
178
|
+
return this.partNamed('control');
|
|
179
|
+
}
|
|
172
180
|
render() {
|
|
173
181
|
return html `${this.renderLabel()}
|
|
174
182
|
<div part="field">
|
|
@@ -224,7 +232,7 @@ let HelixHeadlessInput = class HelixHeadlessInput extends MixinControllerValue(M
|
|
|
224
232
|
>
|
|
225
233
|
${this.renderRevealIcon()}
|
|
226
234
|
</button>`
|
|
227
|
-
: nothing}
|
|
235
|
+
: nothing}${this.renderVoice()}
|
|
228
236
|
</div>
|
|
229
237
|
${this.renderHint()}${this.renderFeedback()}`;
|
|
230
238
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ariaChord, chordParts, customElement, elementById, HelixElement, HelixShortcutEvent, keyNames, matchesChord, onApple, printableChord, SPOKEN_RULE, wordsConverter, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { ariaChord, chordParts, controlName, customElement, elementById, HelixElement, HelixShortcutEvent, keyNames, matchesChord, onApple, printableChord, registerShortcut, SPOKEN_RULE, wordsConverter, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html, nothing } from 'lit';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
5
|
import { claimShortcut, releaseShortcut } from '../shortcut.js';
|
|
@@ -73,12 +73,19 @@ let HelixHeadlessKbd = class HelixHeadlessKbd extends HelixElement {
|
|
|
73
73
|
this.undescribe();
|
|
74
74
|
if (control && chord !== '') {
|
|
75
75
|
claimShortcut(control, chord);
|
|
76
|
-
|
|
76
|
+
const unregister = registerShortcut({
|
|
77
|
+
keys: () => this.keys,
|
|
78
|
+
label: () => controlName(control),
|
|
79
|
+
owner: this,
|
|
80
|
+
target: control,
|
|
81
|
+
});
|
|
82
|
+
this.described = { chord, control, unregister };
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
undescribe() {
|
|
80
86
|
if (this.described) {
|
|
81
87
|
releaseShortcut(this.described.control, this.described.chord);
|
|
88
|
+
this.described.unregister();
|
|
82
89
|
this.described = undefined;
|
|
83
90
|
}
|
|
84
91
|
}
|
|
@@ -97,6 +97,7 @@ declare const HelixHeadlessLineChart_base: typeof HelixElement & (new (...args:
|
|
|
97
97
|
* @csspart marker-lone - The `marker` path of one series' readings with a blank on either side, which no line reaches and which are marked without `markers`. Set alongside `marker`.
|
|
98
98
|
* @csspart marker-ring - The same marks again under each series' `marker` paths, to stroke a little wider in the page's color, so a mark reads over the line it sits on.
|
|
99
99
|
* @csspart plot - The drawing, which takes focus to be read by key. With nothing to draw, a group named as the chart is, holding the `empty` or `loading` part.
|
|
100
|
+
* @csspart sonify - The button that plays the chart as sound, under `sonify`.
|
|
100
101
|
* @csspart summary - The chart's name and each series' latest reading, written as a sentence for screen readers. Hide it visually.
|
|
101
102
|
* @csspart svg - The drawing surface the lines and areas sit on.
|
|
102
103
|
* @csspart table - The readings as a table, for a screen reader, rendered only where they were drawn from `data`, a page of them at a time past a few hundred. Hide it visually.
|
|
@@ -127,7 +127,7 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
|
|
|
127
127
|
}
|
|
128
128
|
const domain = this.range(series);
|
|
129
129
|
const { x, y } = this.scalesOf(domain, readings.length);
|
|
130
|
-
return html `${this.valueAxis ? this.renderAxis(y, domain) : nothing}${this.renderPlot(series, x, y, domain)} ${this.renderLabels(readings)}${this.renderSummary(series)}${this.renderTable()}`;
|
|
130
|
+
return html `${this.valueAxis ? this.renderAxis(y, domain) : nothing}${this.renderPlot(series, x, y, domain)} ${this.renderLabels(readings)}${this.renderSummary(series)}${this.renderSonify()}${this.renderTable()}`;
|
|
131
131
|
}
|
|
132
132
|
renderAxis(y, domain) {
|
|
133
133
|
return drawValueAxis(domain, (value) => (y(value) / PLOT_HEIGHT) * 100, formatNumbers(wordsLocale(this)), (widest) => `--line-chart-axis: ${widest}ch`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AriaForwardController, type DataOptionItem, DisabledCascadeController, HelixFormElement, UpgradeController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import type { HelixHeadlessOption } from '../../option/root/option-root.js';
|
|
4
|
-
declare const HelixHeadlessListbox_base: (new (...args: any[]) => import("@fusion.dev/helix-core").CollectionElement) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
4
|
+
declare const HelixHeadlessListbox_base: (new (...args: any[]) => import("@fusion.dev/helix-core").VoiceElement) & (new (...args: any[]) => import("@fusion.dev/helix-core").CollectionElement) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
5
5
|
/**
|
|
6
6
|
* @summary A list of options, from which you choose one or several.
|
|
7
7
|
*
|
|
@@ -107,8 +107,10 @@ declare const HelixHeadlessListbox_base: (new (...args: any[]) => import("@fusio
|
|
|
107
107
|
*
|
|
108
108
|
* @event {Event} change - Fired after the value changes.
|
|
109
109
|
* @event {HelixBeforeChangeEvent} helix-before-change - Fired when the value is about to change, and cancelable.
|
|
110
|
+
* @event {HelixBeforeListenEvent} helix-before-listen - The dictation button was pressed. Cancelable: cancel it to keep the field from listening.
|
|
110
111
|
* @event {HelixBeforeReorderEvent} helix-before-reorder - Fired when an option is dropped at a new place, in a `reorderable` list with `@fusion.dev/helix/listbox/reorder` imported, with every value in the new order. Cancelable: cancel it to keep the option where it is.
|
|
111
112
|
* @event {HelixFilterEvent} helix-filter - Fired before the list is filtered, and cancelable.
|
|
113
|
+
* @event {HelixListenEvent} helix-listen - Dictation settled on a phrase and put it in the search field, after the field's own `input`.
|
|
112
114
|
* @event {HelixLoadMoreEvent} helix-load-more - Fired once the list is scrolled within a screen of its end, once for each number of options, and not while `loading` is set. Add the next page of options and set `loading` while you fetch it.
|
|
113
115
|
* @event {HelixReorderEvent} helix-reorder - Fired after `helix-before-reorder` when nobody canceled it. Move your options, or your `items`, to the order in `keys`. Cancelable: cancel it to say the move did not happen.
|
|
114
116
|
* @event {Event} input - Fired after the value changes.
|
|
@@ -125,10 +127,14 @@ declare const HelixHeadlessListbox_base: (new (...args: any[]) => import("@fusio
|
|
|
125
127
|
* @csspart loading - The text shown while the options load.
|
|
126
128
|
* @csspart search - The region that holds the filter field.
|
|
127
129
|
* @csspart search-field - The filter field.
|
|
130
|
+
* @csspart voice - The dictation button, under `voice` on a `filterable` list, in the search field.
|
|
131
|
+
* @csspart voice-listening - The dictation button while it listens. Set alongside `voice`.
|
|
132
|
+
* @csspart voice-status - What a screen reader hears as dictation starts and stops, drawn for no one else.
|
|
128
133
|
*
|
|
129
134
|
* @cssstate empty - The list has no options to show: none were given, or the filter hid every one.
|
|
130
135
|
* @cssstate error - While `load-error` is set.
|
|
131
136
|
* @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
|
|
137
|
+
* @cssstate listening - While the field listens for dictation. The element sets `--dictation-level` on itself meanwhile, from 0 to 1, for a meter.
|
|
132
138
|
* @cssstate loading - While `loading` is set.
|
|
133
139
|
* @cssstate no-results - A filter hid every option of a list that has some.
|
|
134
140
|
*/
|
|
@@ -734,6 +740,7 @@ export declare class HelixHeadlessListbox extends HelixHeadlessListbox_base {
|
|
|
734
740
|
private get failed();
|
|
735
741
|
/** The error, or what a filter that hid everything says, before the shared words. */
|
|
736
742
|
protected renderLive(hasContent: boolean): TemplateResult;
|
|
743
|
+
protected voiceField(): HTMLInputElement | null;
|
|
737
744
|
protected render(): TemplateResult;
|
|
738
745
|
}
|
|
739
746
|
declare global {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, auditChildren, centerInView, chosenValues, columnStep, countLabel, customElement, DelayController, DisabledCascadeController, drawAutofill, endInSight, filterKeeps, formatWords, HelixFilterEvent, HelixFormElement, HelixLoadMoreEvent, hostAria, inlineStep, MixinCollection, MixinControllerValue, MixinField, markMatches, OptionWindowController, onApple, pageRows, rangeAdd, reportValues, requestChange, scrollItemIntoView, selectsAll, Typeahead, timeConverter, toggleEvery, typesCharacter, UpgradeController, VIRTUAL_RULE, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, auditChildren, centerInView, chosenValues, columnStep, countLabel, customElement, DelayController, DisabledCascadeController, drawAutofill, endInSight, filterKeeps, formatWords, HelixFilterEvent, HelixFormElement, HelixLoadMoreEvent, hostAria, inlineStep, MixinCollection, MixinControllerValue, MixinField, MixinVoice, markMatches, OptionWindowController, onApple, pageRows, rangeAdd, reportValues, requestChange, SPOKEN_RULE, scrollItemIntoView, selectsAll, Typeahead, timeConverter, toggleEvery, typesCharacter, UpgradeController, VIRTUAL_RULE, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { magnifyingGlass } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -8,7 +8,7 @@ import { isOption } from '../../option/among.js';
|
|
|
8
8
|
const FIELD_MOVES = new Set(['ArrowDown', 'ArrowUp', 'PageDown', 'PageUp']);
|
|
9
9
|
const MOVES = new Set([...FIELD_MOVES, 'End', 'Home']);
|
|
10
10
|
const PAGE = 10;
|
|
11
|
-
let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(MixinControllerValue(MixinField(HelixFormElement))) {
|
|
11
|
+
let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCollection(MixinControllerValue(MixinField(HelixFormElement)))) {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this.aria = new AriaForwardController(this, {
|
|
@@ -222,7 +222,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
222
222
|
this.navigate(event);
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
static { this.markRules = [VIRTUAL_RULE]; }
|
|
225
|
+
static { this.markRules = [VIRTUAL_RULE, SPOKEN_RULE]; }
|
|
226
226
|
static { this.words = 'helix-listbox'; }
|
|
227
227
|
get filter() {
|
|
228
228
|
return this.filterState ?? this.defaultFilter;
|
|
@@ -617,6 +617,9 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
617
617
|
? super.renderLive(hasContent)
|
|
618
618
|
: html `<span part="live" role="status">${words}</span>`;
|
|
619
619
|
}
|
|
620
|
+
voiceField() {
|
|
621
|
+
return this.filterable ? this.partNamed('search-field') : null;
|
|
622
|
+
}
|
|
620
623
|
render() {
|
|
621
624
|
const shown = this.showsOptions;
|
|
622
625
|
return html `${this.renderGroupLabel()}
|
|
@@ -638,7 +641,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
638
641
|
?disabled=${this.isDisabled}
|
|
639
642
|
@input=${this.handleFilter}
|
|
640
643
|
@keydown=${this.handleFilterKeydown}
|
|
641
|
-
|
|
644
|
+
/>${this.renderVoice()}
|
|
642
645
|
</div>`
|
|
643
646
|
: ''}
|
|
644
647
|
<div
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown's blocks, read line by line from text that may still be arriving.
|
|
3
|
+
*
|
|
4
|
+
* **Written for a stream, so it decides nothing it may have to take back.** A
|
|
5
|
+
* block that a later line closed is final, and a reader of the result can keep
|
|
6
|
+
* what it drew for it. Two CommonMark constructs change a block after the
|
|
7
|
+
* fact, and neither is read: a setext heading (`Title` over `===`), which turns
|
|
8
|
+
* a paragraph into a heading when its second line arrives, and an indented code
|
|
9
|
+
* block, which a list's continuation lines are easily mistaken for. `---` under
|
|
10
|
+
* a paragraph is a rule, and four spaces of indent are text. Reference links
|
|
11
|
+
* are not read either, since a definition at the end would relink a paragraph
|
|
12
|
+
* drawn long before it.
|
|
13
|
+
*
|
|
14
|
+
* Raw HTML is text. A model's reply is not trusted markup.
|
|
15
|
+
*/
|
|
16
|
+
/** How a table column aligns its cells. */
|
|
17
|
+
export type MarkdownAlign = 'center' | 'end' | 'start' | undefined;
|
|
18
|
+
/** The five kinds of GitHub alert. */
|
|
19
|
+
export type MarkdownAlertKind = 'caution' | 'important' | 'note' | 'tip' | 'warning';
|
|
20
|
+
/** One item of a list, and whether it is a task and done. */
|
|
21
|
+
export interface MarkdownItem {
|
|
22
|
+
/** Present for a task item: `true` where it is checked. */
|
|
23
|
+
checked?: boolean;
|
|
24
|
+
children: MarkdownBlock[];
|
|
25
|
+
}
|
|
26
|
+
/** A block of a Markdown document. */
|
|
27
|
+
export type MarkdownBlock = {
|
|
28
|
+
kind: 'code';
|
|
29
|
+
info: string;
|
|
30
|
+
open: boolean;
|
|
31
|
+
text: string;
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'heading';
|
|
34
|
+
level: number;
|
|
35
|
+
text: string;
|
|
36
|
+
} | {
|
|
37
|
+
items: MarkdownItem[];
|
|
38
|
+
kind: 'list';
|
|
39
|
+
ordered: boolean;
|
|
40
|
+
start: number;
|
|
41
|
+
} | {
|
|
42
|
+
kind: 'paragraph';
|
|
43
|
+
text: string;
|
|
44
|
+
} | {
|
|
45
|
+
alert?: MarkdownAlertKind;
|
|
46
|
+
children: MarkdownBlock[];
|
|
47
|
+
kind: 'quote';
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'rule';
|
|
50
|
+
} | {
|
|
51
|
+
align: MarkdownAlign[];
|
|
52
|
+
head: string[];
|
|
53
|
+
kind: 'table';
|
|
54
|
+
rows: string[][];
|
|
55
|
+
};
|
|
56
|
+
/** The blocks of some lines, and the line each top-level block starts on. */
|
|
57
|
+
export interface MarkdownBlocks {
|
|
58
|
+
blocks: MarkdownBlock[];
|
|
59
|
+
starts: number[];
|
|
60
|
+
}
|
|
61
|
+
/** The columns of a line's leading whitespace, a tab reaching the next stop of four. */
|
|
62
|
+
export declare const indentOf: (line: string) => number;
|
|
63
|
+
/** A table row's cells: split at pipes a backslash does not escape, the outer pipes dropped. */
|
|
64
|
+
export declare const cellsOf: (line: string) => string[];
|
|
65
|
+
/** Every block of some lines, in order, and the line each starts on. */
|
|
66
|
+
export declare const parseBlocks: (lines: string[]) => MarkdownBlocks;
|