@lo-tek/interfaces 0.42.0 → 0.43.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/agent/astro.md +1 -1
  3. package/agent/bundles.md +1 -1
  4. package/agent/datastar.md +50 -50
  5. package/agent/html.md +53 -53
  6. package/agent/kotlin.md +4 -4
  7. package/agent/react.md +1 -1
  8. package/agent/templates.md +50 -50
  9. package/dist/components/frame/dialog/lt-dialog.d.ts +11 -3
  10. package/dist/components/frame/dialog/lt-dialog.d.ts.map +1 -1
  11. package/dist/components/frame/dialog/lt-dialog.js +59 -46
  12. package/dist/components/frame/dialog/lt-dialog.js.map +1 -1
  13. package/dist/components/frame/error-summary/lt-error-summary.d.ts +9 -6
  14. package/dist/components/frame/error-summary/lt-error-summary.d.ts.map +1 -1
  15. package/dist/components/frame/error-summary/lt-error-summary.js +38 -57
  16. package/dist/components/frame/error-summary/lt-error-summary.js.map +1 -1
  17. package/dist/components/frame/field/lt-field.d.ts +17 -26
  18. package/dist/components/frame/field/lt-field.d.ts.map +1 -1
  19. package/dist/components/frame/field/lt-field.js +81 -143
  20. package/dist/components/frame/field/lt-field.js.map +1 -1
  21. package/dist/components/frame/popover/lt-popover.d.ts +1 -1
  22. package/dist/components/frame/popover/lt-popover.d.ts.map +1 -1
  23. package/dist/components/frame/popover/lt-popover.js +31 -33
  24. package/dist/components/frame/popover/lt-popover.js.map +1 -1
  25. package/dist/components/frame/session-timeout/lt-session-timeout.d.ts +14 -2
  26. package/dist/components/frame/session-timeout/lt-session-timeout.d.ts.map +1 -1
  27. package/dist/components/frame/session-timeout/lt-session-timeout.js +73 -46
  28. package/dist/components/frame/session-timeout/lt-session-timeout.js.map +1 -1
  29. package/dist/components/frame/suggestion/lt-suggestion.d.ts +5 -7
  30. package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -1
  31. package/dist/components/frame/suggestion/lt-suggestion.js +57 -72
  32. package/dist/components/frame/suggestion/lt-suggestion.js.map +1 -1
  33. package/dist/components/frame/tabs/lt-tabs.d.ts +14 -5
  34. package/dist/components/frame/tabs/lt-tabs.d.ts.map +1 -1
  35. package/dist/components/frame/tabs/lt-tabs.js +86 -106
  36. package/dist/components/frame/tabs/lt-tabs.js.map +1 -1
  37. package/dist/components/frame/term/lt-term.d.ts +5 -1
  38. package/dist/components/frame/term/lt-term.d.ts.map +1 -1
  39. package/dist/components/frame/term/lt-term.js +23 -21
  40. package/dist/components/frame/term/lt-term.js.map +1 -1
  41. package/dist/components/host-element.d.ts +137 -2
  42. package/dist/components/host-element.d.ts.map +1 -1
  43. package/dist/components/host-element.js +187 -4
  44. package/dist/components/host-element.js.map +1 -1
  45. package/dist/lotek.css +1 -1
  46. package/dist/react.d.ts +51 -437
  47. package/dist/react.d.ts.map +1 -1
  48. package/dist/react.js +48 -208
  49. package/dist/react.js.map +1 -1
  50. package/manifest/manifest.json +1 -1
  51. package/package.json +7 -3
  52. package/src/components/frame/dialog/lt-dialog.ts +56 -50
  53. package/src/components/frame/error-summary/lt-error-summary.ts +33 -46
  54. package/src/components/frame/field/lt-field.ts +99 -207
  55. package/src/components/frame/popover/lt-popover.ts +37 -35
  56. package/src/components/frame/session-timeout/lt-session-timeout.ts +88 -46
  57. package/src/components/frame/suggestion/lt-suggestion.ts +59 -73
  58. package/src/components/frame/tabs/lt-tabs.ts +96 -122
  59. package/src/components/frame/term/lt-term.ts +27 -21
  60. package/src/components/host-element.ts +306 -3
  61. package/src/react.ts +125 -240
  62. package/web-types.json +1 -1
package/dist/react.js CHANGED
@@ -1,51 +1,9 @@
1
- import { accordion } from "./components/css/accordion/accordion.js";
2
- import { alert } from "./components/css/alert/alert.js";
3
- import { avatar } from "./components/css/avatar/avatar.js";
4
- import { badge } from "./components/css/badge/badge.js";
5
- import { breadcrumbs } from "./components/css/breadcrumbs/breadcrumbs.js";
6
- import { button } from "./components/css/button/button.js";
7
- import { card } from "./components/css/card/card.js";
8
- import { checkbox } from "./components/css/checkbox/checkbox.js";
9
- import { divider } from "./components/css/divider/divider.js";
10
- import { errorText } from "./components/css/error-text/error-text.js";
11
- import { fieldset, legend } from "./components/css/fieldset/fieldset.js";
12
- import { fileUpload } from "./components/css/file-upload/file-upload.js";
13
- import { heading } from "./components/css/heading/heading.js";
14
- import { helpText } from "./components/css/help-text/help-text.js";
15
- import { icon } from "./components/css/icon/icon.js";
16
- import { input } from "./components/css/input/input.js";
17
- import { label } from "./components/css/label/label.js";
18
- import { link } from "./components/css/link/link.js";
19
- import { list } from "./components/css/list/list.js";
20
- import { pagination } from "./components/css/pagination/pagination.js";
21
- import { paragraph } from "./components/css/paragraph/paragraph.js";
22
- import { progress } from "./components/css/progress/progress.js";
23
- import { radio } from "./components/css/radio/radio.js";
24
- import { search } from "./components/css/search/search.js";
25
- import { select } from "./components/css/select/select.js";
26
- import { fieldStates, isFieldState, isRequiredMarker, managedNames, rememberManaged, requiredMarkers, } from "./components/css/shared.js";
27
- import { skeleton } from "./components/css/skeleton/skeleton.js";
28
- import { skipLink } from "./components/css/skip-link/skip-link.js";
29
- import { spinner } from "./components/css/spinner/spinner.js";
30
- import { srOnly } from "./components/css/sr-only/sr-only.js";
31
- import { steps } from "./components/css/steps/steps.js";
32
- import { switchControl } from "./components/css/switch/switch.js";
33
- import { table, tableSort } from "./components/css/table/table.js";
34
- import { tag } from "./components/css/tag/tag.js";
35
- import { textarea } from "./components/css/textarea/textarea.js";
36
- import { toggleGroup } from "./components/css/toggle-group/toggle-group.js";
37
- import { tooltip } from "./components/css/tooltip/tooltip.js";
38
- import { dialog } from "./components/frame/dialog/dialog.js";
39
- import { errorSummary } from "./components/frame/error-summary/error-summary.js";
40
- import { computeFieldAttributes, createFieldId, } from "./components/frame/field/field-core.js";
41
- import { popover } from "./components/frame/popover/popover.js";
42
- import { sessionTimeout } from "./components/frame/session-timeout/session-timeout.js";
43
- import { suggestion } from "./components/frame/suggestion/suggestion.js";
1
+ import { managedNames, rememberManaged } from "./components/css/shared.js";
2
+ import { createFieldId } from "./components/frame/field/field-core.js";
44
3
  import { tabsWithState, } from "./components/frame/tabs/tabs.js";
45
4
  import { termWithState } from "./components/frame/term/term.js";
46
- import { connectionStatus } from "./components/standalone/connection-status/connection-status.js";
47
- import { toast } from "./components/standalone/toast/toast.js";
48
5
  import { setAttributes as setHtmlAttributes } from "./dom.js";
6
+ import { lt as html } from "./lt.js";
49
7
  /**
50
8
  * The attributes that have another name in React.
51
9
  *
@@ -118,16 +76,48 @@ export function setAttributes(element, ...sets) {
118
76
  setHtmlAttributes(element, ...sets.map((set) => toHtmlAttributes(set)));
119
77
  }
120
78
  /**
121
- * Wraps a builder function so the return value gets the React names.
122
- *
123
- * The signature is written as an intersection type so TypeScript can infer
124
- * both the options type and the extra fields attached to the function, that
125
- * is `variants`, `isVariant` and the others, in one go.
79
+ * The result with the React names. A set is recognised by what
80
+ * `attributes()` notes on every set a builder function makes, not by its
81
+ * shape, so a compound whose parts are all absent is not taken for one.
82
+ */
83
+ function toReactResult(value) {
84
+ if (Array.isArray(value))
85
+ return value.map(toReactResult);
86
+ if (!value || typeof value !== "object")
87
+ return value;
88
+ if (managedNames(value))
89
+ return toReactAttributes(value);
90
+ return Object.fromEntries(Object.entries(value).map(([name, child]) => [name, toReactResult(child)]));
91
+ }
92
+ /**
93
+ * Wraps a builder function so the result gets the React names, and keeps
94
+ * what hangs on the function: `variants`, `isVariant` and the others.
126
95
  */
127
96
  function forReact(fn) {
128
- const wrapped = (options) => toReactAttributes(fn(options));
97
+ const wrapped = (...args) => toReactResult(fn(...args));
129
98
  return Object.assign(wrapped, fn);
130
99
  }
100
+ /**
101
+ * A guard on `lt`, such as `isState`: it builds nothing, and passes through
102
+ * as the same function. Named `is` and a capital letter, as every guard in
103
+ * the package is.
104
+ */
105
+ const isGuard = (name) => /^is[A-Z]/.test(name);
106
+ /**
107
+ * What stands by hand in `lt` below: the two that give the whole state, and
108
+ * `setAttributes`, which takes an element and builds nothing.
109
+ */
110
+ const BY_HAND = ["tabs", "term", "setAttributes"];
111
+ function everyBuilder() {
112
+ const result = {};
113
+ for (const [name, value] of Object.entries(html))
114
+ if (!BY_HAND.includes(name))
115
+ result[name] =
116
+ typeof value === "function" && !isGuard(name)
117
+ ? forReact(value)
118
+ : value;
119
+ return result;
120
+ }
131
121
  /**
132
122
  * Re-exported from the main entry point.
133
123
  *
@@ -138,173 +128,23 @@ function forReact(fn) {
138
128
  * also in an app without a server.
139
129
  */
140
130
  export { createFieldId };
131
+ /**
132
+ * Every builder function from the main entry, with the React names. A new
133
+ * component comes along by itself; only the exceptions stand here.
134
+ */
141
135
  export const lt = {
142
- accordion: forReact(accordion),
143
- alert: forReact(alert),
144
- avatar: forReact(avatar),
145
- badge: forReact(badge),
146
- breadcrumbs: forReact(breadcrumbs),
147
- button: forReact(button),
148
- card: forReact(card),
149
- checkbox: forReact(checkbox),
150
- divider: forReact(divider),
151
- errorText: forReact(errorText),
152
- fieldset: forReact(fieldset),
153
- heading: forReact(heading),
154
- fileUpload: forReact(fileUpload),
155
- helpText: forReact(helpText),
156
- icon: forReact(icon),
157
- input: forReact(input),
158
- label: forReact(label),
159
- legend: forReact(legend),
160
- link: forReact(link),
161
- list: forReact(list),
162
- pagination: forReact(pagination),
163
- paragraph: forReact(paragraph),
164
- radio: forReact(radio),
165
- search: forReact(search),
166
- select: forReact(select),
167
- skeleton: forReact(skeleton),
168
- skipLink: forReact(skipLink),
169
- progress: forReact(progress),
170
- spinner: forReact(spinner),
171
- srOnly: forReact(srOnly),
172
- steps: forReact(steps),
173
- switch: forReact(switchControl),
174
- toggleGroup: forReact(toggleGroup),
175
- tooltip: forReact(tooltip),
176
- table: forReact(table),
177
- tableSort: Object.assign((options) => {
178
- const built = tableSort(options);
179
- return {
180
- header: built.header,
181
- button: toReactAttributes(built.button),
182
- };
183
- }, { isDirection: tableSort.isDirection }),
184
- tag: forReact(tag),
185
- textarea: forReact(textarea),
186
- /**
187
- * Wires a whole field, with `className` and `htmlFor` on the label.
188
- *
189
- * `control`, `help` and `error` have no keys that need renaming, and are
190
- * therefore the same in both entry points.
191
- */
192
- field: (options) => {
193
- const field = computeFieldAttributes(options);
194
- return { ...field, label: toReactAttributes(field.label) };
195
- },
196
- /**
197
- * The compound builder functions return one attribute set per element,
198
- * and each set must be renamed on its own. `host` has `tabindex`, and the
199
- * panels in `lt.tabs()` have both `tabindex` and `class`.
200
- */
201
- errorSummary: (options = {}) => {
202
- const built = errorSummary(options);
203
- return {
204
- host: toReactAttributes(built.host),
205
- title: toReactAttributes(built.title),
206
- };
207
- },
208
- dialog: Object.assign((options) => {
209
- const built = dialog(options);
210
- return {
211
- host: built.host,
212
- dialog: toReactAttributes(built.dialog),
213
- header: toReactAttributes(built.header),
214
- title: toReactAttributes(built.title),
215
- subtitle: toReactAttributes(built.subtitle),
216
- body: toReactAttributes(built.body),
217
- footer: toReactAttributes(built.footer),
218
- };
219
- }, {
220
- dialog: dialog.dialog,
221
- header: dialog.header,
222
- title: dialog.title,
223
- subtitle: dialog.subtitle,
224
- body: dialog.body,
225
- footer: dialog.footer,
226
- colors: dialog.colors,
227
- isColor: dialog.isColor,
228
- }),
229
- popover: Object.assign((options) => {
230
- const built = popover(options);
231
- return {
232
- host: built.host,
233
- trigger: toReactAttributes(built.trigger),
234
- panel: toReactAttributes(built.panel),
235
- };
236
- }, { isPlacement: popover.isPlacement }),
136
+ ...everyBuilder(),
237
137
  /**
238
138
  * The whole state, not just the links: React reports a mismatch for every
239
139
  * attribute the component writes on an element React has rendered. See
240
140
  * `tabsWithState`.
241
141
  */
242
- tabs: (options) => {
243
- const built = tabsWithState(options);
244
- return {
245
- list: toReactAttributes(built.list),
246
- item: toReactAttributes(built.item),
247
- tabs: built.tabs.map(toReactAttributes),
248
- panels: built.panels.map(toReactAttributes),
249
- };
250
- },
142
+ tabs: (options) => toReactResult(tabsWithState(options)),
251
143
  /**
252
144
  * With `aria-expanded`, which `<lt-term>` writes: React reports a mismatch
253
145
  * for an attribute it did not render. See `termWithState`.
254
146
  */
255
- term: (options) => {
256
- const built = termWithState(options);
257
- return {
258
- word: toReactAttributes(built.word),
259
- entry: toReactAttributes(built.entry),
260
- };
261
- },
262
- suggestion: (options) => {
263
- const built = suggestion(options);
264
- return {
265
- ...built,
266
- label: toReactAttributes(built.label),
267
- control: toReactAttributes(built.control),
268
- list: toReactAttributes(built.list),
269
- options: built.options.map(toReactAttributes),
270
- empty: toReactAttributes(built.empty),
271
- status: toReactAttributes(built.status),
272
- value: toReactAttributes(built.value),
273
- };
274
- },
275
- toast: (options = {}) => {
276
- const built = toast(options);
277
- return {
278
- host: toReactAttributes(built.host),
279
- message: toReactAttributes(built.message),
280
- close: toReactAttributes(built.close),
281
- };
282
- },
283
- sessionTimeout: Object.assign((options) => {
284
- const built = sessionTimeout(options);
285
- return {
286
- host: toReactAttributes(built.host),
287
- dialog: toReactAttributes(built.dialog),
288
- title: toReactAttributes(built.title),
289
- text: toReactAttributes(built.text),
290
- count: toReactAttributes(built.count),
291
- live: toReactAttributes(built.live),
292
- actions: toReactAttributes(built.actions),
293
- extend: toReactAttributes(built.extend),
294
- logout: toReactAttributes(built.logout),
295
- };
296
- }, {
297
- dialog: sessionTimeout.dialog,
298
- title: sessionTimeout.title,
299
- text: sessionTimeout.text,
300
- count: sessionTimeout.count,
301
- actions: sessionTimeout.actions,
302
- }),
303
- connectionStatus: forReact(connectionStatus),
147
+ term: (options) => toReactResult(termWithState(options)),
304
148
  setAttributes,
305
- states: fieldStates,
306
- isState: isFieldState,
307
- markers: requiredMarkers,
308
- isMarker: isRequiredMarker,
309
149
  };
310
150
  //# sourceMappingURL=react.js.map
package/dist/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAA;AACvD,OAA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AAE,CACrD,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAEnC;IAEH,aAAa;CACd,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "version": "0.42.0",
4
+ "version": "0.43.0",
5
5
  "textLanguage": "en",
6
6
  "elements": {
7
7
  "lt-field": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lo-tek/interfaces",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
4
4
  "description": "Framework-agnostic design system: tokens, CSS components and web components.",
5
5
  "license": "MIT",
6
6
  "author": "August Søberg-Klyver",
@@ -367,14 +367,14 @@
367
367
  "access": "public"
368
368
  },
369
369
  "scripts": {
370
- "generate": "bun scripts/generate-matrix.ts && bun scripts/generate-tokens.ts && bun scripts/generate-tailwind.ts && bun scripts/generate-vocabulary.ts && bun scripts/generate-agent.ts && bun scripts/generate-manifest.ts",
370
+ "generate": "bun scripts/extract-recipes.ts && bun scripts/generate-matrix.ts && bun scripts/generate-tokens.ts && bun scripts/generate-tailwind.ts && bun scripts/generate-vocabulary.ts && bun scripts/generate-agent.ts && bun scripts/generate-manifest.ts",
371
371
  "build:css": "bun scripts/build-css.ts",
372
372
  "pack": "bun run core && rm -rf dist && tsc -b --force && bun run build:css && npm pack --ignore-scripts",
373
373
  "build:browser": "tsc -b && bun run build:css",
374
374
  "vocabulary": "bun scripts/generate-vocabulary.ts",
375
375
  "check:vocabulary": "bun scripts/check-vocabulary.ts",
376
376
  "core": "bun ../core/scripts/build.ts && mkdir -p core && cp ../core/dist/lotek-core.wasm ../core/dist/lotek.wasm core/",
377
- "build": "bun run core && bun run generate && rm -rf dist && tsc -b --force && bun run build:css && bun run check:exports && bun run check:server && bun run check:types && bun run check:writes && bun run check:test-files && bun run check:texts && bun run check:identifiers && bun run check:agent && bun run check:vocabulary && bun run check:css-witness && bun run check:wording && bun run check:cli && bun run check:version && bun run check:package",
377
+ "build": "bun run core && bun run generate && rm -rf dist && tsc -b --force && bun run build:css && bun run check:exports && bun run check:server && bun run check:types && bun run check:writes && bun run check:layers && bun run check:test-files && bun run check:texts && bun run check:identifiers && bun run check:agent && bun run check:vocabulary && bun run check:css-witness && bun run check:wording && bun run check:cli && bun run check:version && bun run check:package",
378
378
  "typecheck": "tsc --noEmit",
379
379
  "typecheck:tests": "tsc --noEmit -p tsconfig.tests.json",
380
380
  "test:browser": "vitest --config vitest.config.ts --run",
@@ -391,6 +391,7 @@
391
391
  "check:package": "publint",
392
392
  "prepublishOnly": "bun run build",
393
393
  "check:writes": "bun scripts/check-writes.ts",
394
+ "check:layers": "bun scripts/check-layers.ts",
394
395
  "check:test-files": "bun scripts/check-test-files.ts",
395
396
  "check:identifiers": "bun scripts/check-identifiers.ts",
396
397
  "typecheck:scripts": "tsc --noEmit -p scripts/tsconfig.json",
@@ -411,7 +412,10 @@
411
412
  "publint": "^0.3.24",
412
413
  "react": "19",
413
414
  "react-dom": "19",
415
+ "remark-mdx": "3.1.1",
416
+ "remark-parse": "11.0.0",
414
417
  "tailwindcss": "4.3.0",
418
+ "unified": "11.0.5",
415
419
  "vite": "7.3.7",
416
420
  "vitest": "4.1.12"
417
421
  }
@@ -2,12 +2,17 @@ import {
2
2
  addClass,
3
3
  defineElement,
4
4
  HostElement,
5
+ hasName,
5
6
  isServerControlled,
7
+ nameFromHeading,
8
+ ownership,
9
+ restoreModalOpen,
6
10
  SERVER_CONTROLLED,
7
11
  setAttr,
8
12
  setFlag,
9
13
  uniqueId,
10
14
  warnAboutMarkup,
15
+ watcher,
11
16
  } from "../../host-element.js"
12
17
  import {
13
18
  DIALOG_BODY_CLASS,
@@ -89,7 +94,23 @@ const upgradeChecked = new WeakSet<HTMLDialogElement>()
89
94
  export class LtDialog extends HostElement {
90
95
  static observedAttributes = ["open", SERVER_CONTROLLED] as const
91
96
 
92
- private observer?: MutationObserver
97
+ private readonly watch = watcher(
98
+ (records) => {
99
+ const swapped = records.some(
100
+ (record) => record.type === "childList" && record.target === this,
101
+ )
102
+ if (swapped) this.sync()
103
+ else this.rewire()
104
+ },
105
+ {
106
+ childList: true,
107
+ subtree: true,
108
+ attributes: true,
109
+ // `aria-label` too: removed, the dialog is named after its title
110
+ // again, and without it here the dialog was left without a name.
111
+ attributeFilter: ["class", "id", "aria-labelledby", "aria-label"],
112
+ },
113
+ )
93
114
  /**
94
115
  * A separate observer for `open` on the `<dialog>` itself.
95
116
  *
@@ -98,9 +119,12 @@ export class LtDialog extends HostElement {
98
119
  * an observer running all of `sync()` there would have seen a host still
99
120
  * saying "open" and a dialog that was not modal, and opened it again before
100
121
  * `close` was handled. This one does only one thing: it puts the attribute
101
- * back on a dialog that is still in the top layer.
122
+ * back on a dialog that is still in the top layer. It is started again on
123
+ * a dialog the server replaced.
102
124
  */
103
- private openObserver?: MutationObserver
125
+ private readonly openWatch = watcher(() => this.repairOpen(), {
126
+ attributeFilter: ["open"],
127
+ })
104
128
  private dialogElement?: HTMLDialogElement
105
129
  /**
106
130
  * What the component last reported, so it reports only when the state
@@ -148,29 +172,13 @@ export class LtDialog extends HostElement {
148
172
  * and opened it again before the close was handled. Every write compares
149
173
  * first, or the observer would trigger itself.
150
174
  */
151
- this.observer = new MutationObserver((records) => {
152
- const swapped = records.some(
153
- (record) => record.type === "childList" && record.target === this,
154
- )
155
- if (swapped) this.sync()
156
- else this.rewire()
157
- })
158
- this.observer.observe(this, {
159
- childList: true,
160
- subtree: true,
161
- attributes: true,
162
- // `aria-label` too: removed, the dialog is named after its title
163
- // again, and without it here the dialog was left without a name.
164
- attributeFilter: ["class", "id", "aria-labelledby", "aria-label"],
165
- })
175
+ this.watch.start(this)
166
176
  this.sync()
167
177
  }
168
178
 
169
179
  disconnectedCallback(): void {
170
- this.observer?.disconnect()
171
- this.observer = undefined
172
- this.openObserver?.disconnect()
173
- this.openObserver = undefined
180
+ this.watch.stop()
181
+ this.openWatch.stop()
174
182
  this.dialogElement?.removeEventListener("close", this.handleClose)
175
183
  this.dialogElement = undefined
176
184
  }
@@ -191,6 +199,13 @@ export class LtDialog extends HostElement {
191
199
 
192
200
  /** The id the component gave the heading, so a patch gets the same one back. */
193
201
  private titleId?: string
202
+ /**
203
+ * The `aria-labelledby` the component wrote on the `<dialog>`. Another
204
+ * value there is the server's, and stays; the component's own follows the
205
+ * title, so a patch that replaces the title does not leave the name
206
+ * pointing at an id that is gone.
207
+ */
208
+ private readonly own = ownership()
194
209
 
195
210
  /** The wiring alone, for an attribute record. See the observer. */
196
211
  private rewire(): void {
@@ -230,8 +245,7 @@ export class LtDialog extends HostElement {
230
245
  private nameless(dialog: HTMLDialogElement): boolean {
231
246
  return (
232
247
  dialog.childElementCount > 0 &&
233
- !dialog.hasAttribute("aria-labelledby") &&
234
- !dialog.hasAttribute("aria-label") &&
248
+ !hasName(dialog) &&
235
249
  this.headingOf(dialog) === null
236
250
  )
237
251
  }
@@ -248,22 +262,27 @@ export class LtDialog extends HostElement {
248
262
  private wire(dialog: HTMLDialogElement): void {
249
263
  addClass(dialog, DIALOG_CLASS)
250
264
 
251
- const named = dialog.getAttribute("aria-labelledby")
252
- if (named) {
265
+ const name = nameFromHeading(this.own, this, dialog, () => {
266
+ const title = this.headingOf(dialog)
267
+ if (!title) return null
268
+ addClass(title, DIALOG_TITLE_CLASS)
269
+ if (!title.id) {
270
+ this.titleId ??= uniqueId("lt-dialog-title")
271
+ setAttr(title, "id", this.titleId)
272
+ }
273
+ return title.id
274
+ })
275
+ if (name === "server") {
253
276
  // The attribute can list several ids. The title is the first one that
254
277
  // is inside the dialog.
278
+ const named = (dialog.getAttribute("aria-labelledby") ?? "").trim()
255
279
  const root = this.getRootNode() as Document | ShadowRoot
256
280
  const title = named
257
281
  .split(/\s+/)
258
282
  .map((id) => root.getElementById?.(id) ?? null)
259
283
  .find((element) => element !== null && dialog.contains(element))
260
284
  if (title) addClass(title, DIALOG_TITLE_CLASS)
261
- return
262
- }
263
- if (dialog.hasAttribute("aria-label")) return
264
-
265
- const title = this.headingOf(dialog)
266
- if (!title) {
285
+ } else if (name === "none") {
267
286
  warnAboutMarkup(
268
287
  this,
269
288
  "the dialog has no name: it has no aria-labelledby, no " +
@@ -275,14 +294,7 @@ export class LtDialog extends HostElement {
275
294
  return now !== null && this.nameless(now)
276
295
  },
277
296
  )
278
- return
279
297
  }
280
- addClass(title, DIALOG_TITLE_CLASS)
281
- if (!title.id) {
282
- this.titleId ??= uniqueId("lt-dialog-title")
283
- setAttr(title, "id", this.titleId)
284
- }
285
- setAttr(dialog, "aria-labelledby", title.id)
286
298
  }
287
299
 
288
300
  private notify(open: boolean, returnValue = ""): void {
@@ -316,14 +328,10 @@ export class LtDialog extends HostElement {
316
328
  */
317
329
  private repairOpen(): void {
318
330
  const dialog = this.dialogElement
319
- if (!dialog?.isConnected || !dialog.matches(":modal") || dialog.open) {
320
- return
321
- }
322
-
323
331
  // The attribute must come back either way: without it `close()` does
324
332
  // nothing, and the dialog stayed in the top layer, invisible, with the
325
333
  // rest of the page inert.
326
- setAttr(dialog, "open", "")
334
+ if (!dialog || !restoreModalOpen(dialog)) return
327
335
  if (!isServerControlled(this)) return
328
336
 
329
337
  /*
@@ -370,8 +378,7 @@ export class LtDialog extends HostElement {
370
378
  // listener stayed attached to a detached node for as long as the host
371
379
  // lived.
372
380
  if (!dialog) {
373
- this.openObserver?.disconnect()
374
- this.openObserver = undefined
381
+ this.openWatch.stop()
375
382
  this.dialogElement?.removeEventListener("close", this.handleClose)
376
383
  this.dialogElement = undefined
377
384
  }
@@ -384,7 +391,8 @@ export class LtDialog extends HostElement {
384
391
  // If the component is detached, a morph is building the server's
385
392
  // version in a separate tree, and there is nothing to report. An
386
393
  // empty element is a region the server has not filled yet.
387
- () => this.childElementCount > 0 && this.dialog === null,
394
+ () => this.dialog === null,
395
+ { silentWhenEmpty: true },
388
396
  )
389
397
  return
390
398
  }
@@ -397,9 +405,7 @@ export class LtDialog extends HostElement {
397
405
  this.dialogElement = dialog
398
406
  dialog.addEventListener("close", this.handleClose)
399
407
 
400
- this.openObserver?.disconnect()
401
- this.openObserver = new MutationObserver(() => this.repairOpen())
402
- this.openObserver.observe(dialog, { attributeFilter: ["open"] })
408
+ this.openWatch.start(dialog)
403
409
  }
404
410
 
405
411
  this.repairOpen()