lintje 0.7.0 → 0.8.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/NOTICE.md +2 -0
- package/README.md +2 -2
- package/dist-elements/actions.js +1 -1
- package/dist-elements/chat.js +1 -1
- package/dist-elements/chunks/{addon-CFoSG70u.js → addon-B-nZKTVZ.js} +2 -2
- package/dist-elements/chunks/avatar-C1Wj9drG.js +1 -0
- package/dist-elements/chunks/axes-DPj3RyPk.js +129 -0
- package/dist-elements/chunks/base-lxVG98kf.js +226 -0
- package/dist-elements/chunks/chart-styles-sK3xVPFj.js +45 -0
- package/dist-elements/chunks/{date-format-5bii3QLP.js → date-format-DvDaZtFc.js} +1 -1
- package/dist-elements/chunks/{dialog-close-CzMRXkJ6.js → dialog-close-DpjJ6JbT.js} +1 -1
- package/dist-elements/chunks/disclosure-Ch2SwnkG.js +1 -0
- package/dist-elements/chunks/disclosure-o3Agc4Ji.js +20 -0
- package/dist-elements/chunks/download-C74iql1Q.js +18 -0
- package/dist-elements/chunks/{focus-trap-BDxiHED1.js → focus-trap-xGyZPSzU.js} +1 -1
- package/dist-elements/chunks/frame-BMR48Vea.js +1 -0
- package/dist-elements/chunks/{input-C7qx0e4p.js → input-C7MnFu5X.js} +4 -4
- package/dist-elements/chunks/input-CCT6CcW1.js +1 -0
- package/dist-elements/chunks/month-grid-CoYFI13w.js +26 -0
- package/dist-elements/chunks/{other-BaLStKaf.js → other-D_wlqvPA.js} +3 -3
- package/dist-elements/chunks/player-BW0tPg9_.js +39 -0
- package/dist-elements/chunks/{prose-DOF7h3je.js → prose-aNcSsHId.js} +1 -1
- package/dist-elements/chunks/search-text-i-Em9oIy.js +1 -0
- package/dist-elements/chunks/sentence-CJX3W7W5.js +3 -0
- package/dist-elements/chunks/stagger-DYloMMgF.js +27 -0
- package/dist-elements/chunks/wheel-Co2Dpj0Q.js +1 -0
- package/dist-elements/content.js +1 -1
- package/dist-elements/core.js +1 -1
- package/dist-elements/custom-elements.json +1298 -204
- package/dist-elements/data-types.json +2836 -622
- package/dist-elements/feedback.js +1 -1
- package/dist-elements/graph.d.ts +1 -0
- package/dist-elements/graph.js +1 -0
- package/dist-elements/guides/events.md +7 -3
- package/dist-elements/guides/loading.md +12 -9
- package/dist-elements/layout.js +1 -1
- package/dist-elements/lintje.js +3002 -2246
- package/dist-elements/overlays.js +1 -1
- package/dist-elements/skills/lintje/SKILL.md +26 -5
- package/dist-elements/skills/lintje/check.mjs +180 -0
- package/dist-elements/skills/lintje/reference.mjs +24 -3
- package/dist-elements/tables.js +1 -1
- package/dist-elements/tag/accordion.d.ts +1 -0
- package/dist-elements/tag/accordion.js +6 -0
- package/dist-elements/tag/activity-log.js +13 -11
- package/dist-elements/tag/ai-label.js +5 -5
- package/dist-elements/tag/announcement.js +2 -2
- package/dist-elements/tag/app-search.js +19 -19
- package/dist-elements/tag/attachment.d.ts +1 -0
- package/dist-elements/tag/attachment.js +54 -0
- package/dist-elements/tag/audio-player.js +42 -42
- package/dist-elements/tag/badge.js +1 -1
- package/dist-elements/tag/breadcrumbs.js +8 -8
- package/dist-elements/tag/button.js +1 -1
- package/dist-elements/tag/card-list.js +9 -9
- package/dist-elements/tag/card.js +41 -35
- package/dist-elements/tag/chart.js +682 -419
- package/dist-elements/tag/chat-answer.js +49 -47
- package/dist-elements/tag/chat-composer.js +100 -40
- package/dist-elements/tag/chat-message.js +16 -11
- package/dist-elements/tag/chat-questions.d.ts +1 -0
- package/dist-elements/tag/chat-questions.js +133 -0
- package/dist-elements/tag/chat-steps.d.ts +1 -0
- package/dist-elements/tag/chat-steps.js +52 -0
- package/dist-elements/tag/chat-strip.js +27 -27
- package/dist-elements/tag/chat-suggestions.js +9 -10
- package/dist-elements/tag/chat.js +70 -42
- package/dist-elements/tag/checkbox-group.js +8 -8
- package/dist-elements/tag/checkbox.js +7 -7
- package/dist-elements/tag/code.js +9 -9
- package/dist-elements/tag/combobox.js +22 -22
- package/dist-elements/tag/conflict-alert.js +7 -7
- package/dist-elements/tag/copy-button.js +9 -9
- package/dist-elements/tag/data-table.js +237 -232
- package/dist-elements/tag/date-input.js +15 -39
- package/dist-elements/tag/date-range.js +21 -46
- package/dist-elements/tag/description-list.js +21 -19
- package/dist-elements/tag/dialog.js +7 -7
- package/dist-elements/tag/document-viewer.js +23 -23
- package/dist-elements/tag/drawer.js +9 -9
- package/dist-elements/tag/empty-state.js +1 -1
- package/dist-elements/tag/error-page.js +11 -11
- package/dist-elements/tag/error-summary.js +12 -12
- package/dist-elements/tag/expander.js +5 -5
- package/dist-elements/tag/explainer.js +5 -5
- package/dist-elements/tag/field.js +4 -4
- package/dist-elements/tag/file-upload.js +32 -42
- package/dist-elements/tag/filter-bar.js +20 -20
- package/dist-elements/tag/filter-sheet.js +3 -3
- package/dist-elements/tag/filter-zone.js +15 -15
- package/dist-elements/tag/find.js +16 -16
- package/dist-elements/tag/footer.js +14 -14
- package/dist-elements/tag/form-actions.js +2 -2
- package/dist-elements/tag/form-section.js +3 -3
- package/dist-elements/tag/form.js +3 -3
- package/dist-elements/tag/gallery.js +10 -10
- package/dist-elements/tag/graph.d.ts +1 -0
- package/dist-elements/tag/graph.js +102 -0
- package/dist-elements/tag/grid-item.js +1 -1
- package/dist-elements/tag/grid.js +1 -1
- package/dist-elements/tag/hero.js +7 -7
- package/dist-elements/tag/highlight.js +4 -4
- package/dist-elements/tag/icon-button.js +1 -1
- package/dist-elements/tag/icon.js +1 -1
- package/dist-elements/tag/job-list.js +4 -4
- package/dist-elements/tag/key.d.ts +1 -0
- package/dist-elements/tag/key.js +1 -0
- package/dist-elements/tag/kpi-row.js +5 -5
- package/dist-elements/tag/kpi.js +70 -70
- package/dist-elements/tag/level-meter.js +8 -8
- package/dist-elements/tag/list.js +43 -42
- package/dist-elements/tag/log-viewer.js +68 -68
- package/dist-elements/tag/logo.js +23 -23
- package/dist-elements/tag/map.js +154 -153
- package/dist-elements/tag/menu-button.js +34 -34
- package/dist-elements/tag/modal.js +9 -9
- package/dist-elements/tag/multiselect.js +21 -22
- package/dist-elements/tag/note.js +2 -2
- package/dist-elements/tag/notifications.js +23 -23
- package/dist-elements/tag/number-input.js +18 -18
- package/dist-elements/tag/page-header.js +13 -13
- package/dist-elements/tag/pagination.js +26 -26
- package/dist-elements/tag/person-group.d.ts +1 -0
- package/dist-elements/tag/person-group.js +36 -0
- package/dist-elements/tag/person.d.ts +1 -0
- package/dist-elements/tag/person.js +11 -0
- package/dist-elements/tag/popover.js +1 -1
- package/dist-elements/tag/progress-bar.js +1 -1
- package/dist-elements/tag/prose.js +1 -1
- package/dist-elements/tag/qr-code.js +5 -5
- package/dist-elements/tag/radio-group.js +12 -12
- package/dist-elements/tag/range.js +24 -24
- package/dist-elements/tag/recording-status.js +9 -9
- package/dist-elements/tag/repeater.js +5 -5
- package/dist-elements/tag/segmented.js +8 -8
- package/dist-elements/tag/select.js +8 -8
- package/dist-elements/tag/shell.js +199 -199
- package/dist-elements/tag/skeleton.js +1 -1
- package/dist-elements/tag/slot-picker.js +15 -15
- package/dist-elements/tag/sortable-list.js +20 -20
- package/dist-elements/tag/spinner.js +1 -1
- package/dist-elements/tag/split-pane.js +9 -9
- package/dist-elements/tag/status-dot.js +1 -1
- package/dist-elements/tag/stepper.js +14 -14
- package/dist-elements/tag/streaming-text.js +13 -13
- package/dist-elements/tag/sub-nav.js +20 -20
- package/dist-elements/tag/tabs.js +37 -38
- package/dist-elements/tag/tag-input.js +28 -28
- package/dist-elements/tag/text-editor.js +25 -24
- package/dist-elements/tag/text-input.js +21 -21
- package/dist-elements/tag/textarea.js +11 -11
- package/dist-elements/tag/tile.js +1 -1
- package/dist-elements/tag/time-input.js +13 -13
- package/dist-elements/tag/toast.js +8 -8
- package/dist-elements/tag/toggle.js +5 -5
- package/dist-elements/tag/toggletip.js +6 -6
- package/dist-elements/tag/token-value.js +2 -2
- package/dist-elements/tag/tooltip.js +1 -1
- package/dist-elements/tag/transcript.js +32 -32
- package/dist-elements/tag/translator.js +6 -6
- package/dist-elements/tag/tree-view.js +22 -22
- package/dist-elements/tag/user-menu.js +37 -36
- package/dist-elements/tag/video-player.js +17 -14
- package/dist-elements/tokens.css +52 -1
- package/dist-elements/tokens.json +701 -313
- package/dist-elements/types/bundle/chat.d.ts +2 -0
- package/dist-elements/types/bundle/content.d.ts +2 -0
- package/dist-elements/types/bundle/graph.d.ts +2 -0
- package/dist-elements/types/bundle/index.d.ts +1 -1
- package/dist-elements/types/bundle/layout.d.ts +1 -0
- package/dist-elements/types/bundle/tables.d.ts +2 -0
- package/dist-elements/types/components/charts/chart/chart.d.ts +3 -12
- package/dist-elements/types/components/chat/chat/chat.d.ts +11 -2
- package/dist-elements/types/components/chat/chat-answer/chat-answer.d.ts +6 -4
- package/dist-elements/types/components/chat/chat-composer/chat-composer.d.ts +61 -4
- package/dist-elements/types/components/chat/chat-message/chat-message.d.ts +6 -2
- package/dist-elements/types/components/chat/chat-questions/chat-questions.d.ts +106 -0
- package/dist-elements/types/components/chat/chat-steps/chat-steps.d.ts +53 -0
- package/dist-elements/types/components/chat/chat-suggestions/chat-suggestions.d.ts +4 -11
- package/dist-elements/types/components/content/attachment/attachment.d.ts +58 -0
- package/dist-elements/types/components/content/audio-player/audio-player.d.ts +2 -1
- package/dist-elements/types/components/content/key/key.d.ts +21 -0
- package/dist-elements/types/components/content/prose/prose.d.ts +4 -3
- package/dist-elements/types/components/content/shared/player.d.ts +2 -1
- package/dist-elements/types/components/content/transcript/transcript.d.ts +7 -0
- package/dist-elements/types/components/content/video-player/video-player.d.ts +12 -3
- package/dist-elements/types/components/feedback/empty-state/empty-state.d.ts +2 -2
- package/dist-elements/types/components/feedback/status-dot/status-dot.d.ts +13 -2
- package/dist-elements/types/components/forms/form-actions/form-actions.d.ts +5 -2
- package/dist-elements/types/components/frame/app-search/app-search.d.ts +0 -2
- package/dist-elements/types/components/frame/user-menu/user-menu.d.ts +2 -2
- package/dist-elements/types/components/graph/graph/graph.d.ts +147 -0
- package/dist-elements/types/components/graph/graph/layout-runner.d.ts +13 -0
- package/dist-elements/types/components/graph/graph/layout-worker.d.ts +1 -0
- package/dist-elements/types/components/graph/graph/layout.d.ts +27 -0
- package/dist-elements/types/components/graph/graph/model.d.ts +81 -0
- package/dist-elements/types/components/graph/graph/routes.d.ts +62 -0
- package/dist-elements/types/components/graph/graph/view.d.ts +58 -0
- package/dist-elements/types/components/index.d.ts +20 -4
- package/dist-elements/types/components/inputs/combobox/combobox.d.ts +0 -2
- package/dist-elements/types/components/inputs/date-input/date-input.d.ts +1 -1
- package/dist-elements/types/components/inputs/date-range/date-range.d.ts +17 -6
- package/dist-elements/types/components/inputs/file-upload/file-upload.d.ts +10 -33
- package/dist-elements/types/components/inputs/multiselect/multiselect.d.ts +1 -11
- package/dist-elements/types/components/layout/accordion/accordion.d.ts +37 -0
- package/dist-elements/types/components/layout/expander/expander.d.ts +5 -1
- package/dist-elements/types/components/layout/split-pane/split-pane.d.ts +2 -0
- package/dist-elements/types/components/layout/tabs/tabs.d.ts +3 -0
- package/dist-elements/types/components/overlays/popover/popover.d.ts +7 -0
- package/dist-elements/types/components/overlays/tooltip/tooltip.d.ts +1 -1
- package/dist-elements/types/components/shared/avatar.d.ts +21 -0
- package/dist-elements/types/components/shared/charts/bar-chart/bar-chart.d.ts +3 -2
- package/dist-elements/types/components/shared/charts/dumbbell-chart/dumbbell-chart.d.ts +33 -0
- package/dist-elements/types/components/shared/charts/index.d.ts +6 -2
- package/dist-elements/types/components/shared/charts/kinds.d.ts +22 -4
- package/dist-elements/types/components/shared/charts/line-chart/line-chart.d.ts +3 -2
- package/dist-elements/types/components/shared/charts/sankey-chart/sankey-chart.d.ts +124 -0
- package/dist-elements/types/components/shared/charts/shared/axes.d.ts +33 -6
- package/dist-elements/types/components/shared/charts/shared/chart-states.d.ts +1 -1
- package/dist-elements/types/components/shared/charts/shared/chart-styles.d.ts +2 -0
- package/dist-elements/types/components/shared/charts/shared/colors.d.ts +29 -4
- package/dist-elements/types/components/shared/charts/shared/controller.d.ts +23 -3
- package/dist-elements/types/components/shared/charts/shared/forecast.d.ts +21 -0
- package/dist-elements/types/components/shared/charts/shared/plot-keys.d.ts +5 -0
- package/dist-elements/types/components/shared/charts/shared/tints.d.ts +2 -0
- package/dist-elements/types/components/shared/charts/shared/types.d.ts +146 -0
- package/dist-elements/types/components/shared/charts/shared/wheel.d.ts +11 -0
- package/dist-elements/types/components/shared/charts/treemap-chart/squarify.d.ts +16 -0
- package/dist-elements/types/components/shared/charts/treemap-chart/treemap-chart.d.ts +18 -0
- package/dist-elements/types/components/shared/charts/treemap-chart/treemap-labels.d.ts +36 -0
- package/dist-elements/types/components/shared/charts/treemap-chart/treemap-parts.d.ts +64 -0
- package/dist-elements/types/components/shared/disclosure.d.ts +5 -3
- package/dist-elements/types/components/shared/download.d.ts +28 -2
- package/dist-elements/types/components/shared/empty-state-block.d.ts +1 -1
- package/dist-elements/types/components/shared/files.d.ts +67 -0
- package/dist-elements/types/components/shared/heading.d.ts +4 -0
- package/dist-elements/types/components/shared/month-grid.d.ts +33 -0
- package/dist-elements/types/components/shared/place.d.ts +2 -2
- package/dist-elements/types/components/shared/search-text.d.ts +5 -0
- package/dist-elements/types/components/tables/activity-log/activity-log.d.ts +9 -2
- package/dist-elements/types/components/tables/card/card.d.ts +13 -2
- package/dist-elements/types/components/tables/data-table/editing.d.ts +7 -2
- package/dist-elements/types/components/tables/description-list/description-list.d.ts +4 -0
- package/dist-elements/types/components/tables/list/list.d.ts +9 -0
- package/dist-elements/types/components/tables/person/person.d.ts +35 -0
- package/dist-elements/types/components/tables/person-group/person-group.d.ts +42 -0
- package/dist-elements/types/core/format.d.ts +2 -2
- package/dist-elements/types/core/id.d.ts +2 -0
- package/dist-elements/types/icons/register.d.ts +1 -1
- package/dist-elements/types/types.d.ts +194 -15
- package/dist-elements/workers/layout-worker.js +3 -0
- package/dist-icons/functioneel-link.svg +1 -0
- package/dist-icons/functioneel-ondertiteling.svg +1 -0
- package/package.json +8 -1
- package/dist-elements/chunks/base-BsZyWDre.js +0 -226
- package/dist-elements/chunks/chart-styles-C5IzbVUF.js +0 -44
- package/dist-elements/chunks/disclosure-CQcLUnKh.js +0 -22
- package/dist-elements/chunks/disclosure-DjLQzn9n.js +0 -1
- package/dist-elements/chunks/download-CxEzwMxI.js +0 -13
- package/dist-elements/chunks/input-CazTpGUd.js +0 -1
- package/dist-elements/chunks/player-BEG3MVCm.js +0 -39
- package/dist-elements/chunks/sentence-CjgQjBP9.js +0 -3
- package/dist-elements/chunks/stagger-CwsMNTLl.js +0 -133
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import '../components/chat/chat/chat.js';
|
|
3
3
|
import '../components/chat/chat-message/chat-message.js';
|
|
4
4
|
import '../components/chat/chat-answer/chat-answer.js';
|
|
5
|
+
import '../components/chat/chat-steps/chat-steps.js';
|
|
5
6
|
import '../components/chat/chat-composer/chat-composer.js';
|
|
7
|
+
import '../components/chat/chat-questions/chat-questions.js';
|
|
6
8
|
import '../components/chat/chat-strip/chat-strip.js';
|
|
7
9
|
import '../components/chat/chat-suggestions/chat-suggestions.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** The content category (Tekst en media): importing it defines its tags. */
|
|
2
2
|
import '../components/content/prose/prose.js';
|
|
3
3
|
import '../components/content/code/code.js';
|
|
4
|
+
import '../components/content/key/key.js';
|
|
4
5
|
import '../components/content/highlight/highlight.js';
|
|
5
6
|
import '../components/content/token-value/token-value.js';
|
|
6
7
|
import '../components/content/translator/translator.js';
|
|
@@ -10,3 +11,4 @@ import '../components/content/transcript/transcript.js';
|
|
|
10
11
|
import '../components/content/log-viewer/log-viewer.js';
|
|
11
12
|
import '../components/content/document-viewer/document-viewer.js';
|
|
12
13
|
import '../components/content/gallery/gallery.js';
|
|
14
|
+
import '../components/content/attachment/attachment.js';
|
|
@@ -7,7 +7,7 @@ export type * from '../types.js';
|
|
|
7
7
|
/** Every tag this bundle defines, for a host that wants to check. */
|
|
8
8
|
export declare const LINTJE_TAGS: readonly string[];
|
|
9
9
|
/** The views a host mounts: the tags that take a `data` object straight from the host. */
|
|
10
|
-
export declare const LINTJE_VIEWS: readonly ['shell', 'page-header', 'filter-bar', 'kpi-row', 'chart', 'data-table', 'announcement', 'map', 'explainer', 'note', 'chat', 'log-viewer'];
|
|
10
|
+
export declare const LINTJE_VIEWS: readonly ['shell', 'page-header', 'filter-bar', 'kpi-row', 'chart', 'data-table', 'announcement', 'map', 'graph', 'explainer', 'note', 'chat', 'log-viewer'];
|
|
11
11
|
export type LintjeViewName = (typeof LINTJE_VIEWS)[number];
|
|
12
12
|
/** The tag of a view: `lintje-` plus its name. */
|
|
13
13
|
export declare const tagFor: (view: LintjeViewName) => string;
|
|
@@ -4,4 +4,5 @@ import '../components/layout/grid-item/grid-item.js';
|
|
|
4
4
|
import '../components/layout/tile/tile.js';
|
|
5
5
|
import '../components/layout/tabs/tabs.js';
|
|
6
6
|
import '../components/layout/expander/expander.js';
|
|
7
|
+
import '../components/layout/accordion/accordion.js';
|
|
7
8
|
import '../components/layout/split-pane/split-pane.js';
|
|
@@ -8,3 +8,5 @@ import '../components/tables/description-list/description-list.js';
|
|
|
8
8
|
import '../components/tables/tree-view/tree-view.js';
|
|
9
9
|
import '../components/tables/sortable-list/sortable-list.js';
|
|
10
10
|
import '../components/tables/activity-log/activity-log.js';
|
|
11
|
+
import '../components/tables/person/person.js';
|
|
12
|
+
import '../components/tables/person-group/person-group.js';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `<lintje-chart>` — a chart in its tile, with loading, empty and error states.
|
|
3
3
|
*
|
|
4
|
-
* Expand and download are handled here.
|
|
5
|
-
* CSV rows; it never reaches the URL. A mark with an `href` goes there after its
|
|
4
|
+
* Expand and download are handled here. A mark with an `href` goes there after its
|
|
6
5
|
* `lintje-mark-select`, and undoing goes to `data.clearHref`: the event is cancelable, and a host
|
|
7
6
|
* that routes itself cancels it. A modifier or middle click on a mark opens its `href` in a new
|
|
8
7
|
* tab, without that event.
|
|
@@ -10,25 +9,21 @@
|
|
|
10
9
|
* Events: `lintje-mark-select` `{ id, label, href }` (a mark with an `href` was clicked;
|
|
11
10
|
* deselected, `{ id: null, label: null, href: data.clearHref }`).
|
|
12
11
|
*/
|
|
13
|
-
import { nothing, type PropertyDeclarations, type TemplateResult } from 'lit';
|
|
12
|
+
import { nothing, type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
|
|
14
13
|
import { type FrameSettings } from '../../../core/element.js';
|
|
15
14
|
import { LintjeContentTileElement } from '../../shared/content-tile.js';
|
|
16
15
|
import '../../feedback/announcement/announcement.js';
|
|
17
|
-
import '../../tables/data-table/data-table.js';
|
|
18
|
-
import '../../inputs/segmented/segmented.js';
|
|
19
16
|
import '../../layout/tile/tile.js';
|
|
20
17
|
import type { ChartData } from '../../../types.js';
|
|
21
|
-
type ChartView = 'chart' | 'table';
|
|
22
18
|
export declare class LintjeChart extends LintjeContentTileElement {
|
|
23
19
|
#private;
|
|
24
20
|
static styles: import("lit").CSSResult[];
|
|
25
21
|
static properties: PropertyDeclarations;
|
|
26
22
|
data?: ChartData | null;
|
|
27
|
-
view: ChartView;
|
|
28
23
|
protected get dataSettings(): FrameSettings | undefined;
|
|
24
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
29
25
|
disconnectedCallback(): void;
|
|
30
26
|
private get ready();
|
|
31
|
-
private get showsTable();
|
|
32
27
|
private get expandable();
|
|
33
28
|
private get downloadName();
|
|
34
29
|
private csv;
|
|
@@ -37,9 +32,6 @@ export declare class LintjeChart extends LintjeContentTileElement {
|
|
|
37
32
|
protected render(): TemplateResult | typeof nothing;
|
|
38
33
|
/** The drawing, or the skeleton in its shape for the tile's `loading` slot; empty and error are the tile's. */
|
|
39
34
|
private content;
|
|
40
|
-
/** Header actions from 768 px; below that a row of its own in the `notice` slot. */
|
|
41
|
-
private viewSwitch;
|
|
42
|
-
private table;
|
|
43
35
|
/**
|
|
44
36
|
* The host may take the choice over by cancelling the event; else the page goes to its `href`.
|
|
45
37
|
* A modifier or middle click opens the `href` in a new tab, without the event.
|
|
@@ -55,4 +47,3 @@ declare global {
|
|
|
55
47
|
'lintje-chart': LintjeChart;
|
|
56
48
|
}
|
|
57
49
|
}
|
|
58
|
-
export {};
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
* It sends no events of its own: those of its question box, messages and answers reach the host,
|
|
9
9
|
* with the `turnId` where a turn sent them. The host answers `lintje-message-send` with a new turn,
|
|
10
10
|
* `lintje-message-edit` by asking again without that turn and all after it, and
|
|
11
|
-
* `lintje-strip-change` by answering again with the new assumption.
|
|
11
|
+
* `lintje-strip-change` by answering again with the new assumption. A turn's `divider` stands as a
|
|
12
|
+
* centred line above its question. The `questions` of the last answer stand in a box above the
|
|
13
|
+
* question box until the next turn; on a phone the question box folds to one line meanwhile.
|
|
12
14
|
*/
|
|
13
15
|
import { nothing, type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
|
|
14
16
|
import { LintjeElement, type FrameSettings } from '../../../core/element.js';
|
|
@@ -16,11 +18,12 @@ import '../../actions/button/button.js';
|
|
|
16
18
|
import '../chat-answer/chat-answer.js';
|
|
17
19
|
import '../chat-composer/chat-composer.js';
|
|
18
20
|
import '../chat-message/chat-message.js';
|
|
21
|
+
import '../chat-questions/chat-questions.js';
|
|
19
22
|
import '../chat-suggestions/chat-suggestions.js';
|
|
20
23
|
import type { ChatData } from '../../../types.js';
|
|
21
24
|
export declare class LintjeChat extends LintjeElement {
|
|
22
25
|
#private;
|
|
23
|
-
static styles: import("lit").CSSResult;
|
|
26
|
+
static styles: import("lit").CSSResult[];
|
|
24
27
|
static properties: PropertyDeclarations;
|
|
25
28
|
data?: ChatData | null;
|
|
26
29
|
/** The turn whose message is in its input frame, if any. */
|
|
@@ -28,6 +31,8 @@ export declare class LintjeChat extends LintjeElement {
|
|
|
28
31
|
away: boolean;
|
|
29
32
|
/** The page scrolls the conversation, so a question sticks under the shell's pinned bar. */
|
|
30
33
|
paged: boolean;
|
|
34
|
+
/** On a phone, the reader opened the folded question box while the assistant asks. */
|
|
35
|
+
composerOpen: boolean;
|
|
31
36
|
/** Pixels from the end that count as away. */
|
|
32
37
|
static readonly AWAY = 120;
|
|
33
38
|
connectedCallback(): void;
|
|
@@ -43,7 +48,11 @@ export declare class LintjeChat extends LintjeElement {
|
|
|
43
48
|
private toEnd;
|
|
44
49
|
private get composer();
|
|
45
50
|
private toLatest;
|
|
51
|
+
/** The questions of the last answer while it waits on the reader; none while a turn is edited. */
|
|
52
|
+
private get asking();
|
|
46
53
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
54
|
+
private focusQuestions;
|
|
55
|
+
private openComposer;
|
|
47
56
|
/**
|
|
48
57
|
* A turn can take the focused control away: an edit that ends, or the edit button an answer
|
|
49
58
|
* that starts takes away. Once the turns have drawn, a focus that fell out goes to the field.
|
|
@@ -16,12 +16,14 @@ import '../../actions/icon-button/icon-button.js';
|
|
|
16
16
|
import '../../feedback/spinner/spinner.js';
|
|
17
17
|
import '../../feedback/announcement/announcement.js';
|
|
18
18
|
import '../../charts/chart/chart.js';
|
|
19
|
+
import '../chat-steps/chat-steps.js';
|
|
19
20
|
import '../chat-strip/chat-strip.js';
|
|
20
21
|
import '../chat-suggestions/chat-suggestions.js';
|
|
21
22
|
import '../../tables/data-table/data-table.js';
|
|
22
23
|
import '../../charts/kpi-row/kpi-row.js';
|
|
23
24
|
import '../../content/prose/prose.js';
|
|
24
|
-
import
|
|
25
|
+
import '../../content/attachment/attachment.js';
|
|
26
|
+
import type { ChatAnswerState, ChatBlock, ChatStepsData, ChatStripData, ChatSuggestion } from '../../../types.js';
|
|
25
27
|
export type ChatRating = 'up' | 'down';
|
|
26
28
|
export declare class LintjeChatAnswer extends LintjeElement {
|
|
27
29
|
#private;
|
|
@@ -33,15 +35,15 @@ export declare class LintjeChatAnswer extends LintjeElement {
|
|
|
33
35
|
text?: string;
|
|
34
36
|
blocks?: ChatBlock[];
|
|
35
37
|
strip?: ChatStripData;
|
|
36
|
-
/** `streaming`: the step that is running. */
|
|
38
|
+
/** `streaming`: the step that is running; not drawn when `steps` has one. */
|
|
37
39
|
status?: string;
|
|
40
|
+
/** What the assistant did, above the text in every state; its running step is the status. */
|
|
41
|
+
steps?: ChatStepsData;
|
|
38
42
|
/** `error`: what went wrong, and the way out in words. */
|
|
39
43
|
error?: {
|
|
40
44
|
title?: string;
|
|
41
45
|
text: string;
|
|
42
46
|
};
|
|
43
|
-
/** The choices of `out-of-scope` and `needs-clarification`. */
|
|
44
|
-
choices?: ChatSuggestion[];
|
|
45
47
|
/** Suggested next questions; drawn on the current answer only. */
|
|
46
48
|
followUps?: ChatSuggestion[];
|
|
47
49
|
/** The latest answer: only it can be retried, changed through its strip or followed up. */
|
|
@@ -4,18 +4,25 @@
|
|
|
4
4
|
* The field is plain text; the element never writes markup into it. Terms are marked through the
|
|
5
5
|
* CSS Custom Highlight API, so typing and undo stay the browser's; without it the field is
|
|
6
6
|
* unmarked. The source selection is the host's; the draft, the send key (kept in `localStorage`)
|
|
7
|
-
* and the answer form are the element's own.
|
|
7
|
+
* and the answer form are the element's own. With `files` it takes attachments — the paperclip,
|
|
8
|
+
* dragging and pasting — and the host keeps them, as with `lintje-file-upload`; a file it refuses
|
|
9
|
+
* itself stays its own and never reaches the host. A question may be only its attachments.
|
|
10
|
+
* `lintje-chat` folds it to one line (`collapsed`) while the assistant asks, on a phone.
|
|
8
11
|
*
|
|
9
|
-
* Events: `lintje-message-send` `{ text, terms, sources, form }
|
|
10
|
-
* `lintje-
|
|
11
|
-
*
|
|
12
|
+
* Events: `lintje-message-send` `{ text, terms, sources, form, attachments }` (`attachments`: the
|
|
13
|
+
* ids of the done files), `lintje-answer-stop`, `lintje-sources-change` `{ ids }`,
|
|
14
|
+
* `lintje-draft-change` `{ text }` (200 ms after the last key), `lintje-files-add` `File[]`; from
|
|
15
|
+
* its chips `lintje-file-remove` `{ id }`, `lintje-file-cancel` `{ id }` and `lintje-file-retry`
|
|
16
|
+
* `{ id }`; with `variant="edit"` instead `lintje-submit` `{ text, terms }` and `lintje-cancel`.
|
|
12
17
|
*/
|
|
13
18
|
import { type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
|
|
14
19
|
import { LintjeElement } from '../../../core/element.js';
|
|
15
20
|
import '../../actions/button/button.js';
|
|
16
21
|
import '../../actions/icon-button/icon-button.js';
|
|
22
|
+
import '../../content/attachment/attachment.js';
|
|
17
23
|
import '../../inputs/multiselect/multiselect.js';
|
|
18
24
|
import '../../inputs/radio-group/radio-group.js';
|
|
25
|
+
import { type UploadFile } from '../../shared/files.js';
|
|
19
26
|
import type { ChatAnswerForm, ChatDraftTerms, ChatSourceData, ChatTermData } from '../../../types.js';
|
|
20
27
|
export type ChatComposerVariant = 'ask' | 'edit';
|
|
21
28
|
export type ChatSendKey = 'enter' | 'ctrl-enter';
|
|
@@ -27,6 +34,7 @@ export declare class LintjeChatComposer extends LintjeElement {
|
|
|
27
34
|
variant: ChatComposerVariant;
|
|
28
35
|
/** The text to start from. Setting it again replaces what stands in the field. */
|
|
29
36
|
text: string;
|
|
37
|
+
/** Left out or emptied, "Stel een vraag over de gegevens". */
|
|
30
38
|
placeholder: string;
|
|
31
39
|
/** An answer is arriving: "Stoppen" stands in for the send button. */
|
|
32
40
|
busy: boolean;
|
|
@@ -45,12 +53,44 @@ export declare class LintjeChatComposer extends LintjeElement {
|
|
|
45
53
|
/** Only "Versturen": no choice of the answer's form, no send key. For a question that is not a
|
|
46
54
|
* conversation with data, such as the one on a start page that searches a catalogue. */
|
|
47
55
|
plain: boolean;
|
|
56
|
+
/** The file chooser's filter and the box's own check: ".pdf,.xlsx" or "image/*". */
|
|
57
|
+
accept: string;
|
|
58
|
+
/** The largest file, in bytes. */
|
|
59
|
+
maxSize?: number;
|
|
60
|
+
/** The host's files for the question being typed. Without it, no paperclip: the box takes no files. */
|
|
61
|
+
files?: UploadFile[];
|
|
62
|
+
/** A line in the bar beside the send button; "Kies eerst een bron" and "Wacht op de upload" win. */
|
|
63
|
+
hint?: string;
|
|
64
|
+
/**
|
|
65
|
+
* One line that opens the box, with how many attachments wait in it; no source picker. A tap
|
|
66
|
+
* asks `lintje-chat` to open it. Only a phone's while the assistant asks.
|
|
67
|
+
*/
|
|
68
|
+
collapsed: boolean;
|
|
69
|
+
/** Open, it offers "Inklappen", which asks `lintje-chat` to fold it again. */
|
|
70
|
+
collapsible: boolean;
|
|
71
|
+
/** The files the box refused itself: they stay until the reader removes them. */
|
|
72
|
+
refused: UploadFile[];
|
|
73
|
+
dragging: boolean;
|
|
74
|
+
/** How many are dragged: 0 when the browser does not say. */
|
|
75
|
+
dragCount: number;
|
|
76
|
+
/** What changed in the attachments, for the status region. */
|
|
77
|
+
news: string;
|
|
48
78
|
draft: string;
|
|
49
79
|
/** The caret as an offset into the draft. */
|
|
50
80
|
caret: number;
|
|
51
81
|
completionIndex: number;
|
|
52
82
|
/** The reader dismissed the list, or took from it; typing brings it back. */
|
|
53
83
|
completionOff: boolean;
|
|
84
|
+
private readonly onDragEnter;
|
|
85
|
+
private readonly onDragLeave;
|
|
86
|
+
private readonly onDragEnd;
|
|
87
|
+
connectedCallback(): void;
|
|
88
|
+
/** Attachments belong to a new question; an edited one keeps those of its message. */
|
|
89
|
+
private get takesFiles();
|
|
90
|
+
private get readyIds();
|
|
91
|
+
private get uploading();
|
|
92
|
+
/** Text or a done attachment, nothing still uploading, and a source on. */
|
|
93
|
+
private get canSend();
|
|
54
94
|
private get input();
|
|
55
95
|
private get selectedIds();
|
|
56
96
|
private get noSource();
|
|
@@ -61,6 +101,16 @@ export declare class LintjeChatComposer extends LintjeElement {
|
|
|
61
101
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
62
102
|
protected updated(): void;
|
|
63
103
|
focus(): void;
|
|
104
|
+
private get chips();
|
|
105
|
+
private focusPaperclip;
|
|
106
|
+
/** Sends the files that pass with `lintje-files-add` and keeps a chip for those it refuses. */
|
|
107
|
+
add(chosen: File[]): void;
|
|
108
|
+
private pick;
|
|
109
|
+
private onPicked;
|
|
110
|
+
private onDragOver;
|
|
111
|
+
private onDrop;
|
|
112
|
+
/** A chip of the box's own refusal is the box's alone: its event stops here and the chip goes. */
|
|
113
|
+
private onChipEvent;
|
|
64
114
|
/** Opens the source picker; the start screen's "Wijzigen" asks for it. */
|
|
65
115
|
openSources(): void;
|
|
66
116
|
private selection;
|
|
@@ -78,6 +128,13 @@ export declare class LintjeChatComposer extends LintjeElement {
|
|
|
78
128
|
private setSendKey;
|
|
79
129
|
private toggleOptions;
|
|
80
130
|
protected render(): TemplateResult;
|
|
131
|
+
private get placeholderText();
|
|
132
|
+
/** "Stel een nieuwe vraag · 2 bijlagen": every chip counts, also one busy or refused. */
|
|
133
|
+
private get attachmentCount();
|
|
134
|
+
private renderCollapsed;
|
|
135
|
+
private renderAttachments;
|
|
136
|
+
/** While files hang over the window, the frame is the drop zone of the upload field. */
|
|
137
|
+
private renderDrop;
|
|
81
138
|
private renderAsk;
|
|
82
139
|
private renderSendOptions;
|
|
83
140
|
private renderEdit;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `<lintje-chat-message>` — what the reader asked: a filled bar on the right
|
|
2
|
+
* `<lintje-chat-message>` — what the reader asked: a filled bar on the right, with the files sent
|
|
3
|
+
* along above it. A message of only files is its chips, without a bar.
|
|
3
4
|
*
|
|
4
5
|
* Editing is the message's own state, in a `lintje-chat-composer`. It never changes its own text:
|
|
5
6
|
* asking again is an event, and the host replaces the turn.
|
|
@@ -11,13 +12,16 @@
|
|
|
11
12
|
import { type PropertyDeclarations, type TemplateResult } from 'lit';
|
|
12
13
|
import { LintjeElement } from '../../../core/element.js';
|
|
13
14
|
import '../../actions/icon-button/icon-button.js';
|
|
15
|
+
import '../../content/attachment/attachment.js';
|
|
14
16
|
import '../chat-composer/chat-composer.js';
|
|
15
|
-
import type { ChatSourceData, ChatTermData, ChatTermRange } from '../../../types.js';
|
|
17
|
+
import type { ChatSourceData, ChatTermData, ChatTermRange, UploadFile } from '../../../types.js';
|
|
16
18
|
export declare class LintjeChatMessage extends LintjeElement {
|
|
17
19
|
static styles: import("lit").CSSResult;
|
|
18
20
|
static properties: PropertyDeclarations;
|
|
19
21
|
text: string;
|
|
20
22
|
terms?: ChatTermRange[];
|
|
23
|
+
/** What was sent along with the question. */
|
|
24
|
+
attachments?: UploadFile[];
|
|
21
25
|
/** When it was sent, as the host formats it ("08:20"). */
|
|
22
26
|
time?: string;
|
|
23
27
|
editable: boolean;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<lintje-chat-questions>` — what the assistant asks before it answers, in a box above the
|
|
3
|
+
* question box. One `one` question without descriptions is the short form: a tap sends. Anything
|
|
4
|
+
* else is steps: one question at a time, with Vorige, Volgende and Versturen.
|
|
5
|
+
*
|
|
6
|
+
* Every choice question ends in "Iets anders…". What the reader picked is the element's own until
|
|
7
|
+
* it sends, and starts over only when the questions change (other ids). It checks its own questions
|
|
8
|
+
* at Volgende and Versturen. `focus()` puts the focus on the first choice; `lintje-chat` calls it
|
|
9
|
+
* when the box appears while the focus is in the conversation. The host sets `state: 'sending'`
|
|
10
|
+
* while it waits, then adds a turn with `text` as the reader's message, which ends the questions.
|
|
11
|
+
*
|
|
12
|
+
* Events: `lintje-questions-answer` `{ turnId, answers, text }` (`answers`: per question
|
|
13
|
+
* `{ id, values, other, skipped }`; `text`: the reader's message, a line per question).
|
|
14
|
+
*/
|
|
15
|
+
import { nothing, type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
|
|
16
|
+
import { LintjeElement } from '../../../core/element.js';
|
|
17
|
+
import '../../actions/button/button.js';
|
|
18
|
+
import '../../feedback/progress-bar/progress-bar.js';
|
|
19
|
+
import '../../inputs/checkbox-group/checkbox-group.js';
|
|
20
|
+
import '../../inputs/radio-group/radio-group.js';
|
|
21
|
+
import '../../inputs/text-input/text-input.js';
|
|
22
|
+
import '../../inputs/textarea/textarea.js';
|
|
23
|
+
import type { ChatQuestion, ChatQuestionsData } from '../../../types.js';
|
|
24
|
+
/** The reader's answer to one question, as `lintje-questions-answer` carries it. */
|
|
25
|
+
export interface ChatQuestionAnswer {
|
|
26
|
+
id: string;
|
|
27
|
+
/** Only the host's options; at most one for `one`; the text as the one value for `text`. */
|
|
28
|
+
values: string[];
|
|
29
|
+
/** The text of "Iets anders…" while it is chosen; `null` otherwise. */
|
|
30
|
+
other: string | null;
|
|
31
|
+
/** An optional question that went by without an answer. */
|
|
32
|
+
skipped: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** What the reader has picked or typed for one question so far. */
|
|
35
|
+
interface Draft {
|
|
36
|
+
/** The chosen values, `other` among them while "Iets anders…" is chosen. */
|
|
37
|
+
values: string[];
|
|
38
|
+
other: string;
|
|
39
|
+
text: string;
|
|
40
|
+
}
|
|
41
|
+
interface Problem {
|
|
42
|
+
error?: string;
|
|
43
|
+
otherError?: string;
|
|
44
|
+
}
|
|
45
|
+
/** The short form: one `one` question whose options need no line of their own. */
|
|
46
|
+
export declare function isShortForm(questions: ChatQuestion[]): boolean;
|
|
47
|
+
export declare class LintjeChatQuestions extends LintjeElement {
|
|
48
|
+
#private;
|
|
49
|
+
static styles: import("lit").CSSResult[];
|
|
50
|
+
static properties: PropertyDeclarations;
|
|
51
|
+
data?: ChatQuestionsData | null;
|
|
52
|
+
/** The turn whose answer asks; it comes back in the event. */
|
|
53
|
+
turnId?: string;
|
|
54
|
+
step: number;
|
|
55
|
+
drafts: Record<string, Draft>;
|
|
56
|
+
problems: Record<string, Problem>;
|
|
57
|
+
/** The optional questions the reader passed with Overslaan. */
|
|
58
|
+
skipped: string[];
|
|
59
|
+
/** The short form's "Iets anders…" is open. */
|
|
60
|
+
otherOpen: boolean;
|
|
61
|
+
/** What the status region says. */
|
|
62
|
+
said: string;
|
|
63
|
+
private get questions();
|
|
64
|
+
private get sending();
|
|
65
|
+
private get short();
|
|
66
|
+
private get current();
|
|
67
|
+
private draft;
|
|
68
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
69
|
+
private measure;
|
|
70
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
71
|
+
disconnectedCallback(): void;
|
|
72
|
+
/** The status region is drawn empty: its words come a frame later, so they are read. */
|
|
73
|
+
private say;
|
|
74
|
+
private get position();
|
|
75
|
+
/** The focus on the current question's first choice, or the chosen one. */
|
|
76
|
+
focus(): void;
|
|
77
|
+
private focusQuestion;
|
|
78
|
+
private focusOther;
|
|
79
|
+
private change;
|
|
80
|
+
/** What is wrong with a question's answer, if anything. */
|
|
81
|
+
private check;
|
|
82
|
+
/** Volgende and Versturen: on to the next question, or send from the last. */
|
|
83
|
+
private next;
|
|
84
|
+
private skip;
|
|
85
|
+
private back;
|
|
86
|
+
private advance;
|
|
87
|
+
/** The answer to one question, as the event carries it. */
|
|
88
|
+
private answerTo;
|
|
89
|
+
/** How an answer reads in the reader's message: the labels, then the own text. */
|
|
90
|
+
private words;
|
|
91
|
+
private send;
|
|
92
|
+
/** The short form: a tap on a choice sends it. */
|
|
93
|
+
private pick;
|
|
94
|
+
private toggleOther;
|
|
95
|
+
private onKeydown;
|
|
96
|
+
protected render(): TemplateResult | typeof nothing;
|
|
97
|
+
private renderShort;
|
|
98
|
+
private renderStep;
|
|
99
|
+
private renderControl;
|
|
100
|
+
}
|
|
101
|
+
declare global {
|
|
102
|
+
interface HTMLElementTagNameMap {
|
|
103
|
+
'lintje-chat-questions': LintjeChatQuestions;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<lintje-chat-steps>` — what the assistant did for one answer: a series of steps on a rail that
|
|
3
|
+
* folds into one line.
|
|
4
|
+
*
|
|
5
|
+
* The closed line shows what counts now: the running step, else a failed one, else a stopped one,
|
|
6
|
+
* else how many. It never opens or closes by itself; whether it is open is its own state. The
|
|
7
|
+
* labels, states and duration are the host's: it counts nothing and keeps no timer. Steps are
|
|
8
|
+
* only added at the end, and compared by position. Only the first step starting and a failure
|
|
9
|
+
* are spoken, and only once the element has drawn: steps it arrives with stay silent, except a
|
|
10
|
+
* lone first step that has just begun.
|
|
11
|
+
*
|
|
12
|
+
* Events: `lintje-navigate` `{ href }` from a link in a detail (cancel it to route yourself).
|
|
13
|
+
*/
|
|
14
|
+
import { type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
|
|
15
|
+
import { LintjeElement } from '../../../core/element.js';
|
|
16
|
+
import '../../feedback/spinner/spinner.js';
|
|
17
|
+
import type { ChatStep } from '../../../types.js';
|
|
18
|
+
type Mark = 'ring' | 'cross' | 'open' | 'square';
|
|
19
|
+
export declare const stepCount: (count: number) => string;
|
|
20
|
+
/** What the closed line shows: a mark, a label and the muted rest after it. */
|
|
21
|
+
export interface StepsSummary {
|
|
22
|
+
mark: Mark;
|
|
23
|
+
/** The step that counts now; without one only `rest` stands. */
|
|
24
|
+
label?: string;
|
|
25
|
+
failed?: boolean;
|
|
26
|
+
rest: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function summarise(items: ChatStep[], duration?: string): StepsSummary;
|
|
29
|
+
export declare class LintjeChatSteps extends LintjeElement {
|
|
30
|
+
#private;
|
|
31
|
+
static styles: import("lit").CSSResult[];
|
|
32
|
+
static properties: PropertyDeclarations;
|
|
33
|
+
items: ChatStep[];
|
|
34
|
+
/** How long it took, as the host formats it ("12 s"); not drawn while a step runs. */
|
|
35
|
+
duration?: string;
|
|
36
|
+
open: boolean;
|
|
37
|
+
/** What the status region has said, one sentence per paragraph. */
|
|
38
|
+
spoken: string[];
|
|
39
|
+
disconnectedCallback(): void;
|
|
40
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
41
|
+
private get expandable();
|
|
42
|
+
private renderMark;
|
|
43
|
+
private renderDetail;
|
|
44
|
+
private renderStep;
|
|
45
|
+
private renderLine;
|
|
46
|
+
protected render(): TemplateResult;
|
|
47
|
+
}
|
|
48
|
+
declare global {
|
|
49
|
+
interface HTMLElementTagNameMap {
|
|
50
|
+
'lintje-chat-steps': LintjeChatSteps;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `<lintje-chat-suggestions>` — sentences the reader can send with one press, on the reader's side
|
|
2
|
+
* `<lintje-chat-suggestions>` — sentences the reader can send with one press, on the reader's side,
|
|
3
|
+
* dashed: what the reader could ask. A question the assistant waits on is `lintje-chat-questions`.
|
|
3
4
|
*
|
|
4
|
-
* Events: `lintje-suggestion-select` `{ turnId,
|
|
5
|
-
*
|
|
5
|
+
* Events: `lintje-suggestion-select` `{ turnId, label, value }` (`value` is the item's own, or its
|
|
6
|
+
* label).
|
|
6
7
|
*/
|
|
7
8
|
import { nothing, type PropertyDeclarations, type TemplateResult } from 'lit';
|
|
8
9
|
import { LintjeElement } from '../../../core/element.js';
|
|
9
10
|
import type { ChatSuggestion } from '../../../types.js';
|
|
10
|
-
export type ChatSuggestionKind = 'suggestion' | 'choice';
|
|
11
11
|
export type ChatSuggestionsAlign = 'end' | 'start';
|
|
12
12
|
export declare class LintjeChatSuggestions extends LintjeElement {
|
|
13
13
|
static styles: import("lit").CSSResult[];
|
|
14
14
|
static properties: PropertyDeclarations;
|
|
15
15
|
/** The caps line above the sentences: "Jij, als vervolgvraag". */
|
|
16
16
|
label?: string;
|
|
17
|
-
/** The gray line under a set of choices. */
|
|
18
|
-
hint?: string;
|
|
19
|
-
/**
|
|
20
|
-
* A rule, not decoration: `suggestion` (dashed) is something the reader could ask, `choice`
|
|
21
|
-
* (solid) an answer the assistant is waiting for.
|
|
22
|
-
*/
|
|
23
|
-
kind: ChatSuggestionKind;
|
|
24
17
|
/** `start`: left and side by side, outside a conversation, as examples under a question box. */
|
|
25
18
|
align: ChatSuggestionsAlign;
|
|
26
19
|
items?: ChatSuggestion[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<lintje-attachment>` — one file as a quiet chip of one line: the icon of its kind or a
|
|
3
|
+
* thumbnail, the name and the size, busy or with an error.
|
|
4
|
+
*
|
|
5
|
+
* It opens nothing itself: a chip with `href` is a link, one without asks the host with
|
|
6
|
+
* `lintje-file-open`. A `removable` chip has the cross and opens nothing. Whoever draws a list
|
|
7
|
+
* puts each chip in its own `<li>`.
|
|
8
|
+
*
|
|
9
|
+
* Events: `lintje-file-remove` `{ id }` (the cross on a done or failed file),
|
|
10
|
+
* `lintje-file-cancel` `{ id }` (the cross on a busy one), `lintje-file-retry` `{ id }`,
|
|
11
|
+
* `lintje-file-open` `{ id }` (a chip without `href`), `lintje-navigate` `{ href }` (a chip with
|
|
12
|
+
* `href` and without `download`; cancel it to route yourself).
|
|
13
|
+
*/
|
|
14
|
+
import { nothing, type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
|
|
15
|
+
import { LintjeElement } from '../../../core/element.js';
|
|
16
|
+
import { type UploadFile } from '../../shared/files.js';
|
|
17
|
+
/** What follows the last dot, unless that dot starts the name: ".env" has none. */
|
|
18
|
+
export declare function extensionOf(name: string): string;
|
|
19
|
+
export declare function fileIcon(file: Pick<UploadFile, 'name' | 'type'>): string;
|
|
20
|
+
/** The name in two: a stem that takes the ellipsis and keeps three letters, and a tail that stays. */
|
|
21
|
+
export declare function splitName(name: string): {
|
|
22
|
+
stem: string;
|
|
23
|
+
tail: string;
|
|
24
|
+
};
|
|
25
|
+
export declare class LintjeAttachment extends LintjeElement {
|
|
26
|
+
#private;
|
|
27
|
+
static styles: import("lit").CSSResult[];
|
|
28
|
+
static properties: PropertyDeclarations;
|
|
29
|
+
data?: UploadFile;
|
|
30
|
+
/** The cross, in a question box or an upload field: the chip then opens nothing. */
|
|
31
|
+
removable: boolean;
|
|
32
|
+
/** Its error is the drawing element's own refusal ("geweigerd"), not the host's ("mislukt"). */
|
|
33
|
+
refused: boolean;
|
|
34
|
+
/** No cross, no "Opnieuw", and it opens nothing. */
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
/** The chip's first control: the cross, "Opnieuw", or the chip itself when it opens. */
|
|
37
|
+
focus(options?: FocusOptions): void;
|
|
38
|
+
private get opens();
|
|
39
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
40
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
41
|
+
private send;
|
|
42
|
+
private onLink;
|
|
43
|
+
/** What stands beside the name: the percentage, the reason, `detail` or the size. */
|
|
44
|
+
private get detail();
|
|
45
|
+
/** The chip in words: the name, its state where it is not done, and what stands beside it. */
|
|
46
|
+
private get spoken();
|
|
47
|
+
private renderMark;
|
|
48
|
+
private renderContent;
|
|
49
|
+
private renderMain;
|
|
50
|
+
private renderActions;
|
|
51
|
+
private renderProgress;
|
|
52
|
+
protected render(): TemplateResult | typeof nothing;
|
|
53
|
+
}
|
|
54
|
+
declare global {
|
|
55
|
+
interface HTMLElementTagNameMap {
|
|
56
|
+
'lintje-attachment': LintjeAttachment;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* It never autoplays.
|
|
6
6
|
*
|
|
7
7
|
* Events: `lintje-time-change` `number` (seconds, at most four times a second), `lintje-seek`
|
|
8
|
-
* `number` (seconds: the reader moved the position), `lintje-play`, `lintje-pause
|
|
8
|
+
* `number` (seconds: the reader moved the position), `lintje-play`, `lintje-pause`, `lintje-retry`
|
|
9
|
+
* ("Opnieuw proberen" was pressed).
|
|
9
10
|
*/
|
|
10
11
|
import { type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
|
|
11
12
|
import '../../actions/button/button.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<lintje-key>` — one keyboard key on the page, drawn as Lintje draws a key inside its own
|
|
3
|
+
* elements: `<lintje-key>Ctrl</lintje-key>`.
|
|
4
|
+
*
|
|
5
|
+
* A combination is two keys side by side, with a space between them. It reads as the key's text,
|
|
6
|
+
* is no button and takes no focus.
|
|
7
|
+
*/
|
|
8
|
+
import { type PropertyDeclarations, type TemplateResult } from 'lit';
|
|
9
|
+
import { LintjeElement } from '../../../core/element.js';
|
|
10
|
+
export declare class LintjeKey extends LintjeElement {
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
static properties: PropertyDeclarations;
|
|
13
|
+
/** The key's text, for a host that sets it rather than writing it inside; the content wins. */
|
|
14
|
+
key?: string;
|
|
15
|
+
protected render(): TemplateResult;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
'lintje-key': LintjeKey;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `<lintje-prose>` — a block of text on the type scale: `html`, else `text`, else the slot.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* stands.
|
|
4
|
+
* `html` is for formatted content: the host renders the markdown and sanitises it, and it is
|
|
5
|
+
* written into the shadow root as it stands. `text` is one paragraph. The slot is for plain text
|
|
6
|
+
* only, in the block's font and colour: a heading, list or paragraph in it gets no styling.
|
|
6
7
|
*/
|
|
7
8
|
import { type PropertyDeclarations, type TemplateResult } from 'lit';
|
|
8
9
|
import { LintjeGridItemElement } from '../../shared/grid-item-element.js';
|
|
@@ -10,7 +11,7 @@ export type ProseTone = 'default' | 'muted';
|
|
|
10
11
|
export declare class LintjeProse extends LintjeGridItemElement {
|
|
11
12
|
static styles: import("lit").CSSResult;
|
|
12
13
|
static properties: PropertyDeclarations;
|
|
13
|
-
/**
|
|
14
|
+
/** Formatted content: server-rendered, server-sanitised HTML. A property only. */
|
|
14
15
|
html?: string;
|
|
15
16
|
/** One paragraph. Ignored when `html` is set. */
|
|
16
17
|
text?: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Events: `lintje-time-change` (seconds; at most four a second while playing, at once after a
|
|
5
5
|
* seek or pause), `lintje-seek` (seconds: the reader moved the position, with the bar, a key or a
|
|
6
|
-
* skip), `lintje-play`, `lintje-pause
|
|
6
|
+
* skip), `lintje-play`, `lintje-pause`, `lintje-retry` ("Opnieuw proberen" was pressed).
|
|
7
7
|
*
|
|
8
8
|
* Setting `currentTime` seeks without an event of its own, so a host that answers
|
|
9
9
|
* `lintje-time-change` by setting it cannot loop. A seek before the duration is known is kept.
|
|
@@ -46,6 +46,7 @@ export declare abstract class LintjePlayerElement extends LintjeElement {
|
|
|
46
46
|
play(): void;
|
|
47
47
|
protected skip(seconds: number): void;
|
|
48
48
|
protected setSpeed(speed: number): void;
|
|
49
|
+
/** Loads again and tells the host, which may answer with a new `src` for a lasting failure. */
|
|
49
50
|
protected retry(): void;
|
|
50
51
|
private readonly onMetadata;
|
|
51
52
|
private readonly onTimeUpdate;
|