brumate 0.3.0 → 0.4.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 (122) hide show
  1. package/README.md +2 -2
  2. package/check.d.ts +49 -0
  3. package/dist/{boot-C25Sa6vq.d.ts → boot-SCWYwuUd.d.ts} +8 -10
  4. package/dist/cli.js +275 -15
  5. package/dist/cli.js.map +1 -1
  6. package/dist/client-BBtVTOIt.js +3506 -0
  7. package/dist/client-BBtVTOIt.js.map +1 -0
  8. package/dist/{client-D0CqSxoO.d.ts → client-Cs3o4key.d.ts} +390 -181
  9. package/dist/{client-routes-JTbGtukf.js → client-routes-BtGpYCef.js} +60 -30
  10. package/dist/client-routes-BtGpYCef.js.map +1 -0
  11. package/dist/{cookies-BzllthiF.js → cookies-Cnbf4w-S.js} +14 -7
  12. package/dist/cookies-Cnbf4w-S.js.map +1 -0
  13. package/dist/{defer-BbD7JQhj.js → defer-BLJjxqVc.js} +4 -4
  14. package/dist/defer-BLJjxqVc.js.map +1 -0
  15. package/dist/{devtools-CQgD7NPB.js → devtools-DTpsVFbn.js} +56 -82
  16. package/dist/devtools-DTpsVFbn.js.map +1 -0
  17. package/dist/{devtools-panel-BVB-W5q4.js → devtools-panel-C1Dfv6nq.js} +397 -333
  18. package/dist/devtools-panel-C1Dfv6nq.js.map +1 -0
  19. package/dist/{events-CSs7OwIC.js → events-LgLdp1R7.js} +34 -5
  20. package/dist/events-LgLdp1R7.js.map +1 -0
  21. package/dist/features-CHY5Ekku.js +30 -0
  22. package/dist/features-CHY5Ekku.js.map +1 -0
  23. package/dist/files-DZIiMDnS.js +506 -0
  24. package/dist/files-DZIiMDnS.js.map +1 -0
  25. package/dist/{forms-Cl21hkHt.d.ts → forms-j1xPAR14.d.ts} +3 -3
  26. package/dist/{forms-Bg-CwGqX.js → forms-nXK7-Lv_.js} +78 -44
  27. package/dist/forms-nXK7-Lv_.js.map +1 -0
  28. package/dist/highlight.js +31 -22
  29. package/dist/highlight.js.map +1 -1
  30. package/dist/{html-mNTKzaDD.js → html-DS9B1H-M.js} +92 -22
  31. package/dist/html-DS9B1H-M.js.map +1 -0
  32. package/dist/{html-Bq1rFxX_.d.ts → html-Gggepsf-.d.ts} +22 -5
  33. package/dist/index.d.ts +98 -10
  34. package/dist/index.js +639 -104
  35. package/dist/index.js.map +1 -1
  36. package/dist/{inspect-BHpOw1LF.js → inspect-DomFHy5O.js} +3832 -695
  37. package/dist/inspect-DomFHy5O.js.map +1 -0
  38. package/dist/{loader-Dos_3NP0.js → loader-D62komKu.js} +20 -14
  39. package/dist/loader-D62komKu.js.map +1 -0
  40. package/dist/logo-DQ_OYhBi.js +10 -0
  41. package/dist/logo-DQ_OYhBi.js.map +1 -0
  42. package/dist/{navigate-O78d_zGN.js → navigate-CfOr-TRF.js} +94 -31
  43. package/dist/navigate-CfOr-TRF.js.map +1 -0
  44. package/dist/nesting-DA5vJw9X.js +265 -0
  45. package/dist/nesting-DA5vJw9X.js.map +1 -0
  46. package/dist/{produce-Doc91GkX.js → produce-BNIpmZq2.js} +138 -9
  47. package/dist/produce-BNIpmZq2.js.map +1 -0
  48. package/dist/{produce-D0V0ICkz.d.ts → produce-CRfouraC.d.ts} +44 -5
  49. package/dist/{rpc-ygMRPmN4.js → rpc-BTMb8jap.js} +11 -6
  50. package/dist/rpc-BTMb8jap.js.map +1 -0
  51. package/dist/runtime/batch.js +9 -7
  52. package/dist/runtime/batch.js.map +1 -1
  53. package/dist/runtime/client.d.ts +4 -4
  54. package/dist/runtime/client.js +4 -4
  55. package/dist/runtime/devtools.d.ts +11 -29
  56. package/dist/runtime/devtools.js +3 -1
  57. package/dist/runtime/env.js +14 -2
  58. package/dist/runtime/env.js.map +1 -1
  59. package/dist/runtime/events.d.ts +23 -1
  60. package/dist/runtime/events.js +1 -1
  61. package/dist/runtime/forms.d.ts +2 -2
  62. package/dist/runtime/forms.js +1 -1
  63. package/dist/runtime/hot.d.ts +1 -1
  64. package/dist/runtime/hot.js +5 -2
  65. package/dist/runtime/hot.js.map +1 -1
  66. package/dist/runtime/html.d.ts +2 -2
  67. package/dist/runtime/html.js +1 -1
  68. package/dist/runtime/loader.d.ts +2 -2
  69. package/dist/runtime/loader.js +2 -2
  70. package/dist/runtime/routes.js +4 -1
  71. package/dist/runtime/routes.js.map +1 -1
  72. package/dist/runtime/server.d.ts +5 -5
  73. package/dist/runtime/server.js +5 -5
  74. package/dist/runtime/signals.d.ts +38 -1
  75. package/dist/runtime/signals.js +33 -1
  76. package/dist/runtime/signals.js.map +1 -1
  77. package/dist/runtime/static-loader.d.ts +2 -2
  78. package/dist/runtime/static-loader.js +1 -1
  79. package/dist/runtime/testing.d.ts +18 -3
  80. package/dist/runtime/testing.js +150 -33
  81. package/dist/runtime/testing.js.map +1 -1
  82. package/dist/{server-CxVDYE_V.js → server-BTtsQFFw.js} +633 -163
  83. package/dist/server-BTtsQFFw.js.map +1 -0
  84. package/dist/{server-DuFYRXrd.d.ts → server-CYw15Dsg.d.ts} +103 -22
  85. package/dist/{static-loader-nZssh66R.js → static-loader-C_GYIFtt.js} +79 -99
  86. package/dist/static-loader-C_GYIFtt.js.map +1 -0
  87. package/dist/{static-loader-Drpr0AzI.d.ts → static-loader-DVuLmXeu.d.ts} +2 -2
  88. package/dist/{stream-DCYZO4IF.js → stream-r4V5zBKm.js} +102 -16
  89. package/dist/stream-r4V5zBKm.js.map +1 -0
  90. package/dist/vite.d.ts +13 -20
  91. package/dist/vite.js +1956 -554
  92. package/dist/vite.js.map +1 -1
  93. package/elements.d.ts +951 -0
  94. package/forms/forms.brm.ts +3 -3
  95. package/package.json +12 -3
  96. package/skills/brumate/SKILL.md +58 -0
  97. package/skills/brumate/references/errors.md +2078 -0
  98. package/skills/brumate/references/events.md +117 -0
  99. package/skills/brumate/references/signals.md +61 -0
  100. package/skills/brumate/references/state.md +235 -0
  101. package/skills/brumate/references/syntax.md +250 -0
  102. package/types.d.ts +4 -4
  103. package/dist/client-BD6XT-s5.js +0 -1968
  104. package/dist/client-BD6XT-s5.js.map +0 -1
  105. package/dist/client-routes-JTbGtukf.js.map +0 -1
  106. package/dist/cookies-BzllthiF.js.map +0 -1
  107. package/dist/defer-BbD7JQhj.js.map +0 -1
  108. package/dist/devtools-CQgD7NPB.js.map +0 -1
  109. package/dist/devtools-panel-BVB-W5q4.js.map +0 -1
  110. package/dist/events-CSs7OwIC.js.map +0 -1
  111. package/dist/files-BXSSrQgc.js +0 -205
  112. package/dist/files-BXSSrQgc.js.map +0 -1
  113. package/dist/forms-Bg-CwGqX.js.map +0 -1
  114. package/dist/html-mNTKzaDD.js.map +0 -1
  115. package/dist/inspect-BHpOw1LF.js.map +0 -1
  116. package/dist/loader-Dos_3NP0.js.map +0 -1
  117. package/dist/navigate-O78d_zGN.js.map +0 -1
  118. package/dist/produce-Doc91GkX.js.map +0 -1
  119. package/dist/rpc-ygMRPmN4.js.map +0 -1
  120. package/dist/server-CxVDYE_V.js.map +0 -1
  121. package/dist/static-loader-nZssh66R.js.map +0 -1
  122. package/dist/stream-DCYZO4IF.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { t as Raw } from "./html-Bq1rFxX_.js";
2
- import { a as PackedState, c as ScopeState, n as Binding, o as PageState, r as ElementReference, s as ScopeId } from "./produce-D0V0ICkz.js";
3
1
  import { t as Context$1 } from "./context-btHuB01Z.js";
2
+ import { n as Raw } from "./html-Gggepsf-.js";
3
+ import { a as PackedState, l as ScopeId, n as Binding, o as PageState, r as ElementReference, s as PropSink, u as ScopeState } from "./produce-CRfouraC.js";
4
4
  import { t as StandardSchemaV1 } from "./standard-schema-BNY82yX3.js";
5
- import { f as Intent, v as SubmissionResult } from "./forms-Cl21hkHt.js";
5
+ import { f as Intent, v as SubmissionResult } from "./forms-j1xPAR14.js";
6
6
  //#region src/runtime/cookies.d.ts
7
7
  interface CookieOptions {
8
8
  /** Seconds until the cookie expires. Without it, the cookie lasts until the browser closes. */
@@ -725,6 +725,15 @@ interface Boundary {
725
725
  around?: boolean;
726
726
  /** The `#reveal` group that orders it, when it is in one. */
727
727
  group?: RevealGroup;
728
+ /** The `#try` blocks around it, from the outside in. */
729
+ catchers: Catcher[];
730
+ }
731
+ /** A `#try` that is rendering its body, and how to render its `#catch` body later. */
732
+ interface Catcher {
733
+ /** The marker of the block, `<scope>:<anchor>`. */
734
+ key: string;
735
+ /** Renders the `#catch` body for an error, in a context of its own. */
736
+ render: (ctx: Context, error: unknown) => Promise<string>;
728
737
  }
729
738
  /** The order of a `#reveal` block. */
730
739
  type RevealOrder = "sequential" | "backwards" | "together" | "natural";
@@ -800,7 +809,7 @@ interface IdSpace {
800
809
  entries: (ScopeEntry | undefined)[];
801
810
  }
802
811
  /** A scope of a render: its record, and what the server keeps of it while the page renders. */
803
- interface ScopeEntry {
812
+ interface ScopeEntry extends PropSink {
804
813
  id: ScopeId;
805
814
  /** The prefix of the ID and the number after it, such as `'5.'` and `1`, or `''` and `3`. */
806
815
  prefix: string;
@@ -846,6 +855,8 @@ declare class Context {
846
855
  /** The scope that the render used last, since it uses one a few times in a row. */
847
856
  private last;
848
857
  private readonly root;
858
+ /** The keys of the signals that a visible `$client` waits for. See `near`. */
859
+ private waited?;
849
860
  /** The ID spaces of the blocks that the render is in, from the outside in. */
850
861
  private readonly spaces;
851
862
  private readonly baseId;
@@ -863,6 +874,10 @@ declare class Context {
863
874
  /** The titles that this render set, and whether they all came from a `<title>` in `#head`. */
864
875
  private titles;
865
876
  private onBoundary;
877
+ /** The `#try` blocks of the parents of this context, from the outside in. */
878
+ outer: Catcher[];
879
+ /** The `#try` blocks of this context that are rendering their bodies now. */
880
+ private readonly catchers;
866
881
  /** The scope that renders the next component, which becomes its owner. */
867
882
  private owner;
868
883
  /**
@@ -876,6 +891,8 @@ declare class Context {
876
891
  private rpcPrefix;
877
892
  /** The ID of the build, for forms that post to server functions. See `RenderOptions`. */
878
893
  build: string | undefined;
894
+ /** True in development, where a memo that failed or a `#catch` sends its error to the browser. */
895
+ development: boolean;
879
896
  /** Results of server functions that a form posted to this page, for `$action`. */
880
897
  actions: Map<unknown, unknown>;
881
898
  /** The params of the route of the page, for `$route`. */
@@ -919,6 +936,8 @@ declare class Context {
919
936
  leave(): void;
920
937
  /** Returns the URL prefix of server function calls. */
921
938
  rpc(): string;
939
+ /** True when the render is in development. */
940
+ isDev(): boolean;
922
941
  /** Returns the ID of the build, when the render has one. */
923
942
  buildId(): string | undefined;
924
943
  /**
@@ -934,7 +953,9 @@ declare class Context {
934
953
  * keep `from`, the scope of the markup that wrote them, for their values,
935
954
  * and find their contexts from `at`.
936
955
  */
937
- children(from: ScopeId, at: ScopeId, renderBody: () => Promise<string>): Promise<string>;
956
+ children(from: ScopeId, at: ScopeId, renderBody: () => Promise<string>, tag?: string): Promise<string>;
957
+ /** The tag of the element where the children that render now are inserted, for spacers. */
958
+ spacerTag(): string;
938
959
  /**
939
960
  * The ID that `$id()` makes: the scope's ID and the position of the call.
940
961
  * A dot in a scope ID inside a `#loading` body becomes `_`, so the ID also
@@ -946,9 +967,9 @@ declare class Context {
946
967
  /** Provides a value of a context to the scopes inside `scope`. */
947
968
  provide<T>(context: Context$1<T>, value: T, scope: ScopeId): void;
948
969
  /**
949
- * Reads a context from the nearest scope that provides it, starting at
950
- * `scope`. With `slot`, records which slot holds it, so the client can
951
- * update it when the provided value changes.
970
+ * Reads a context from the nearest scope above `scope` that provides it.
971
+ * With `slot`, records which slot holds it, so the client can update it
972
+ * when the provided value changes.
952
973
  */
953
974
  consume<T>(context: Context$1<T>, scope: ScopeId, slot?: number): T;
954
975
  /** The ID that the next call to `scope()` returns. */
@@ -981,13 +1002,28 @@ declare class Context {
981
1002
  * scope, as `[scope, slot]`. The items of a list share one array.
982
1003
  */
983
1004
  get sources(): Map<ScopeId, ItemSource>;
1005
+ /** The scope that `unbind` collects the promise props of its component in. */
1006
+ sink(scope: ScopeId): PropSink;
984
1007
  slots(scope: ScopeId, values: unknown[], names?: string[]): void;
1008
+ /** Elements that bound props of components forwarded to the slots of scopes that have no slots yet. */
1009
+ private forwards?;
1010
+ /**
1011
+ * Writes the element that a component forwards to a slot of a scope above it, and on through
1012
+ * the props that scope binds in turn. The parent records its slots after its children render,
1013
+ * so a write for a scope that has none waits for them.
1014
+ */
1015
+ private forward;
985
1016
  /**
986
1017
  * Records the props that a parent bound with `$bind`, among the props that
987
1018
  * the component writes: `slots` has the slot of each, by its name. Its
988
1019
  * writes in the browser go to the parent's slots.
989
1020
  */
990
1021
  bindings(scope: ScopeId, props: Record<string, unknown>, slots: Record<string, number>): void;
1022
+ /**
1023
+ * Records where the bound props write, before the component renders its markup, so an element
1024
+ * that it forwards can name the signal at the end of the bindings. See `refKey`.
1025
+ */
1026
+ bound(scope: ScopeId, props: Record<string, unknown>, slots: Record<string, number>): void;
991
1027
  /**
992
1028
  * Records the item of a list that can change on the client. `source` is
993
1029
  * the scope and slot that hold the list, when the compiler found one, so
@@ -996,6 +1032,23 @@ declare class Context {
996
1032
  item(scope: ScopeId, value: unknown, source?: ItemSource): void;
997
1033
  /** Records the scope of a child component at an anchor of its parent. */
998
1034
  link(scope: ScopeId, anchor: number, child: ScopeId): void;
1035
+ /**
1036
+ * A `ref` that the rest props of a component hold is a binding of a signal above. The element
1037
+ * that spreads them goes to that signal, as when the component names `ref` itself.
1038
+ */
1039
+ restRef<T extends Record<string, unknown>>(attributes: T, scope: ScopeId, anchor: number, tag?: unknown): T;
1040
+ /**
1041
+ * The `b-near` attribute of a visible `$client` that reads the signal at `slot` of `scope`,
1042
+ * which a component may get with `ref=$bind(...)`. It records the key, so `refKey` marks only
1043
+ * the elements that a callback waits for.
1044
+ */
1045
+ near(scope: ScopeId, slot: number): string;
1046
+ /**
1047
+ * The `b-r` attribute of an element that a component forwards for its caller: the scope and slot
1048
+ * of the signal at the end of the bindings, `S.slot`, when a visible `$client` waits for it.
1049
+ * The loader finds the element by it. Empty otherwise.
1050
+ */
1051
+ refKey(scope: ScopeId, slot: number): string;
999
1052
  /** Returns the reference that a `ref` signal holds on the server. */
1000
1053
  element(scope: ScopeId, anchor: number): ElementReference;
1001
1054
  /**
@@ -1051,6 +1104,11 @@ declare class Context {
1051
1104
  fallbackStart(id: ScopeId): string;
1052
1105
  /** Ends the fallback that `fallbackStart` started. */
1053
1106
  fallbackEnd(id: ScopeId): string;
1107
+ /**
1108
+ * Starts a `#try` body. A `#loading` body inside it that fails renders the `#catch` body with
1109
+ * `draw`, after the page is sent. The returned function ends the `#try` body.
1110
+ */
1111
+ catcher(key: string, draw: Catcher["render"]): () => void;
1054
1112
  /** Returns the ID of a new `#loading` boundary. */
1055
1113
  boundary(): ScopeId;
1056
1114
  /** Renders a `#loading` body after the rest of the page, in its own context and ID space. */
@@ -1099,9 +1157,9 @@ declare function wait(node: Memo): Promise<unknown>;
1099
1157
  declare function ready(node: Memo): unknown;
1100
1158
  /**
1101
1159
  * The value of a memo for the page state: its value when it is ready, or
1102
- * a promise of it while it loads. A memo that fails gives a rejected
1103
- * promise either way, so the page renders and the failure reaches the
1104
- * browser as the load that failed.
1160
+ * a promise of it while it loads. A memo that fails gives a `MemoError`
1161
+ * either way, so the page renders, the stream goes on, and a read in the
1162
+ * browser throws the error as a memo that failed there.
1105
1163
  */
1106
1164
  declare function stateValue(node: Memo): unknown;
1107
1165
  /**
@@ -1122,14 +1180,19 @@ declare function settled(nodes: Memo[]): boolean;
1122
1180
  declare const LAZY: unique symbol;
1123
1181
  /** Markup that renders where it is inserted, so it can read the contexts there. */
1124
1182
  interface Lazy {
1125
- [LAZY]: (ctx: Context, scope: ScopeId | undefined) => Promise<string>;
1183
+ [LAZY]: (ctx: Context, scope: ScopeId | undefined, tag?: string, anchor?: number) => Promise<string>;
1126
1184
  }
1127
1185
  /**
1128
1186
  * The children of a component, which render where the component inserts
1129
1187
  * them, so they read the contexts that the component provides. `from` is the
1130
1188
  * scope of the markup that wrote them.
1131
1189
  */
1132
- declare function children(from: ScopeId, renderBody: (ctx: Context) => Promise<string>): Lazy;
1190
+ declare function children(from: ScopeId, renderBody: (ctx: Context) => Promise<string>, ref?: string): Lazy;
1191
+ /**
1192
+ * The tag of the spacers of a windowed list in children: a row in a table body, an item in a
1193
+ * list, as the element where the children are inserted says, or else a `div`.
1194
+ */
1195
+ declare function spacerTag(ctx: Context): string;
1133
1196
  /** Makes markup that renders where it is inserted, such as the children of a layout. */
1134
1197
  declare function lazy(renderAt: (ctx: Context, scope: ScopeId | undefined) => Promise<string>): Lazy;
1135
1198
  /** Renders the attributes of a form or button that posts to a server function. */
@@ -1140,18 +1203,18 @@ declare function action(ctx: Context, name: string, id: string, method?: string,
1140
1203
  */
1141
1204
  declare function actionResult(ctx: Context, fn: unknown): unknown;
1142
1205
  /**
1143
- * Renders a value inserted in markup. `ctx` and `scope` are where it is
1144
- * inserted, for markup that renders there.
1206
+ * Renders a value inserted in markup. `ctx`, `scope` and `anchor` are where it
1207
+ * is inserted, for markup that renders there.
1145
1208
  */
1146
- declare function insert(value: unknown, ctx?: Context, scope?: ScopeId): string | Promise<string>;
1147
- type Component<P = any> = (props: P, ctx: Context) => Promise<string>;
1209
+ declare function insert(value: unknown, ctx?: Context, scope?: ScopeId, tag?: string, anchor?: number): string | Promise<string>;
1210
+ type Component<P = any> = (props: P, ctx: Context) => Promise<string | object>;
1148
1211
  /**
1149
1212
  * Renders a child component. With `scope` and `anchor`, records the child's
1150
1213
  * scope so the parent can update its props on the client.
1151
1214
  */
1152
- declare function component<P>(Child: Component<P>, props: P, ctx: Context, scope?: ScopeId, anchor?: number): Promise<string>;
1215
+ declare function component<P>(Child: Component<P>, props: P, ctx: Context, scope?: ScopeId, anchor?: number, paragraph?: string): Promise<string>;
1153
1216
  /** Renders a dynamic tag, which can be an element name or a component. */
1154
- declare function dynamic(tag: string | Component, attributes: Record<string, unknown>, content: Raw | Lazy | undefined, ctx: Context, scope?: ScopeId): string | Promise<string>;
1217
+ declare function dynamic(tag: string | Component, attributes: Record<string, unknown>, content: Raw | Lazy | undefined, ctx: Context, scope?: ScopeId, ref?: unknown): string | Promise<string>;
1155
1218
  /** The records of the scopes of a render, by scope ID. */
1156
1219
  type StateMap = Map<ScopeId, ScopeState>;
1157
1220
  /**
@@ -1182,6 +1245,10 @@ interface StateAttributes {
1182
1245
  params?: Record<string, string>;
1183
1246
  /** The ID of the build that rendered the page, on its first record, for skew protection. */
1184
1247
  build?: string;
1248
+ /** The ID of a `#loading` boundary whose body failed. The record is the error. */
1249
+ fail?: ScopeId;
1250
+ /** The marker of a `#try` whose `#catch` body replaces its body, from the template `b-c`. */
1251
+ catches?: string;
1185
1252
  }
1186
1253
  /**
1187
1254
  * Returns the script of a state record. `scopes` marks a record with scopes,
@@ -1333,6 +1400,14 @@ type StreamOptions = DocumentOptions;
1333
1400
  declare function renderToStream<P>(Root: Component<P>, props: P, options?: DocumentOptions): ReadableStream<string>;
1334
1401
  /** Streams the parts of a page from `render`: the first render whole, then what resolves later. */
1335
1402
  declare function streamParts(parts: RenderResult, options?: DocumentOptions): ReadableStream<string>;
1403
+ /**
1404
+ * The error that a `#catch` body gets on the server, which the page state carries to the
1405
+ * browser. In development it is the error itself, for debugging. In production it is a plain
1406
+ * `Error` with the message of a `ServerError`, or a generic message, and the real error is
1407
+ * logged, as for a server function that fails. The body renders with this value too, so the
1408
+ * HTML cannot print what the state does not carry.
1409
+ */
1410
+ declare function caught(error: unknown, ctx: Context): unknown;
1336
1411
  interface RequestOptions {
1337
1412
  /**
1338
1413
  * Other origins that may call server functions and post forms to them,
@@ -1425,6 +1500,12 @@ interface RouteOptions extends DocumentOptions, RequestOptions {
1425
1500
  * passes them from the client build.
1426
1501
  */
1427
1502
  hints?: string[];
1503
+ /**
1504
+ * The URLs of the bundle of each root component, such as a route or a layout, by component ID:
1505
+ * its chunk and the chunks that it imports. A page adds those of its views to `hints`, so the
1506
+ * code of the page loads with the HTML. `virtual:brumate/routes` passes them.
1507
+ */
1508
+ bundleHints?: Record<string, string[]>;
1428
1509
  /**
1429
1510
  * Receives the `Link` values of `hints` before the page renders, so a
1430
1511
  * server can send them as `103 Early Hints`, such as with Node's
@@ -1454,7 +1535,7 @@ declare function handleRoute(tree: RouteNode, request: Request, options?: RouteO
1454
1535
  * function belongs to and the modifiers of its wrappers. A function that
1455
1536
  * refers to nothing in the browser is left out.
1456
1537
  */
1457
- declare function spread(attributes: Record<string, unknown>, on?: string[]): string;
1538
+ declare function spread(attributes: Record<string, unknown>, on?: string[], names?: boolean): string;
1458
1539
  //#endregion
1459
- export { setCacheStore as $, serializeCookie as $t, isCrossSite as A, RouteMatch as At, stateScript as B, RequestKind as Bt, children as C, parseForm as Ct, handleRoute as D, Loader as Dt, handleRequest as E, Handler as Et, ready as F, Locals as Ft, waitAll as G, isRedirect as Gt, streamParts as H, dedupe as Ht, render as I, Redirect as It, CacheStore as J, CookieOptions as Jt, IdempotentOptions as K, redirect as Kt, renderToStream as L, RequestCall as Lt, memo as M, RouteView as Mt, packState as N, matchRoute as Nt, inlineBodies as O, Middleware as Ot, read as P, EntryMiddleware as Pt, revalidate as Q, parseCookies as Qt, settled as R, RequestEvent as Rt, binding as S, parse as St, dynamic as T, EndpointLoader as Tt, streamState as U, defineMiddleware as Ut, stateValue as V, ServerError as Vt, wait as W, getEvent as Wt, cached as X, SessionOptions as Xt, CachedOptions as Y, Session as Yt, memoryStore as Z, createSession as Zt, StateAttributes as _, parseSubmission as _t, ItemSource as a, RateLimitOptions as at, action as b, ValidationIssue as bt, Memo as c, clientAddress as ct, RenderOptions as d, FailedSubmission as dt, toNodeHeaders as en, storageStore as et, RenderResult as f, IntentSubmission as ft, ScopeEntry as g, SuccessfulSubmission as gt, RouteOptions as h, SubmissionOptions as ht, DocumentOptions as i, RateLimitMiddleware as it, lazy as j, RouteNode as jt, insert as k, MiddlewareLoader as kt, NotReady as l, configureRateLimit as lt, RevealOrder as m, Submission as mt, Context as n, RateLimitConfig as nt, Lazy as o, RateLimitStore as ot, RequestOptions as p, ReplyOptions as pt, idempotent as q, withEvent as qt, DeferTarget as r, RateLimitError as rt, Mark as s, Window as st, Component as t, RateLimit as tt, PageCache as u, rateLimit as ut, StateMap as v, ParseResult as vt, component as w, safeParse as wt, actionResult as x, fieldErrors as xt, StreamOptions as y, ValidationError as yt, spread as z, RequestEventOptions as zt };
1460
- //# sourceMappingURL=server-DuFYRXrd.d.ts.map
1540
+ export { memoryStore as $, createSession as $t, insert as A, Middleware as At, spacerTag as B, RequestEvent as Bt, caught as C, fieldErrors as Ct, handleRequest as D, EndpointLoader as Dt, dynamic as E, safeParse as Et, read as F, matchRoute as Ft, streamState as G, defineMiddleware as Gt, stateScript as H, RequestKind as Ht, ready as I, EntryMiddleware as It, IdempotentOptions as J, redirect as Jt, wait as K, getEvent as Kt, render as L, Locals as Lt, lazy as M, RouteMatch as Mt, memo as N, RouteNode as Nt, handleRoute as O, Handler as Ot, packState as P, RouteView as Pt, cached as Q, SessionOptions as Qt, renderToStream as R, Redirect as Rt, binding as S, ValidationIssue as St, component as T, parseForm as Tt, stateValue as U, ServerError as Ut, spread as V, RequestEventOptions as Vt, streamParts as W, dedupe as Wt, CacheStore as X, CookieOptions as Xt, idempotent as Y, withEvent as Yt, CachedOptions as Z, Session as Zt, StateAttributes as _, SubmissionOptions as _t, ItemSource as a, RateLimitError as at, action as b, ParseResult as bt, Memo as c, RateLimitStore as ct, RenderOptions as d, configureRateLimit as dt, parseCookies as en, revalidate as et, RenderResult as f, rateLimit as ft, ScopeEntry as g, Submission as gt, RouteOptions as h, ReplyOptions as ht, DocumentOptions as i, RateLimitConfig as it, isCrossSite as j, MiddlewareLoader as jt, inlineBodies as k, Loader as kt, NotReady as l, Window as lt, RevealOrder as m, IntentSubmission as mt, Context as n, toNodeHeaders as nn, storageStore as nt, Lazy as o, RateLimitMiddleware as ot, RequestOptions as p, FailedSubmission as pt, waitAll as q, isRedirect as qt, DeferTarget as r, RateLimit as rt, Mark as s, RateLimitOptions as st, Component as t, serializeCookie as tn, setCacheStore as tt, PageCache as u, clientAddress as ut, StateMap as v, SuccessfulSubmission as vt, children as w, parse as wt, actionResult as x, ValidationError as xt, StreamOptions as y, parseSubmission as yt, settled as z, RequestCall as zt };
1541
+ //# sourceMappingURL=server-CYw15Dsg.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { o as HAS_LATE_MARKUP, r as HAS_BLOCKS, s as HAS_LISTENERS, t as HAS_ACTIONS } from "./features-CHY5Ekku.js";
1
2
  //#region src/runtime/boot.ts
2
3
  /** True on the dev server. A Vite build replaces it with `false`, so the devtools calls go. */
3
4
  const DEV = import.meta.env?.DEV;
@@ -19,10 +20,6 @@ function entries(element) {
19
20
  };
20
21
  })).get(value);
21
22
  }
22
- /** The `prefetch` strategy of an element, from its `data-prefetch`. */
23
- function strategy(element) {
24
- return element.getAttribute("data-prefetch") ?? "hover";
25
- }
26
23
  /**
27
24
  * Imports the core. It reads one export by name, so a build keeps only it and
28
25
  * the helpers that compiled components call.
@@ -42,6 +39,7 @@ const idle = (fn) => (window.requestIdleCallback ?? setTimeout)(fn);
42
39
  */
43
40
  function boot(options, navigate) {
44
41
  let core;
42
+ let stopped = false;
45
43
  /** The event types that the document listens to, and whether each listener is passive. */
46
44
  const types = /* @__PURE__ */ new Map();
47
45
  const removers = [];
@@ -87,46 +85,29 @@ function boot(options, navigate) {
87
85
  return client;
88
86
  });
89
87
  listen(document, "brumate:core", () => void loadCore());
90
- const warmed = /* @__PURE__ */ new Set();
91
- const parts = /* @__PURE__ */ new Map();
92
- const partOf = (ref) => {
93
- if (parts.has(ref)) return parts.get(ref);
94
- let found;
95
- if (!ref.startsWith("$")) {
96
- const [id, name] = ref.split("@")[0].split("#");
97
- found = [id, /^[hct]\d/.test(name) ? name : "update"];
98
- }
99
- parts.set(ref, found);
100
- return found;
101
- };
102
- const warmedAll = (element) => {
103
- for (const entry of entries(element)) {
104
- const found = partOf(entry.ref);
105
- if (found && !warmed.has(`${found[0]}#${found[1]}`)) return false;
106
- }
107
- return true;
108
- };
109
- const warm = (ref, reason) => {
110
- const found = partOf(ref);
111
- if (!found) return;
112
- const [id, part] = found;
113
- const key = `${id}#${part}`;
114
- if (warmed.has(key)) return;
115
- warmed.add(key);
116
- const done = loadModule(id)?.then((module) => {
117
- if (!module.load) return;
118
- if (part !== "update") loadPart(module, "update").catch(() => {});
119
- return loadPart(module, part);
120
- });
121
- done?.catch(() => warmed.delete(key));
122
- if (DEV && done) devtools()?.load?.(id, part, reason, done);
123
- };
124
88
  const run = (element, ref, event) => {
125
- warm(ref, event ? "event" : "block");
89
+ if (stopped) return;
126
90
  loadCore().then((client) => client.handle(element, ref, event));
127
91
  };
92
+ /**
93
+ * A key of `prevent` matches its `event.key` while only the modifier that it names is held. A
94
+ * key alone matches while Ctrl, Meta and Alt are up, so the shortcuts of the browser, such as
95
+ * Cmd+Left or Alt+Left, keep their default. `Mod+` is Ctrl or Meta. Shift does not count.
96
+ */
97
+ const keyMatches = (key, event) => {
98
+ const plus = key.indexOf("+", 1);
99
+ const modifier = plus > 0 ? key.slice(0, plus) : "";
100
+ if ((event.key === " " ? "Space" : event.key) !== (plus > 0 ? key.slice(plus + 1) : key)) return false;
101
+ switch (modifier) {
102
+ case "Mod": return (event.ctrlKey || event.metaKey) && !event.altKey;
103
+ case "Ctrl": return event.ctrlKey && !event.metaKey && !event.altKey;
104
+ case "Meta": return event.metaKey && !event.ctrlKey && !event.altKey;
105
+ case "Alt": return event.altKey && !event.ctrlKey && !event.metaKey;
106
+ default: return !event.ctrlKey && !event.metaKey && !event.altKey;
107
+ }
108
+ };
128
109
  const apply = (event, element, entry) => {
129
- for (const modifier of entry.modifiers) if (modifier === "prevent" || modifier.startsWith("prevent(") && modifier.slice(8, -1).split(",").includes(event.key === " " ? "Space" : event.key)) event.preventDefault();
110
+ for (const modifier of entry.modifiers) if (modifier === "prevent" || modifier.startsWith("prevent(") && !event.isComposing && modifier.slice(8, -1).split(",").some((key) => keyMatches(key, event))) event.preventDefault();
130
111
  if (entry.modifiers.includes("once")) element.setAttribute("b-on", entries(element).map((item) => item.raw).filter((raw) => raw !== entry.raw).join(" "));
131
112
  run(element, entry.ref, event);
132
113
  return entry.modifiers.includes("stop");
@@ -138,6 +119,19 @@ function boot(options, navigate) {
138
119
  * of its target. `stop` ends the event where it is.
139
120
  */
140
121
  const onEvent = (event) => {
122
+ for (let node = event.target; node; node = node.parentNode) for (const [type, check] of cancels.get(node) ?? []) {
123
+ if (type !== event.type) continue;
124
+ let cancel = false;
125
+ try {
126
+ cancel = check(event);
127
+ } catch (error) {
128
+ console.error(error);
129
+ }
130
+ if (cancel) {
131
+ event.preventDefault();
132
+ return;
133
+ }
134
+ }
141
135
  const path = [];
142
136
  for (let node = event.target; node && node !== document; node = node.parentNode) if (node.nodeType === 1 && node.hasAttribute("b-on")) path.push(node);
143
137
  const phase = (elements, capture) => {
@@ -153,13 +147,24 @@ function boot(options, navigate) {
153
147
  };
154
148
  if (!phase([...path].reverse(), true)) phase(event.bubbles ? path : path.filter((element) => element === event.target), false);
155
149
  };
150
+ const cancels = /* @__PURE__ */ new WeakMap();
151
+ globalThis[Symbol.for("brumate.cancel")] = (element, type, check) => {
152
+ const entry = [type, check];
153
+ let set = cancels.get(element);
154
+ if (!set) cancels.set(element, set = /* @__PURE__ */ new Set());
155
+ set.add(entry);
156
+ delegate(type, false);
157
+ return () => void set.delete(entry);
158
+ };
156
159
  /** True for an entry that prevents the default action, which a passive listener cannot do. */
157
160
  const prevents = (entry) => entry.modifiers.some((modifier) => modifier.startsWith("prevent"));
158
161
  /**
159
162
  * Listens to an event type on the document. The listener is passive, so
160
- * scrolling does not wait for it, until an entry of the type prevents.
163
+ * scrolling does not wait for it, until an entry of the type prevents. `click` and `submit` never
164
+ * scroll, so they are never passive: a `prevent` that is written after load cancels them.
161
165
  */
162
- const delegate = (type, prevent) => {
166
+ const delegate = (type, cancel) => {
167
+ const prevent = cancel || type === "click" || type === "submit";
163
168
  const passive = types.get(type);
164
169
  if (passive === false || passive === true && !prevent) return;
165
170
  if (passive) document.removeEventListener(type, onEvent, true);
@@ -183,30 +188,13 @@ function boot(options, navigate) {
183
188
  for (const element of root.querySelectorAll(selector)) add(element);
184
189
  return found;
185
190
  };
186
- const visible = typeof IntersectionObserver === "undefined" ? void 0 : new IntersectionObserver((records) => {
187
- for (const record of records) if (record.isIntersecting) {
188
- visible.unobserve(record.target);
189
- preload(record.target, eagerly.has(record.target) ? "eager" : "visible");
190
- }
191
- }, { rootMargin: "25%" });
192
- removers.push(() => visible?.disconnect());
193
- const eagerly = /* @__PURE__ */ new WeakSet();
194
- let eager = false;
195
191
  const delegated = /* @__PURE__ */ new Set();
196
- const ready = /* @__PURE__ */ new Set();
197
192
  const onElement = (element) => {
198
193
  const value = element.getAttribute("b-on");
199
194
  if (!delegated.has(value)) {
200
195
  delegated.add(value);
201
196
  for (const entry of entries(element)) delegate(entry.type, prevents(entry));
202
197
  }
203
- if (!eager || ready.has(value) || strategy(element) !== "hover") return;
204
- if (warmedAll(element)) {
205
- ready.add(value);
206
- return;
207
- }
208
- eagerly.add(element);
209
- visible?.observe(element);
210
198
  };
211
199
  const onListener = (template) => {
212
200
  const target = template.getAttribute("b-listen") === "window" ? window : document;
@@ -225,13 +213,16 @@ function boot(options, navigate) {
225
213
  run(template, ref);
226
214
  return;
227
215
  }
228
- const done = import("./defer-BbD7JQhj.js").then((module) => module.loadDeferred(template));
216
+ const done = import("./defer-BLJjxqVc.js").then((module) => module.loadDeferred(template));
229
217
  if (DEV) devtools()?.defer?.(template, done);
230
218
  };
231
219
  const near = template.getAttribute("b-near");
232
- const next = near && (root.querySelector(`[b-b="${near}"]`) ?? document.querySelector(`[b-b="${near}"]`)) || template.nextElementSibling;
220
+ let after = template.nextElementSibling;
221
+ while (after?.tagName === "TEMPLATE") after = after.nextElementSibling;
222
+ const selector = `[b-b="${near}"],[b-r="${near}"]`;
223
+ const next = near && (root.querySelector(selector) ?? document.querySelector(selector)) || after;
233
224
  if (trigger === "idle") idle(go);
234
- else if (trigger === "visible" && next && visible) {
225
+ else if (trigger === "visible" && next && typeof IntersectionObserver !== "undefined") {
235
226
  const observer = new IntersectionObserver((records) => {
236
227
  if (records.some((record) => record.isIntersecting)) {
237
228
  observer.disconnect();
@@ -241,43 +232,23 @@ function boot(options, navigate) {
241
232
  observer.observe(next);
242
233
  } else go();
243
234
  };
244
- const SCANNED = "[data-prefetch=visible],[data-prefetch=idle],[b-on],template[b-listen],template[b-client],template[b-defer]";
235
+ const SCANNED = "[b-on],template[b-listen],template[b-client],template[b-defer]";
245
236
  const scan = (root) => {
237
+ if (stopped) return;
246
238
  const blocks = [];
247
239
  for (const element of select(root, SCANNED)) {
248
240
  if (element.tagName === "TEMPLATE") {
249
- if (element.hasAttribute("b-listen")) onListener(element);
250
- else if (element.hasAttribute("b-client") || element.hasAttribute("b-defer") && !element.hasAttribute("b-hole")) blocks.push(element);
241
+ if (HAS_LISTENERS && element.hasAttribute("b-listen")) onListener(element);
242
+ else if (HAS_BLOCKS && (element.hasAttribute("b-client") || element.hasAttribute("b-defer") && !element.hasAttribute("b-hole"))) blocks.push(element);
251
243
  continue;
252
244
  }
253
- if (element.hasAttribute("data-prefetch")) {
254
- const prefetch = element.getAttribute("data-prefetch");
255
- if (prefetch === "visible" || prefetch === "idle") {
256
- if (strategy(element) === "idle" || !visible) idle(() => preload(element, strategy(element) === "idle" ? "idle" : "visible"));
257
- else visible.observe(element);
258
- }
259
- }
260
245
  if (element.hasAttribute("b-on")) onElement(element);
261
246
  }
262
247
  for (const template of blocks) onBlock(root, template);
263
248
  };
264
- const preloaded = /* @__PURE__ */ new WeakSet();
265
- const preload = (element, reason) => {
266
- if (preloaded.has(element)) return;
267
- preloaded.add(element);
268
- importCore();
269
- loadSerial()?.catch(() => {});
270
- for (const entry of entries(element)) warm(entry.ref, reason);
271
- };
272
- const hover = (event) => {
273
- const element = event.target.closest?.("[b-on]");
274
- if (element && strategy(element) === "hover") preload(element, "hover");
275
- };
276
- listen(document, "pointerover", hover, { passive: true });
277
- listen(document, "focusin", hover);
278
249
  listen(document, "submit", (event) => {
279
250
  const form = event.target;
280
- if (event.defaultPrevented || !form.hasAttribute?.("b-result")) return;
251
+ if (!HAS_ACTIONS || event.defaultPrevented || !form.hasAttribute?.("b-result")) return;
281
252
  event.preventDefault();
282
253
  const submitter = event.submitter;
283
254
  loadCore().then((client) => client.submitAction(form, submitter));
@@ -294,25 +265,34 @@ function boot(options, navigate) {
294
265
  const scanAdded = (records) => {
295
266
  for (const record of records) for (const node of record.addedNodes) if (node.nodeType === 1) scan(node);
296
267
  };
297
- const observer = new MutationObserver(scanAdded);
298
- observer.observe(document, {
268
+ const observer = HAS_LATE_MARKUP ? new MutationObserver(scanAdded) : void 0;
269
+ observer?.observe(document, {
299
270
  childList: true,
300
271
  subtree: true
301
272
  });
273
+ if (!HAS_LATE_MARKUP && document.readyState === "loading") listen(document, "DOMContentLoaded", () => scan(document));
302
274
  const scanInsert = (root) => {
303
- scanAdded(observer.takeRecords());
275
+ if (observer) scanAdded(observer.takeRecords());
304
276
  scan(root);
305
277
  };
306
278
  const inserted = () => {
307
- observer.takeRecords();
279
+ observer?.takeRecords();
280
+ };
281
+ loadCore().catch(() => {});
282
+ const bundled = /* @__PURE__ */ new Set();
283
+ const loadBundles = () => {
284
+ for (const script of document.querySelectorAll("script[b-state]")) for (const [, id] of script.textContent?.matchAll(/\bm:"([^"]+)"/g) ?? []) if (!bundled.has(id)) {
285
+ bundled.add(id);
286
+ options.loadBundle?.(id)?.catch(() => {});
287
+ }
308
288
  };
309
- const connection = navigator.connection;
310
- if (options.preload !== false && !connection?.saveData && !/2g/.test(connection?.effectiveType)) listen(window, "load", () => idle(() => {
311
- eager = true;
312
- scan(document);
313
- }));
289
+ if (options.loadBundle) {
290
+ loadBundles();
291
+ if (document.readyState === "loading") listen(document, "DOMContentLoaded", loadBundles);
292
+ }
314
293
  return () => {
315
- observer.disconnect();
294
+ stopped = true;
295
+ observer?.disconnect();
316
296
  for (const remove of removers.splice(0)) remove();
317
297
  core?.then((client) => client.dispose());
318
298
  };
@@ -328,6 +308,6 @@ function startWithoutNavigation(options) {
328
308
  return boot(options);
329
309
  }
330
310
  //#endregion
331
- export { strategy as i, boot as n, importCore as r, startWithoutNavigation as t };
311
+ export { boot as n, importCore as r, startWithoutNavigation as t };
332
312
 
333
- //# sourceMappingURL=static-loader-nZssh66R.js.map
313
+ //# sourceMappingURL=static-loader-C_GYIFtt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-loader-C_GYIFtt.js","names":[],"sources":["../src/runtime/boot.ts","../src/runtime/static-loader.ts"],"sourcesContent":["// The loader's code that every page runs. `loader.ts` adds client navigation,\n// and `static-loader.ts` starts it without, so a site that turns navigation\n// off does not have its code, or the parts of the core that only it uses, in\n// its bundle.\n//\n// This file keeps its arrow functions and its Array methods, for size: the loader ships to every\n// page, and the function declarations and loops measured 20 to 50 bytes of gzip larger.\n\nimport { HAS_ACTIONS, HAS_BLOCKS, HAS_LATE_MARKUP, HAS_LISTENERS } from './features.ts';\nimport type * as Client from './client.ts';\nimport type { ClientModule, DevtoolsHooks, Part } from './client.ts';\nimport type { SerialEntry } from './values.ts';\n\n/** True on the dev server. A Vite build replaces it with `false`, so the devtools calls go. */\nconst DEV = (import.meta as { env?: { DEV?: boolean } }).env?.DEV;\n\n/** The hooks of the devtools overlay, under the same key as the core's. */\nfunction devtools(): DevtoolsHooks | undefined {\n return (globalThis as Record<symbol, DevtoolsHooks | undefined>)[Symbol.for('brumate.devtools')];\n}\n\nexport interface LoaderOptions {\n /**\n * Imports the client module of a component, by component ID. Undefined for\n * a component that has no client code.\n */\n load: (id: string) => Promise<ClientModule> | undefined;\n /**\n * Loads the bundle of a root component of the page, such as a route: the client modules of\n * the components that it can render, in one chunk. Undefined for a component that is not a\n * root.\n */\n loadBundle?: (id: string) => Promise<unknown> | undefined;\n /** The URL prefix of server function calls. */\n rpc?: string;\n /** Imports the serial entry, which the core takes before it reads the page state. */\n serial?: () => Promise<SerialEntry>;\n /**\n * Loads pages without a full page load: links to the same origin, the back\n * and forward buttons, forms that post to a server function, and redirects\n * from server functions to the same origin. Defaults to true.\n */\n navigate?: boolean | NavigateOptions;\n /**\n * The ID of the build of the page, for skew protection. The Vite plugin\n * sets it. Calls send it, and a page of another build, or a call that\n * answers 409 after a deploy, makes the next navigation a full page load.\n */\n build?: string;\n /**\n * Receives every error of client code first: of a handler, an effect, a\n * `$client` callback or a memo that loads, such as for a reporting\n * service. `scope` is the ID of the scope that the code belongs to. The\n * error then renders the `#catch` body of the nearest `#try`, or the page\n * gets a `brumate:error` event on `window` and the error is logged.\n */\n onError?: (error: unknown, info: { scope?: number | string }) => void;\n}\n\nexport interface NavigateOptions {\n /**\n * Swaps the page inside a view transition, where the browser has them.\n * CSS can tell links, the back and forward buttons and forms apart with\n * the types `push`, `traverse` and `form`. A redirect from a server\n * function has the type `form`.\n */\n transition?: boolean;\n /**\n * After a navigation, moves the focus to the first `<h1>` of the routes\n * that changed, or to `<main>`, as a full page load starts it at the top.\n * Defaults to true.\n */\n focus?: boolean;\n}\n\ninterface Entry {\n raw: string;\n type: string;\n modifiers: string[];\n ref: string;\n}\n\n// Parsed `b-on` values, so repeated events do not parse them again.\nconst parsed = new Map<string, Entry[]>();\n\nexport function entries(element: Element): Entry[] {\n const value = element.getAttribute('b-on') ?? '';\n return (parsed.get(value) ??\n parsed\n .set(\n value,\n value\n .split(' ')\n .filter(Boolean)\n .map((entry) => {\n const [name, ref] = entry.split('=') as [string, string];\n const [type, ...modifiers] = name.split(':') as [string, ...string[]];\n return { raw: entry, type, modifiers, ref };\n }),\n )\n .get(value))!;\n}\n\n/** The functions of the core that the loader calls. */\nexport type Core = (typeof Client)['loader'];\n\n/**\n * Imports the core. It reads one export by name, so a build keeps only it and\n * the helpers that compiled components call.\n */\nlet corePromise: Promise<Core> | undefined;\nexport const importCore = (): Promise<Core> =>\n (corePromise ??= import('./client.ts').then(\n (client) => client.loader,\n (error: unknown) => {\n // A load that fails can start again, such as after the network comes back.\n corePromise = undefined;\n throw error;\n },\n ));\n\n/** Runs a function when the browser is idle. */\nconst idle = (fn: () => void): unknown => (window.requestIdleCallback ?? setTimeout)(fn);\n\n/** What the loader gives the code that loads pages without a full page load. */\nexport interface Navigation {\n options: LoaderOptions;\n listen: (\n target: EventTarget,\n type: string,\n listener: (event: Event) => void,\n flags?: AddEventListenerOptions | boolean,\n ) => void;\n core: () => Promise<Core> | undefined;\n /** Starts the core, or returns the one that runs. */\n start: () => Promise<Core>;\n scan: (root: ParentNode) => void;\n}\n\n/**\n * Starts resuming the page. Listens to the events in `b-on` attributes\n * and loads `brumate/client` and the component's module on the first one.\n * `navigate` adds client navigation, and returns how to import the core.\n * Returns a function that removes the listeners and stops the core.\n */\nexport function boot(\n options: LoaderOptions,\n navigate?: (navigation: Navigation) => () => Promise<Core>,\n): () => void {\n let core: Promise<Core> | undefined;\n // Once stopped, the loader starts nothing, also from markup that the core inserts later with the\n // hooks that this loader gave it. A new loader can reuse the IDs of client scopes, so a stale\n // start would run in a scope of the new page.\n let stopped = false;\n /** The event types that the document listens to, and whether each listener is passive. */\n const types = new Map<string, boolean>();\n const removers: (() => void)[] = [];\n const listen = (\n target: EventTarget,\n type: string,\n listener: (event: Event) => void,\n flags?: AddEventListenerOptions | boolean,\n ): void => {\n target.addEventListener(type, listener, flags);\n removers.push(() => target.removeEventListener(type, listener, flags));\n };\n\n // Client navigation imports the core with the code that reads the pages it adds.\n let load = importCore;\n // The modules and parts that the loader asked for, which the core takes, so a handler whose\n // code loaded runs without another `import()`. In Chrome, an `import()` of a module that is\n // loaded already still resolves in a task of its own, which can wait for the next frame.\n const modules = new Map<string, Promise<ClientModule> | undefined>();\n const loadModule = (id: string): Promise<ClientModule> | undefined => {\n if (modules.has(id)) {\n return modules.get(id);\n }\n const promise = options.load(id);\n modules.set(id, promise);\n // A load that fails can start again, such as after the network comes back.\n promise?.catch(() => modules.delete(id));\n return promise;\n };\n const partLoads = new Map<string, Promise<Part>>();\n const loadPart = (module: ClientModule, part: string): Promise<Part> => {\n const key = `${module.id}#${part}`;\n let promise = partLoads.get(key);\n if (!promise) {\n promise = module.load!(part);\n partLoads.set(key, promise);\n promise.catch(() => partLoads.delete(key));\n }\n return promise;\n };\n // The serial entry loads with the core, so the core can make the values of the app.\n let serialLoad: Promise<SerialEntry> | undefined;\n const loadSerial = (): Promise<SerialEntry> | undefined => {\n serialLoad ??= options.serial?.();\n serialLoad?.catch(() => (serialLoad = undefined));\n return serialLoad;\n };\n const loadCore = (): Promise<Core> =>\n (core ??= Promise.all([load(), loadSerial()]).then(([client, serial]) => {\n client.init({ ...options, load: loadModule, loadPart, listen: scanInsert, inserted, serial });\n return client;\n }));\n\n // The devtools panel asks for the core when it opens, so it can show the page before any event.\n listen(document, 'brumate:core', () => void loadCore());\n\n const run = (element: Element, ref: string, event?: Event): void => {\n if (stopped) {\n return;\n }\n void loadCore().then((client) => client.handle(element, ref, event));\n };\n\n /**\n * A key of `prevent` matches its `event.key` while only the modifier that it names is held. A\n * key alone matches while Ctrl, Meta and Alt are up, so the shortcuts of the browser, such as\n * Cmd+Left or Alt+Left, keep their default. `Mod+` is Ctrl or Meta. Shift does not count.\n */\n const keyMatches = (key: string, event: KeyboardEvent): boolean => {\n const plus = key.indexOf('+', 1);\n const modifier = plus > 0 ? key.slice(0, plus) : '';\n if ((event.key === ' ' ? 'Space' : event.key) !== (plus > 0 ? key.slice(plus + 1) : key)) {\n return false;\n }\n switch (modifier) {\n case 'Mod':\n return (event.ctrlKey || event.metaKey) && !event.altKey;\n case 'Ctrl':\n return event.ctrlKey && !event.metaKey && !event.altKey;\n case 'Meta':\n return event.metaKey && !event.ctrlKey && !event.altKey;\n case 'Alt':\n return event.altKey && !event.ctrlKey && !event.metaKey;\n default:\n return !event.ctrlKey && !event.metaKey && !event.altKey;\n }\n };\n\n const apply = (event: Event, element: Element, entry: Entry): boolean => {\n for (const modifier of entry.modifiers) {\n // `prevent(ArrowDown,Enter)` prevents only these keys, by `event.key`. A key that commits\n // or moves within the text of an input method, such as Enter while it composes, is the\n // input method's, so it keeps its default.\n if (\n modifier === 'prevent' ||\n (modifier.startsWith('prevent(') &&\n !(event as KeyboardEvent).isComposing &&\n modifier\n .slice(8, -1)\n .split(',')\n .some((key) => keyMatches(key, event as KeyboardEvent)))\n ) {\n event.preventDefault();\n }\n }\n if (entry.modifiers.includes('once')) {\n element.setAttribute(\n 'b-on',\n entries(element)\n .map((item) => item.raw)\n .filter((raw) => raw !== entry.raw)\n .join(' '),\n );\n }\n run(element, entry.ref, event);\n return entry.modifiers.includes('stop');\n };\n\n /**\n * Handlers run as if each element had its own listener: those with\n * `capture` from the outside in, then the others from the target outwards.\n * An event that does not bubble, such as `focus`, reaches only the others\n * of its target. `stop` ends the event where it is.\n */\n const onEvent = (event: Event): void => {\n // The checks of `cancelWhen`, from the target up, run before any handler.\n for (let node = event.target as Node | null; node; node = node.parentNode) {\n for (const [type, check] of cancels.get(node as Element) ?? []) {\n if (type !== event.type) {\n continue;\n }\n let cancel = false;\n try {\n cancel = check(event);\n } catch (error) {\n // A check that throws cancels nothing, and the other checks and the handlers still run.\n console.error(error);\n }\n if (cancel) {\n event.preventDefault();\n return;\n }\n }\n }\n const path: Element[] = [];\n for (\n let node = event.target as Node | null;\n node && node !== document;\n node = node.parentNode\n ) {\n if (node.nodeType === 1 && (node as Element).hasAttribute('b-on')) {\n path.push(node as Element);\n }\n }\n const phase = (elements: Element[], capture: boolean): boolean => {\n for (const element of elements) {\n let stop = false;\n for (const entry of entries(element)) {\n if (\n entry.type === event.type &&\n entry.modifiers.includes('capture') === capture &&\n apply(event, element, entry)\n ) {\n stop = true;\n }\n }\n if (stop) {\n event.stopPropagation();\n return true;\n }\n }\n return false;\n };\n if (!phase([...path].reverse(), true)) {\n phase(event.bubbles ? path : path.filter((element) => element === event.target), false);\n }\n };\n\n // The checks of `cancelWhen`, by element. `events.ts` reaches them through a symbol of the registry.\n const cancels = new WeakMap<Node, Set<[string, (event: Event) => boolean]>>();\n (globalThis as { [key: symbol]: unknown })[Symbol.for('brumate.cancel')] = (\n element: Element,\n type: string,\n check: (event: Event) => boolean,\n ): (() => void) => {\n const entry: [string, typeof check] = [type, check];\n let set = cancels.get(element);\n if (!set) {\n cancels.set(element, (set = new Set()));\n }\n set.add(entry);\n delegate(type, false);\n return () => void set.delete(entry);\n };\n\n /** True for an entry that prevents the default action, which a passive listener cannot do. */\n const prevents = (entry: Entry): boolean =>\n entry.modifiers.some((modifier) => modifier.startsWith('prevent'));\n\n /**\n * Listens to an event type on the document. The listener is passive, so\n * scrolling does not wait for it, until an entry of the type prevents. `click` and `submit` never\n * scroll, so they are never passive: a `prevent` that is written after load cancels them.\n */\n const delegate = (type: string, cancel: boolean): void => {\n const prevent = cancel || type === 'click' || type === 'submit';\n const passive = types.get(type);\n if (passive === false || (passive === true && !prevent)) {\n return;\n }\n if (passive) {\n document.removeEventListener(type, onEvent, true);\n }\n types.set(type, !prevent);\n listen(document, type, onEvent, { capture: true, passive: !prevent });\n };\n\n // Templates are started once, even when markup is scanned again.\n const started = new WeakSet<Element>();\n const select = (root: ParentNode, selector: string): Element[] => {\n const found: Element[] = [];\n const add = (element: Element): void => {\n if (element.tagName === 'TEMPLATE') {\n if (started.has(element)) {\n return;\n }\n started.add(element);\n }\n found.push(element);\n };\n if ((root as Element).matches?.(selector)) {\n add(root as Element);\n }\n for (const element of root.querySelectorAll(selector)) {\n add(element);\n }\n return found;\n };\n\n // The values of `b-on` whose event types the document listens to already. The rows of a\n // list repeat the same few values.\n const delegated = new Set<string>();\n const onElement = (element: Element): void => {\n const value = element.getAttribute('b-on')!;\n if (!delegated.has(value)) {\n delegated.add(value);\n for (const entry of entries(element)) {\n delegate(entry.type, prevents(entry));\n }\n }\n };\n const onListener = (template: Element): void => {\n const target = template.getAttribute('b-listen') === 'window' ? window : document;\n for (const entry of entries(template)) {\n // Markup that is gone, such as a page that navigation replaced, no longer listens.\n listen(\n target,\n entry.type,\n (event) => {\n if (template.isConnected) {\n apply(event, template, entry);\n }\n },\n { capture: entry.modifiers.includes('capture'), passive: !prevents(entry) },\n );\n }\n };\n // A `#defer` block whose body the server sends in the same response, with `b-hole`, waits for it.\n const onBlock = (root: ParentNode, template: Element): void => {\n const client = template.getAttribute('b-client');\n const [trigger, ref] = (client ?? template.getAttribute('b-defer')!).split(\n client ? '=' : ':',\n ) as [string, string];\n // A `#defer` block asks the server for its body, with a module that only it needs.\n const go = (): void => {\n if (client) {\n run(template, ref);\n return;\n }\n const done = import('./defer.ts').then((module) => module.loadDeferred(template));\n if (DEV) {\n devtools()?.defer?.(template, done);\n }\n };\n // The element that a `$client` callback reads through `ref` (`b-b`), or that a component\n // forwards to its signal (`b-r`), or the one after the marker.\n // Other markers can follow it, and a template has no box, so it is never in view.\n const near = template.getAttribute('b-near');\n let after = template.nextElementSibling;\n while (after?.tagName === 'TEMPLATE') {\n after = after.nextElementSibling;\n }\n const selector = `[b-b=\"${near}\"],[b-r=\"${near}\"]`;\n const next =\n (near && (root.querySelector(selector) ?? document.querySelector(selector))) || after;\n if (trigger === 'idle') {\n idle(go);\n } else if (trigger === 'visible' && next && typeof IntersectionObserver !== 'undefined') {\n const observer = new IntersectionObserver((records) => {\n if (records.some((record) => record.isIntersecting)) {\n observer.disconnect();\n go();\n }\n });\n observer.observe(next);\n } else {\n go();\n }\n };\n const SCANNED = '[b-on],template[b-listen],template[b-client],template[b-defer]';\n // One query of the markup for everything that the loader starts. The blocks start after the\n // rest, as they did when each kind had its own query.\n const scan = (root: ParentNode): void => {\n if (stopped) {\n return;\n }\n const blocks: Element[] = [];\n for (const element of select(root, SCANNED)) {\n if (element.tagName === 'TEMPLATE') {\n if (HAS_LISTENERS && element.hasAttribute('b-listen')) {\n onListener(element);\n } else if (\n HAS_BLOCKS &&\n (element.hasAttribute('b-client') ||\n (element.hasAttribute('b-defer') && !element.hasAttribute('b-hole')))\n ) {\n blocks.push(element);\n }\n continue;\n }\n if (element.hasAttribute('b-on')) {\n onElement(element);\n }\n }\n for (const template of blocks) {\n onBlock(root, template);\n }\n };\n\n // A form of an `$action` sends its data with `fetch`, and the core writes the result into the page.\n listen(document, 'submit', (event) => {\n const form = event.target as HTMLFormElement;\n if (!HAS_ACTIONS || event.defaultPrevented || !form.hasAttribute?.('b-result')) {\n return;\n }\n event.preventDefault();\n const submitter = (event as SubmitEvent).submitter;\n void loadCore().then((client) => client.submitAction(form, submitter));\n });\n\n if (navigate) {\n load = navigate({ options, listen, core: () => core, start: loadCore, scan });\n } else {\n // A hot update whose markup changed loads the page again.\n listen(document, 'brumate:reload', () => location.reload());\n }\n\n scan(document);\n // Markup that streams in later, such as a `#loading` body, has handlers too.\n const scanAdded = (records: MutationRecord[]): void => {\n for (const record of records) {\n for (const node of record.addedNodes) {\n if (node.nodeType === 1) {\n scan(node as Element);\n }\n }\n }\n };\n // Without markup that others insert, the core scans all that comes into the page. The rest of\n // the page that the browser reads after an `async` script starts is scanned when it ends.\n const observer = HAS_LATE_MARKUP ? new MutationObserver(scanAdded) : undefined;\n observer?.observe(document, { childList: true, subtree: true });\n if (!HAS_LATE_MARKUP && document.readyState === 'loading') {\n listen(document, 'DOMContentLoaded', () => scan(document));\n }\n // The core scans the markup that it inserts before the insert, so the records of the insert\n // are dropped instead of scanned again. The markup that others inserted first is scanned\n // first.\n const scanInsert = (root: ParentNode): void => {\n if (observer) {\n scanAdded(observer.takeRecords());\n }\n scan(root);\n };\n const inserted = (): void => {\n observer?.takeRecords();\n };\n\n // The core starts at once and loads the code of the components on the page, so a call of a\n // function of another component, such as a function prop, runs at once and in order.\n void loadCore().catch(() => {});\n // The bundles of the components in the state start with it, so the code of the page comes in\n // the same round trip as the core. The core asks for them again when it reads the state.\n const bundled = new Set<string>();\n const loadBundles = (): void => {\n for (const script of document.querySelectorAll('script[b-state]')) {\n for (const [, id] of script.textContent?.matchAll(/\\bm:\"([^\"]+)\"/g) ?? []) {\n if (!bundled.has(id!)) {\n bundled.add(id!);\n void options.loadBundle?.(id!)?.catch(() => {});\n }\n }\n }\n };\n if (options.loadBundle) {\n loadBundles();\n if (document.readyState === 'loading') {\n listen(document, 'DOMContentLoaded', loadBundles);\n }\n }\n return () => {\n stopped = true;\n observer?.disconnect();\n for (const remove of removers.splice(0)) {\n remove();\n }\n void core?.then((client) => client.dispose());\n };\n}\n","// The loader without client navigation, for `navigate: false`. It is a module\n// of its own, so a bundle that starts it has no import of the navigation code,\n// and keeps none of the core's exports that only navigation reads.\n\nimport { boot } from './boot.ts';\nimport type { LoaderOptions } from './boot.ts';\n\nexport type { LoaderOptions } from './boot.ts';\n\n/**\n * `start` for a site that loads every page with a full page load, as with\n * `navigate: false`. A bundle that only calls it leaves out the code of\n * client navigation.\n */\nexport function startWithoutNavigation(options: LoaderOptions): () => void {\n return boot(options);\n}\n"],"mappings":";;;AAcA,MAAM,MAAO,YAA4C,KAAK;;AAG9D,SAAS,WAAsC;CAC7C,OAAQ,WAAyD,OAAO,IAAI,kBAAkB;AAChG;AAgEA,MAAM,yBAAS,IAAI,IAAqB;AAExC,SAAgB,QAAQ,SAA2B;CACjD,MAAM,QAAQ,QAAQ,aAAa,MAAM,KAAK;CAC9C,OAAQ,OAAO,IAAI,KAAK,KACtB,OACG,IACC,OACA,MACG,MAAM,GAAG,CAAC,CACV,OAAO,OAAO,CAAC,CACf,KAAK,UAAU;EACd,MAAM,CAAC,MAAM,OAAO,MAAM,MAAM,GAAG;EACnC,MAAM,CAAC,MAAM,GAAG,aAAa,KAAK,MAAM,GAAG;EAC3C,OAAO;GAAE,KAAK;GAAO;GAAM;GAAW;EAAI;CAC5C,CAAC,CACL,CAAC,CACA,IAAI,KAAK;AAChB;;;;;AASA,IAAI;AACJ,MAAa,mBACV,gBAAgB,OAAO,sBAAc,CAAC,MACpC,WAAW,OAAO,SAClB,UAAmB;CAElB,cAAc,KAAA;CACd,MAAM;AACR,CACF;;AAGF,MAAM,QAAQ,QAA6B,OAAO,uBAAuB,WAAA,CAAY,EAAE;;;;;;;AAuBvF,SAAgB,KACd,SACA,UACY;CACZ,IAAI;CAIJ,IAAI,UAAU;;CAEd,MAAM,wBAAQ,IAAI,IAAqB;CACvC,MAAM,WAA2B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AI,EAAG,GAAG;GACrB,QAAQ,IAAI,EAAG;GACf,QAAa,aAAa,EAAG,CAAC,EAAE,YAAY,CAAC,CAAC;EAChD;CAGN;CACA,IAAI,QAAQ,YAAY;EACtB,YAAY;EACZ,IAAI,SAAS,eAAe,WAC1B,OAAO,UAAU,oBAAoB,WAAW;CAEpD;CACA,aAAa;EACX,UAAU;EACV,UAAU,WAAW;EACrB,KAAK,MAAM,UAAU,SAAS,OAAO,CAAC,GACpC,OAAO;EAET,MAAW,MAAM,WAAW,OAAO,QAAQ,CAAC;CAC9C;AACF;;;;;;;;AC9iBA,SAAgB,uBAAuB,SAAoC;CACzE,OAAO,KAAK,OAAO;AACrB"}
@@ -1,4 +1,4 @@
1
- import { t as LoaderOptions } from "./boot-C25Sa6vq.js";
1
+ import { t as LoaderOptions } from "./boot-SCWYwuUd.js";
2
2
  //#region src/runtime/static-loader.d.ts
3
3
  /**
4
4
  * `start` for a site that loads every page with a full page load, as with
@@ -8,4 +8,4 @@ import { t as LoaderOptions } from "./boot-C25Sa6vq.js";
8
8
  declare function startWithoutNavigation(options: LoaderOptions): () => void;
9
9
  //#endregion
10
10
  export { startWithoutNavigation as t };
11
- //# sourceMappingURL=static-loader-Drpr0AzI.d.ts.map
11
+ //# sourceMappingURL=static-loader-DVuLmXeu.d.ts.map