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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-DS9B1H-M.js","names":[],"sources":["../src/runtime/html.ts"],"sourcesContent":["// HTML string helpers that the server and the client both use.\n\nconst RAW: unique symbol = Symbol.for('brumate.raw');\nconst INTERNAL: unique symbol = Symbol.for('brumate.internal');\n\n/** HTML that is inserted as it is, such as the output of a template. */\nexport interface Raw {\n [RAW]: string;\n}\n\n// A class, not an object literal, so serializers can skip their test for raw HTML on plain objects.\nclass RawHTML implements Raw {\n readonly [RAW]: string;\n\n constructor(html: string) {\n this[RAW] = html;\n }\n}\n\nexport function raw(html: string): Raw {\n return new RawHTML(html);\n}\n\nexport function isRaw(value: unknown): value is Raw {\n return typeof value === 'object' && value !== null && RAW in value;\n}\n\nexport function rawHTML(value: Raw): string {\n return value[RAW];\n}\n\nconst ESCAPES: Record<string, string> = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;' };\n\nfunction toEscape(char: string): string {\n return ESCAPES[char]!;\n}\n\n// Most text has nothing to escape, so a test without the global flag skips the replace.\nexport function escape(value: string): string {\n return /[&<>]/.test(value) ? value.replace(/[&<>]/g, toEscape) : value;\n}\n\nexport function escapeAttribute(value: string): string {\n return /[&<\"]/.test(value) ? value.replace(/[&<\"]/g, toEscape) : value;\n}\n\n/** True for a promise, or any object with a `then` function, as the server awaits it. */\nfunction isThenable(value: unknown): boolean {\n return (\n value !== null &&\n (typeof value === 'object' || typeof value === 'function') &&\n typeof (value as PromiseLike<unknown>).then === 'function'\n );\n}\n\n/** Renders a value inserted in markup. A promise is not awaited: it renders empty. */\nexport function insertValue(value: unknown): string {\n if (isRaw(value)) {\n return value[RAW];\n }\n // A memo of a promise that is still loading: empty until its value lands.\n if (value === null || value === undefined || typeof value === 'boolean' || isThenable(value)) {\n return '';\n }\n if (Array.isArray(value)) {\n let result = '';\n for (const item of value) {\n result += insertValue(item);\n }\n return result;\n }\n return escape(String(value));\n}\n\n/**\n * Renders a value as the text of an element whose content is text, such as\n * a `<textarea>`, as `insertValue` does but without escaping.\n */\nexport function textValue(value: unknown): string {\n if (isRaw(value)) {\n return value[RAW];\n }\n if (value === null || value === undefined || typeof value === 'boolean' || isThenable(value)) {\n return '';\n }\n if (Array.isArray(value)) {\n let result = '';\n for (const item of value) {\n result += textValue(item);\n }\n return result;\n }\n return String(value);\n}\n\nfunction toKebabCase(name: string): string {\n return name.startsWith('--') ? name : name.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);\n}\n\nexport function classValue(value: unknown): string {\n if (typeof value !== 'object' || value === null) {\n return value ? String(value) : '';\n }\n let text = '';\n if (Array.isArray(value)) {\n for (const item of value) {\n const part = classValue(item);\n if (part !== '') {\n text = text === '' ? part : `${text} ${part}`;\n }\n }\n return text;\n }\n // An empty name still adds a space between its neighbours, as in a join.\n let first = true;\n for (const name in value) {\n if (Object.hasOwn(value, name) && (value as Record<string, unknown>)[name]) {\n text = first ? name : `${text} ${name}`;\n first = false;\n }\n }\n return text;\n}\n\n/**\n * Renders a `class` attribute from classes that each have a space before\n * them, which the compiler builds from a literal class value. The classes\n * are escaped already. No class renders nothing.\n */\nexport function classAttribute(classes: string): string {\n return classes === '' ? '' : ` class=\"${classes.slice(1)}\"`;\n}\n\nfunction styleValue(value: unknown): string {\n if (typeof value === 'object' && value !== null) {\n const declarations: string[] = [];\n for (const [name, item] of Object.entries(value)) {\n if (item !== null && item !== undefined && item !== false) {\n declarations.push(`${toKebabCase(name)}:${String(item)}`);\n }\n }\n return declarations.join(';');\n }\n return String(value);\n}\n\n/** The brand of a binding of `$bind`, under the key of the registry. See `Binding`. */\nconst BOUND = Symbol.for('brumate.binding');\n\n/** The words of an attribute that says `true` or `false` in its value. */\nconst TRUE_FALSE = ['true', 'false'] as const;\n\n/**\n * Attributes whose two states are words in the value, not whether the\n * attribute is there, by their words for `true` and `false`. A missing\n * attribute means a third state, such as the default of the element, so\n * `false` must not remove it. `aria-*` and `data-*` are such attributes too.\n */\nconst SWITCHES = new Map<string, readonly [string, string]>([\n ['contenteditable', TRUE_FALSE],\n ['draggable', TRUE_FALSE],\n ['spellcheck', TRUE_FALSE],\n ['writingsuggestions', TRUE_FALSE],\n // SVG.\n ['focusable', TRUE_FALSE],\n ['translate', ['yes', 'no']],\n ['autocomplete', ['on', 'off']],\n ['autocorrect', ['on', 'off']],\n]);\n\n/** The words of `true` and `false` for an attribute that says them in its value, or undefined. */\nfunction switchWords(name: string): readonly [string, string] | undefined {\n const lower = name.toLowerCase();\n if (lower.startsWith('aria-') || lower.startsWith('data-')) {\n return TRUE_FALSE;\n }\n return SWITCHES.get(lower);\n}\n\n/**\n * Returns the text of an attribute, or undefined if the attribute is not\n * rendered.\n *\n * - `null` and `undefined` leave the attribute out.\n * - For an attribute whose value says its state, such as `aria-expanded`,\n * `draggable` or `translate`, `true` and `false` render as its words:\n * `\"true\"` and `\"false\"`, or `\"yes\"` and `\"no\"`, or `\"on\"` and `\"off\"`.\n * - For other attributes, such as `disabled`, `true` renders the attribute\n * without a value, and `false` leaves it out.\n */\nexport function attributeText(name: string, value: unknown): string | undefined {\n // `value=$bind(name)` on an element renders the value of the name.\n if (typeof value === 'object' && value !== null && BOUND in value) {\n // A `ref` is no attribute: the element goes to its signal.\n if (name === 'ref') {\n return undefined;\n }\n value = (value as unknown as { value: unknown }).value;\n }\n // A promise is a memo that is still loading: the attribute is absent until its value lands.\n if (value === null || value === undefined || typeof value === 'function' || isThenable(value)) {\n return undefined;\n }\n if (typeof value === 'boolean') {\n const words = switchWords(name);\n if (words) {\n return value ? words[0] : words[1];\n }\n return value ? '' : undefined;\n }\n if (name === 'class') {\n const text = classValue(value);\n return text === '' ? undefined : text;\n }\n return name === 'style' ? styleValue(value) : String(value);\n}\n\n/**\n * A name that HTML reads as one attribute. A spread takes its names from\n * data, so a name with a space, a quote, `>`, `/` or `=` could write other\n * attributes or markup.\n */\n// oxlint-disable-next-line no-control-regex -- HTML reads no control character in a name.\nconst ATTRIBUTE_NAME = /^[^\\s\"'>/=\\x00-\\x1f\\x7f]+$/;\n\n/** Renders one attribute, with a leading space. A name that is not one attribute renders nothing. */\nexport function attribute(name: string, value: unknown): string {\n const text = attributeText(name, value);\n if (text === undefined || !ATTRIBUTE_NAME.test(name)) {\n return '';\n }\n return value === true && text === '' ? ` ${name}` : ` ${name}=\"${escapeAttribute(text)}\"`;\n}\n\n/**\n * Returns the value of a style variable with text around it, such as `12px`\n * for `${size}px`. A value that sets no variable stays as it is.\n */\nexport function affix(prefix: string, value: unknown, suffix: string): unknown {\n return value === null || value === undefined || value === false\n ? value\n : `${prefix}${String(value)}${suffix}`;\n}\n\n/** Returns a style with custom properties before an element's own style. */\nexport function vars(variables: Record<string, unknown>, own: unknown): string {\n const parts: string[] = [];\n for (const [name, value] of Object.entries(variables)) {\n if (value !== null && value !== undefined && value !== false) {\n parts.push(`${name}:${String(value)}`);\n }\n }\n const rest = own === null || own === undefined || own === false ? '' : styleValue(own);\n if (rest) {\n parts.push(rest);\n }\n return parts.join(';');\n}\n\n/** Returns a `<style>` element for a component's stylesheet. */\nexport function styleElement(id: string, css: string): string {\n return `<style b-style=\"${escapeAttribute(id)}\">${css.replace(/<\\/style/gi, '<\\\\/style')}</style>`;\n}\n\n/**\n * Merges the attributes of an element that has spreads, in their order: a\n * later value wins, except `class`, whose values all apply.\n */\n/**\n * A value of an attribute that brumate writes, such as the `b-on` of a dynamic tag, which the\n * compiler wraps. An object of attributes, such as a spread, writes a `b-` attribute only with\n * one, so data from outside the app cannot name handlers or scopes.\n */\nexport class Internal {\n readonly value: unknown;\n\n constructor(value: unknown) {\n this.value = value;\n }\n}\n\n// The brand sits on the prototype, so an instance does not carry a field for it.\n(Internal.prototype as unknown as Record<symbol, boolean>)[INTERNAL] = true;\n\n/** True for an `Internal`, also one that another copy of the runtime made. */\nexport function isInternal(value: unknown): value is Internal {\n return typeof value === 'object' && value !== null && INTERNAL in value;\n}\n\n/** Wraps the value of an attribute that brumate writes. See `Internal`. */\nexport function internal(value: unknown): Internal {\n return new Internal(value);\n}\n\n/** The value of an attribute of an object, or undefined for a `b-` attribute from outside. */\nexport function ownValue(name: string, value: unknown): unknown {\n if (isInternal(value)) {\n return value.value;\n }\n return name.startsWith('b-') ? undefined : value;\n}\n\nexport function mergeAttributes(\n parts: Record<string, unknown>[],\n variables?: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const part of parts) {\n for (const [name, value] of Object.entries(part ?? {})) {\n // A `b-` attribute from outside the app does not take the place of brumate's own.\n if (name.startsWith('b-') && !isInternal(value)) {\n continue;\n }\n result[name] =\n name === 'class' && result.class !== undefined && value !== undefined\n ? [result.class, value]\n : value;\n }\n }\n // The style variables of the component come before the style that won, whoever gave it.\n if (variables) {\n result.style = vars(variables, result.style);\n }\n return result;\n}\n\n/**\n * The `b-on` entry of a handler that a spread passes on, such as\n * `click:prevent=Parent#h1@3`: its event, the modifiers of its wrappers, its\n * client function and the scope it runs in. A handler that `$handler` made\n * has its arguments after another `@`, encoded so that they hold no space.\n */\nexport function handlerEntry(\n name: string,\n ref: string,\n scope: number | string,\n modifiers: readonly string[] = [],\n args?: unknown[],\n): string {\n const bound = args === undefined ? '' : `@${encodeURIComponent(JSON.stringify(args))}`;\n return `${[name.slice(2).toLowerCase(), ...modifiers].join(':')}=${ref}@${scope}${bound}`;\n}\n\n/**\n * The `b-on` entry of a binding that a spread puts on `value` or `checked`\n * of an element. It names the scope of the slot, or of the setter of\n * `$bind(name, fn)`, after `@`. A box writes on `change`.\n */\nexport function bindEntry(\n name: string,\n ref: { scope: number | string; slot: number },\n setter?: { ref: string; scope: number | string },\n): string {\n const event = name === 'checked' ? 'change' : 'input';\n return setter\n ? `${event}=$set:${setter.ref}@${setter.scope}`\n : `${event}=$bind#0.${ref.slot}@${ref.scope}`;\n}\n\n/**\n * The `b-on` attribute of an element with spreads: the bindings of its\n * spreads, so its handlers read the new value, then its own handlers, then\n * those of its spreads.\n */\nexport function onAttribute(on: string[], own: string): string {\n const value = onValue(on, own);\n return value ? ` b-on=\"${escapeAttribute(value)}\"` : '';\n}\n\n/** The value of `b-on`, in the order of `onAttribute`. */\nexport function onValue(on: string[], own: string): string {\n const bindings: string[] = [];\n const rest: string[] = [];\n for (const entry of on) {\n if (/=\\$(bind#|set:)/.test(entry)) {\n bindings.push(entry);\n } else {\n rest.push(entry);\n }\n }\n const parts: string[] = [];\n for (const part of [...bindings, own, ...rest]) {\n if (part) {\n parts.push(part);\n }\n }\n return parts.join(' ');\n}\n\n/** Renders an object of attributes. */\nexport function spread(attributes: Record<string, unknown>, names = false): string {\n let result = '';\n const written: string[] = [];\n for (const [name, value] of Object.entries(attributes)) {\n if (name !== 'children' && !/^on[A-Z]/.test(name)) {\n const text = attribute(name, ownValue(name, value));\n if (text) {\n result += text;\n written.push(name);\n }\n }\n }\n // `b-s` names the attributes of a spread that changes in the browser. Its first update there\n // removes only those, so a spread that wrote none still writes it, empty.\n return names ? `${result} b-s=\"${written.join(' ')}\"` : result;\n}\n\nexport const VOID_ELEMENTS: Set<string> = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'source',\n 'track',\n 'wbr',\n]);\n\n/**\n * Renders the attributes of a form that posts to a server function, such as\n * ` action=\"/_brumate/App_1abc%23save\" method=\"post\"`. `method` is the name of\n * the method attribute to add, if the element has none. `build` is the ID\n * of the build of the page, which the URL carries as `__build`, so the\n * server can tell a post from before a deploy without scripts.\n */\nexport function actionAttributes(\n prefix: string,\n name: string,\n id: string,\n method?: string,\n result?: string,\n build?: string,\n key?: string,\n): string {\n const methodText = method ? ` ${method}=\"post\"` : '';\n // The key of a form of a function that `idempotent` made, so a second post gets the first result.\n const params: string[] = [];\n if (build !== undefined) {\n params.push(`__build=${encodeURIComponent(build)}`);\n }\n if (key !== undefined) {\n params.push(`__key=${key}`);\n }\n const query = params.join('&');\n if (result !== undefined) {\n // The form posts to its page, which renders with the result. With the\n // loader, the result is written into the `$action` at `result` instead.\n const url = `?__action=${encodeURIComponent(id)}${query ? `&${query}` : ''}`;\n return ` ${name}=\"${escapeAttribute(url)}\"${methodText} b-action=\"${escapeAttribute(id)}\" b-result=\"${escapeAttribute(result)}\"`;\n }\n const url = `${prefix}/${encodeURIComponent(id)}${query ? `?${query}` : ''}`;\n return ` ${name}=\"${escapeAttribute(url)}\"${methodText}`;\n}\n"],"mappings":";AAEA,MAAM,MAAqB,OAAO,IAAI,aAAa;AACnD,MAAM,WAA0B,OAAO,IAAI,kBAAkB;AAQ7D,IAAM,UAAN,MAA6B;CAC3B,CAAU;CAEV,YAAY,MAAc;EACxB,KAAK,OAAO;CACd;AACF;AAEA,SAAgB,IAAI,MAAmB;CACrC,OAAO,IAAI,QAAQ,IAAI;AACzB;AAEA,SAAgB,MAAM,OAA8B;CAClD,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,OAAO;AAC/D;AAEA,SAAgB,QAAQ,OAA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,MAAM;GACR,UAAU;GACV,QAAQ,KAAK,IAAI;EACnB;CACF;CAIF,OAAO,QAAQ,GAAG,OAAO,QAAQ,QAAQ,KAAK,GAAG,EAAE,KAAK;AAC1D;AAEA,MAAa,gCAA6B,IAAI,IAAI;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;AASD,SAAgB,iBACd,QACA,MACA,IACA,QACA,QACA,OACA,KACQ;CACR,MAAM,aAAa,SAAS,IAAI,OAAO,WAAW;CAElD,MAAM,SAAmB,CAAC;CAC1B,IAAI,UAAU,KAAA,GACZ,OAAO,KAAK,WAAW,mBAAmB,KAAK,GAAG;CAEpD,IAAI,QAAQ,KAAA,GACV,OAAO,KAAK,SAAS,KAAK;CAE5B,MAAM,QAAQ,OAAO,KAAK,GAAG;CAC7B,IAAI,WAAW,KAAA,GAIb,OAAO,IAAI,KAAK,IAAI,gBAAgB,aADX,mBAAmB,EAAE,IAAI,QAAQ,IAAI,UAAU,IACjC,EAAE,GAAG,WAAW,aAAa,gBAAgB,EAAE,EAAE,cAAc,gBAAgB,MAAM,EAAE;CAGhI,OAAO,IAAI,KAAK,IAAI,gBAAgB,GADrB,OAAO,GAAG,mBAAmB,EAAE,IAAI,QAAQ,IAAI,UAAU,IACjC,EAAE,GAAG;AAC9C"}
@@ -9,7 +9,7 @@ declare function isRaw(value: unknown): value is Raw;
9
9
  declare function rawHTML(value: Raw): string;
10
10
  declare function escape(value: string): string;
11
11
  declare function escapeAttribute(value: string): string;
12
- /** Renders a value inserted in markup. Promises are not awaited. */
12
+ /** Renders a value inserted in markup. A promise is not awaited: it renders empty. */
13
13
  declare function insertValue(value: unknown): string;
14
14
  /**
15
15
  * Renders a value as the text of an element whose content is text, such as
@@ -50,7 +50,22 @@ declare function styleElement(id: string, css: string): string;
50
50
  * Merges the attributes of an element that has spreads, in their order: a
51
51
  * later value wins, except `class`, whose values all apply.
52
52
  */
53
- declare function mergeAttributes(parts: Record<string, unknown>[]): Record<string, unknown>;
53
+ /**
54
+ * A value of an attribute that brumate writes, such as the `b-on` of a dynamic tag, which the
55
+ * compiler wraps. An object of attributes, such as a spread, writes a `b-` attribute only with
56
+ * one, so data from outside the app cannot name handlers or scopes.
57
+ */
58
+ declare class Internal {
59
+ readonly value: unknown;
60
+ constructor(value: unknown);
61
+ }
62
+ /** True for an `Internal`, also one that another copy of the runtime made. */
63
+ declare function isInternal(value: unknown): value is Internal;
64
+ /** Wraps the value of an attribute that brumate writes. See `Internal`. */
65
+ declare function internal(value: unknown): Internal;
66
+ /** The value of an attribute of an object, or undefined for a `b-` attribute from outside. */
67
+ declare function ownValue(name: string, value: unknown): unknown;
68
+ declare function mergeAttributes(parts: Record<string, unknown>[], variables?: Record<string, unknown>): Record<string, unknown>;
54
69
  /**
55
70
  * The `b-on` entry of a handler that a spread passes on, such as
56
71
  * `click:prevent=Parent#h1@3`: its event, the modifiers of its wrappers, its
@@ -76,8 +91,10 @@ declare function bindEntry(name: string, ref: {
76
91
  * those of its spreads.
77
92
  */
78
93
  declare function onAttribute(on: string[], own: string): string;
94
+ /** The value of `b-on`, in the order of `onAttribute`. */
95
+ declare function onValue(on: string[], own: string): string;
79
96
  /** Renders an object of attributes. */
80
- declare function spread(attributes: Record<string, unknown>): string;
97
+ declare function spread(attributes: Record<string, unknown>, names?: boolean): string;
81
98
  declare const VOID_ELEMENTS: Set<string>;
82
99
  /**
83
100
  * Renders the attributes of a form that posts to a server function, such as
@@ -88,5 +105,5 @@ declare const VOID_ELEMENTS: Set<string>;
88
105
  */
89
106
  declare function actionAttributes(prefix: string, name: string, id: string, method?: string, result?: string, build?: string, key?: string): string;
90
107
  //#endregion
91
- export { vars as S, raw as _, attribute as a, styleElement as b, classAttribute as c, escapeAttribute as d, handlerEntry as f, onAttribute as g, mergeAttributes as h, affix as i, classValue as l, isRaw as m, VOID_ELEMENTS as n, attributeText as o, insertValue as p, actionAttributes as r, bindEntry as s, Raw as t, escape as u, rawHTML as v, textValue as x, spread as y };
92
- //# sourceMappingURL=html-Bq1rFxX_.d.ts.map
108
+ export { rawHTML as C, vars as D, textValue as E, raw as S, styleElement as T, isRaw as _, affix as a, onValue as b, bindEntry as c, escape as d, escapeAttribute as f, isInternal as g, internal as h, actionAttributes as i, classAttribute as l, insertValue as m, Raw as n, attribute as o, handlerEntry as p, VOID_ELEMENTS as r, attributeText as s, Internal as t, classValue as u, mergeAttributes as v, spread as w, ownValue as x, onAttribute as y };
109
+ //# sourceMappingURL=html-Gggepsf-.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1399,7 +1399,6 @@ interface InsertNode extends Range {
1399
1399
  expression: Expression;
1400
1400
  }
1401
1401
  type Modifier = "prevent" | "stop" | "passive" | "once" | "capture";
1402
- type PrefetchStrategy = "hover" | "visible" | "idle" | "none";
1403
1402
  interface StaticAttribute extends Range {
1404
1403
  kind: "static";
1405
1404
  name: string;
@@ -1421,15 +1420,11 @@ interface EventAttribute extends Range {
1421
1420
  }
1422
1421
  interface RefAttribute extends Range {
1423
1422
  kind: "ref";
1424
- /** The name of a signal. */
1423
+ /** The name in `ref=$bind(name)`: a signal, or a prop that the component writes. */
1425
1424
  target: string;
1426
1425
  /** The range of the name. */
1427
1426
  targetRange: Range;
1428
1427
  }
1429
- interface PrefetchAttribute extends Range {
1430
- kind: "prefetch";
1431
- strategy: PrefetchStrategy;
1432
- }
1433
1428
  interface SpreadAttribute extends Range {
1434
1429
  kind: "spread";
1435
1430
  value: Expression;
@@ -1439,7 +1434,7 @@ interface ComputedAttribute extends Range {
1439
1434
  name: Expression;
1440
1435
  value: Expression | true;
1441
1436
  }
1442
- type Attribute = StaticAttribute | ValueAttribute | EventAttribute | RefAttribute | PrefetchAttribute | SpreadAttribute | ComputedAttribute;
1437
+ type Attribute = StaticAttribute | ValueAttribute | EventAttribute | RefAttribute | SpreadAttribute | ComputedAttribute;
1443
1438
  interface Body extends Range {
1444
1439
  script?: Script;
1445
1440
  templates: TemplateDecl[];
@@ -1461,6 +1456,14 @@ interface ForBlock extends Range {
1461
1456
  list: Expression;
1462
1457
  /** `'index'` keys items by position. */
1463
1458
  key?: Expression | "index";
1459
+ /**
1460
+ * `window(height, count)`: the browser renders only the items in view, which are about
1461
+ * `height` pixels tall, and the server renders the first `count`.
1462
+ */
1463
+ window?: {
1464
+ height: Expression;
1465
+ count?: Expression;
1466
+ };
1464
1467
  body: Body;
1465
1468
  fallback?: Body;
1466
1469
  }
@@ -1573,6 +1576,10 @@ interface Declaration {
1573
1576
  * `const { user: { name } } = $props()`. Undefined for the props object.
1574
1577
  */
1575
1578
  propKey?: string;
1579
+ /** True for a prop whose `$props<T>` type is written as `Promise<...>`, or a union with one. */
1580
+ promise?: boolean;
1581
+ /** True for the props object (`const props = $props()`) and the rest of `$props()`. */
1582
+ whole?: boolean;
1576
1583
  /** For `const result = $action(fn)`, the name of the server function. */
1577
1584
  action?: string;
1578
1585
  /** True for a server function that a server function refreshes with `refresh(fn)`. */
@@ -1606,14 +1613,21 @@ interface Declaration {
1606
1613
  writable?: boolean;
1607
1614
  /** True for a signal or a writable prop that `$bind` passes to a child, which needs a slot. */
1608
1615
  bound?: boolean;
1616
+ /**
1617
+ * The props of components that the binding passes the declaration to, and `value` or `checked`
1618
+ * of an input. A signal that only `ref` binds holds an element that the browser fills.
1619
+ */
1620
+ boundAs?: Set<string>;
1609
1621
  /** True for `const name = await $memo(value)`: the render waits for the memo where it is declared. */
1610
1622
  awaited?: boolean;
1611
1623
  /** For `const name = $id()`, the position of the call among the `$id` calls of its scope. */
1612
1624
  idIndex?: number;
1625
+ /** For `const name = $isPassed(prop)`, the key of the prop. */
1626
+ passedKey?: string;
1613
1627
  /** Elements whose `ref` targets this declaration. */
1614
1628
  refs: {
1615
1629
  attribute: RefAttribute;
1616
- element: ElementNode;
1630
+ element: ElementNode | DynamicTagNode;
1617
1631
  scope: Scope;
1618
1632
  }[];
1619
1633
  }
@@ -1651,6 +1665,8 @@ interface Site {
1651
1665
  * values that the site depends on.
1652
1666
  */
1653
1667
  trackedCalls: Set<Declaration>;
1668
+ /** True when the site calls through a context value or a prop, outside `$untrack`. */
1669
+ opaqueCalls?: boolean;
1654
1670
  /** The declaration that a function or memo site belongs to. */
1655
1671
  declaration?: Declaration;
1656
1672
  /** The element, component or listener of an attribute or event site. */
@@ -1661,6 +1677,8 @@ interface Site {
1661
1677
  * the modifiers that `b-on` holds, such as `prevent(Enter)`.
1662
1678
  */
1663
1679
  modifiers?: string[];
1680
+ /** True for the handler prop of a component, such as `onPick=(…)`, which the child calls. */
1681
+ handlerProp?: boolean;
1664
1682
  /** The block whose header this site is. */
1665
1683
  block?: Block;
1666
1684
  /** The trigger of a `$client` site. */
@@ -1697,6 +1715,11 @@ interface SemanticModel {
1697
1715
  setter?: Site;
1698
1716
  }[];
1699
1717
  diagnostics: Diagnostic[];
1718
+ /** The `$isPending(memo)` and `$resolve(memo)` calls, with the read of their memo. */
1719
+ pendingCalls: {
1720
+ reference: Reference;
1721
+ at: Range;
1722
+ }[];
1700
1723
  }
1701
1724
  /** Returns true if `scope` is `ancestor` or inside it. */
1702
1725
  export declare function isWithin(scope: Scope, ancestor: Scope): boolean;
@@ -1712,6 +1735,28 @@ export declare function lookup(scope: Scope, name: string): Declaration | undefi
1712
1735
  //#region src/analyze.d.ts
1713
1736
  export declare function analyze(file: SFCFile): SemanticModel;
1714
1737
  //#endregion
1738
+ //#region src/error-catalog.d.ts
1739
+ /** One compile error of a `.brm` file. */
1740
+ interface ErrorEntry {
1741
+ /** The message the compiler reports, with `{name}` for the parts that vary. */
1742
+ message: string;
1743
+ /** What causes it, in one sentence. */
1744
+ cause: string;
1745
+ /** The form to write instead, as a short `brm` example. */
1746
+ fix: string;
1747
+ /** A code such as BRM012. It never changes and is never reused. */
1748
+ code?: string;
1749
+ /** The docs page that explains the code. */
1750
+ link?: string;
1751
+ }
1752
+ /** The link to the explanation of a code. */
1753
+ export declare function errorLink(code: string): string;
1754
+ /**
1755
+ * The entry for a message that the compiler reported. The place of the
1756
+ * error, as in `(File.brm:3:7)`, can follow the message.
1757
+ */
1758
+ export declare function findError(message: string): ErrorEntry | undefined;
1759
+ //#endregion
1715
1760
  //#region src/graph.d.ts
1716
1761
  type GraphNode = {
1717
1762
  kind: "source";
@@ -1763,6 +1808,18 @@ interface ComponentUsage {
1763
1808
  source: string;
1764
1809
  /** The props whose values can change on the client. `*` means every prop. */
1765
1810
  liveProps: Set<string>;
1811
+ /** True for a dynamic tag, which can name the component. Only a component that declares the prop takes it. */
1812
+ dynamic?: boolean;
1813
+ /**
1814
+ * The props whose value names `.brm` imports, such as `as=Target` or `as=(flag ? A : B)`: the
1815
+ * prop name and the import specifiers.
1816
+ */
1817
+ components?: Map<string, string[]>;
1818
+ /**
1819
+ * The props whose value is a prop of this file, such as `{as}`: the prop name and the names of
1820
+ * this file's props. `*` means the whole props object.
1821
+ */
1822
+ passed?: Map<string, string[]>;
1766
1823
  }
1767
1824
  /** Lists the components that a file renders, and the props it passes that can change. */
1768
1825
  export declare function summarize(file: SFCFile, graph: Graph): ComponentUsage[];
@@ -1802,7 +1859,7 @@ export declare function printGraph(source: string, graph: Graph): string;
1802
1859
  interface StyleOutput {
1803
1860
  /** The scoped CSS of every `<style>` block, or an empty string. */
1804
1861
  css: string;
1805
- /** The attribute that marks the component's elements, such as `s-1abc`. */
1862
+ /** The attribute that marks the component's elements, such as `b-c-1abc`. */
1806
1863
  attribute: string;
1807
1864
  /**
1808
1865
  * The custom property for each `${…}` interpolation, in source order. Text
@@ -1875,6 +1932,22 @@ interface Plan {
1875
1932
  elementItems: Set<Block>;
1876
1933
  /** The export name of each client root, such as `h3`. */
1877
1934
  symbols: Map<Site, string>;
1935
+ /**
1936
+ * The children of each component and dynamic tag, which the browser renders each time the
1937
+ * component inserts them: the export of their render, such as `n0`, and their scope.
1938
+ */
1939
+ childrenRenders: Map<ComponentNode | DynamicTagNode, {
1940
+ symbol: string;
1941
+ scope: Scope;
1942
+ }>;
1943
+ /**
1944
+ * The component whose children hold a block, for the blocks in children. The browser renders
1945
+ * the new bodies of such a block with the contexts of that component, as the server does.
1946
+ */
1947
+ blockHolders: Map<Block, {
1948
+ node: ComponentNode;
1949
+ scope: Scope;
1950
+ }>;
1878
1951
  /** Sites whose code runs on the client, including update code for live nodes. */
1879
1952
  clientSites: Set<Site>;
1880
1953
  /** The compiled `<style>` blocks. */
@@ -2037,6 +2110,16 @@ export declare class CompileError extends Error {
2037
2110
  }
2038
2111
  export declare function compile(source: string, options?: CompileOptions): CompileResult;
2039
2112
  //#endregion
2113
+ //#region src/codegen/markup.d.ts
2114
+ /** The render functions that fill a nested block of a clone. */
2115
+ type Fill = {
2116
+ kind: "if";
2117
+ renders: string[];
2118
+ } | {
2119
+ kind: "for";
2120
+ render: string;
2121
+ };
2122
+ //#endregion
2040
2123
  //#region src/shared-module.d.ts
2041
2124
  /** The query of the shared module of a module of reactive logic. */
2042
2125
  export declare const SHARED_QUERY = "?brumate-shared";
@@ -2093,6 +2176,11 @@ interface ClientOutput {
2093
2176
  loaders: Record<string, string[]>;
2094
2177
  /** False when nothing of the component runs in the browser. */
2095
2178
  clientCode: boolean;
2179
+ /**
2180
+ * The render functions of the client entry that fill a nested `#if` or `#for` of a clone,
2181
+ * for the render module, which imports them.
2182
+ */
2183
+ fillOf: (block: Block) => Fill | undefined;
2096
2184
  diagnostics: Diagnostic[];
2097
2185
  }
2098
2186
  /**
@@ -2179,5 +2267,5 @@ export declare function inspect(source: string, options?: InspectOptions): {
2179
2267
  text: string;
2180
2268
  };
2181
2269
  //#endregion
2182
- export type { AnchorTarget, Attribute, Block, Body, Branch, CheckMapping, CheckOutput, ClientBlock, ClientTrigger, CompileOptions, CompileResult, ComponentNode, ComponentUsage, ComputedAttribute, Declaration, DeclarationKind, DeferBlock, Diagnostic, DynamicTagNode, Edge, ElementNode, EventAttribute, Expression, ForBlock, FragmentNode, GlobalListenerNode, Graph, GraphNode, GraphOptions, HeadBlock, IfBlock, InsertNode, InspectEntry, InspectOptions, InspectReport, KeyBlock, LoadingBlock, Location, Markup, Modifier, OffscreenBlock, ParseOptions, Plan, PortalBlock, PrefetchAttribute, PrefetchStrategy, ProjectProps, Range, ReactiveModule, RefAttribute, Reference, RepeatBlock, Resolve, ResolveModule, Reveal, RevealOrder, SFCFile, Scope, ScopeKind, ScopePlan, Script, SemanticModel, Severity, SharedSite, Site, SiteKind, SourceMap, SpreadAttribute, StaticAttribute, Style, SwitchBlock, TemplateDecl, TextNode, TryBlock, ValueAttribute, upstreamMemos };
2270
+ export type { AnchorTarget, Attribute, Block, Body, Branch, CheckMapping, CheckOutput, ClientBlock, ClientTrigger, CompileOptions, CompileResult, ComponentNode, ComponentUsage, ComputedAttribute, Declaration, DeclarationKind, DeferBlock, Diagnostic, DynamicTagNode, Edge, ElementNode, ErrorEntry, EventAttribute, Expression, ForBlock, FragmentNode, GlobalListenerNode, Graph, GraphNode, GraphOptions, HeadBlock, IfBlock, InsertNode, InspectEntry, InspectOptions, InspectReport, KeyBlock, LoadingBlock, Location, Markup, Modifier, OffscreenBlock, ParseOptions, Plan, PortalBlock, ProjectProps, Range, ReactiveModule, RefAttribute, Reference, RepeatBlock, Resolve, ResolveModule, Reveal, RevealOrder, SFCFile, Scope, ScopeKind, ScopePlan, Script, SemanticModel, Severity, SharedSite, Site, SiteKind, SourceMap, SpreadAttribute, StaticAttribute, Style, SwitchBlock, TemplateDecl, TextNode, TryBlock, ValueAttribute, upstreamMemos };
2183
2271
  //# sourceMappingURL=index.d.ts.map