brumate 0.7.0 → 0.7.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 (59) hide show
  1. package/dist/{boot-Cs_P8cDu.d.ts → boot-CMy0f_iC.d.ts} +2 -2
  2. package/dist/cli.js +2 -2
  3. package/dist/{client-DYIZ7BYK.js → client-Bm0XbjHr.js} +7 -5
  4. package/dist/{client-DYIZ7BYK.js.map → client-Bm0XbjHr.js.map} +1 -1
  5. package/dist/{client-BDPsTd4q.d.ts → client-DnFF9_lv.d.ts} +2 -2
  6. package/dist/{defer-7JDhFxQq.js → defer-BWwxv7Qf.js} +2 -2
  7. package/dist/{defer-7JDhFxQq.js.map → defer-BWwxv7Qf.js.map} +1 -1
  8. package/dist/{devtools-CzSp1GGq.js → devtools-Cl6AhENB.js} +4 -4
  9. package/dist/{devtools-CzSp1GGq.js.map → devtools-Cl6AhENB.js.map} +1 -1
  10. package/dist/{devtools-panel-DugGrz7L.js → devtools-panel-DLIeWcAj.js} +2 -2
  11. package/dist/{devtools-panel-DugGrz7L.js.map → devtools-panel-DLIeWcAj.js.map} +1 -1
  12. package/dist/events-LgLdp1R7.js.map +1 -1
  13. package/dist/{files-XX5yW3KL.js → files-BuQvpBwF.js} +2 -2
  14. package/dist/{files-XX5yW3KL.js.map → files-BuQvpBwF.js.map} +1 -1
  15. package/dist/{html-t1JpkODI.js → html-Cf5uKhLs.js} +3 -3
  16. package/dist/html-Cf5uKhLs.js.map +1 -0
  17. package/dist/index.js +1 -1
  18. package/dist/{inspect-B9cRF6AM.js → inspect-BSHv1_25.js} +70 -7
  19. package/dist/inspect-BSHv1_25.js.map +1 -0
  20. package/dist/{loader-BGSXt_Eb.js → loader-BPNSRA2A.js} +2 -2
  21. package/dist/{loader-BGSXt_Eb.js.map → loader-BPNSRA2A.js.map} +1 -1
  22. package/dist/{rpc-B9EkaPdU.js → rpc-DqfCaYgF.js} +3 -3
  23. package/dist/{rpc-B9EkaPdU.js.map → rpc-DqfCaYgF.js.map} +1 -1
  24. package/dist/runtime/bundles.d.ts +1 -1
  25. package/dist/runtime/client.d.ts +2 -2
  26. package/dist/runtime/client.js +3 -3
  27. package/dist/runtime/devtools.d.ts +2 -2
  28. package/dist/runtime/devtools.js +1 -1
  29. package/dist/runtime/events.d.ts +1 -1
  30. package/dist/runtime/hot.d.ts +1 -1
  31. package/dist/runtime/html.d.ts +1 -1
  32. package/dist/runtime/html.js +1 -1
  33. package/dist/runtime/loader.d.ts +2 -2
  34. package/dist/runtime/loader.js +2 -2
  35. package/dist/runtime/server.d.ts +2 -2
  36. package/dist/runtime/server.js +3 -3
  37. package/dist/runtime/static-loader.d.ts +2 -2
  38. package/dist/runtime/static-loader.js +1 -1
  39. package/dist/runtime/testing.d.ts +2 -2
  40. package/dist/runtime/testing.js +2 -2
  41. package/dist/{search-params-Cy3uRphR.js → search-params-C64liRBj.js} +2 -2
  42. package/dist/{search-params-Cy3uRphR.js.map → search-params-C64liRBj.js.map} +1 -1
  43. package/dist/{server-CavhuoFI.d.ts → server-0rS5vUW1.d.ts} +7 -4
  44. package/dist/{server-C1OTFH4r.js → server-BVObWh-w.js} +8 -5
  45. package/dist/server-BVObWh-w.js.map +1 -0
  46. package/dist/{shared-CRduzyi3.d.ts → shared-CuJdWifz.d.ts} +2 -2
  47. package/dist/{static-loader-D5hvLQK7.d.ts → static-loader-BYbXVJDY.d.ts} +2 -2
  48. package/dist/{static-loader-XGXMzfJR.js → static-loader-V4V1Oy6G.js} +12 -4
  49. package/dist/static-loader-V4V1Oy6G.js.map +1 -0
  50. package/dist/{stream-BBnArf_5.js → stream-RXLadXx1.js} +3 -3
  51. package/dist/{stream-BBnArf_5.js.map → stream-RXLadXx1.js.map} +1 -1
  52. package/dist/vite.d.ts +1 -1
  53. package/dist/vite.js +2 -2
  54. package/elements.d.ts +83 -60
  55. package/package.json +1 -1
  56. package/dist/html-t1JpkODI.js.map +0 -1
  57. package/dist/inspect-B9cRF6AM.js.map +0 -1
  58. package/dist/server-C1OTFH4r.js.map +0 -1
  59. package/dist/static-loader-XGXMzfJR.js.map +0 -1
package/elements.d.ts CHANGED
@@ -40,6 +40,13 @@ export type PropsOf<C> = C extends (props: infer P, ...rest: any[]) => unknown ?
40
40
  /** A value of an attribute: the value, `null` or `undefined` to leave the attribute out. */
41
41
  type Attr<T> = T | null | undefined;
42
42
 
43
+ /**
44
+ * The keywords `S` as HTML matches an enumerated attribute, without regard to case: in lower
45
+ * case, in upper case, or with a capital first letter, so `'submit'` also takes `'SUBMIT'` and
46
+ * `'Submit'`. Other mixes of case are left out, so a type error lists a short union.
47
+ */
48
+ type Keyword<S extends string> = S | Uppercase<S> | Capitalize<S>;
49
+
43
50
  /**
44
51
  * The events of an element, by the name of the event. An app that sends its own events from
45
52
  * an element adds them: `interface ElementEvents { itemaction: CustomEvent<string> }`.
@@ -501,23 +508,27 @@ export type GlobalAttributes<E> = Handlers<E> &
501
508
  role?: Attr<AriaRole | `${AriaRole} ${string}`>;
502
509
  title?: Attr<string>;
503
510
  lang?: Attr<string>;
504
- dir?: Attr<'ltr' | 'rtl' | 'auto'>;
511
+ dir?: Attr<Keyword<'ltr' | 'rtl' | 'auto'>>;
505
512
  nonce?: Attr<string>;
506
513
  accesskey?: Attr<string>;
507
- autocapitalize?: Attr<'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'>;
514
+ autocapitalize?: Attr<
515
+ '' | Keyword<'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'>
516
+ >;
508
517
  autofocus?: Attr<boolean>;
509
- contenteditable?: Attr<boolean | 'true' | 'false' | 'plaintext-only'>;
510
- draggable?: Attr<boolean | 'true' | 'false'>;
511
- enterkeyhint?: Attr<'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'>;
512
- hidden?: Attr<boolean | 'hidden' | 'until-found'>;
518
+ contenteditable?: Attr<boolean | '' | Keyword<'true' | 'false' | 'plaintext-only'>>;
519
+ draggable?: Attr<boolean | Keyword<'true' | 'false'>>;
520
+ enterkeyhint?: Attr<Keyword<'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'>>;
521
+ hidden?: Attr<boolean | '' | Keyword<'hidden' | 'until-found'>>;
513
522
  inert?: Attr<boolean>;
514
- inputmode?: Attr<'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'>;
515
- popover?: Attr<boolean | 'auto' | 'manual' | 'hint'>;
516
- spellcheck?: Attr<boolean | 'true' | 'false'>;
523
+ inputmode?: Attr<
524
+ Keyword<'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'>
525
+ >;
526
+ popover?: Attr<boolean | '' | Keyword<'auto' | 'manual' | 'hint'>>;
527
+ spellcheck?: Attr<boolean | '' | Keyword<'true' | 'false'>>;
517
528
  tabindex?: Attr<Num>;
518
- translate?: Attr<'yes' | 'no'>;
519
- writingsuggestions?: Attr<boolean | 'true' | 'false'>;
520
- autocorrect?: Attr<boolean | 'on' | 'off'>;
529
+ translate?: Attr<'' | Keyword<'yes' | 'no'>>;
530
+ writingsuggestions?: Attr<boolean | '' | Keyword<'true' | 'false'>>;
531
+ autocorrect?: Attr<boolean | '' | Keyword<'on' | 'off'>>;
521
532
  exportparts?: Attr<string>;
522
533
  itemid?: Attr<string>;
523
534
  itemprop?: Attr<string>;
@@ -528,7 +539,7 @@ export type GlobalAttributes<E> = Handlers<E> &
528
539
  [attribute: `aria-${string}`]: Attr<string | number | boolean>;
529
540
  };
530
541
 
531
- type Referrer =
542
+ type Referrer = Keyword<
532
543
  | 'no-referrer'
533
544
  | 'no-referrer-when-downgrade'
534
545
  | 'origin'
@@ -536,8 +547,9 @@ type Referrer =
536
547
  | 'same-origin'
537
548
  | 'strict-origin'
538
549
  | 'strict-origin-when-cross-origin'
539
- | 'unsafe-url';
540
- type CrossOrigin = boolean | 'anonymous' | 'use-credentials';
550
+ | 'unsafe-url'
551
+ >;
552
+ type CrossOrigin = boolean | '' | Keyword<'anonymous' | 'use-credentials'>;
541
553
  type Size = number | string;
542
554
 
543
555
  // A value of a list of tokens: one token or more, with other text after it.
@@ -671,7 +683,7 @@ interface MediaOwn {
671
683
  autoplay?: Attr<boolean>;
672
684
  loop?: Attr<boolean>;
673
685
  muted?: Attr<boolean>;
674
- preload?: Attr<'none' | 'metadata' | 'auto' | ''>;
686
+ preload?: Attr<'' | Keyword<'none' | 'metadata' | 'auto'>>;
675
687
  crossorigin?: Attr<CrossOrigin>;
676
688
  controlslist?: Attr<string>;
677
689
  disableremoteplayback?: Attr<boolean>;
@@ -684,15 +696,17 @@ interface FormControlOwn {
684
696
  }
685
697
 
686
698
  interface ButtonOwn extends FormControlOwn {
687
- type?: Attr<'button' | 'submit' | 'reset'>;
699
+ type?: Attr<Keyword<'button' | 'submit' | 'reset'>>;
688
700
  value?: Attr<string | number>;
689
701
  formaction?: Attr<string | ServerFunction>;
690
- formenctype?: Attr<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>;
691
- formmethod?: Attr<'get' | 'post' | 'dialog'>;
702
+ formenctype?: Attr<
703
+ Keyword<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>
704
+ >;
705
+ formmethod?: Attr<Keyword<'get' | 'post' | 'dialog'>>;
692
706
  formnovalidate?: Attr<boolean>;
693
707
  formtarget?: Attr<string>;
694
708
  popovertarget?: Attr<string>;
695
- popovertargetaction?: Attr<'show' | 'hide' | 'toggle'>;
709
+ popovertargetaction?: Attr<Keyword<'show' | 'hide' | 'toggle'>>;
696
710
  command?: Attr<
697
711
  | 'show-modal'
698
712
  | 'close'
@@ -708,35 +722,37 @@ interface ButtonOwn extends FormControlOwn {
708
722
 
709
723
  interface InputOwn extends FormControlOwn {
710
724
  type?: Attr<
711
- | 'button'
712
- | 'checkbox'
713
- | 'color'
714
- | 'date'
715
- | 'datetime-local'
716
- | 'email'
717
- | 'file'
718
- | 'hidden'
719
- | 'image'
720
- | 'month'
721
- | 'number'
722
- | 'password'
723
- | 'radio'
724
- | 'range'
725
- | 'reset'
726
- | 'search'
727
- | 'submit'
728
- | 'tel'
729
- | 'text'
730
- | 'time'
731
- | 'url'
732
- | 'week'
725
+ Keyword<
726
+ | 'button'
727
+ | 'checkbox'
728
+ | 'color'
729
+ | 'date'
730
+ | 'datetime-local'
731
+ | 'email'
732
+ | 'file'
733
+ | 'hidden'
734
+ | 'image'
735
+ | 'month'
736
+ | 'number'
737
+ | 'password'
738
+ | 'radio'
739
+ | 'range'
740
+ | 'reset'
741
+ | 'search'
742
+ | 'submit'
743
+ | 'tel'
744
+ | 'text'
745
+ | 'time'
746
+ | 'url'
747
+ | 'week'
748
+ >
733
749
  >;
734
750
  value?: Attr<string | number | BoundValue>;
735
751
  checked?: Attr<boolean | BoundChecked>;
736
752
  accept?: Attr<string>;
737
753
  alt?: Attr<string>;
738
754
  autocomplete?: Attr<Autocomplete>;
739
- capture?: Attr<boolean | 'user' | 'environment'>;
755
+ capture?: Attr<boolean | '' | Keyword<'user' | 'environment'>>;
740
756
  dirname?: Attr<string>;
741
757
  webkitdirectory?: Attr<boolean>;
742
758
  list?: Attr<string>;
@@ -755,12 +771,14 @@ interface InputOwn extends FormControlOwn {
755
771
  width?: Attr<Size>;
756
772
  height?: Attr<Size>;
757
773
  formaction?: Attr<string | ServerFunction>;
758
- formenctype?: Attr<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>;
759
- formmethod?: Attr<'get' | 'post' | 'dialog'>;
774
+ formenctype?: Attr<
775
+ Keyword<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>
776
+ >;
777
+ formmethod?: Attr<Keyword<'get' | 'post' | 'dialog'>>;
760
778
  formnovalidate?: Attr<boolean>;
761
779
  formtarget?: Attr<string>;
762
780
  popovertarget?: Attr<string>;
763
- popovertargetaction?: Attr<'show' | 'hide' | 'toggle'>;
781
+ popovertargetaction?: Attr<Keyword<'show' | 'hide' | 'toggle'>>;
764
782
  }
765
783
 
766
784
  interface TextareaOwn extends FormControlOwn {
@@ -773,7 +791,7 @@ interface TextareaOwn extends FormControlOwn {
773
791
  readonly?: Attr<boolean>;
774
792
  required?: Attr<boolean>;
775
793
  rows?: Attr<Num>;
776
- wrap?: Attr<'hard' | 'soft' | 'off'>;
794
+ wrap?: Attr<Keyword<'hard' | 'soft' | 'off'>>;
777
795
  value?: Attr<string | BoundValue>;
778
796
  }
779
797
 
@@ -1018,7 +1036,7 @@ export interface Elements {
1018
1036
  dfn: Html<'dfn'>;
1019
1037
  dialog: Html<
1020
1038
  'dialog',
1021
- { open?: Attr<boolean>; closedby?: Attr<'any' | 'closerequest' | 'none'> }
1039
+ { open?: Attr<boolean>; closedby?: Attr<Keyword<'any' | 'closerequest' | 'none'>> }
1022
1040
  >;
1023
1041
  div: Html<'div'>;
1024
1042
  dl: Html<'dl'>;
@@ -1036,11 +1054,13 @@ export interface Elements {
1036
1054
  'form',
1037
1055
  {
1038
1056
  action?: Attr<string | ServerFunction>;
1039
- method?: Attr<'get' | 'post' | 'dialog'>;
1040
- enctype?: Attr<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>;
1057
+ method?: Attr<Keyword<'get' | 'post' | 'dialog'>>;
1058
+ enctype?: Attr<
1059
+ Keyword<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>
1060
+ >;
1041
1061
  target?: Attr<string>;
1042
1062
  novalidate?: Attr<boolean>;
1043
- autocomplete?: Attr<boolean | 'on' | 'off'>;
1063
+ autocomplete?: Attr<boolean | Keyword<'on' | 'off'>>;
1044
1064
  name?: Attr<string>;
1045
1065
  rel?: Attr<string>;
1046
1066
  'accept-charset'?: Attr<string>;
@@ -1068,7 +1088,7 @@ export interface Elements {
1068
1088
  height?: Attr<Size>;
1069
1089
  allow?: Attr<string>;
1070
1090
  allowfullscreen?: Attr<boolean>;
1071
- loading?: Attr<'eager' | 'lazy'>;
1091
+ loading?: Attr<Keyword<'eager' | 'lazy'>>;
1072
1092
  referrerpolicy?: Attr<Referrer>;
1073
1093
  sandbox?: Attr<'' | Tokens<SandboxToken> | (string & {})>;
1074
1094
  }
@@ -1082,13 +1102,13 @@ export interface Elements {
1082
1102
  sizes?: Attr<string>;
1083
1103
  width?: Attr<Size>;
1084
1104
  height?: Attr<Size>;
1085
- loading?: Attr<'eager' | 'lazy'>;
1086
- decoding?: Attr<'sync' | 'async' | 'auto'>;
1105
+ loading?: Attr<Keyword<'eager' | 'lazy'>>;
1106
+ decoding?: Attr<Keyword<'sync' | 'async' | 'auto'>>;
1087
1107
  crossorigin?: Attr<CrossOrigin>;
1088
1108
  usemap?: Attr<string>;
1089
1109
  ismap?: Attr<boolean>;
1090
1110
  referrerpolicy?: Attr<Referrer>;
1091
- fetchpriority?: Attr<'high' | 'low' | 'auto'>;
1111
+ fetchpriority?: Attr<Keyword<'high' | 'low' | 'auto'>>;
1092
1112
  }
1093
1113
  >;
1094
1114
  input: Html<'input', InputOwn>;
@@ -1112,7 +1132,7 @@ export interface Elements {
1112
1132
  imagesrcset?: Attr<string>;
1113
1133
  imagesizes?: Attr<string>;
1114
1134
  referrerpolicy?: Attr<Referrer>;
1115
- fetchpriority?: Attr<'high' | 'low' | 'auto'>;
1135
+ fetchpriority?: Attr<Keyword<'high' | 'low' | 'auto'>>;
1116
1136
  disabled?: Attr<boolean>;
1117
1137
  blocking?: Attr<'render' | (string & {})>;
1118
1138
  }
@@ -1200,7 +1220,7 @@ export interface Elements {
1200
1220
  crossorigin?: Attr<CrossOrigin>;
1201
1221
  integrity?: Attr<string>;
1202
1222
  referrerpolicy?: Attr<Referrer>;
1203
- fetchpriority?: Attr<'high' | 'low' | 'auto'>;
1223
+ fetchpriority?: Attr<Keyword<'high' | 'low' | 'auto'>>;
1204
1224
  blocking?: Attr<'render' | (string & {})>;
1205
1225
  }
1206
1226
  >;
@@ -1249,7 +1269,7 @@ export interface Elements {
1249
1269
  template: Html<
1250
1270
  'template',
1251
1271
  {
1252
- shadowrootmode?: Attr<'open' | 'closed'>;
1272
+ shadowrootmode?: Attr<Keyword<'open' | 'closed'>>;
1253
1273
  shadowrootclonable?: Attr<boolean>;
1254
1274
  shadowrootdelegatesfocus?: Attr<boolean>;
1255
1275
  shadowrootserializable?: Attr<boolean>;
@@ -1260,7 +1280,10 @@ export interface Elements {
1260
1280
  tfoot: Html<'tfoot'>;
1261
1281
  th: Html<
1262
1282
  'th',
1263
- TableCellOwn & { scope?: Attr<'row' | 'col' | 'rowgroup' | 'colgroup'>; abbr?: Attr<string> }
1283
+ TableCellOwn & {
1284
+ scope?: Attr<Keyword<'row' | 'col' | 'rowgroup' | 'colgroup'>>;
1285
+ abbr?: Attr<string>;
1286
+ }
1264
1287
  >;
1265
1288
  thead: Html<'thead'>;
1266
1289
  time: Html<'time', { datetime?: Attr<string> }>;
@@ -1270,7 +1293,7 @@ export interface Elements {
1270
1293
  'track',
1271
1294
  {
1272
1295
  default?: Attr<boolean>;
1273
- kind?: Attr<'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'>;
1296
+ kind?: Attr<Keyword<'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'>>;
1274
1297
  label?: Attr<string>;
1275
1298
  src?: Attr<string>;
1276
1299
  srclang?: Attr<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brumate",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "A component language and compiler for resumable web apps",
5
5
  "homepage": "https://github.com/lxsmnsyc/brumate",
6
6
  "bugs": "https://github.com/lxsmnsyc/brumate/issues",
@@ -1 +0,0 @@
1
- {"version":3,"file":"html-t1JpkODI.js","names":[],"sources":["../src/runtime/html.ts"],"sourcesContent":["// HTML string helpers that the server and the client both use.\n\nimport type { ScopeId } from './shared.ts';\n\nconst RAW: unique symbol = Symbol.for('brumate.raw');\nconst INTERNAL: unique symbol = Symbol.for('brumate.internal');\n\n/** HTML that is inserted as it is, such as the output of a template. */\nexport interface Raw {\n [RAW]: string;\n /** For the output of a template, the ID of its scope, which the insert links to its call. */\n s?: ScopeId;\n}\n\n// A class, not an object literal, so serializers can skip their test for raw HTML on plain objects.\nclass RawHTML implements Raw {\n readonly [RAW]: string;\n readonly s?: ScopeId;\n\n constructor(html: string, scope?: ScopeId) {\n this[RAW] = html;\n this.s = scope;\n }\n}\n\nexport function raw(html: string, scope?: ScopeId): Raw {\n return new RawHTML(html, scope);\n}\n\nexport function isRaw(value: unknown): value is Raw {\n return typeof value === 'object' && value !== null && RAW in value;\n}\n\nexport function rawHTML(value: Raw): string {\n return value[RAW];\n}\n\nconst ESCAPES: Record<string, string> = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;' };\n\nfunction toEscape(char: string): string {\n return ESCAPES[char]!;\n}\n\n// Most text has nothing to escape, so a test without the global flag skips the replace.\nexport function escape(value: string): string {\n return /[&<>]/.test(value) ? value.replace(/[&<>]/g, toEscape) : value;\n}\n\nexport function escapeAttribute(value: string): string {\n return /[&<\"]/.test(value) ? value.replace(/[&<\"]/g, toEscape) : value;\n}\n\n/** True for a promise, or any object with a `then` function, as the server awaits it. */\nfunction isThenable(value: unknown): boolean {\n return (\n value !== null &&\n (typeof value === 'object' || typeof value === 'function') &&\n typeof (value as PromiseLike<unknown>).then === 'function'\n );\n}\n\n/** Renders a value inserted in markup. A promise is not awaited: it renders empty. */\nexport function insertValue(value: unknown): string {\n if (isRaw(value)) {\n return value[RAW];\n }\n // A memo of a promise that is still loading: empty until its value lands.\n if (value === null || value === undefined || typeof value === 'boolean' || isThenable(value)) {\n return '';\n }\n if (Array.isArray(value)) {\n let result = '';\n for (const item of value) {\n result += insertValue(item);\n }\n return result;\n }\n return escape(String(value));\n}\n\n/**\n * Renders a value as the text of an element whose content is text, such as\n * a `<textarea>`, as `insertValue` does but without escaping.\n */\nexport function textValue(value: unknown): string {\n if (isRaw(value)) {\n return value[RAW];\n }\n if (value === null || value === undefined || typeof value === 'boolean' || isThenable(value)) {\n return '';\n }\n if (Array.isArray(value)) {\n let result = '';\n for (const item of value) {\n result += textValue(item);\n }\n return result;\n }\n return String(value);\n}\n\nfunction toKebabCase(name: string): string {\n return name.startsWith('--') ? name : name.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);\n}\n\nexport function classValue(value: unknown): string {\n if (typeof value !== 'object' || value === null) {\n return value ? String(value) : '';\n }\n let text = '';\n if (Array.isArray(value)) {\n for (const item of value) {\n const part = classValue(item);\n if (part !== '') {\n text = text === '' ? part : `${text} ${part}`;\n }\n }\n return text;\n }\n // An empty name still adds a space between its neighbours, as in a join.\n let first = true;\n for (const name in value) {\n if (Object.hasOwn(value, name) && (value as Record<string, unknown>)[name]) {\n text = first ? name : `${text} ${name}`;\n first = false;\n }\n }\n return text;\n}\n\n/**\n * Renders a `class` attribute from classes that each have a space before\n * them, which the compiler builds from a literal class value. The classes\n * are escaped already. No class renders nothing.\n */\nexport function classAttribute(classes: string): string {\n return classes === '' ? '' : ` class=\"${classes.slice(1)}\"`;\n}\n\nfunction styleValue(value: unknown): string {\n if (typeof value === 'object' && value !== null) {\n const declarations: string[] = [];\n for (const [name, item] of Object.entries(value)) {\n if (item !== null && item !== undefined && item !== false) {\n declarations.push(`${toKebabCase(name)}:${String(item)}`);\n }\n }\n return declarations.join(';');\n }\n return String(value);\n}\n\n/** The brand of a binding of `$bind`, under the key of the registry. See `Binding`. */\nconst BOUND = Symbol.for('brumate.binding');\n\n/** The words of an attribute that says `true` or `false` in its value. */\nconst TRUE_FALSE = ['true', 'false'] as const;\n\n/**\n * Attributes whose two states are words in the value, not whether the\n * attribute is there, by their words for `true` and `false`. A missing\n * attribute means a third state, such as the default of the element, so\n * `false` must not remove it. `aria-*` and `data-*` are such attributes too.\n */\nconst SWITCHES = new Map<string, readonly [string, string]>([\n ['contenteditable', TRUE_FALSE],\n ['draggable', TRUE_FALSE],\n ['spellcheck', TRUE_FALSE],\n ['writingsuggestions', TRUE_FALSE],\n // SVG.\n ['focusable', TRUE_FALSE],\n ['translate', ['yes', 'no']],\n ['autocomplete', ['on', 'off']],\n ['autocorrect', ['on', 'off']],\n]);\n\n/** The words of `true` and `false` for an attribute that says them in its value, or undefined. */\nfunction switchWords(name: string): readonly [string, string] | undefined {\n const lower = name.toLowerCase();\n if (lower.startsWith('aria-') || lower.startsWith('data-')) {\n return TRUE_FALSE;\n }\n return SWITCHES.get(lower);\n}\n\n/**\n * Returns the text of an attribute, or undefined if the attribute is not\n * rendered.\n *\n * - `null` and `undefined` leave the attribute out.\n * - For an attribute whose value says its state, such as `aria-expanded`,\n * `draggable` or `translate`, `true` and `false` render as its words:\n * `\"true\"` and `\"false\"`, or `\"yes\"` and `\"no\"`, or `\"on\"` and `\"off\"`.\n * - For other attributes, such as `disabled`, `true` renders the attribute\n * without a value, and `false` leaves it out.\n */\nexport function attributeText(name: string, value: unknown): string | undefined {\n // `value=$bind(name)` on an element renders the value of the name.\n if (typeof value === 'object' && value !== null && BOUND in value) {\n // A `ref` is no attribute: the element goes to its signal.\n if (name === 'ref') {\n return undefined;\n }\n value = (value as unknown as { value: unknown }).value;\n }\n // A promise is a memo that is still loading: the attribute is absent until its value lands.\n if (value === null || value === undefined || typeof value === 'function' || isThenable(value)) {\n return undefined;\n }\n if (typeof value === 'boolean') {\n const words = switchWords(name);\n if (words) {\n return value ? words[0] : words[1];\n }\n return value ? '' : undefined;\n }\n if (name === 'class') {\n const text = classValue(value);\n return text === '' ? undefined : text;\n }\n return name === 'style' ? styleValue(value) : String(value);\n}\n\n/**\n * A name that HTML reads as one attribute. A spread takes its names from\n * data, so a name with a space, a quote, `>`, `/` or `=` could write other\n * attributes or markup.\n */\n// oxlint-disable-next-line no-control-regex -- HTML reads no control character in a name.\nconst ATTRIBUTE_NAME = /^[^\\s\"'>/=\\x00-\\x1f\\x7f]+$/;\n\n/** Renders one attribute, with a leading space. A name that is not one attribute renders nothing. */\nexport function attribute(name: string, value: unknown): string {\n const text = attributeText(name, value);\n if (text === undefined || !ATTRIBUTE_NAME.test(name)) {\n return '';\n }\n return value === true && text === '' ? ` ${name}` : ` ${name}=\"${escapeAttribute(text)}\"`;\n}\n\n/**\n * Returns the value of a style variable with text around it, such as `12px`\n * for `${size}px`. A value that sets no variable stays as it is.\n */\nexport function affix(prefix: string, value: unknown, suffix: string): unknown {\n return value === null || value === undefined || value === false\n ? value\n : `${prefix}${String(value)}${suffix}`;\n}\n\n/** Returns a style with custom properties before an element's own style. */\nexport function vars(variables: Record<string, unknown>, own: unknown): string {\n const parts: string[] = [];\n for (const [name, value] of Object.entries(variables)) {\n if (value !== null && value !== undefined && value !== false) {\n parts.push(`${name}:${String(value)}`);\n }\n }\n const rest = own === null || own === undefined || own === false ? '' : styleValue(own);\n if (rest) {\n parts.push(rest);\n }\n return parts.join(';');\n}\n\n/** Returns a `<style>` element for a component's stylesheet. */\nexport function styleElement(id: string, css: string): string {\n return `<style b-style=\"${escapeAttribute(id)}\">${css.replace(/<\\/style/gi, '<\\\\/style')}</style>`;\n}\n\n/**\n * Merges the attributes of an element that has spreads, in their order: a\n * later value wins, except `class`, whose values all apply.\n */\n/**\n * A value of an attribute that brumate writes, such as the `b-on` of a dynamic tag, which the\n * compiler wraps. An object of attributes, such as a spread, writes a `b-` attribute only with\n * one, so data from outside the app cannot name handlers or scopes.\n */\nexport class Internal {\n readonly value: unknown;\n\n constructor(value: unknown) {\n this.value = value;\n }\n}\n\n// The brand sits on the prototype, so an instance does not carry a field for it.\n(Internal.prototype as unknown as Record<symbol, boolean>)[INTERNAL] = true;\n\n/** True for an `Internal`, also one that another copy of the runtime made. */\nexport function isInternal(value: unknown): value is Internal {\n return typeof value === 'object' && value !== null && INTERNAL in value;\n}\n\n/** Wraps the value of an attribute that brumate writes. See `Internal`. */\nexport function internal(value: unknown): Internal {\n return new Internal(value);\n}\n\n/** The value of an attribute of an object, or undefined for a `b-` attribute from outside. */\nexport function ownValue(name: string, value: unknown): unknown {\n if (isInternal(value)) {\n return value.value;\n }\n return name.startsWith('b-') ? undefined : value;\n}\n\nexport function mergeAttributes(\n parts: Record<string, unknown>[],\n variables?: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const part of parts) {\n for (const [name, value] of Object.entries(part ?? {})) {\n // A `b-` attribute from outside the app does not take the place of brumate's own.\n if (name.startsWith('b-') && !isInternal(value)) {\n continue;\n }\n result[name] =\n name === 'class' && result.class !== undefined && value !== undefined\n ? [result.class, value]\n : value;\n }\n }\n // The style variables of the component come before the style that won, whoever gave it.\n if (variables) {\n result.style = vars(variables, result.style);\n }\n return result;\n}\n\n/**\n * The `b-on` entry of a handler that a spread passes on, such as\n * `click:prevent=Parent#h1@3`: its event, the modifiers of its wrappers, its\n * client function and the scope it runs in. A handler that `$handler` made\n * has its arguments after another `@`, encoded so that they hold no space.\n */\nexport function handlerEntry(\n name: string,\n ref: string,\n scope: number | string,\n modifiers: readonly string[] = [],\n args?: unknown[],\n): string {\n const bound = args === undefined ? '' : `@${encodeURIComponent(JSON.stringify(args))}`;\n return `${[name.slice(2).toLowerCase(), ...modifiers].join(':')}=${ref}@${scope}${bound}`;\n}\n\n/**\n * The `b-on` entry of a binding that a spread puts on `value` or `checked`\n * of an element. It names the scope of the slot, or of the setter of\n * `$bind(name, fn)`, after `@`. A box writes on `change`.\n */\nexport function bindEntry(\n name: string,\n ref: { scope: number | string; slot: number },\n setter?: { ref: string; scope: number | string },\n): string {\n const event = name === 'checked' ? 'change' : 'input';\n return setter\n ? `${event}=$set:${setter.ref}@${setter.scope}`\n : `${event}=$bind#0.${ref.slot}@${ref.scope}`;\n}\n\n/**\n * The `b-on` attribute of an element with spreads: the bindings of its\n * spreads, so its handlers read the new value, then its own handlers, then\n * those of its spreads.\n */\nexport function onAttribute(on: string[], own: string): string {\n const value = onValue(on, own);\n return value ? ` b-on=\"${escapeAttribute(value)}\"` : '';\n}\n\n/** The value of `b-on`, in the order of `onAttribute`. */\nexport function onValue(on: string[], own: string): string {\n const bindings: string[] = [];\n const rest: string[] = [];\n for (const entry of on) {\n if (/=\\$(bind#|set:)/.test(entry)) {\n bindings.push(entry);\n } else {\n rest.push(entry);\n }\n }\n const parts: string[] = [];\n for (const part of [...bindings, own, ...rest]) {\n if (part) {\n parts.push(part);\n }\n }\n return parts.join(' ');\n}\n\n/** Renders an object of attributes. */\nexport function spread(attributes: Record<string, unknown>, names = false): string {\n let result = '';\n const written: string[] = [];\n for (const [name, value] of Object.entries(attributes)) {\n if (name !== 'children' && !/^on[A-Z]/.test(name)) {\n const text = attribute(name, ownValue(name, value));\n if (text) {\n result += text;\n written.push(name);\n }\n }\n }\n // `b-s` names the attributes of a spread that changes in the browser. Its first update there\n // removes only those, so a spread that wrote none still writes it, empty.\n return names ? `${result} b-s=\"${written.join(' ')}\"` : result;\n}\n\nexport const VOID_ELEMENTS: Set<string> = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'source',\n 'track',\n 'wbr',\n]);\n\n/**\n * Renders the attributes of a form that posts to a server function, such as\n * ` action=\"/_brumate/App_1abc%23save\" method=\"post\"`. `method` is the name of\n * the method attribute to add, if the element has none. `build` is the ID\n * of the build of the page, which the URL carries as `__build`, so the\n * server can tell a post from before a deploy without scripts.\n */\nexport function actionAttributes(\n prefix: string,\n name: string,\n id: string,\n method?: string,\n result?: string,\n build?: string,\n key?: string,\n): string {\n const methodText = method ? ` ${method}=\"post\"` : '';\n // The key of a form of a function that `idempotent` made, so a second post gets the first result.\n const params: string[] = [];\n if (build !== undefined) {\n params.push(`__build=${encodeURIComponent(build)}`);\n }\n if (key !== undefined) {\n params.push(`__key=${key}`);\n }\n const query = params.join('&');\n if (result !== undefined) {\n // The form posts to its page, which renders with the result. With the\n // loader, the result is written into the `$action` at `result` instead.\n const url = `?__action=${encodeURIComponent(id)}${query ? `&${query}` : ''}`;\n return ` ${name}=\"${escapeAttribute(url)}\"${methodText} b-action=\"${escapeAttribute(id)}\" b-result=\"${escapeAttribute(result)}\"`;\n }\n const url = `${prefix}/${encodeURIComponent(id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