brumate 0.6.2 → 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 (96) hide show
  1. package/check.d.ts +3 -3
  2. package/dist/{boot-DkbcqdUz.d.ts → boot-CMy0f_iC.d.ts} +2 -2
  3. package/dist/cli.js +77 -6
  4. package/dist/cli.js.map +1 -1
  5. package/dist/{client-C3vRNuLi.js → client-Bm0XbjHr.js} +274 -113
  6. package/dist/client-Bm0XbjHr.js.map +1 -0
  7. package/dist/{client-CqGDbWd_.d.ts → client-DnFF9_lv.d.ts} +40 -14
  8. package/dist/{client-routes-BtGpYCef.js → client-routes-BmPvNr4s.js} +10 -1
  9. package/dist/client-routes-BmPvNr4s.js.map +1 -0
  10. package/dist/{context-btHuB01Z.d.ts → context-BNgBXVUQ.d.ts} +7 -5
  11. package/dist/{context-CTiSzQRc.js → context-CU4Fpn5a.js} +10 -13
  12. package/dist/context-CU4Fpn5a.js.map +1 -0
  13. package/dist/{defer-M18UKyfG.js → defer-BWwxv7Qf.js} +2 -2
  14. package/dist/{defer-M18UKyfG.js.map → defer-BWwxv7Qf.js.map} +1 -1
  15. package/dist/{devtools-D9Q7a41M.js → devtools-Cl6AhENB.js} +4 -4
  16. package/dist/{devtools-D9Q7a41M.js.map → devtools-Cl6AhENB.js.map} +1 -1
  17. package/dist/{devtools-panel-DTQtljeA.js → devtools-panel-DLIeWcAj.js} +32 -9
  18. package/dist/devtools-panel-DLIeWcAj.js.map +1 -0
  19. package/dist/events-LgLdp1R7.js.map +1 -1
  20. package/dist/{features-CbgII-o7.js → features-DwMYKBIC.js} +6 -2
  21. package/dist/features-DwMYKBIC.js.map +1 -0
  22. package/dist/{files-DtDH5AR4.js → files-BuQvpBwF.js} +94 -3
  23. package/dist/files-BuQvpBwF.js.map +1 -0
  24. package/dist/{html-t1JpkODI.js → html-Cf5uKhLs.js} +3 -3
  25. package/dist/html-Cf5uKhLs.js.map +1 -0
  26. package/dist/index.d.ts +44 -0
  27. package/dist/index.js +3 -3
  28. package/dist/index.js.map +1 -1
  29. package/dist/{inspect-Bonq6EJO.js → inspect-BSHv1_25.js} +2739 -2080
  30. package/dist/inspect-BSHv1_25.js.map +1 -0
  31. package/dist/{loader-C-S3yzep.js → loader-BPNSRA2A.js} +5 -5
  32. package/dist/{loader-C-S3yzep.js.map → loader-BPNSRA2A.js.map} +1 -1
  33. package/dist/{rpc-C_znDZ_w.js → rpc-DqfCaYgF.js} +3 -3
  34. package/dist/{rpc-C_znDZ_w.js.map → rpc-DqfCaYgF.js.map} +1 -1
  35. package/dist/runtime/bundles.d.ts +1 -1
  36. package/dist/runtime/bundles.js +2 -0
  37. package/dist/runtime/bundles.js.map +1 -1
  38. package/dist/runtime/client.d.ts +4 -4
  39. package/dist/runtime/client.js +5 -5
  40. package/dist/runtime/context.d.ts +2 -2
  41. package/dist/runtime/context.js +1 -1
  42. package/dist/runtime/devtools.d.ts +2 -2
  43. package/dist/runtime/devtools.js +1 -1
  44. package/dist/runtime/events.d.ts +1 -1
  45. package/dist/runtime/hot.d.ts +1 -1
  46. package/dist/runtime/html.d.ts +1 -1
  47. package/dist/runtime/html.js +1 -1
  48. package/dist/runtime/loader.d.ts +2 -2
  49. package/dist/runtime/loader.js +2 -2
  50. package/dist/runtime/server.d.ts +4 -4
  51. package/dist/runtime/server.js +5 -5
  52. package/dist/runtime/signals.d.ts +2 -2
  53. package/dist/runtime/signals.js +43 -5
  54. package/dist/runtime/signals.js.map +1 -1
  55. package/dist/runtime/static-loader.d.ts +2 -2
  56. package/dist/runtime/static-loader.js +1 -1
  57. package/dist/runtime/store.d.ts +2 -0
  58. package/dist/runtime/store.js +1 -0
  59. package/dist/runtime/testing.d.ts +2 -2
  60. package/dist/runtime/testing.js +2 -2
  61. package/dist/{search-params-CM1RWR2P.js → search-params-C64liRBj.js} +34 -9
  62. package/dist/search-params-C64liRBj.js.map +1 -0
  63. package/dist/{server-dP_ucRiJ.d.ts → server-0rS5vUW1.d.ts} +37 -10
  64. package/dist/{server-BcT9icQ4.js → server-BVObWh-w.js} +132 -16
  65. package/dist/server-BVObWh-w.js.map +1 -0
  66. package/dist/{shared-CzbnWkVA.d.ts → shared-CuJdWifz.d.ts} +16 -3
  67. package/dist/{signals-BwD4u22K.d.ts → signals-DBnq9QRW.d.ts} +46 -6
  68. package/dist/{static-loader-DysAET-w.d.ts → static-loader-BYbXVJDY.d.ts} +2 -2
  69. package/dist/{static-loader-Bt2WDkY1.js → static-loader-V4V1Oy6G.js} +13 -5
  70. package/dist/static-loader-V4V1Oy6G.js.map +1 -0
  71. package/dist/store-BIBAYZo-.js +293 -0
  72. package/dist/store-BIBAYZo-.js.map +1 -0
  73. package/dist/store-xlTzAM_r.d.ts +171 -0
  74. package/dist/{stream-DRjx0keF.js → stream-RXLadXx1.js} +90 -4
  75. package/dist/stream-RXLadXx1.js.map +1 -0
  76. package/dist/vite.d.ts +1 -1
  77. package/dist/vite.js +128 -13
  78. package/dist/vite.js.map +1 -1
  79. package/elements.d.ts +349 -79
  80. package/package.json +5 -1
  81. package/skills/brumate/SKILL.md +1 -1
  82. package/skills/brumate/references/errors.md +127 -9
  83. package/skills/brumate/references/signals.md +37 -30
  84. package/skills/brumate/references/state.md +3 -2
  85. package/dist/client-C3vRNuLi.js.map +0 -1
  86. package/dist/client-routes-BtGpYCef.js.map +0 -1
  87. package/dist/context-CTiSzQRc.js.map +0 -1
  88. package/dist/devtools-panel-DTQtljeA.js.map +0 -1
  89. package/dist/features-CbgII-o7.js.map +0 -1
  90. package/dist/files-DtDH5AR4.js.map +0 -1
  91. package/dist/html-t1JpkODI.js.map +0 -1
  92. package/dist/inspect-Bonq6EJO.js.map +0 -1
  93. package/dist/search-params-CM1RWR2P.js.map +0 -1
  94. package/dist/server-BcT9icQ4.js.map +0 -1
  95. package/dist/static-loader-Bt2WDkY1.js.map +0 -1
  96. package/dist/stream-DRjx0keF.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> }`.
@@ -51,7 +58,8 @@ type Num = number | `${number}`;
51
58
 
52
59
  /**
53
60
  * A handler of the event `Ev` on the element `E`, which is `event.currentTarget`. Use it to type
54
- * a function that a handler prop takes: `EventHandler<HTMLButtonElement, MouseEvent>`.
61
+ * a function that a handler prop takes: `EventHandler<HTMLButtonElement, MouseEvent>`. Its
62
+ * `target` stays `EventTarget`; for the typed target of a form control, use `ElementEvent`.
55
63
  */
56
64
  export type EventHandler<E, Ev = Event> = (event: Ev & { currentTarget: E }) => unknown;
57
65
 
@@ -145,7 +153,28 @@ type BoundValue = BindableMark<unknown> & WritableMark<string>;
145
153
  /** What `checked=$bind(name)` takes: a binding that can hold the boolean the field writes. */
146
154
  type BoundChecked = BindableMark<unknown> & WritableMark<boolean>;
147
155
 
148
- type Handler<Ev, E> = EventHandler<E, Ev>;
156
+ /** The events that a form control fires at itself, as Solid types them: `target` is the control. */
157
+ type ControlEventName =
158
+ | 'input'
159
+ | 'change'
160
+ | 'beforeinput'
161
+ | 'focus'
162
+ | 'blur'
163
+ | 'focusin'
164
+ | 'focusout';
165
+
166
+ type ControlElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
167
+
168
+ /**
169
+ * The event `K` on the element `E`. `currentTarget` is `E`. `target` is `E` for the events of
170
+ * `ControlEventName` on an `input`, a `select` or a `textarea`, and `Element` for the others.
171
+ */
172
+ export type ElementEvent<K extends keyof ElementEvents, E> = ElementEvents[K] & {
173
+ currentTarget: E;
174
+ target: [E] extends [ControlElement] ? (K extends ControlEventName ? E : Element) : Element;
175
+ };
176
+
177
+ type Handler<K extends keyof ElementEvents, E> = (event: ElementEvent<K, E>) => unknown;
149
178
 
150
179
  /**
151
180
  * The camel-case name of each event whose name has more than one word, by the name of the event:
@@ -261,7 +290,7 @@ type EventWord<K extends string> = K extends keyof ElementEventNames
261
290
  export type Handlers<E> = {
262
291
  [
263
292
  K in keyof ElementEvents & string as K extends `webkit${string}` ? never : `on${EventWord<K>}`
264
- ]?: Handler<ElementEvents[K], E>;
293
+ ]?: Handler<K, E>;
265
294
  };
266
295
 
267
296
  /** A value of an ARIA attribute that is `true` or `false`. The runtime writes both as words. */
@@ -479,28 +508,38 @@ export type GlobalAttributes<E> = Handlers<E> &
479
508
  role?: Attr<AriaRole | `${AriaRole} ${string}`>;
480
509
  title?: Attr<string>;
481
510
  lang?: Attr<string>;
482
- dir?: Attr<'ltr' | 'rtl' | 'auto'>;
511
+ dir?: Attr<Keyword<'ltr' | 'rtl' | 'auto'>>;
483
512
  nonce?: Attr<string>;
484
513
  accesskey?: Attr<string>;
485
- autocapitalize?: Attr<'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'>;
514
+ autocapitalize?: Attr<
515
+ '' | Keyword<'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'>
516
+ >;
486
517
  autofocus?: Attr<boolean>;
487
- contenteditable?: Attr<boolean | 'true' | 'false' | 'plaintext-only'>;
488
- draggable?: Attr<boolean | 'true' | 'false'>;
489
- enterkeyhint?: Attr<'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'>;
490
- 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'>>;
491
522
  inert?: Attr<boolean>;
492
- inputmode?: Attr<'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'>;
493
- popover?: Attr<boolean | 'auto' | 'manual' | 'hint'>;
494
- 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'>>;
495
528
  tabindex?: Attr<Num>;
496
- translate?: Attr<'yes' | 'no'>;
497
- writingsuggestions?: Attr<boolean | 'true' | 'false'>;
498
- 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'>>;
532
+ exportparts?: Attr<string>;
533
+ itemid?: Attr<string>;
534
+ itemprop?: Attr<string>;
535
+ itemref?: Attr<string>;
536
+ itemscope?: Attr<boolean>;
537
+ itemtype?: Attr<string>;
499
538
  [attribute: `data-${string}`]: unknown;
500
539
  [attribute: `aria-${string}`]: Attr<string | number | boolean>;
501
540
  };
502
541
 
503
- type Referrer =
542
+ type Referrer = Keyword<
504
543
  | 'no-referrer'
505
544
  | 'no-referrer-when-downgrade'
506
545
  | 'origin'
@@ -508,10 +547,117 @@ type Referrer =
508
547
  | 'same-origin'
509
548
  | 'strict-origin'
510
549
  | 'strict-origin-when-cross-origin'
511
- | 'unsafe-url';
512
- type CrossOrigin = boolean | 'anonymous' | 'use-credentials';
550
+ | 'unsafe-url'
551
+ >;
552
+ type CrossOrigin = boolean | '' | Keyword<'anonymous' | 'use-credentials'>;
513
553
  type Size = number | string;
514
554
 
555
+ // A value of a list of tokens: one token or more, with other text after it.
556
+ type Tokens<T extends string> = T | `${T} ${string}`;
557
+
558
+ // The tokens of `autocomplete` that fill a field (HTML, "autofill field names"). A value can start
559
+ // with `section-*`, `shipping` or `billing`, and end with `webauthn`, so a string stays valid.
560
+ type AutofillField =
561
+ | 'name'
562
+ | 'honorific-prefix'
563
+ | 'given-name'
564
+ | 'additional-name'
565
+ | 'family-name'
566
+ | 'honorific-suffix'
567
+ | 'nickname'
568
+ | 'username'
569
+ | 'new-password'
570
+ | 'current-password'
571
+ | 'one-time-code'
572
+ | 'organization-title'
573
+ | 'organization'
574
+ | 'street-address'
575
+ | 'address-line1'
576
+ | 'address-line2'
577
+ | 'address-line3'
578
+ | 'address-level4'
579
+ | 'address-level3'
580
+ | 'address-level2'
581
+ | 'address-level1'
582
+ | 'country'
583
+ | 'country-name'
584
+ | 'postal-code'
585
+ | 'cc-name'
586
+ | 'cc-given-name'
587
+ | 'cc-additional-name'
588
+ | 'cc-family-name'
589
+ | 'cc-number'
590
+ | 'cc-exp'
591
+ | 'cc-exp-month'
592
+ | 'cc-exp-year'
593
+ | 'cc-csc'
594
+ | 'cc-type'
595
+ | 'transaction-currency'
596
+ | 'transaction-amount'
597
+ | 'language'
598
+ | 'bday'
599
+ | 'bday-day'
600
+ | 'bday-month'
601
+ | 'bday-year'
602
+ | 'sex'
603
+ | 'url'
604
+ | 'photo'
605
+ | 'tel'
606
+ | 'tel-country-code'
607
+ | 'tel-national'
608
+ | 'tel-area-code'
609
+ | 'tel-local'
610
+ | 'tel-local-prefix'
611
+ | 'tel-local-suffix'
612
+ | 'tel-extension'
613
+ | 'email'
614
+ | 'impp';
615
+ type Autocomplete = boolean | 'on' | 'off' | AutofillField | (string & {});
616
+
617
+ // The tokens of `sandbox` (HTML, "sandboxing flag set").
618
+ type SandboxToken =
619
+ | 'allow-downloads'
620
+ | 'allow-forms'
621
+ | 'allow-modals'
622
+ | 'allow-orientation-lock'
623
+ | 'allow-pointer-lock'
624
+ | 'allow-popups'
625
+ | 'allow-popups-to-escape-sandbox'
626
+ | 'allow-storage-access-by-user-activation'
627
+ | 'allow-presentation'
628
+ | 'allow-same-origin'
629
+ | 'allow-scripts'
630
+ | 'allow-top-navigation'
631
+ | 'allow-top-navigation-by-user-activation'
632
+ | 'allow-top-navigation-to-custom-protocols';
633
+
634
+ // The destinations that `link as` takes for `rel=preload` and `rel=modulepreload` (the fetch
635
+ // destinations that HTML lists).
636
+ type LinkDestination =
637
+ | 'audio'
638
+ | 'document'
639
+ | 'embed'
640
+ | 'fetch'
641
+ | 'font'
642
+ | 'image'
643
+ | 'object'
644
+ | 'script'
645
+ | 'style'
646
+ | 'track'
647
+ | 'video'
648
+ | 'worker'
649
+ | 'audioworklet'
650
+ | 'paintworklet'
651
+ | 'serviceworker'
652
+ | 'sharedworker'
653
+ | 'json'
654
+ | 'manifest'
655
+ | 'frame'
656
+ | 'iframe'
657
+ | 'report'
658
+ | 'xslt'
659
+ | (string & {});
660
+
515
661
  /** An HTML element `E` with the attributes of its own. */
516
662
  type Html<E extends keyof HTMLElementTagNameMap, Own = {}> = GlobalAttributes<
517
663
  HTMLElementTagNameMap[E]
@@ -537,7 +683,7 @@ interface MediaOwn {
537
683
  autoplay?: Attr<boolean>;
538
684
  loop?: Attr<boolean>;
539
685
  muted?: Attr<boolean>;
540
- preload?: Attr<'none' | 'metadata' | 'auto' | ''>;
686
+ preload?: Attr<'' | Keyword<'none' | 'metadata' | 'auto'>>;
541
687
  crossorigin?: Attr<CrossOrigin>;
542
688
  controlslist?: Attr<string>;
543
689
  disableremoteplayback?: Attr<boolean>;
@@ -550,50 +696,63 @@ interface FormControlOwn {
550
696
  }
551
697
 
552
698
  interface ButtonOwn extends FormControlOwn {
553
- type?: Attr<'button' | 'submit' | 'reset'>;
699
+ type?: Attr<Keyword<'button' | 'submit' | 'reset'>>;
554
700
  value?: Attr<string | number>;
555
701
  formaction?: Attr<string | ServerFunction>;
556
- formenctype?: Attr<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>;
557
- 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'>>;
558
706
  formnovalidate?: Attr<boolean>;
559
707
  formtarget?: Attr<string>;
560
708
  popovertarget?: Attr<string>;
561
- popovertargetaction?: Attr<'show' | 'hide' | 'toggle'>;
562
- command?: Attr<string>;
709
+ popovertargetaction?: Attr<Keyword<'show' | 'hide' | 'toggle'>>;
710
+ command?: Attr<
711
+ | 'show-modal'
712
+ | 'close'
713
+ | 'request-close'
714
+ | 'show-popover'
715
+ | 'hide-popover'
716
+ | 'toggle-popover'
717
+ | `--${string}`
718
+ | (string & {})
719
+ >;
563
720
  commandfor?: Attr<string>;
564
721
  }
565
722
 
566
723
  interface InputOwn extends FormControlOwn {
567
724
  type?: Attr<
568
- | 'button'
569
- | 'checkbox'
570
- | 'color'
571
- | 'date'
572
- | 'datetime-local'
573
- | 'email'
574
- | 'file'
575
- | 'hidden'
576
- | 'image'
577
- | 'month'
578
- | 'number'
579
- | 'password'
580
- | 'radio'
581
- | 'range'
582
- | 'reset'
583
- | 'search'
584
- | 'submit'
585
- | 'tel'
586
- | 'text'
587
- | 'time'
588
- | 'url'
589
- | '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
+ >
590
749
  >;
591
750
  value?: Attr<string | number | BoundValue>;
592
751
  checked?: Attr<boolean | BoundChecked>;
593
752
  accept?: Attr<string>;
594
753
  alt?: Attr<string>;
595
- autocomplete?: Attr<boolean | string>;
596
- capture?: Attr<boolean | 'user' | 'environment'>;
754
+ autocomplete?: Attr<Autocomplete>;
755
+ capture?: Attr<boolean | '' | Keyword<'user' | 'environment'>>;
597
756
  dirname?: Attr<string>;
598
757
  webkitdirectory?: Attr<boolean>;
599
758
  list?: Attr<string>;
@@ -612,16 +771,18 @@ interface InputOwn extends FormControlOwn {
612
771
  width?: Attr<Size>;
613
772
  height?: Attr<Size>;
614
773
  formaction?: Attr<string | ServerFunction>;
615
- formenctype?: Attr<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>;
616
- 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'>>;
617
778
  formnovalidate?: Attr<boolean>;
618
779
  formtarget?: Attr<string>;
619
780
  popovertarget?: Attr<string>;
620
- popovertargetaction?: Attr<'show' | 'hide' | 'toggle'>;
781
+ popovertargetaction?: Attr<Keyword<'show' | 'hide' | 'toggle'>>;
621
782
  }
622
783
 
623
784
  interface TextareaOwn extends FormControlOwn {
624
- autocomplete?: Attr<boolean | string>;
785
+ autocomplete?: Attr<Autocomplete>;
625
786
  cols?: Attr<Num>;
626
787
  dirname?: Attr<string>;
627
788
  maxlength?: Attr<Num>;
@@ -630,7 +791,7 @@ interface TextareaOwn extends FormControlOwn {
630
791
  readonly?: Attr<boolean>;
631
792
  required?: Attr<boolean>;
632
793
  rows?: Attr<Num>;
633
- wrap?: Attr<'hard' | 'soft' | 'off'>;
794
+ wrap?: Attr<Keyword<'hard' | 'soft' | 'off'>>;
634
795
  value?: Attr<string | BoundValue>;
635
796
  }
636
797
 
@@ -789,14 +950,54 @@ type SvgAttributeNames =
789
950
  | 'accumulate'
790
951
  | 'restart'
791
952
  | 'crossorigin';
792
- type SvgPresentation = { [K in SvgAttributeNames]?: SvgValue };
953
+ type SvgPresentation = { [K in SvgAttributeNames]?: SvgValue } & {
954
+ 'xlink:href'?: SvgValue;
955
+ 'xml:lang'?: SvgValue;
956
+ };
793
957
  type Svg<E extends keyof SVGElementTagNameMap> = GlobalAttributes<SVGElementTagNameMap[E]> &
794
958
  SvgPresentation;
795
959
 
960
+ // The attributes of MathML Core. The global ones apply to every MathML element.
961
+ type MathLength = Attr<string | number>;
962
+ interface MathGlobal {
963
+ displaystyle?: Attr<boolean>;
964
+ scriptlevel?: Attr<number | `${number}` | `+${number}` | `-${number}`>;
965
+ mathbackground?: Attr<string>;
966
+ mathcolor?: Attr<string>;
967
+ mathsize?: MathLength;
968
+ mathvariant?: Attr<'normal'>;
969
+ // A legacy attribute of MathML Core, which browsers still follow on any MathML element.
970
+ href?: Attr<string>;
971
+ }
972
+ /** A MathML element `E` with the global MathML attributes and the attributes of its own. */
973
+ type MathAttrs<E extends keyof MathMLElementTagNameMap, Own = {}> = GlobalAttributes<
974
+ MathMLElementTagNameMap[E]
975
+ > &
976
+ MathGlobal &
977
+ Own;
978
+ interface MathOperatorOwn {
979
+ fence?: Attr<boolean>;
980
+ form?: Attr<'prefix' | 'infix' | 'postfix'>;
981
+ largeop?: Attr<boolean>;
982
+ lspace?: MathLength;
983
+ rspace?: MathLength;
984
+ maxsize?: MathLength;
985
+ minsize?: MathLength;
986
+ movablelimits?: Attr<boolean>;
987
+ separator?: Attr<boolean>;
988
+ stretchy?: Attr<boolean>;
989
+ symmetric?: Attr<boolean>;
990
+ }
991
+ interface MathSizeOwn {
992
+ width?: MathLength;
993
+ height?: MathLength;
994
+ depth?: MathLength;
995
+ }
996
+
796
997
  /**
797
- * The attributes of each element, by tag. HTML elements have the attributes of HTML, and SVG
798
- * elements the shared attributes of SVG. An app adds the tag of a custom element by merging into
799
- * this interface.
998
+ * The attributes of each element, by tag. HTML elements have the attributes of HTML, SVG
999
+ * elements the shared attributes of SVG, and MathML elements those of MathML Core. An app
1000
+ * adds the tag of a custom element by merging into this interface.
800
1001
  */
801
1002
  export interface Elements {
802
1003
  a: Html<'a', AnchorOwn>;
@@ -833,7 +1034,10 @@ export interface Elements {
833
1034
  del: Html<'del', { cite?: Attr<string>; datetime?: Attr<string> }>;
834
1035
  details: Html<'details', { open?: Attr<boolean>; name?: Attr<string> }>;
835
1036
  dfn: Html<'dfn'>;
836
- dialog: Html<'dialog', { open?: Attr<boolean> }>;
1037
+ dialog: Html<
1038
+ 'dialog',
1039
+ { open?: Attr<boolean>; closedby?: Attr<Keyword<'any' | 'closerequest' | 'none'>> }
1040
+ >;
837
1041
  div: Html<'div'>;
838
1042
  dl: Html<'dl'>;
839
1043
  dt: Html<'dt'>;
@@ -850,11 +1054,13 @@ export interface Elements {
850
1054
  'form',
851
1055
  {
852
1056
  action?: Attr<string | ServerFunction>;
853
- method?: Attr<'get' | 'post' | 'dialog'>;
854
- 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
+ >;
855
1061
  target?: Attr<string>;
856
1062
  novalidate?: Attr<boolean>;
857
- autocomplete?: Attr<boolean | 'on' | 'off'>;
1063
+ autocomplete?: Attr<boolean | Keyword<'on' | 'off'>>;
858
1064
  name?: Attr<string>;
859
1065
  rel?: Attr<string>;
860
1066
  'accept-charset'?: Attr<string>;
@@ -882,9 +1088,9 @@ export interface Elements {
882
1088
  height?: Attr<Size>;
883
1089
  allow?: Attr<string>;
884
1090
  allowfullscreen?: Attr<boolean>;
885
- loading?: Attr<'eager' | 'lazy'>;
1091
+ loading?: Attr<Keyword<'eager' | 'lazy'>>;
886
1092
  referrerpolicy?: Attr<Referrer>;
887
- sandbox?: Attr<string>;
1093
+ sandbox?: Attr<'' | Tokens<SandboxToken> | (string & {})>;
888
1094
  }
889
1095
  >;
890
1096
  img: Html<
@@ -896,13 +1102,13 @@ export interface Elements {
896
1102
  sizes?: Attr<string>;
897
1103
  width?: Attr<Size>;
898
1104
  height?: Attr<Size>;
899
- loading?: Attr<'eager' | 'lazy'>;
900
- decoding?: Attr<'sync' | 'async' | 'auto'>;
1105
+ loading?: Attr<Keyword<'eager' | 'lazy'>>;
1106
+ decoding?: Attr<Keyword<'sync' | 'async' | 'auto'>>;
901
1107
  crossorigin?: Attr<CrossOrigin>;
902
1108
  usemap?: Attr<string>;
903
1109
  ismap?: Attr<boolean>;
904
1110
  referrerpolicy?: Attr<Referrer>;
905
- fetchpriority?: Attr<'high' | 'low' | 'auto'>;
1111
+ fetchpriority?: Attr<Keyword<'high' | 'low' | 'auto'>>;
906
1112
  }
907
1113
  >;
908
1114
  input: Html<'input', InputOwn>;
@@ -916,7 +1122,7 @@ export interface Elements {
916
1122
  {
917
1123
  href?: Attr<string>;
918
1124
  rel?: Attr<string>;
919
- as?: Attr<string>;
1125
+ as?: Attr<LinkDestination>;
920
1126
  type?: Attr<string>;
921
1127
  media?: Attr<string>;
922
1128
  crossorigin?: Attr<CrossOrigin>;
@@ -926,9 +1132,9 @@ export interface Elements {
926
1132
  imagesrcset?: Attr<string>;
927
1133
  imagesizes?: Attr<string>;
928
1134
  referrerpolicy?: Attr<Referrer>;
929
- fetchpriority?: Attr<'high' | 'low' | 'auto'>;
1135
+ fetchpriority?: Attr<Keyword<'high' | 'low' | 'auto'>>;
930
1136
  disabled?: Attr<boolean>;
931
- blocking?: Attr<string>;
1137
+ blocking?: Attr<'render' | (string & {})>;
932
1138
  }
933
1139
  >;
934
1140
  main: Html<'main'>;
@@ -943,7 +1149,14 @@ export interface Elements {
943
1149
  charset?: Attr<string>;
944
1150
  property?: Attr<string>;
945
1151
  media?: Attr<string>;
946
- 'http-equiv'?: Attr<string>;
1152
+ 'http-equiv'?: Attr<
1153
+ | 'content-security-policy'
1154
+ | 'content-type'
1155
+ | 'default-style'
1156
+ | 'refresh'
1157
+ | 'x-ua-compatible'
1158
+ | (string & {})
1159
+ >;
947
1160
  }
948
1161
  >;
949
1162
  meter: Html<
@@ -955,6 +1168,7 @@ export interface Elements {
955
1168
  low?: Attr<Num>;
956
1169
  high?: Attr<Num>;
957
1170
  optimum?: Attr<Num>;
1171
+ form?: Attr<string>;
958
1172
  }
959
1173
  >;
960
1174
  nav: Html<'nav'>;
@@ -999,15 +1213,15 @@ export interface Elements {
999
1213
  'script',
1000
1214
  {
1001
1215
  src?: Attr<string>;
1002
- type?: Attr<string>;
1216
+ type?: Attr<'importmap' | 'module' | 'speculationrules' | (string & {})>;
1003
1217
  async?: Attr<boolean>;
1004
1218
  defer?: Attr<boolean>;
1005
1219
  nomodule?: Attr<boolean>;
1006
1220
  crossorigin?: Attr<CrossOrigin>;
1007
1221
  integrity?: Attr<string>;
1008
1222
  referrerpolicy?: Attr<Referrer>;
1009
- fetchpriority?: Attr<'high' | 'low' | 'auto'>;
1010
- blocking?: Attr<string>;
1223
+ fetchpriority?: Attr<Keyword<'high' | 'low' | 'auto'>>;
1224
+ blocking?: Attr<'render' | (string & {})>;
1011
1225
  }
1012
1226
  >;
1013
1227
  search: Html<'search'>;
@@ -1015,7 +1229,7 @@ export interface Elements {
1015
1229
  select: Html<
1016
1230
  'select',
1017
1231
  FormControlOwn & {
1018
- autocomplete?: Attr<boolean | string>;
1232
+ autocomplete?: Attr<Autocomplete>;
1019
1233
  multiple?: Attr<boolean>;
1020
1234
  required?: Attr<boolean>;
1021
1235
  size?: Attr<Num>;
@@ -1038,19 +1252,38 @@ export interface Elements {
1038
1252
  >;
1039
1253
  span: Html<'span'>;
1040
1254
  strong: Html<'strong'>;
1041
- style: Html<'style', { media?: Attr<string>; blocking?: Attr<string> }>;
1255
+ style: Html<
1256
+ 'style',
1257
+ {
1258
+ type?: Attr<'text/css' | (string & {})>;
1259
+ media?: Attr<string>;
1260
+ blocking?: Attr<'render' | (string & {})>;
1261
+ }
1262
+ >;
1042
1263
  sub: Html<'sub'>;
1043
1264
  summary: Html<'summary'>;
1044
1265
  sup: Html<'sup'>;
1045
1266
  table: Html<'table'>;
1046
1267
  tbody: Html<'tbody'>;
1047
1268
  td: Html<'td', TableCellOwn>;
1048
- template: Html<'template', { shadowrootmode?: Attr<'open' | 'closed'> }>;
1269
+ template: Html<
1270
+ 'template',
1271
+ {
1272
+ shadowrootmode?: Attr<Keyword<'open' | 'closed'>>;
1273
+ shadowrootclonable?: Attr<boolean>;
1274
+ shadowrootdelegatesfocus?: Attr<boolean>;
1275
+ shadowrootserializable?: Attr<boolean>;
1276
+ shadowrootcustomelementregistry?: Attr<boolean>;
1277
+ }
1278
+ >;
1049
1279
  textarea: Html<'textarea', TextareaOwn>;
1050
1280
  tfoot: Html<'tfoot'>;
1051
1281
  th: Html<
1052
1282
  'th',
1053
- 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
+ }
1054
1287
  >;
1055
1288
  thead: Html<'thead'>;
1056
1289
  time: Html<'time', { datetime?: Attr<string> }>;
@@ -1060,7 +1293,7 @@ export interface Elements {
1060
1293
  'track',
1061
1294
  {
1062
1295
  default?: Attr<boolean>;
1063
- kind?: Attr<'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'>;
1296
+ kind?: Attr<Keyword<'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'>>;
1064
1297
  label?: Attr<string>;
1065
1298
  src?: Attr<string>;
1066
1299
  srclang?: Attr<string>;
@@ -1140,6 +1373,41 @@ export interface Elements {
1140
1373
  tspan: Svg<'tspan'>;
1141
1374
  use: Svg<'use'>;
1142
1375
  view: Svg<'view'>;
1376
+
1377
+ // MathML elements. `a` is the HTML one, which MathML shares.
1378
+ annotation: MathAttrs<'annotation', { encoding?: Attr<string> }>;
1379
+ 'annotation-xml': MathAttrs<'annotation-xml', { encoding?: Attr<string> }>;
1380
+ maction: MathAttrs<
1381
+ 'maction',
1382
+ { actiontype?: Attr<string>; selection?: Attr<number | `${number}`> }
1383
+ >;
1384
+ math: MathAttrs<'math', { display?: Attr<'block' | 'inline'>; xmlns?: Attr<string> }>;
1385
+ merror: MathAttrs<'merror'>;
1386
+ mfrac: MathAttrs<'mfrac', { linethickness?: MathLength }>;
1387
+ mi: MathAttrs<'mi'>;
1388
+ mmultiscripts: MathAttrs<'mmultiscripts'>;
1389
+ mn: MathAttrs<'mn'>;
1390
+ mo: MathAttrs<'mo', MathOperatorOwn>;
1391
+ mover: MathAttrs<'mover', { accent?: Attr<boolean> }>;
1392
+ mpadded: MathAttrs<'mpadded', MathSizeOwn & { lspace?: MathLength; voffset?: MathLength }>;
1393
+ mphantom: MathAttrs<'mphantom'>;
1394
+ mprescripts: MathAttrs<'mprescripts'>;
1395
+ mroot: MathAttrs<'mroot'>;
1396
+ mrow: MathAttrs<'mrow'>;
1397
+ ms: MathAttrs<'ms'>;
1398
+ mspace: MathAttrs<'mspace', MathSizeOwn>;
1399
+ msqrt: MathAttrs<'msqrt'>;
1400
+ mstyle: MathAttrs<'mstyle'>;
1401
+ msub: MathAttrs<'msub'>;
1402
+ msubsup: MathAttrs<'msubsup'>;
1403
+ msup: MathAttrs<'msup'>;
1404
+ mtable: MathAttrs<'mtable'>;
1405
+ mtd: MathAttrs<'mtd', { columnspan?: Attr<Num>; rowspan?: Attr<Num> }>;
1406
+ mtext: MathAttrs<'mtext'>;
1407
+ mtr: MathAttrs<'mtr'>;
1408
+ munder: MathAttrs<'munder', { accentunder?: Attr<boolean> }>;
1409
+ munderover: MathAttrs<'munderover', { accent?: Attr<boolean>; accentunder?: Attr<boolean> }>;
1410
+ semantics: MathAttrs<'semantics'>;
1143
1411
  }
1144
1412
 
1145
1413
  /** The attributes of an element by its tag. */
@@ -1150,4 +1418,6 @@ export type ElementOf<T extends keyof Elements> = T extends keyof HTMLElementTag
1150
1418
  ? HTMLElementTagNameMap[T]
1151
1419
  : T extends keyof SVGElementTagNameMap
1152
1420
  ? SVGElementTagNameMap[T]
1153
- : HTMLElement;
1421
+ : T extends keyof MathMLElementTagNameMap
1422
+ ? MathMLElementTagNameMap[T]
1423
+ : HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brumate",
3
- "version": "0.6.2",
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",
@@ -63,6 +63,10 @@
63
63
  "types": "./dist/runtime/signals.d.ts",
64
64
  "default": "./dist/runtime/signals.js"
65
65
  },
66
+ "./store": {
67
+ "types": "./dist/runtime/store.d.ts",
68
+ "default": "./dist/runtime/store.js"
69
+ },
66
70
  "./routes": {
67
71
  "types": "./dist/runtime/routes.d.ts",
68
72
  "default": "./dist/runtime/routes.js"