brumate 0.4.1 → 0.4.3

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 (61) hide show
  1. package/dist/{boot-SCWYwuUd.d.ts → boot-D3NjfyUX.d.ts} +2 -2
  2. package/dist/cli.js +2 -2
  3. package/dist/{client-BBtVTOIt.js → client-AXNULmRZ.js} +67 -12
  4. package/dist/client-AXNULmRZ.js.map +1 -0
  5. package/dist/{client-Cs3o4key.d.ts → client-DNva05jp.d.ts} +20 -7
  6. package/dist/{defer-BLJjxqVc.js → defer-D3YMPgkX.js} +2 -2
  7. package/dist/{defer-BLJjxqVc.js.map → defer-D3YMPgkX.js.map} +1 -1
  8. package/dist/{devtools-DTpsVFbn.js → devtools-BiP5fDiB.js} +4 -4
  9. package/dist/{devtools-DTpsVFbn.js.map → devtools-BiP5fDiB.js.map} +1 -1
  10. package/dist/{devtools-panel-C1Dfv6nq.js → devtools-panel-EQhLm39H.js} +2 -2
  11. package/dist/{devtools-panel-C1Dfv6nq.js.map → devtools-panel-EQhLm39H.js.map} +1 -1
  12. package/dist/{files-DZIiMDnS.js → files-BUjvEO_o.js} +2 -2
  13. package/dist/{files-DZIiMDnS.js.map → files-BUjvEO_o.js.map} +1 -1
  14. package/dist/{html-DS9B1H-M.js → html-t1JpkODI.js} +6 -4
  15. package/dist/html-t1JpkODI.js.map +1 -0
  16. package/dist/index.d.ts +5 -1
  17. package/dist/index.js +1 -1
  18. package/dist/{inspect-DomFHy5O.js → inspect-BvPTZs6k.js} +235 -67
  19. package/dist/inspect-BvPTZs6k.js.map +1 -0
  20. package/dist/{loader-D62komKu.js → loader-DgMk6p9M.js} +2 -2
  21. package/dist/{loader-D62komKu.js.map → loader-DgMk6p9M.js.map} +1 -1
  22. package/dist/produce-CLABZ8k2.d.ts +11 -0
  23. package/dist/{produce-BNIpmZq2.js → produce-DS-dQaUX.js} +3 -2
  24. package/dist/produce-DS-dQaUX.js.map +1 -0
  25. package/dist/{rpc-BTMb8jap.js → rpc-Bxv7DYGe.js} +3 -3
  26. package/dist/{rpc-BTMb8jap.js.map → rpc-Bxv7DYGe.js.map} +1 -1
  27. package/dist/runtime/client.d.ts +4 -4
  28. package/dist/runtime/client.js +4 -4
  29. package/dist/runtime/devtools.d.ts +2 -2
  30. package/dist/runtime/devtools.js +1 -1
  31. package/dist/runtime/hot.d.ts +1 -1
  32. package/dist/runtime/html.d.ts +1 -1
  33. package/dist/runtime/html.js +1 -1
  34. package/dist/runtime/loader.d.ts +2 -2
  35. package/dist/runtime/loader.js +2 -2
  36. package/dist/runtime/server.d.ts +3 -3
  37. package/dist/runtime/server.js +3 -3
  38. package/dist/runtime/static-loader.d.ts +2 -2
  39. package/dist/runtime/static-loader.js +1 -1
  40. package/dist/runtime/testing.d.ts +2 -2
  41. package/dist/runtime/testing.js +2 -2
  42. package/dist/{server-CYw15Dsg.d.ts → server-BXMH3Z9T.d.ts} +4 -3
  43. package/dist/{server-BTtsQFFw.js → server-O_rC-RRL.js} +11 -9
  44. package/dist/server-O_rC-RRL.js.map +1 -0
  45. package/dist/shared-CzbnWkVA.d.ts +255 -0
  46. package/dist/{static-loader-DVuLmXeu.d.ts → static-loader-BiUaZaag.d.ts} +2 -2
  47. package/dist/{static-loader-C_GYIFtt.js → static-loader-U_x-ctJI.js} +2 -2
  48. package/dist/{static-loader-C_GYIFtt.js.map → static-loader-U_x-ctJI.js.map} +1 -1
  49. package/dist/{stream-r4V5zBKm.js → stream-JGRPr7u5.js} +29 -5
  50. package/dist/stream-JGRPr7u5.js.map +1 -0
  51. package/dist/vite.d.ts +1 -1
  52. package/dist/vite.js +2 -2
  53. package/package.json +1 -1
  54. package/dist/client-BBtVTOIt.js.map +0 -1
  55. package/dist/html-DS9B1H-M.js.map +0 -1
  56. package/dist/html-Gggepsf-.d.ts +0 -109
  57. package/dist/inspect-DomFHy5O.js.map +0 -1
  58. package/dist/produce-BNIpmZq2.js.map +0 -1
  59. package/dist/produce-CRfouraC.d.ts +0 -153
  60. package/dist/server-BTtsQFFw.js.map +0 -1
  61. package/dist/stream-r4V5zBKm.js.map +0 -1
@@ -1 +0,0 @@
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,OAAoB;CAC1C,OAAO,MAAM;AACf;AAEA,MAAM,UAAkC;CAAE,KAAK;CAAS,KAAK;CAAQ,KAAK;CAAQ,MAAK;AAAS;AAEhG,SAAS,SAAS,MAAsB;CACtC,OAAO,QAAQ;AACjB;AAGA,SAAgB,OAAO,OAAuB;CAC5C,OAAO,QAAQ,KAAK,KAAK,IAAI,MAAM,QAAQ,UAAU,QAAQ,IAAI;AACnE;AAEA,SAAgB,gBAAgB,OAAuB;CACrD,OAAO,QAAQ,KAAK,KAAK,IAAI,MAAM,QAAQ,UAAU,QAAQ,IAAI;AACnE;;AAGA,SAAS,WAAW,OAAyB;CAC3C,OACE,UAAU,SACT,OAAO,UAAU,YAAY,OAAO,UAAU,eAC/C,OAAQ,MAA+B,SAAS;AAEpD;;AAGA,SAAgB,YAAY,OAAwB;CAClD,IAAI,MAAM,KAAK,GACb,OAAO,MAAM;CAGf,IAAI,UAAU,QAAQ,UAAU,KAAA,KA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AAgB,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"}
@@ -1,109 +0,0 @@
1
- //#region src/runtime/html.d.ts
2
- declare const RAW: unique symbol;
3
- /** HTML that is inserted as it is, such as the output of a template. */
4
- interface Raw {
5
- [RAW]: string;
6
- }
7
- declare function raw(html: string): Raw;
8
- declare function isRaw(value: unknown): value is Raw;
9
- declare function rawHTML(value: Raw): string;
10
- declare function escape(value: string): string;
11
- declare function escapeAttribute(value: string): string;
12
- /** Renders a value inserted in markup. A promise is not awaited: it renders empty. */
13
- declare function insertValue(value: unknown): string;
14
- /**
15
- * Renders a value as the text of an element whose content is text, such as
16
- * a `<textarea>`, as `insertValue` does but without escaping.
17
- */
18
- declare function textValue(value: unknown): string;
19
- declare function classValue(value: unknown): string;
20
- /**
21
- * Renders a `class` attribute from classes that each have a space before
22
- * them, which the compiler builds from a literal class value. The classes
23
- * are escaped already. No class renders nothing.
24
- */
25
- declare function classAttribute(classes: string): string;
26
- /**
27
- * Returns the text of an attribute, or undefined if the attribute is not
28
- * rendered.
29
- *
30
- * - `null` and `undefined` leave the attribute out.
31
- * - For an attribute whose value says its state, such as `aria-expanded`,
32
- * `draggable` or `translate`, `true` and `false` render as its words:
33
- * `"true"` and `"false"`, or `"yes"` and `"no"`, or `"on"` and `"off"`.
34
- * - For other attributes, such as `disabled`, `true` renders the attribute
35
- * without a value, and `false` leaves it out.
36
- */
37
- declare function attributeText(name: string, value: unknown): string | undefined;
38
- /** Renders one attribute, with a leading space. A name that is not one attribute renders nothing. */
39
- declare function attribute(name: string, value: unknown): string;
40
- /**
41
- * Returns the value of a style variable with text around it, such as `12px`
42
- * for `${size}px`. A value that sets no variable stays as it is.
43
- */
44
- declare function affix(prefix: string, value: unknown, suffix: string): unknown;
45
- /** Returns a style with custom properties before an element's own style. */
46
- declare function vars(variables: Record<string, unknown>, own: unknown): string;
47
- /** Returns a `<style>` element for a component's stylesheet. */
48
- declare function styleElement(id: string, css: string): string;
49
- /**
50
- * Merges the attributes of an element that has spreads, in their order: a
51
- * later value wins, except `class`, whose values all apply.
52
- */
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>;
69
- /**
70
- * The `b-on` entry of a handler that a spread passes on, such as
71
- * `click:prevent=Parent#h1@3`: its event, the modifiers of its wrappers, its
72
- * client function and the scope it runs in. A handler that `$handler` made
73
- * has its arguments after another `@`, encoded so that they hold no space.
74
- */
75
- declare function handlerEntry(name: string, ref: string, scope: number | string, modifiers?: readonly string[], args?: unknown[]): string;
76
- /**
77
- * The `b-on` entry of a binding that a spread puts on `value` or `checked`
78
- * of an element. It names the scope of the slot, or of the setter of
79
- * `$bind(name, fn)`, after `@`. A box writes on `change`.
80
- */
81
- declare function bindEntry(name: string, ref: {
82
- scope: number | string;
83
- slot: number;
84
- }, setter?: {
85
- ref: string;
86
- scope: number | string;
87
- }): string;
88
- /**
89
- * The `b-on` attribute of an element with spreads: the bindings of its
90
- * spreads, so its handlers read the new value, then its own handlers, then
91
- * those of its spreads.
92
- */
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;
96
- /** Renders an object of attributes. */
97
- declare function spread(attributes: Record<string, unknown>, names?: boolean): string;
98
- declare const VOID_ELEMENTS: Set<string>;
99
- /**
100
- * Renders the attributes of a form that posts to a server function, such as
101
- * ` action="/_brumate/App_1abc%23save" method="post"`. `method` is the name of
102
- * the method attribute to add, if the element has none. `build` is the ID
103
- * of the build of the page, which the URL carries as `__build`, so the
104
- * server can tell a post from before a deploy without scripts.
105
- */
106
- declare function actionAttributes(prefix: string, name: string, id: string, method?: string, result?: string, build?: string, key?: string): string;
107
- //#endregion
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