lintje 0.7.0 → 0.8.1

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.
Files changed (263) hide show
  1. package/NOTICE.md +2 -0
  2. package/README.md +2 -2
  3. package/dist-elements/actions.js +1 -1
  4. package/dist-elements/chat.js +1 -1
  5. package/dist-elements/chunks/{addon-CFoSG70u.js → addon-BZQerXJg.js} +2 -2
  6. package/dist-elements/chunks/avatar-BV0HVtpt.js +1 -0
  7. package/dist-elements/chunks/axes-Dhhfq0h7.js +129 -0
  8. package/dist-elements/chunks/base-CEzuIIQb.js +226 -0
  9. package/dist-elements/chunks/chart-styles-BXfNph7G.js +45 -0
  10. package/dist-elements/chunks/{date-format-5bii3QLP.js → date-format-DvDaZtFc.js} +1 -1
  11. package/dist-elements/chunks/{dialog-close-CzMRXkJ6.js → dialog-close-DlqfynTX.js} +1 -1
  12. package/dist-elements/chunks/disclosure-Ch2SwnkG.js +1 -0
  13. package/dist-elements/chunks/disclosure-Drp0ihys.js +20 -0
  14. package/dist-elements/chunks/download--CwgcFVi.js +18 -0
  15. package/dist-elements/chunks/{focus-trap-BDxiHED1.js → focus-trap-Cx3dzqGn.js} +1 -1
  16. package/dist-elements/chunks/frame-BMR48Vea.js +1 -0
  17. package/dist-elements/chunks/input-CCT6CcW1.js +1 -0
  18. package/dist-elements/chunks/{input-C7qx0e4p.js → input-D3fVdkF6.js} +4 -4
  19. package/dist-elements/chunks/month-grid-B3pzhVAU.js +26 -0
  20. package/dist-elements/chunks/{other-BaLStKaf.js → other-D3EFrOs_.js} +3 -3
  21. package/dist-elements/chunks/player-D66x63QC.js +39 -0
  22. package/dist-elements/chunks/{prose-DOF7h3je.js → prose-aNcSsHId.js} +1 -1
  23. package/dist-elements/chunks/search-text-i-Em9oIy.js +1 -0
  24. package/dist-elements/chunks/sentence-BHQlq1yn.js +3 -0
  25. package/dist-elements/chunks/stagger-Dtq8AS1Y.js +27 -0
  26. package/dist-elements/chunks/wheel-Co2Dpj0Q.js +1 -0
  27. package/dist-elements/content.js +1 -1
  28. package/dist-elements/core.js +1 -1
  29. package/dist-elements/custom-elements.json +1298 -204
  30. package/dist-elements/data-types.json +2836 -622
  31. package/dist-elements/feedback.js +1 -1
  32. package/dist-elements/graph.d.ts +1 -0
  33. package/dist-elements/graph.js +1 -0
  34. package/dist-elements/guides/events.md +7 -3
  35. package/dist-elements/guides/loading.md +12 -9
  36. package/dist-elements/layout.js +1 -1
  37. package/dist-elements/lintje.js +3003 -2247
  38. package/dist-elements/overlays.js +1 -1
  39. package/dist-elements/skills/lintje/SKILL.md +26 -5
  40. package/dist-elements/skills/lintje/check.mjs +180 -0
  41. package/dist-elements/skills/lintje/reference.mjs +24 -3
  42. package/dist-elements/tables.js +1 -1
  43. package/dist-elements/tag/accordion.d.ts +1 -0
  44. package/dist-elements/tag/accordion.js +6 -0
  45. package/dist-elements/tag/activity-log.js +13 -11
  46. package/dist-elements/tag/ai-label.js +5 -5
  47. package/dist-elements/tag/announcement.js +2 -2
  48. package/dist-elements/tag/app-search.js +19 -19
  49. package/dist-elements/tag/attachment.d.ts +1 -0
  50. package/dist-elements/tag/attachment.js +54 -0
  51. package/dist-elements/tag/audio-player.js +42 -42
  52. package/dist-elements/tag/badge.js +1 -1
  53. package/dist-elements/tag/breadcrumbs.js +8 -8
  54. package/dist-elements/tag/button.js +1 -1
  55. package/dist-elements/tag/card-list.js +9 -9
  56. package/dist-elements/tag/card.js +41 -35
  57. package/dist-elements/tag/chart.js +682 -419
  58. package/dist-elements/tag/chat-answer.js +49 -47
  59. package/dist-elements/tag/chat-composer.js +100 -40
  60. package/dist-elements/tag/chat-message.js +16 -11
  61. package/dist-elements/tag/chat-questions.d.ts +1 -0
  62. package/dist-elements/tag/chat-questions.js +133 -0
  63. package/dist-elements/tag/chat-steps.d.ts +1 -0
  64. package/dist-elements/tag/chat-steps.js +52 -0
  65. package/dist-elements/tag/chat-strip.js +27 -27
  66. package/dist-elements/tag/chat-suggestions.js +9 -10
  67. package/dist-elements/tag/chat.js +70 -42
  68. package/dist-elements/tag/checkbox-group.js +8 -8
  69. package/dist-elements/tag/checkbox.js +7 -7
  70. package/dist-elements/tag/code.js +9 -9
  71. package/dist-elements/tag/combobox.js +22 -22
  72. package/dist-elements/tag/conflict-alert.js +7 -7
  73. package/dist-elements/tag/copy-button.js +9 -9
  74. package/dist-elements/tag/data-table.js +237 -232
  75. package/dist-elements/tag/date-input.js +15 -39
  76. package/dist-elements/tag/date-range.js +21 -46
  77. package/dist-elements/tag/description-list.js +21 -19
  78. package/dist-elements/tag/dialog.js +7 -7
  79. package/dist-elements/tag/document-viewer.js +23 -23
  80. package/dist-elements/tag/drawer.js +9 -9
  81. package/dist-elements/tag/empty-state.js +1 -1
  82. package/dist-elements/tag/error-page.js +11 -11
  83. package/dist-elements/tag/error-summary.js +12 -12
  84. package/dist-elements/tag/expander.js +5 -5
  85. package/dist-elements/tag/explainer.js +5 -5
  86. package/dist-elements/tag/field.js +4 -4
  87. package/dist-elements/tag/file-upload.js +32 -42
  88. package/dist-elements/tag/filter-bar.js +20 -20
  89. package/dist-elements/tag/filter-sheet.js +3 -3
  90. package/dist-elements/tag/filter-zone.js +15 -15
  91. package/dist-elements/tag/find.js +16 -16
  92. package/dist-elements/tag/footer.js +14 -14
  93. package/dist-elements/tag/form-actions.js +2 -2
  94. package/dist-elements/tag/form-section.js +3 -3
  95. package/dist-elements/tag/form.js +3 -3
  96. package/dist-elements/tag/gallery.js +10 -10
  97. package/dist-elements/tag/graph.d.ts +1 -0
  98. package/dist-elements/tag/graph.js +102 -0
  99. package/dist-elements/tag/grid-item.js +1 -1
  100. package/dist-elements/tag/grid.js +1 -1
  101. package/dist-elements/tag/hero.js +7 -7
  102. package/dist-elements/tag/highlight.js +4 -4
  103. package/dist-elements/tag/icon-button.js +1 -1
  104. package/dist-elements/tag/icon.js +1 -1
  105. package/dist-elements/tag/job-list.js +4 -4
  106. package/dist-elements/tag/key.d.ts +1 -0
  107. package/dist-elements/tag/key.js +1 -0
  108. package/dist-elements/tag/kpi-row.js +5 -5
  109. package/dist-elements/tag/kpi.js +70 -70
  110. package/dist-elements/tag/level-meter.js +8 -8
  111. package/dist-elements/tag/list.js +43 -42
  112. package/dist-elements/tag/log-viewer.js +68 -68
  113. package/dist-elements/tag/logo.js +23 -23
  114. package/dist-elements/tag/map.js +154 -153
  115. package/dist-elements/tag/menu-button.js +34 -34
  116. package/dist-elements/tag/modal.js +10 -10
  117. package/dist-elements/tag/multiselect.js +21 -22
  118. package/dist-elements/tag/note.js +2 -2
  119. package/dist-elements/tag/notifications.js +23 -23
  120. package/dist-elements/tag/number-input.js +18 -18
  121. package/dist-elements/tag/page-header.js +13 -13
  122. package/dist-elements/tag/pagination.js +26 -26
  123. package/dist-elements/tag/person-group.d.ts +1 -0
  124. package/dist-elements/tag/person-group.js +36 -0
  125. package/dist-elements/tag/person.d.ts +1 -0
  126. package/dist-elements/tag/person.js +11 -0
  127. package/dist-elements/tag/popover.js +1 -1
  128. package/dist-elements/tag/progress-bar.js +1 -1
  129. package/dist-elements/tag/prose.js +1 -1
  130. package/dist-elements/tag/qr-code.js +5 -5
  131. package/dist-elements/tag/radio-group.js +12 -12
  132. package/dist-elements/tag/range.js +24 -24
  133. package/dist-elements/tag/recording-status.js +9 -9
  134. package/dist-elements/tag/repeater.js +5 -5
  135. package/dist-elements/tag/segmented.js +8 -8
  136. package/dist-elements/tag/select.js +8 -8
  137. package/dist-elements/tag/shell.js +199 -199
  138. package/dist-elements/tag/skeleton.js +1 -1
  139. package/dist-elements/tag/slot-picker.js +15 -15
  140. package/dist-elements/tag/sortable-list.js +20 -20
  141. package/dist-elements/tag/spinner.js +1 -1
  142. package/dist-elements/tag/split-pane.js +9 -9
  143. package/dist-elements/tag/status-dot.js +1 -1
  144. package/dist-elements/tag/stepper.js +14 -14
  145. package/dist-elements/tag/streaming-text.js +13 -13
  146. package/dist-elements/tag/sub-nav.js +20 -20
  147. package/dist-elements/tag/tabs.js +37 -38
  148. package/dist-elements/tag/tag-input.js +28 -28
  149. package/dist-elements/tag/text-editor.js +25 -24
  150. package/dist-elements/tag/text-input.js +21 -21
  151. package/dist-elements/tag/textarea.js +11 -11
  152. package/dist-elements/tag/tile.js +1 -1
  153. package/dist-elements/tag/time-input.js +13 -13
  154. package/dist-elements/tag/toast.js +8 -8
  155. package/dist-elements/tag/toggle.js +5 -5
  156. package/dist-elements/tag/toggletip.js +6 -6
  157. package/dist-elements/tag/token-value.js +2 -2
  158. package/dist-elements/tag/tooltip.js +1 -1
  159. package/dist-elements/tag/transcript.js +32 -32
  160. package/dist-elements/tag/translator.js +6 -6
  161. package/dist-elements/tag/tree-view.js +22 -22
  162. package/dist-elements/tag/user-menu.js +37 -36
  163. package/dist-elements/tag/video-player.js +17 -14
  164. package/dist-elements/tokens.css +52 -1
  165. package/dist-elements/tokens.json +701 -313
  166. package/dist-elements/types/bundle/chat.d.ts +2 -0
  167. package/dist-elements/types/bundle/content.d.ts +2 -0
  168. package/dist-elements/types/bundle/graph.d.ts +2 -0
  169. package/dist-elements/types/bundle/index.d.ts +1 -1
  170. package/dist-elements/types/bundle/layout.d.ts +1 -0
  171. package/dist-elements/types/bundle/tables.d.ts +2 -0
  172. package/dist-elements/types/components/charts/chart/chart.d.ts +3 -12
  173. package/dist-elements/types/components/chat/chat/chat.d.ts +11 -2
  174. package/dist-elements/types/components/chat/chat-answer/chat-answer.d.ts +6 -4
  175. package/dist-elements/types/components/chat/chat-composer/chat-composer.d.ts +61 -4
  176. package/dist-elements/types/components/chat/chat-message/chat-message.d.ts +6 -2
  177. package/dist-elements/types/components/chat/chat-questions/chat-questions.d.ts +106 -0
  178. package/dist-elements/types/components/chat/chat-steps/chat-steps.d.ts +53 -0
  179. package/dist-elements/types/components/chat/chat-suggestions/chat-suggestions.d.ts +4 -11
  180. package/dist-elements/types/components/content/attachment/attachment.d.ts +58 -0
  181. package/dist-elements/types/components/content/audio-player/audio-player.d.ts +2 -1
  182. package/dist-elements/types/components/content/key/key.d.ts +21 -0
  183. package/dist-elements/types/components/content/prose/prose.d.ts +4 -3
  184. package/dist-elements/types/components/content/shared/player.d.ts +2 -1
  185. package/dist-elements/types/components/content/transcript/transcript.d.ts +7 -0
  186. package/dist-elements/types/components/content/video-player/video-player.d.ts +12 -3
  187. package/dist-elements/types/components/feedback/empty-state/empty-state.d.ts +2 -2
  188. package/dist-elements/types/components/feedback/status-dot/status-dot.d.ts +13 -2
  189. package/dist-elements/types/components/forms/form-actions/form-actions.d.ts +5 -2
  190. package/dist-elements/types/components/frame/app-search/app-search.d.ts +0 -2
  191. package/dist-elements/types/components/frame/user-menu/user-menu.d.ts +2 -2
  192. package/dist-elements/types/components/graph/graph/graph.d.ts +147 -0
  193. package/dist-elements/types/components/graph/graph/layout-runner.d.ts +13 -0
  194. package/dist-elements/types/components/graph/graph/layout-worker.d.ts +1 -0
  195. package/dist-elements/types/components/graph/graph/layout.d.ts +27 -0
  196. package/dist-elements/types/components/graph/graph/model.d.ts +81 -0
  197. package/dist-elements/types/components/graph/graph/routes.d.ts +62 -0
  198. package/dist-elements/types/components/graph/graph/view.d.ts +58 -0
  199. package/dist-elements/types/components/index.d.ts +20 -4
  200. package/dist-elements/types/components/inputs/combobox/combobox.d.ts +0 -2
  201. package/dist-elements/types/components/inputs/date-input/date-input.d.ts +1 -1
  202. package/dist-elements/types/components/inputs/date-range/date-range.d.ts +17 -6
  203. package/dist-elements/types/components/inputs/file-upload/file-upload.d.ts +10 -33
  204. package/dist-elements/types/components/inputs/multiselect/multiselect.d.ts +1 -11
  205. package/dist-elements/types/components/layout/accordion/accordion.d.ts +37 -0
  206. package/dist-elements/types/components/layout/expander/expander.d.ts +5 -1
  207. package/dist-elements/types/components/layout/split-pane/split-pane.d.ts +2 -0
  208. package/dist-elements/types/components/layout/tabs/tabs.d.ts +3 -0
  209. package/dist-elements/types/components/overlays/popover/popover.d.ts +7 -0
  210. package/dist-elements/types/components/overlays/tooltip/tooltip.d.ts +1 -1
  211. package/dist-elements/types/components/shared/avatar.d.ts +21 -0
  212. package/dist-elements/types/components/shared/charts/bar-chart/bar-chart.d.ts +3 -2
  213. package/dist-elements/types/components/shared/charts/dumbbell-chart/dumbbell-chart.d.ts +33 -0
  214. package/dist-elements/types/components/shared/charts/index.d.ts +6 -2
  215. package/dist-elements/types/components/shared/charts/kinds.d.ts +22 -4
  216. package/dist-elements/types/components/shared/charts/line-chart/line-chart.d.ts +3 -2
  217. package/dist-elements/types/components/shared/charts/sankey-chart/sankey-chart.d.ts +124 -0
  218. package/dist-elements/types/components/shared/charts/shared/axes.d.ts +33 -6
  219. package/dist-elements/types/components/shared/charts/shared/chart-states.d.ts +1 -1
  220. package/dist-elements/types/components/shared/charts/shared/chart-styles.d.ts +2 -0
  221. package/dist-elements/types/components/shared/charts/shared/colors.d.ts +29 -4
  222. package/dist-elements/types/components/shared/charts/shared/controller.d.ts +23 -3
  223. package/dist-elements/types/components/shared/charts/shared/forecast.d.ts +21 -0
  224. package/dist-elements/types/components/shared/charts/shared/plot-keys.d.ts +5 -0
  225. package/dist-elements/types/components/shared/charts/shared/tints.d.ts +2 -0
  226. package/dist-elements/types/components/shared/charts/shared/types.d.ts +146 -0
  227. package/dist-elements/types/components/shared/charts/shared/wheel.d.ts +11 -0
  228. package/dist-elements/types/components/shared/charts/treemap-chart/squarify.d.ts +16 -0
  229. package/dist-elements/types/components/shared/charts/treemap-chart/treemap-chart.d.ts +18 -0
  230. package/dist-elements/types/components/shared/charts/treemap-chart/treemap-labels.d.ts +36 -0
  231. package/dist-elements/types/components/shared/charts/treemap-chart/treemap-parts.d.ts +64 -0
  232. package/dist-elements/types/components/shared/disclosure.d.ts +5 -3
  233. package/dist-elements/types/components/shared/download.d.ts +28 -2
  234. package/dist-elements/types/components/shared/empty-state-block.d.ts +1 -1
  235. package/dist-elements/types/components/shared/files.d.ts +67 -0
  236. package/dist-elements/types/components/shared/heading.d.ts +4 -0
  237. package/dist-elements/types/components/shared/month-grid.d.ts +33 -0
  238. package/dist-elements/types/components/shared/place.d.ts +2 -2
  239. package/dist-elements/types/components/shared/search-text.d.ts +5 -0
  240. package/dist-elements/types/components/tables/activity-log/activity-log.d.ts +9 -2
  241. package/dist-elements/types/components/tables/card/card.d.ts +13 -2
  242. package/dist-elements/types/components/tables/data-table/editing.d.ts +7 -2
  243. package/dist-elements/types/components/tables/description-list/description-list.d.ts +4 -0
  244. package/dist-elements/types/components/tables/list/list.d.ts +9 -0
  245. package/dist-elements/types/components/tables/person/person.d.ts +35 -0
  246. package/dist-elements/types/components/tables/person-group/person-group.d.ts +42 -0
  247. package/dist-elements/types/core/format.d.ts +2 -2
  248. package/dist-elements/types/core/id.d.ts +2 -0
  249. package/dist-elements/types/icons/register.d.ts +1 -1
  250. package/dist-elements/types/types.d.ts +194 -15
  251. package/dist-elements/workers/layout-worker.js +3 -0
  252. package/dist-icons/functioneel-link.svg +1 -0
  253. package/dist-icons/functioneel-ondertiteling.svg +1 -0
  254. package/package.json +8 -1
  255. package/dist-elements/chunks/base-BsZyWDre.js +0 -226
  256. package/dist-elements/chunks/chart-styles-C5IzbVUF.js +0 -44
  257. package/dist-elements/chunks/disclosure-CQcLUnKh.js +0 -22
  258. package/dist-elements/chunks/disclosure-DjLQzn9n.js +0 -1
  259. package/dist-elements/chunks/download-CxEzwMxI.js +0 -13
  260. package/dist-elements/chunks/input-CazTpGUd.js +0 -1
  261. package/dist-elements/chunks/player-BEG3MVCm.js +0 -39
  262. package/dist-elements/chunks/sentence-CjgQjBP9.js +0 -3
  263. package/dist-elements/chunks/stagger-CwsMNTLl.js +0 -133
@@ -99,6 +99,8 @@ export declare class LintjeTranscript extends LintjeElement {
99
99
  private followed;
100
100
  /** The segment whose field had the focus when its save began. */
101
101
  private savedFrom;
102
+ /** The segment whose speaker button had the focus when `segments` changed. */
103
+ private speakerFrom;
102
104
  private get currentIndex();
103
105
  private segmentElement;
104
106
  private focusInside;
@@ -114,6 +116,11 @@ export declare class LintjeTranscript extends LintjeElement {
114
116
  /** The menu's own `lintje-action` ends here, as the request it stands for. */
115
117
  private onSpeakerAction;
116
118
  protected willUpdate(changed: PropertyValues<this>): void;
119
+ /**
120
+ * Grouped as a chat, a fragment that takes the speaker of the one before hides its name, button
121
+ * and all: the focus goes to the name of its turn instead of dropping to the page.
122
+ */
123
+ private keepSpeakerFocus;
117
124
  /**
118
125
  * A saving field is natively disabled, which drops its focus to the page: "Opslaan", busy but
119
126
  * focusable, holds it meanwhile, and a save that failed gives it back to the field.
@@ -7,9 +7,10 @@
7
7
  * load says so on the picture, with "Opnieuw proberen".
8
8
  *
9
9
  * Events: `lintje-time-change` `number` (seconds, at most four times a second), `lintje-seek`
10
- * `number` (seconds: the reader moved the position), `lintje-play`, `lintje-pause`.
10
+ * `number` (seconds: the reader moved the position), `lintje-play`, `lintje-pause`, `lintje-retry`
11
+ * ("Opnieuw proberen" was pressed).
11
12
  */
12
- import { type PropertyDeclarations, type TemplateResult } from 'lit';
13
+ import { type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
13
14
  import '../../actions/menu-button/menu-button.js';
14
15
  import { LintjePlayerElement } from '../shared/player.js';
15
16
  export interface TimedText {
@@ -17,11 +18,12 @@ export interface TimedText {
17
18
  text: string;
18
19
  }
19
20
  export declare class LintjeVideoPlayer extends LintjePlayerElement {
21
+ #private;
20
22
  static styles: import("lit").CSSResult[];
21
23
  static properties: PropertyDeclarations;
22
24
  /** The captions: the transcript's segments, or any `{ start, text }[]`. */
23
25
  segments: TimedText[];
24
- /** Whether the captions show; the reader switches it, in "Meer opties" or with C. */
26
+ /** Whether the captions show; the reader switches it with the bar's button or with C. */
25
27
  captions: boolean;
26
28
  /**
27
29
  * The same video with an audio description: "Meer opties" offers it when given, and the switch
@@ -32,11 +34,16 @@ export declare class LintjeVideoPlayer extends LintjePlayerElement {
32
34
  described: boolean;
33
35
  protected fullscreen: boolean;
34
36
  protected muted: boolean;
37
+ /** The bar holds fewer than five buttons: the captions move from the bar into the menu. */
38
+ protected narrow: boolean;
35
39
  protected readonly mediaSelector = "video";
36
40
  private get frame();
37
41
  private readonly onFullscreenChange;
38
42
  connectedCallback(): void;
39
43
  disconnectedCallback(): void;
44
+ protected updated(changed: PropertyValues<this>): void;
45
+ /** Five 48 px buttons and the gaps between them; the bar's width, not the screen's. */
46
+ private fit;
40
47
  /** What the `<video>` plays: the described version when the reader chose it. */
41
48
  private get source();
42
49
  /** The other version goes on at the same moment, and plays on if this one played. */
@@ -58,6 +65,8 @@ export declare class LintjeVideoPlayer extends LintjePlayerElement {
58
65
  private renderStage;
59
66
  /** As the audio player's: one name, pressed while muted. */
60
67
  private renderMute;
68
+ /** The same `captions` as the C key; pressed and underlined while they show. */
69
+ private renderCaptions;
61
70
  protected render(): TemplateResult;
62
71
  }
63
72
  declare global {
@@ -6,8 +6,8 @@
6
6
  */
7
7
  import { type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
8
8
  import { LintjeElement } from '../../../core/element.js';
9
- import { type HeadingLevel } from '../../shared/empty-state-block.js';
10
- export type { HeadingLevel } from '../../shared/empty-state-block.js';
9
+ import type { HeadingLevel } from '../../shared/heading.js';
10
+ export type { HeadingLevel } from '../../shared/heading.js';
11
11
  export declare class LintjeEmptyState extends LintjeElement {
12
12
  #private;
13
13
  static styles: import("lit").CSSResult[];
@@ -1,12 +1,23 @@
1
1
  /** `<lintje-status-dot>` — a status as a dot with its word; colour is never the only carrier. */
2
- import { type TemplateResult } from 'lit';
2
+ import { type CSSResult, type TemplateResult } from 'lit';
3
3
  import { LintjeElement } from '../../../core/element.js';
4
4
  import { type Tone } from '../../shared/tone.js';
5
5
  /** A source's delivery status: the element's own words, each a tone. */
6
6
  export type StatusTone = 'complete' | 'delayed' | 'outage' | 'no-data';
7
7
  export declare const STATUS_LABEL: Record<StatusTone, string>;
8
+ export declare const statusDotStyles: CSSResult;
9
+ export interface StatusDotOptions {
10
+ tone: Tone | StatusTone;
11
+ /** Overrides the Dutch word for the tone. */
12
+ label?: string;
13
+ /** The dot's diameter in px; default 10. */
14
+ size?: number;
15
+ className?: string;
16
+ }
17
+ /** The one drawing of a status dot, also for a root that draws one without the element. */
18
+ export declare function renderStatusDot({ tone, label, size, className, }: StatusDotOptions): TemplateResult;
8
19
  export declare class LintjeStatusDot extends LintjeElement {
9
- static styles: import("lit").CSSResult;
20
+ static styles: CSSResult[];
10
21
  static properties: {
11
22
  tone: {
12
23
  type: StringConstructor;
@@ -18,8 +18,11 @@ export declare class LintjeFormActions extends LintjeElement {
18
18
  static styles: import("lit").CSSResult[];
19
19
  static properties: PropertyDeclarations;
20
20
  /**
21
- * Set by the surrounding `lintje-form` (with `saved-at`); standing alone, the host sets it. On
22
- * `busy` the primary button turns `busy` and the others `disabled`; after, each has what it had.
21
+ * What the status line shows: `''` nothing; `dirty` "Wijzigingen nog niet opgeslagen"; `busy`
22
+ * "Bezig met opslaan", with the primary button `busy` and the others `disabled` (after, each
23
+ * has what it had); `saved` "Opgeslagen om 10:42", the time from `saved-at`; `draft` "Concept
24
+ * opgeslagen om 10:42", when `lintje-form` kept a draft in the browser (`saveDraft()`, Ctrl+S).
25
+ * Set by the surrounding `lintje-form`, with `saved-at`; standing alone, the host sets it.
23
26
  */
24
27
  state: FormActionsState;
25
28
  /** When it was saved: "10:42" or anything `Date` parses. */
@@ -28,8 +28,6 @@ export interface SearchGroup {
28
28
  export type AppSearchCloseReason = 'escape' | 'scrim' | 'button' | 'choice';
29
29
  /** Milliseconds after the last keystroke before `lintje-search` is sent. */
30
30
  export declare const SEARCH_DELAY = 200;
31
- /** The label split around the first case-insensitive occurrence of the term; null when absent. */
32
- export declare function splitMatch(label: string, query: string): [string, string, string] | null;
33
31
  /** What the live region says; while loading the spinner's own status speaks. */
34
32
  export declare function resultsMessage(count: number, query: string, loading: boolean): string;
35
33
  export declare class LintjeAppSearch extends LintjeElement {
@@ -14,12 +14,12 @@ import { LintjeElement } from '../../../core/element.js';
14
14
  import { type MenuEntry } from '../../actions/menu-button/menu-button.js';
15
15
  import '../../overlays/popover/popover.js';
16
16
  import '../../overlays/tooltip/tooltip.js';
17
- import type { UserMenuUser } from '../../../types.js';
17
+ import type { Person } from '../../../types.js';
18
18
  export declare class LintjeUserMenu extends LintjeElement {
19
19
  #private;
20
20
  static styles: import("lit").CSSResult[];
21
21
  static properties: PropertyDeclarations;
22
- user?: UserMenuUser | null;
22
+ user?: Person | null;
23
23
  items: MenuEntry[];
24
24
  /** Shown at the bottom: "Versie 2.4.1". */
25
25
  version?: string;
@@ -0,0 +1,147 @@
1
+ /**
2
+ * `<lintje-graph>` — an entity diagram in its tile: nodes and the relations between them, laid
3
+ * out, folded and zoomed by the element itself.
4
+ *
5
+ * The host sends the graph; the element finds its centre, gathers more than five leaves of one
6
+ * kind into a group, lays it out and draws it. `selected`, `collapsed` and `opened` are the
7
+ * host's: a click shows at once and asks with an event, and the host confirms in the next `data`.
8
+ * A node with `more` asks for its neighbours and shows a busy counter until the host sends them.
9
+ * Above a hundred nodes the layout is worked out in a worker. The zoom, the kinds switched off in
10
+ * the legend and the pointer are the element's own.
11
+ *
12
+ * Events: `lintje-node-select` `{ id, label }` (undone, `{ id: null, label: null }`),
13
+ * `lintje-node-toggle` `{ id, open }`, `lintje-node-expand` `{ id }`.
14
+ */
15
+ import { nothing, type PropertyDeclarations, type PropertyValues, type TemplateResult } from 'lit';
16
+ import { type FrameSettings } from '../../../core/element.js';
17
+ import { LintjeContentTileElement } from '../../shared/content-tile.js';
18
+ import '../../feedback/announcement/announcement.js';
19
+ import '../../feedback/spinner/spinner.js';
20
+ import '../../layout/tile/tile.js';
21
+ import '../../overlays/tooltip/tooltip.js';
22
+ import type { GraphData } from '../../../types.js';
23
+ /** The drawing's height in px, in the tile and on a phone. */
24
+ export declare const GRAPH_HEIGHT: {
25
+ readonly desktop: 480;
26
+ readonly mobile: 360;
27
+ };
28
+ export declare class LintjeGraph extends LintjeContentTileElement {
29
+ #private;
30
+ static styles: import("lit").CSSResult[];
31
+ static properties: PropertyDeclarations;
32
+ data?: GraphData | null;
33
+ protected get dataSettings(): FrameSettings | undefined;
34
+ connectedCallback(): void;
35
+ disconnectedCallback(): void;
36
+ protected expandChanged(open: boolean): void;
37
+ protected willUpdate(changed: PropertyValues<this>): void;
38
+ /** Takes over what the host keeps, each only when the host changed it. */
39
+ private adopt;
40
+ private get layoutKind();
41
+ private get lines();
42
+ /** The model again, and its layout when what it lays out changed. */
43
+ private rebuild;
44
+ private readFont;
45
+ /** px at a 14 px text into the element's own text size. */
46
+ private unit;
47
+ private wordWidth;
48
+ /** The counter a node carries, if any: what it shows and what it does. */
49
+ private counterOf;
50
+ /** The counter's width: its circle, or as wide as its sign and number; on a mark, 2 px of
51
+ * clear target round a smaller drawing. */
52
+ private counterWidth;
53
+ /** The room a card keeps at its end for its counter, in px at zoom 1. */
54
+ private roomFor;
55
+ /** A card's size: a fixed width, its name in one or two lines, and its status or group under it. */
56
+ private cardSize;
57
+ /** The line under a card's name: its status, or where a group hangs. */
58
+ private subOf;
59
+ /** How many lines text takes in a width, wrapping at its spaces. */
60
+ private lineCount;
61
+ /**
62
+ * A new layout. What leaves fades first where it stood, with its lines; then what stays moves
63
+ * to its new place, a new node comes out of its neighbour and the fitted view follows.
64
+ */
65
+ private apply;
66
+ private tick;
67
+ /** How far a motion has come, eased; nothing yet while what leaves still fades. */
68
+ private progress;
69
+ /** Where each node stands now, on its way from its last place to its new one. */
70
+ private positionsNow;
71
+ private select;
72
+ private toggle;
73
+ /**
74
+ * Back to the start, as the map's reset: the whole drawing in view, nothing chosen, every
75
+ * folded branch open again and every opened group closed. The host hears each change.
76
+ */
77
+ private reset;
78
+ private toggleType;
79
+ private leave;
80
+ private surfaces;
81
+ private hover;
82
+ /** The view a surface shows: the reader's, or the whole drawing fitted. */
83
+ private viewOf;
84
+ private zoom;
85
+ /** The chosen node and its neighbours in view. */
86
+ private zoomToSelection;
87
+ /** Brings a node into view when the keyboard reaches it outside. */
88
+ private reveal;
89
+ private focusNode;
90
+ /** The neighbour that lies most in the arrow's direction. */
91
+ private neighbourTowards;
92
+ private onKey;
93
+ private onWheel;
94
+ /** What a pointer on the drawing itself does: drag it, or pinch it with two fingers. */
95
+ private onPointerDown;
96
+ private onPointerMove;
97
+ private onPointerUp;
98
+ /** A point of the overview as a point of the graph. */
99
+ private overviewPoint;
100
+ /**
101
+ * The overview: a press outside its frame goes there, and the frame follows the pointer while
102
+ * it is held, from where it was taken.
103
+ */
104
+ private onOverviewDown;
105
+ private onOverviewMove;
106
+ /**
107
+ * The drawing as the reader sees it, with its legend and the words of its tile, as a PNG; the
108
+ * zoom buttons, the overview and the tooltip stay out.
109
+ */
110
+ private png;
111
+ private typeColor;
112
+ private legend;
113
+ protected render(): TemplateResult | typeof nothing;
114
+ private content;
115
+ /** The legend and the drawing of one surface; `height` null takes the modal's. */
116
+ private drawing;
117
+ private picture;
118
+ /**
119
+ * Which marks show their name beside them: the one pointed at and the chosen one first, then
120
+ * the busiest, each only where it covers no node and no other name. Far out, only the first two.
121
+ */
122
+ private markNames;
123
+ /**
124
+ * One node and its counter. The node is one button in either form, a card or a mark, so a
125
+ * change of zoom keeps the element that has the focus.
126
+ */
127
+ private renderNode;
128
+ private renderCounter;
129
+ /** What the tooltip says, for a node or a line; none for the chosen node, whose relations the host shows. */
130
+ private tooltip;
131
+ private controls;
132
+ protected updated(changed: PropertyValues<this>): void;
133
+ /** The node or counter in the drawing that holds the focus, with the node it belongs to. */
134
+ private focusedPart;
135
+ /**
136
+ * A node or counter that held the focus and is gone, or fading, hands it on: to the node that
137
+ * folded it away, to the first member of the group it opened, else to the centre.
138
+ */
139
+ private handFocus;
140
+ /** Each tooltip 12 px under its node or the pointer, above it when the room is too small. */
141
+ private placeTips;
142
+ }
143
+ declare global {
144
+ interface HTMLElementTagNameMap {
145
+ 'lintje-graph': LintjeGraph;
146
+ }
147
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Runs a layout: on the page for a small graph, and in a worker above `LARGE_GRAPH` nodes, so the
3
+ * page keeps answering while it works. Where no worker starts — a test document, a policy that
4
+ * forbids one — a large graph is laid out on the page too, a frame later, after its busy state.
5
+ */
6
+ import { type LayoutRequest, type LayoutResult } from './layout.js';
7
+ export declare class LayoutRunner {
8
+ #private;
9
+ /** A small graph's result at once; a large one's when it is ready. */
10
+ run(request: LayoutRequest): LayoutResult | Promise<LayoutResult>;
11
+ destroy(): void;
12
+ private worker;
13
+ }
@@ -0,0 +1,27 @@
1
+ import type { GraphLayout } from '../../../types.js';
2
+ export interface Point {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ export interface LayoutRequest {
7
+ kind: GraphLayout;
8
+ /** Each node's box, centred on where it will stand. */
9
+ nodes: {
10
+ id: string;
11
+ width: number;
12
+ height: number;
13
+ }[];
14
+ edges: {
15
+ from: string;
16
+ to: string;
17
+ }[];
18
+ centre: string | null;
19
+ /** Where the nodes stood: force keeps them there and puts a new one beside its neighbour. */
20
+ previous?: Record<string, Point>;
21
+ }
22
+ export interface LayoutResult {
23
+ positions: Record<string, Point>;
24
+ /** Per edge, in the request's order: the points dagre routed it along. */
25
+ routes?: Point[][];
26
+ }
27
+ export declare function computeLayout(request: LayoutRequest): LayoutResult;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The graph as drawn, from the graph as the host sent it: the leaves gathered into groups, the
3
+ * centre, what hangs behind each node, and the branches the reader folded. Pure: the element, the
4
+ * layout worker and the tests read the same functions.
5
+ */
6
+ import type { GraphData, GraphDirection, GraphLayout, GraphNode, GraphNodeType } from '../../../types.js';
7
+ /** More leaves than this of one kind on one node become a group, as a pie folds into "Overig". */
8
+ export declare const GROUP_MAX = 5;
9
+ /** Above this many nodes the layout is worked out away from the page, in a worker. */
10
+ export declare const LARGE_GRAPH = 100;
11
+ /** A group's id: the node its members hang on and their kind. */
12
+ export declare function groupId(parent: string, type: string): string;
13
+ export interface DrawnNode extends GraphNode {
14
+ /** A group of leaves: the node they hang on and their ids, in the host's order. */
15
+ group?: {
16
+ parent: string;
17
+ members: string[];
18
+ };
19
+ }
20
+ export interface DrawnEdge {
21
+ /** Stable while both ends stay: the ends and how many before it share them. */
22
+ key: string;
23
+ from: string;
24
+ to: string;
25
+ label: string;
26
+ direction: GraphDirection;
27
+ value?: number;
28
+ unit?: string;
29
+ }
30
+ export interface GraphModel {
31
+ nodes: DrawnNode[];
32
+ edges: DrawnEdge[];
33
+ byId: Map<string, DrawnNode>;
34
+ neighbours: Map<string, Set<string>>;
35
+ /** The busiest node; it stays while it is there, so opening a branch never moves it. */
36
+ centre: string | null;
37
+ /** What hangs behind a node: all the centre reaches only through it. The centre has all. */
38
+ behind: Map<string, string[]>;
39
+ /** The nodes a folded branch hides, drawn no more. */
40
+ folded: Set<string>;
41
+ /** Every node's name as the host sent it, members of a group too. */
42
+ names: Map<string, string>;
43
+ /** The layout the graph's shape asks for, read before any branch is folded. */
44
+ layout: GraphLayout;
45
+ }
46
+ export declare function adjacency(nodes: {
47
+ id: string;
48
+ }[], edges: DrawnEdge[]): Map<string, Set<string>>;
49
+ /** The node with the most relations; the first the host names wins a tie. */
50
+ export declare function busiest(nodes: {
51
+ id: string;
52
+ }[], neighbours: Map<string, Set<string>>): string | null;
53
+ /**
54
+ * What hangs behind each node: everything the centre reaches only through it, whichever way the
55
+ * arrows point. Behind the centre hangs all it reaches, so folding it leaves the centre alone.
56
+ */
57
+ export declare function behindSets(nodes: {
58
+ id: string;
59
+ }[], neighbours: Map<string, Set<string>>, centre: string | null): Map<string, string[]>;
60
+ export interface ModelOptions {
61
+ /** Groups opened, by `groupId`. */
62
+ opened?: Iterable<string>;
63
+ /** Nodes whose branch is folded. */
64
+ collapsed?: Iterable<string>;
65
+ /** The centre the element kept; it stays while the graph still has it. */
66
+ centre?: string | null;
67
+ }
68
+ export declare function buildModel(data: Pick<GraphData, 'nodes' | 'edges' | 'types'>, options?: ModelOptions): GraphModel;
69
+ /**
70
+ * The layout a graph takes when the host names none, by its shape: a large network, a ring of
71
+ * references or a relation both ways goes by force; a chain of directed relations is layered to
72
+ * the right; one node that holds most of the others is the hub of rings; the rest is a
73
+ * hierarchy, layered downwards.
74
+ */
75
+ export declare function defaultLayout(model: Pick<GraphModel, 'nodes' | 'edges' | 'neighbours' | 'centre'>): GraphLayout;
76
+ /** A type by its key; an unknown key still draws, as a type with only its key for a name. */
77
+ export declare function typeOf(types: GraphNodeType[], key: string): GraphNodeType;
78
+ /** A relation as one line, read from `id`: its word, then the other end, an arrow for direction. */
79
+ export declare function sentence(model: GraphModel, edge: DrawnEdge, id: string): string;
80
+ /** The relations of a node as lines, as many as `max`, then "nog n". */
81
+ export declare function relationLines(model: GraphModel, id: string, max?: number): string[];
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The lines between the nodes, on the screen: straight from edge to edge, bent round a node in the
3
+ * way, curved round the centre, along dagre's route or in right angles; their arrowheads; and
4
+ * where each relation's word stands, clear of the nodes and of the other words.
5
+ */
6
+ import type { GraphDirection, GraphLines } from '../../../types.js';
7
+ import type { Point } from './layout.js';
8
+ /** A node's outline on the screen: a box, or the circle of a mark. */
9
+ export interface Shape {
10
+ cx: number;
11
+ cy: number;
12
+ /** Half the width and the height; a circle's radius twice. */
13
+ hw: number;
14
+ hh: number;
15
+ round: boolean;
16
+ }
17
+ export interface RouteEdge {
18
+ key: string;
19
+ from: string;
20
+ to: string;
21
+ label: string;
22
+ direction: GraphDirection;
23
+ /** The stroke's width in px. */
24
+ width: number;
25
+ /** The word shows: at reading zoom, or on a line in the light. */
26
+ labelled: boolean;
27
+ /** The line is in the light: its word shows even where it has no clear place. */
28
+ lit: boolean;
29
+ }
30
+ export interface RouteOptions {
31
+ lines: GraphLines;
32
+ /** The direction of a layered layout; `null` for force and radial. */
33
+ layered: 'right' | 'down' | null;
34
+ /** dagre's route per edge key, on the screen; only while the cards are drawn. */
35
+ routed?: Map<string, Point[]>;
36
+ /** The width a word takes, with its halo. */
37
+ labelWidth: (text: string) => number;
38
+ }
39
+ export interface Route {
40
+ key: string;
41
+ /** The line's path. */
42
+ d: string;
43
+ /** A filled triangle at each end that has an arrowhead. */
44
+ arrows: string[];
45
+ /** The word's centre, if it shows. */
46
+ label: Point | null;
47
+ }
48
+ interface Rect {
49
+ x: number;
50
+ y: number;
51
+ w: number;
52
+ h: number;
53
+ }
54
+ /** Where a line from the shape's centre in direction (dx, dy) leaves its outline, `pad` beyond. */
55
+ export declare function border(shape: Shape, dx: number, dy: number, pad?: number): Point;
56
+ /** Whether the segment p–q crosses the box (Liang–Barsky). */
57
+ export declare function segmentHits(p: Point, q: Point, box: Rect): boolean;
58
+ /** The point at share `t` along a polyline. */
59
+ export declare function along(points: Point[], t: number): Point;
60
+ /** Every line, in the order given; a word placed earlier keeps its place against a later one. */
61
+ export declare function routeEdges(edges: RouteEdge[], shapes: Map<string, Shape>, options: RouteOptions): Route[];
62
+ export {};
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The zoom: where the graph's own units land on the screen (`screen = world · k + t`), fitting,
3
+ * zooming round a point, and the overview map's scale. Pure arithmetic.
4
+ */
5
+ import type { Point } from './layout.js';
6
+ export interface View {
7
+ k: number;
8
+ x: number;
9
+ y: number;
10
+ }
11
+ export interface Bounds {
12
+ x: number;
13
+ y: number;
14
+ width: number;
15
+ height: number;
16
+ }
17
+ /** How a node is drawn at a zoom: a card, a mark with its name where it fits, or a mark alone. */
18
+ export type Level = 'card' | 'mark' | 'icon';
19
+ export declare const ZOOM: {
20
+ readonly min: 0.15;
21
+ readonly max: 3;
22
+ readonly fit: 1.25;
23
+ readonly step: 1.25;
24
+ };
25
+ export declare function levelAt(k: number): Level;
26
+ /** The box round the given nodes, each of its own size. */
27
+ export declare function boundsOf(positions: Record<string, Point>, sizes: Map<string, {
28
+ width: number;
29
+ height: number;
30
+ }>, ids?: Iterable<string>): Bounds;
31
+ /**
32
+ * The view that shows the whole box in the area, never closer than `ZOOM.fit`; `right` keeps a
33
+ * strip of the area clear, where the zoom buttons stand.
34
+ */
35
+ export declare function fit(box: Bounds, area: {
36
+ width: number;
37
+ height: number;
38
+ }, right?: number): View;
39
+ /** Zooms by `factor` round a point of the area, so what is under it stays there. */
40
+ export declare function zoomAt(view: View, at: Point, factor: number): View;
41
+ /** Centres a point of the graph in the area at the view's zoom. */
42
+ export declare function centreOn(view: View, point: Point, area: {
43
+ width: number;
44
+ height: number;
45
+ }): View;
46
+ export declare function fits(box: Bounds, view: View, area: {
47
+ width: number;
48
+ height: number;
49
+ }): boolean;
50
+ /** The overview map: the scale and offset that put the whole box in a frame of `size`. */
51
+ export declare function overview(box: Bounds, size: {
52
+ width: number;
53
+ height: number;
54
+ }): {
55
+ scale: number;
56
+ x: number;
57
+ y: number;
58
+ };