@loadbare/app 0.22.0 → 0.24.0

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 (45) hide show
  1. package/dist/build/assemble.d.ts.map +1 -1
  2. package/dist/build/assemble.js +28 -1
  3. package/dist/build/assemble.js.map +1 -1
  4. package/dist/build/build.d.ts +16 -0
  5. package/dist/build/build.d.ts.map +1 -1
  6. package/dist/build/build.js +77 -5
  7. package/dist/build/build.js.map +1 -1
  8. package/dist/core/lb-constants.d.ts +8 -5
  9. package/dist/core/lb-constants.d.ts.map +1 -1
  10. package/dist/core/lb-constants.js +20 -11
  11. package/dist/core/lb-constants.js.map +1 -1
  12. package/dist/core/lb-types.d.ts +19 -3
  13. package/dist/core/lb-types.d.ts.map +1 -1
  14. package/dist/core/lb-types.js +35 -5
  15. package/dist/core/lb-types.js.map +1 -1
  16. package/dist/hub/lb-apply.d.ts +18 -22
  17. package/dist/hub/lb-apply.d.ts.map +1 -1
  18. package/dist/hub/lb-apply.js +127 -57
  19. package/dist/hub/lb-apply.js.map +1 -1
  20. package/dist/hub/lb-hub.browser.d.ts.map +1 -1
  21. package/dist/hub/lb-hub.browser.js +15 -22
  22. package/dist/hub/lb-hub.browser.js.map +1 -1
  23. package/dist/server/lb-server.d.ts +2 -2
  24. package/dist/server/lb-server.d.ts.map +1 -1
  25. package/dist/server/lb-server.js +29 -9
  26. package/dist/server/lb-server.js.map +1 -1
  27. package/docs/comparison.md +11 -11
  28. package/docs/miswarts.md +7 -5
  29. package/docs/reference/chrome.md +42 -0
  30. package/docs/reference/custom-elements.md +9 -4
  31. package/docs/reference/data-binding.md +89 -67
  32. package/docs/reference/dev-server.md +10 -3
  33. package/docs/reference/names.md +10 -7
  34. package/docs/reference/page-files.md +8 -4
  35. package/docs/temp-proposals.md +251 -0
  36. package/docs/testing.md +3 -3
  37. package/package.json +1 -1
  38. package/skills/loadbare-app/SKILL.md +24 -12
  39. package/skills/loadbare-app/references/chrome.md +42 -0
  40. package/skills/loadbare-app/references/custom-elements.md +9 -4
  41. package/skills/loadbare-app/references/data-binding.md +89 -67
  42. package/skills/loadbare-app/references/dev-server.md +10 -3
  43. package/skills/loadbare-app/references/miswarts.md +7 -5
  44. package/skills/loadbare-app/references/names.md +10 -7
  45. package/skills/loadbare-app/references/page-files.md +8 -4
@@ -1 +1 @@
1
- {"version":3,"file":"lb-constants.js","sourceRoot":"","sources":["../../core/lb-constants.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2DAA2D;AAC3D,kCAAkC;AAElC,4EAA4E;AAC5E,wEAAwE;AACxE,uEAAuE;AACvE,2EAA2E;AAC3E,2BAA2B;AAE3B,wEAAwE;AACxE,yDAAyD;AACzD,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;AAErC,wEAAwE;AACxE,2EAA2E;AAC3E,mCAAmC;AACnC,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;AAEvC,4EAA4E;AAC5E,2EAA2E;AAC3E,4BAA4B;AAC5B,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,yEAAyE;AACzE,2EAA2E;AAC3E,6EAA6E;AAC7E,8EAA8E;AAC9E,kEAAkE;AAClE,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAEnC,qEAAqE;AACrE,kEAAkE;AAClE,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC;AAE5B,0EAA0E;AAC1E,2EAA2E;AAC3E,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAEnD,0EAA0E;AAC1E,wEAAwE;AACxE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAE7C,2EAA2E;AAC3E,sEAAsE;AACtE,4EAA4E;AAC5E,qEAAqE;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAE3C,4EAA4E;AAC5E,4EAA4E;AAC5E,MAA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MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC","sourcesContent":["// Every Loadbare attribute name lives here. Nothing writes one as a string\n// literal — not a widget, not a page host, not a test. See\n// docs/reference/data-binding.md.\n\n// --- Landing (docs/reference/data-binding.md) ----------------------------\n// Everything is a query. The server answers every request with response\n// items, one per query, and each carries the query's kind and key. The\n// markup names a query and the columns it shows; it never repeats what the\n// server already declared.\n\n// Names the query whose rows land in an element's content. A nested one\n// begins a new query: what is inside it is that query's.\nexport const ATTR_QUERY = \"lb-query\";\n\n// The column an element shows, read from the nearest ancestor row. On a\n// control the hub sets its value, and gathers it back under this name when\n// the control's request is issued.\nexport const ATTR_COLUMN = \"lb-column\";\n\n// The column that decides whether an element is present: `null` and `false`\n// are off, and every other value is on. It reads from the nearest ancestor\n// row, as ATTR_COLUMN does.\n//\n// An element that is off is moved into a `<template>` carrying this attribute\n// and the same column, standing where the element stood, and moved back out\n// when the column turns on. The builder ships every such element already\n// inside its template. A developer writes this attribute on an element and\n// never on a template: the template form is Loadbare's, and holds the absent\n// branch in the document so the hub holds nothing. Landing reaches inside it,\n// so a branch that returns is already current; nothing else does.\nexport const ATTR_SHOW = \"lb-show\";\n\n// Written before the column in ATTR_SHOW, it reverses the condition:\n// `lb-show=\"!chosen\"` is present while `chosen` is null or false.\nexport const SHOW_NOT = \"!\";\n\n// Stamped by the hub on every element it sets from a column: the value it\n// set, so a stylesheet can select on it and a custom element that is not a\n// control can render it.\nexport const ATTR_COLUMN_VALUE = \"lb-column-value\";\n\n// Stamped by the hub on each live row, and on an element a `row` lands on\n// itself: the row's key. The key column is the query's, declared by the\n// server and carried by every response item.\nexport const ATTR_KEY_VALUE = \"lb-key-value\";\n\n// Stamped by the hub on each live row, and on nothing else: the element it\n// cloned from a row template. A key alone does not say so, because an\n// element a `row` lands on carries one too, and a live row may name a query\n// of its own, so neither the key nor `lb-query` tells the two apart.\nexport const ATTR_ROW_LIVE = \"lb-row-live\";\n\n// Selects a live row. Anything that walks rows — reconciliation, gathering,\n// a custom element's own placement — finds them with this and nothing else.\nexport const LIVE_ROW = `[${ATTR_ROW_LIVE}]`;\n\n// Stamped by the hub on an element with a row template: how many live rows\n// it shows, so \"no members yet\" is a stylesheet rule rather than a\n// conditional in every widget. A row a filter hides is not counted.\nexport const ATTR_QUERY_ROW_COUNT = \"lb-query-row-count\";\n\n// Stamped by the hub beside ATTR_QUERY_ROW_COUNT: how many live rows stand\n// where the order would not put them, so a stylesheet shows a re-sort\n// control only while one would do something.\nexport const ATTR_QUERY_UNSORTED_COUNT = \"lb-query-unsorted-count\";\n\n// Stamped by the hub beside ATTR_QUERY_ROW_COUNT: the order its rows are\n// placed by, the user's or else the server's, as an order's text, so a\n// widget or a stylesheet can show it. Absent when the rows have no order.\nexport const ATTR_QUERY_ORDER = \"lb-query-order\";\n\n// --- Order and groups (docs/reference/data-binding.md) -------------------\n// A `rows` query's order is a rule over its columns, and the hub places\n// live rows by it, except that an edit from inside a list leaves that list's\n// rows where they stand. A group is a run of rows sharing the order's leading term.\n\n// On a `<template>` inside an element naming a query: a group template. Its\n// content holds the group's heading and exactly one nested `<template>`,\n// which is where the group's contents go: the next group template, or, at\n// the innermost level, the row template. The nth group template breaks on\n// the order's nth term. The markup's nesting decides whether the contents\n// land inside the heading's element or beside it.\nexport const ATTR_GROUP = \"lb-group\";\n\n// Stamped by the hub on each top-level element of a group it built, and on\n// nothing else, as ATTR_ROW_LIVE is on a live row.\nexport const ATTR_GROUP_LIVE = \"lb-group-live\";\n\n// Stamped beside ATTR_GROUP_LIVE: the column the group breaks on, and its\n// value there.\nexport const ATTR_GROUP_COLUMN = \"lb-group-column\";\nexport const ATTR_GROUP_VALUE = \"lb-group-value\";\n\n// Selects a group's element, as LIVE_ROW selects a live row.\nexport const LIVE_GROUP = `[${ATTR_GROUP_LIVE}]`;\n\n// Aggregates, written on any element in a group template or in the element\n// naming the query: the hub sets the element from the rows of the nearest\n// group around it, or of the whole list outside any group. `lb-count` takes\n// no value; the others name the column they aggregate.\nexport const ATTR_COUNT = \"lb-count\";\nexport const ATTR_SUM = \"lb-sum\";\nexport const ATTR_AVG = \"lb-avg\";\nexport const ATTR_MIN = \"lb-min\";\nexport const ATTR_MAX = \"lb-max\";\n\nexport const AGGREGATES = [\n ATTR_COUNT,\n ATTR_SUM,\n ATTR_AVG,\n ATTR_MIN,\n ATTR_MAX,\n] as const;\n\n// Written before a column in an order, it sorts that column descending.\nexport const ORDER_DESCENDING = \"-\";\n\n// The types a `rows` query may declare for its columns. Sorting, filtering,\n// `lb-min` and `lb-max` read a declared column as its type rather than by\n// the JSON type its values arrive as.\nexport const COLUMN_TYPES = [\"number\", \"boolean\", \"text\"] as const;\n\n// --- Choices (docs/reference/data-binding.md) -----------------------------\n// What the user chose for how rows show: an order, a filter. The hub serves\n// them as its own query, one row keyed by the path, with a column per choice,\n// and any control inside `lb-query=\"lb-choices\"` writes one with\n// `lb-row-update`. They hold until the page changes.\nexport const CHOICES_QUERY = \"lb-choices\";\n\n// On an element naming a `rows` query: the column of `lb-choices` holding the\n// user's order for its rows, as an order's text. While that column is empty,\n// the order the server declared places them.\nexport const ATTR_ORDER = \"lb-order\";\n\n// On an element naming a `rows` query: the columns of its rows that a choice\n// may filter, separated by commas. The column of `lb-choices` of the same\n// name holds the filter, and a row it does not pass is `hidden`.\nexport const ATTR_FILTER = \"lb-filter\";\n\n// A filter's operators, written before each value: `^=Amazon`, or\n// `>=2026-01-01 <=2026-03-31` for a range. A value with none is `*=`. The\n// longer are listed first, which is the order they are read in.\nexport const FILTER_OPERATORS = [\n \"!=\",\n \"^=\",\n \"$=\",\n \"*=\",\n \"<=\",\n \">=\",\n \"=\",\n \"<\",\n \">\",\n] as const;\n\n// --- What happened to a row (docs/reference/data-binding.md) ------------\n// Every change the hub makes to a list is one a stylesheet can see, so an\n// application animates with CSS alone. The first three are cleared when the\n// hub next touches the row, and a stamp applied again is removed and added\n// as two changes, so an animation keyed to it plays again.\n\n// The row was created when the hub last touched it.\nexport const ATTR_ROW_CREATED = \"lb-row-created\";\n\n// The row's values changed when the hub last touched it.\nexport const ATTR_ROW_CHANGED = \"lb-row-changed\";\n\n// The row moved when the hub last touched it: its values changed, and the\n// order put it somewhere else among the rows whose values did not.\nexport const ATTR_ROW_MOVED = \"lb-row-moved\";\n\n// What a request from this page did to the row: one of the three values\n// below. Cleared at every landing of the row's query, so a script reading it\n// after a landing reads only what that landing did.\nexport const ATTR_ROW_REQUESTED = \"lb-row-requested\";\nexport const REQUESTED_CREATED = \"created\";\nexport const REQUESTED_CHANGED = \"changed\";\nexport const REQUESTED_MOVED = \"moved\";\n\n// The row stands where the order would not put it: an edit from inside its\n// list changed or created it, and the hub left it where the user was\n// working. Cleared when the rows are next placed by the order.\nexport const ATTR_ROW_UNSORTED = \"lb-row-unsorted\";\n\n// A row or a group on its way out. It is no longer live, takes no input, and\n// is removed once the animations running on it have finished, at once when\n// there are none.\nexport const ATTR_ROW_LEAVING = \"lb-row-leaving\";\nexport const ATTR_GROUP_LEAVING = \"lb-group-leaving\";\n\n// --- Requests (docs/reference/data-binding.md) --------------------------\n// Names the request an element issues when it commits: a form on submit, a\n// control on change, anything else on click.\nexport const ATTR_REQUEST = \"lb-request\";\n\n// Every request travels as one bubbling event of this name, whoever issued\n// it, so an ancestor may stop it.\nexport const LB_EVENT_NAME = \"lb-request\";\n\n// The counterpart of LB_EVENT_NAME: raised on the element that committed,\n// once what the request brought back has landed or the round trip has\n// failed. It bubbles, so the element that cares about the outcome need not\n// be the one that committed.\nexport const LB_DONE_EVENT_NAME = \"lb-request-done\";\n\n// Stamped on the element that issued a request while its round trip is in\n// flight, alongside aria-busy. A commit on an element carrying it is ignored.\nexport const ATTR_REQUEST_PENDING = \"lb-request-pending\";\n\n// Stamped on the element that issued a request when its handler refused it:\n// the refusal's message for the request as a whole, empty when it has none.\n// Cleared at the start of that element's next request. A refusal is not a\n// failure, and does not stamp ATTR_REQUEST_ERROR.\nexport const ATTR_REQUEST_REFUSED = \"lb-request-refused\";\n\n// The status a refusal travels with. Every other failure is a 500 with no\n// body, so nothing but a refusal's own words reaches the browser.\nexport const LB_REFUSAL_STATUS = 422;\n\n// Stamped on the element that issued a request when its round trip failed —\n// a non-2xx response, a thrown application error, or a timeout, all alike.\n// Cleared at the start of that element's next request.\nexport const ATTR_REQUEST_ERROR = \"lb-request-error\";\n\n// --- A form pointed at a row (docs/reference/data-binding.md) -----------\n// One form edits any row of its query, or enters a new one. A button points\n// it with HTML's own `commandfor=\"<form id>\"` and one of these commands,\n// which HTML requires to begin with `--`. The hub hears the `command` event\n// on the form. COMMAND_SORT, the last of them, is for a list, not a form.\n\n// From a button in a live row of the form's query: fill the form from that\n// row, as the hub holds it, and key it by that row.\nexport const COMMAND_EDIT = \"--lb-edit\";\n\n// From any button: start the form empty, for an insert.\nexport const COMMAND_NEW = \"--lb-new\";\n\n// From any button: let the form go without saving.\nexport const COMMAND_RELEASE = \"--lb-release\";\n\n// From any button, for an element carrying `lb-query` rather than a form:\n// place its rows by the order, from the rows the hub holds.\nexport const COMMAND_SORT = \"--lb-sort\";\n\nexport const LB_COMMANDS = [\n COMMAND_EDIT,\n COMMAND_NEW,\n COMMAND_RELEASE,\n COMMAND_SORT,\n] as const;\n\n// Loadbare owns every command beginning with this prefix.\nexport const LB_COMMAND_PREFIX = \"--lb-\";\n\n// Stamped by the hub on the live row a form is pointed at, until the form\n// lets go of it.\nexport const ATTR_ROW_EDITING = \"lb-row-editing\";\n\n// --- Selecting rows (docs/reference/data-binding.md) ---------------------\n// On a checkbox in a row template: ticking it selects the live row it sits\n// in. It is not a column and is not gathered as one. A request for the\n// row's query that names no one row carries the keys of every row selected.\nexport const ATTR_SELECT = \"lb-select\";\n\n// Stamped by the hub on a live row while its `lb-select` checkbox is ticked.\nexport const ATTR_ROW_SELECTED = \"lb-row-selected\";\n\n// --- Reserved names ----------------------------------------------------\n// Loadbare owns every name beginning with this prefix: attribute names, the\n// values of its attributes, query names, request names, the column names of\n// its own queries, custom element names and event names. The server refuses\n// a page that declares a query or a request so named.\nexport const LB_RESERVED_PREFIX = \"lb-\";\n\n// The requests Loadbare provides. Each runs the page's crud declaration for\n// the request's query.\nexport const REQUEST_ROW_INSERT = \"lb-row-insert\";\nexport const REQUEST_ROW_UPDATE = \"lb-row-update\";\nexport const REQUEST_ROW_DELETE = \"lb-row-delete\";\n\nexport const LB_ROW_REQUESTS = [\n REQUEST_ROW_INSERT,\n REQUEST_ROW_UPDATE,\n REQUEST_ROW_DELETE,\n] as const;\n\n// Loadbare also owns every method name on a custom element that begins with\n// `lb` and a capital. These are the ones it calls (the HubLifecycle interface\n// in core/lb-types.ts); the builder refuses a script that declares any other.\nexport const LB_METHODS = [\n \"lbAttached\",\n \"lbRowsLanded\",\n \"lbRequestDone\",\n \"lbDetached\",\n] as const;\n\n// The browser's lifecycle callbacks, which the hub's methods replace. The\n// builder refuses a script that declares any of them.\nexport const BROWSER_LIFECYCLE = [\n \"connectedCallback\",\n \"disconnectedCallback\",\n \"adoptedCallback\",\n \"connectedMoveCallback\",\n] as const;\n\n// --- Kinds --------------------------------------------------------------\nexport const KIND_ROW = \"row\";\nexport const KIND_ROWS = \"rows\";\n\n// --- The URL (docs/reference/chrome.md) ---------------------------------\n// The query the hub serves: one row, keyed by the path, whose other columns\n// are the query parms.\nexport const URL_QUERY = \"lb-url\";\nexport const URL_COLUMN_PATH = \"lb-path\";\nexport const URL_COLUMN_PAGE_LABEL = \"lb-page-label\";\nexport const URL_COLUMN_PAGE_UNKNOWN = \"lb-page-unknown\";\n\n// --- Round trips (docs/reference/chrome.md) ------------------------------\n// The query the hub serves with its own state: one row, keyed by the path,\n// telling whether the page's data arrived and whether the server answers.\n// The hub stamps the same columns on `<lb-hub>` itself, for a stylesheet.\nexport const HUB_QUERY = \"lb-hub\";\n\n// `loading`, `loaded` or `failed`: the page load for the URL showing.\nexport const HUB_COLUMN_LOAD_STATE = \"lb-load-state\";\n\n// `reachable`, `failing` or `unreachable`: how the latest round trip of any\n// kind went. Empty until the first one returns.\nexport const HUB_COLUMN_SERVER_STATE = \"lb-server-state\";\n\n// Empty, or why the latest round trip failed: HUB_ERROR_NETWORK,\n// HUB_ERROR_TIMEOUT, or the HTTP status the server answered with.\nexport const HUB_COLUMN_ERROR = \"lb-error\";\n\n// How many round trips are in flight.\nexport const HUB_COLUMN_PENDING = \"lb-pending\";\n\n// When rows last came from the server, as an ISO timestamp.\nexport const HUB_COLUMN_AS_OF = \"lb-as-of\";\n\nexport const HUB_LOAD_LOADING = \"loading\";\nexport const HUB_LOAD_LOADED = \"loaded\";\nexport const HUB_LOAD_FAILED = \"failed\";\n\nexport const HUB_SERVER_REACHABLE = \"reachable\";\nexport const HUB_SERVER_FAILING = \"failing\";\nexport const HUB_SERVER_UNREACHABLE = \"unreachable\";\n\nexport const HUB_ERROR_NETWORK = \"network\";\nexport const HUB_ERROR_TIMEOUT = \"timeout\";\n\n// On an `<a>`: a plain primary click sets `lb-path` from the `href`.\nexport const ATTR_URL_LINK = \"lb-url-link\";\n\n// On an element with `lb-request`: its update of `lb-url` pushes a history\n// entry instead of replacing one.\nexport const ATTR_URL_PUSH = \"lb-url-push\";\n\n// On an `<a>` carrying ATTR_URL_LINK: columns of the row around it, separated\n// by commas, each added to the `href`'s query string as the parm of the same\n// name.\nexport const ATTR_URL_PARM = \"lb-url-parm\";\n\n// On a `<dialog>`: the hub calls showModal() when `lb-page-unknown` is true.\nexport const ATTR_URL_UNKNOWN = \"lb-url-unknown\";\n\n// --- Build time (docs/reference/custom-elements.md) ---------------------\n// Marks the element in an element file whose children receive the rest of\n// the custom element's content. An attribute rather than an element because\n// HTML content models discard foreign elements inside <select> and <table>.\nexport const ATTR_EXP_SLOT = \"lb-exp-slot\";\n\n// One name in two positions. In an element file it marks a destination; on a\n// `<template>` in the custom element's content it names the destination\n// that template is for, and the template's content moves into it.\nexport const ATTR_EXP_TEMPLATE = \"lb-exp-template\";\n\n// A page ships as <template lb-page=\"<stub>\">.\nexport const ATTR_PAGE = \"lb-page\";\n\n// Stamped by the builder beside ATTR_PAGE: the text content of the page\n// file's `<title>`, which the builder removes.\nexport const ATTR_PAGE_TITLE = \"lb-page-title\";\n\n// The attributes a developer writes. The builder refuses any other `lb-`\n// attribute in markup: the rest are stamps, written by the hub or the\n// builder and never by hand or by script.\nexport const DEVELOPER_ATTRIBUTES = [\n ATTR_QUERY,\n ATTR_COLUMN,\n ATTR_SHOW,\n ATTR_GROUP,\n ...AGGREGATES,\n ATTR_ORDER,\n ATTR_FILTER,\n ATTR_REQUEST,\n ATTR_SELECT,\n ATTR_URL_LINK,\n ATTR_URL_PUSH,\n ATTR_URL_PARM,\n ATTR_URL_UNKNOWN,\n] as const;\n\n// The hub's own tag. It is exempt from the rule every other LB-* tag\n// follows: expansion does not require it to have a definition (build/expand.ts),\n// and the client build does not require it to have a script of its own\n// (build/elements.ts) — it is the framework's live element, always present,\n// registered once by the package's main entry point, not a widget an\n// application discovers or declares.\nexport const HUB_TAG_NAME = \"lb-hub\";\n\n// --- Wire --------------------------------------------------------------\n// One path, one method: everything the hub asks of the server is a POST\n// below this path. The page's stub follows it, and the query string the\n// browser is showing rides after that verbatim, so `/accounts?acct=23` asks\n// as `POST /lb/accounts?acct=23` and the server always knows what URL the\n// browser is showing. Navigation is therefore the only GET an application\n// serves, which is what leaves the page name space unrestricted.\nexport const LB_ENDPOINT = \"/lb\";\n\n// A client-side deadline for one round trip. fetch() has no deadline of its\n// own; past this the request is aborted and treated as a failure.\nexport const LB_REQUEST_TIMEOUT_MS = 10_000;\n"]}
1
+ {"version":3,"file":"lb-constants.js","sourceRoot":"","sources":["../../core/lb-constants.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2DAA2D;AAC3D,kCAAkC;AAElC,4EAA4E;AAC5E,wEAAwE;AACxE,uEAAuE;AACvE,2EAA2E;AAC3E,2BAA2B;AAE3B,wEAAwE;AACxE,yDAAyD;AACzD,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;AAErC,wEAAwE;AACxE,2EAA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AEjD,2EAA2E;AAC3E,0EAA0E;AAC1E,4EAA4E;AAC5E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAE3C,6EAA6E;AAC7E,wEAAwE;AACxE,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAEnD,+CAA+C;AAC/C,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAEnC,wEAAwE;AACxE,+CAA+C;AAC/C,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C,yEAAyE;AACzE,sEAAsE;AACtE,0CAA0C;AAC1C,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU;IACV,WAAW;IACX,SAAS;IACT,UAAU;IACV,GAAG,UAAU;IACb,UAAU;IACV,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,aAAa;IACb,aAAa;IACb,aAAa;IACb,gBAAgB;CACR,CAAC;AAEX,qEAAqE;AACrE,iFAAiF;AACjF,uEAAuE;AACvE,4EAA4E;AAC5E,qEAAqE;AACrE,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC;AAErC,0EAA0E;AAC1E,wEAAwE;AACxE,wEAAwE;AACxE,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,iEAAiE;AACjE,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;AAEjC,4EAA4E;AAC5E,kEAAkE;AAClE,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC","sourcesContent":["// Every Loadbare attribute name lives here. Nothing writes one as a string\n// literal — not a widget, not a page host, not a test. See\n// docs/reference/data-binding.md.\n\n// --- Landing (docs/reference/data-binding.md) ----------------------------\n// Everything is a query. The server answers every request with response\n// items, one per query, and each carries the query's kind and key. The\n// markup names a query and the columns it shows; it never repeats what the\n// server already declared.\n\n// Names the query whose rows land in an element's content. A nested one\n// begins a new query: what is inside it is that query's.\nexport const ATTR_QUERY = \"lb-query\";\n\n// The column an element shows, read from the nearest ancestor row. On a\n// control the hub sets its value, and gathers it back under this name when\n// the control's request is issued.\nexport const ATTR_COLUMN = \"lb-column\";\n\n// The column that decides whether an element is present: `null` and `false`\n// are off, and every other value is on. It reads from the nearest ancestor\n// row, as ATTR_COLUMN does.\n//\n// An element that is off is moved into a `<template>` carrying this attribute\n// and the same column, standing where the element stood, and moved back out\n// when the column turns on. The builder ships every such element already\n// inside its template. A developer writes this attribute on an element and\n// never on a template: the template form is Loadbare's, and holds the absent\n// branch in the document so the hub holds nothing. Landing reaches inside it,\n// so a branch that returns is already current; nothing else does.\nexport const ATTR_SHOW = \"lb-show\";\n\n// Written before the column in ATTR_SHOW, it reverses the condition:\n// `lb-show=\"!chosen\"` is present while `chosen` is null or false.\nexport const SHOW_NOT = \"!\";\n\n// Stamped by the hub on every element it sets from a column: the value it\n// set, so a stylesheet can select on it and a custom element that is not a\n// control can render it.\nexport const ATTR_COLUMN_VALUE = \"lb-column-value\";\n\n// Stamped by the hub on each live row, and on an element a `row` lands on\n// itself: the row's key. The key column is the query's, declared by the\n// server and carried by every response item.\nexport const ATTR_KEY_VALUE = \"lb-key-value\";\n\n// Stamped by the hub on each live row, and on nothing else: the element it\n// cloned from a row template. A key alone does not say so, because an\n// element a `row` lands on carries one too, and a live row may name a query\n// of its own, so neither the key nor `lb-query` tells the two apart.\nexport const ATTR_ROW_LIVE = \"lb-row-live\";\n\n// Selects a live row. Anything that walks rows — reconciliation, gathering,\n// a custom element's own placement — finds them with this and nothing else.\nexport const LIVE_ROW = `[${ATTR_ROW_LIVE}]`;\n\n// Stamped by the hub on an element with a row template: how many live rows\n// it shows, so \"no members yet\" is a stylesheet rule rather than a\n// conditional in every widget. A row a filter hides is not counted.\nexport const ATTR_QUERY_ROW_COUNT = \"lb-query-row-count\";\n\n// Stamped by the hub beside ATTR_QUERY_ROW_COUNT: how many live rows stand\n// where the order or the filter would not leave them, so a stylesheet shows\n// a control that places them only while one would do something.\nexport const ATTR_QUERY_UNPLACED_COUNT = \"lb-query-unplaced-count\";\n\n// Stamped by the hub beside ATTR_QUERY_ROW_COUNT: the order its rows are\n// placed by, the user's or else the server's, as an order's text, so a\n// widget or a stylesheet can show it. Absent when the rows have no order.\nexport const ATTR_QUERY_ORDER = \"lb-query-order\";\n\n// --- Order and groups (docs/reference/data-binding.md) -------------------\n// A `rows` query's order is a rule over its columns, and the hub places\n// live rows by it, except that an edit from inside a list leaves that list's\n// rows where they stand. A group is a run of rows sharing the order's leading term.\n\n// On a `<template>` inside an element naming a query: a group template. Its\n// content holds the group's heading and exactly one nested `<template>`,\n// which is where the group's contents go: the next group template, or, at\n// the innermost level, the row template. The nth group template breaks on\n// the order's nth term. The markup's nesting decides whether the contents\n// land inside the heading's element or beside it.\nexport const ATTR_GROUP = \"lb-group\";\n\n// Stamped by the hub on each top-level element of a group it built, and on\n// nothing else, as ATTR_ROW_LIVE is on a live row.\nexport const ATTR_GROUP_LIVE = \"lb-group-live\";\n\n// Stamped beside ATTR_GROUP_LIVE: the column the group breaks on, and its\n// value there.\nexport const ATTR_GROUP_COLUMN = \"lb-group-column\";\nexport const ATTR_GROUP_VALUE = \"lb-group-value\";\n\n// Selects a group's element, as LIVE_ROW selects a live row.\nexport const LIVE_GROUP = `[${ATTR_GROUP_LIVE}]`;\n\n// Aggregates, written on any element in a group template or in the element\n// naming the query: the hub sets the element from the rows of the nearest\n// group around it, or of the whole list outside any group. `lb-count` takes\n// no value; the others name the column they aggregate.\nexport const ATTR_COUNT = \"lb-count\";\nexport const ATTR_SUM = \"lb-sum\";\nexport const ATTR_AVG = \"lb-avg\";\nexport const ATTR_MIN = \"lb-min\";\nexport const ATTR_MAX = \"lb-max\";\n\nexport const AGGREGATES = [\n ATTR_COUNT,\n ATTR_SUM,\n ATTR_AVG,\n ATTR_MIN,\n ATTR_MAX,\n] as const;\n\n// Written before a column in an order, it sorts that column descending.\nexport const ORDER_DESCENDING = \"-\";\n\n// The types a `rows` query may declare for its columns. Sorting, filtering,\n// `lb-min` and `lb-max` read a declared column as its type rather than by\n// the JSON type its values arrive as.\nexport const COLUMN_TYPES = [\"number\", \"boolean\", \"text\"] as const;\n\n// --- Choices (docs/reference/data-binding.md) -----------------------------\n// What the user chose for how rows show: an order, a filter. The hub serves\n// them as its own query, one row keyed by the path, with a column per choice,\n// and any control inside `lb-query=\"lb-choices\"` writes one with\n// `lb-row-update`. They hold until the page changes.\nexport const CHOICES_QUERY = \"lb-choices\";\n\n// On an element naming a `rows` query: the column of `lb-choices` holding the\n// user's order for its rows, as an order's text. While that column is empty,\n// the order the server declared places them.\nexport const ATTR_ORDER = \"lb-order\";\n\n// On an element naming a `rows` query: the columns of its rows that a choice\n// may filter, separated by commas. The column of `lb-choices` of the same\n// name holds the filter, and a row it does not pass is `hidden`.\nexport const ATTR_FILTER = \"lb-filter\";\n\n// On an element naming a `rows` query: which placements wait for the user,\n// `order`, `filter` or both, separated by spaces. A side not named is placed\n// on every landing. A side named is placed when the page loads, when the\n// user's order or filter changes, and on COMMAND_PLACE; an answer to a\n// request leaves the rows on that side where they stand.\nexport const ATTR_MANUAL = \"lb-manual\";\nexport const MANUAL_ORDER = \"order\";\nexport const MANUAL_FILTER = \"filter\";\n\n// A filter's operators, written before each value: `^=Amazon`, or\n// `>=2026-01-01 <=2026-03-31` for a range. A value with none is `*=`. The\n// longer are listed first, which is the order they are read in.\nexport const FILTER_OPERATORS = [\n \"!=\",\n \"^=\",\n \"$=\",\n \"*=\",\n \"<=\",\n \">=\",\n \"=\",\n \"<\",\n \">\",\n] as const;\n\n// --- What happened to a row (docs/reference/data-binding.md) ------------\n// Every change the hub makes to a list is one a stylesheet can see, so an\n// application animates with CSS alone. The first three are cleared when the\n// hub next touches the row, and a stamp applied again is removed and added\n// as two changes, so an animation keyed to it plays again.\n\n// The row was created when the hub last touched it.\nexport const ATTR_ROW_CREATED = \"lb-row-created\";\n\n// The row's values changed when the hub last touched it.\nexport const ATTR_ROW_CHANGED = \"lb-row-changed\";\n\n// The row moved when the hub last touched it: its values changed, and the\n// order put it somewhere else among the rows whose values did not.\nexport const ATTR_ROW_MOVED = \"lb-row-moved\";\n\n// What a request from this page did to the row: one of the three values\n// below. Cleared at every landing of the row's query, so a script reading it\n// after a landing reads only what that landing did.\nexport const ATTR_ROW_REQUESTED = \"lb-row-requested\";\nexport const REQUESTED_CREATED = \"created\";\nexport const REQUESTED_CHANGED = \"changed\";\nexport const REQUESTED_MOVED = \"moved\";\n\n// The row stands where the order or the filter would not leave it: an answer\n// changed or created it in a list that places that side by hand, and the hub\n// left it where it stood. Cleared when the rows are next placed.\nexport const ATTR_ROW_UNPLACED = \"lb-row-unplaced\";\n\n// A row or a group on its way out. It is no longer live, takes no input, and\n// is removed once the animations running on it have finished, at once when\n// there are none.\nexport const ATTR_ROW_LEAVING = \"lb-row-leaving\";\nexport const ATTR_GROUP_LEAVING = \"lb-group-leaving\";\n\n// --- Requests (docs/reference/data-binding.md) --------------------------\n// Names the request an element issues when it commits: a form on submit, a\n// control on change, anything else on click.\nexport const ATTR_REQUEST = \"lb-request\";\n\n// Every request travels as one bubbling event of this name, whoever issued\n// it, so an ancestor may stop it.\nexport const LB_EVENT_NAME = \"lb-request\";\n\n// The counterpart of LB_EVENT_NAME: raised on the element that committed,\n// once what the request brought back has landed or the round trip has\n// failed. It bubbles, so the element that cares about the outcome need not\n// be the one that committed.\nexport const LB_DONE_EVENT_NAME = \"lb-request-done\";\n\n// Stamped on the element that issued a request while its round trip is in\n// flight, alongside aria-busy. A commit on an element carrying it is ignored.\nexport const ATTR_REQUEST_PENDING = \"lb-request-pending\";\n\n// Stamped on the element that issued a request when its handler refused it:\n// the refusal's message for the request as a whole, empty when it has none.\n// Cleared at the start of that element's next request. A refusal is not a\n// failure, and does not stamp ATTR_REQUEST_ERROR.\nexport const ATTR_REQUEST_REFUSED = \"lb-request-refused\";\n\n// The status a refusal travels with. Every other failure is a 500 with no\n// body, so nothing but a refusal's own words reaches the browser.\nexport const LB_REFUSAL_STATUS = 422;\n\n// Stamped on the element that issued a request when its round trip failed —\n// a non-2xx response, a thrown application error, or a timeout, all alike.\n// Cleared at the start of that element's next request.\nexport const ATTR_REQUEST_ERROR = \"lb-request-error\";\n\n// --- A form pointed at a row (docs/reference/data-binding.md) -----------\n// One form edits any row of its query, or enters a new one. A button points\n// it with HTML's own `commandfor=\"<form id>\"` and one of these commands,\n// which HTML requires to begin with `--`. The hub hears the `command` event\n// on the form. COMMAND_PLACE, the last of them, is for a list, not a form.\n\n// From a button in a live row of the form's query: fill the form from that\n// row, as the hub holds it, and key it by that row.\nexport const COMMAND_EDIT = \"--lb-edit\";\n\n// From any button: start the form empty, for an insert.\nexport const COMMAND_NEW = \"--lb-new\";\n\n// From any button: let the form go without saving.\nexport const COMMAND_RELEASE = \"--lb-release\";\n\n// From any button, for an element carrying `lb-query` rather than a form:\n// place its rows by the order and the filter, from the rows the hub holds.\nexport const COMMAND_PLACE = \"--lb-place\";\n\nexport const LB_COMMANDS = [\n COMMAND_EDIT,\n COMMAND_NEW,\n COMMAND_RELEASE,\n COMMAND_PLACE,\n] as const;\n\n// Loadbare owns every command beginning with this prefix.\nexport const LB_COMMAND_PREFIX = \"--lb-\";\n\n// Stamped by the hub on the live row a form is pointed at, until the form\n// lets go of it.\nexport const ATTR_ROW_EDITING = \"lb-row-editing\";\n\n// --- Selecting rows (docs/reference/data-binding.md) ---------------------\n// On a checkbox in a row template: ticking it selects the live row it sits\n// in. It is not a column and is not gathered as one. A request for the\n// row's query that names no one row carries the keys of every row selected.\nexport const ATTR_SELECT = \"lb-select\";\n\n// Stamped by the hub on a live row while its `lb-select` checkbox is ticked.\nexport const ATTR_ROW_SELECTED = \"lb-row-selected\";\n\n// --- Reserved names ----------------------------------------------------\n// Loadbare owns every name beginning with this prefix: attribute names, the\n// values of its attributes, query names, request names, the column names of\n// its own queries, custom element names and event names. The server refuses\n// a page that declares a query or a request so named.\nexport const LB_RESERVED_PREFIX = \"lb-\";\n\n// The requests Loadbare provides. Each runs the page's crud declaration for\n// the request's query.\nexport const REQUEST_ROW_INSERT = \"lb-row-insert\";\nexport const REQUEST_ROW_UPDATE = \"lb-row-update\";\nexport const REQUEST_ROW_DELETE = \"lb-row-delete\";\n\nexport const LB_ROW_REQUESTS = [\n REQUEST_ROW_INSERT,\n REQUEST_ROW_UPDATE,\n REQUEST_ROW_DELETE,\n] as const;\n\n// Loadbare also owns every method name on a custom element that begins with\n// `lb` and a capital. These are the ones it calls (the HubLifecycle interface\n// in core/lb-types.ts); the builder refuses a script that declares any other.\nexport const LB_METHODS = [\n \"lbAttached\",\n \"lbRowsLanded\",\n \"lbRequestDone\",\n \"lbDetached\",\n] as const;\n\n// The browser's lifecycle callbacks, which the hub's methods replace. The\n// builder refuses a script that declares any of them.\nexport const BROWSER_LIFECYCLE = [\n \"connectedCallback\",\n \"disconnectedCallback\",\n \"adoptedCallback\",\n \"connectedMoveCallback\",\n] as const;\n\n// --- Kinds --------------------------------------------------------------\nexport const KIND_ROW = \"row\";\nexport const KIND_ROWS = \"rows\";\n\n// --- The URL (docs/reference/chrome.md) ---------------------------------\n// The query the hub serves: one row, keyed by the path, whose other columns\n// are the query parms.\nexport const URL_QUERY = \"lb-url\";\nexport const URL_COLUMN_PATH = \"lb-path\";\nexport const URL_COLUMN_PAGE_LABEL = \"lb-page-label\";\nexport const URL_COLUMN_PAGE_UNKNOWN = \"lb-page-unknown\";\n\n// --- Round trips (docs/reference/chrome.md) ------------------------------\n// The query the hub serves with its own state: one row, keyed by the path,\n// telling whether the page's data arrived and whether the server answers.\n// The hub stamps the same columns on `<lb-hub>` itself, for a stylesheet.\nexport const HUB_QUERY = \"lb-hub\";\n\n// `loading`, `loaded` or `failed`: the page load for the URL showing.\nexport const HUB_COLUMN_LOAD_STATE = \"lb-load-state\";\n\n// `reachable`, `failing` or `unreachable`: how the latest round trip of any\n// kind went. Empty until the first one returns.\nexport const HUB_COLUMN_SERVER_STATE = \"lb-server-state\";\n\n// Empty, or why the latest round trip failed: HUB_ERROR_NETWORK,\n// HUB_ERROR_TIMEOUT, or the HTTP status the server answered with.\nexport const HUB_COLUMN_ERROR = \"lb-error\";\n\n// How many round trips are in flight.\nexport const HUB_COLUMN_PENDING = \"lb-pending\";\n\n// When rows last came from the server, as an ISO timestamp.\nexport const HUB_COLUMN_AS_OF = \"lb-as-of\";\n\nexport const HUB_LOAD_LOADING = \"loading\";\nexport const HUB_LOAD_LOADED = \"loaded\";\nexport const HUB_LOAD_FAILED = \"failed\";\n\nexport const HUB_SERVER_REACHABLE = \"reachable\";\nexport const HUB_SERVER_FAILING = \"failing\";\nexport const HUB_SERVER_UNREACHABLE = \"unreachable\";\n\nexport const HUB_ERROR_NETWORK = \"network\";\nexport const HUB_ERROR_TIMEOUT = \"timeout\";\n\n// On an `<a>`: a plain primary click sets `lb-path` from the `href`.\nexport const ATTR_URL_LINK = \"lb-url-link\";\n\n// On an element with `lb-request`: its update of `lb-url` pushes a history\n// entry instead of replacing one.\nexport const ATTR_URL_PUSH = \"lb-url-push\";\n\n// On an `<a>` carrying ATTR_URL_LINK: columns of the row around it, separated\n// by commas, each added to the `href`'s query string as the parm of the same\n// name.\nexport const ATTR_URL_PARM = \"lb-url-parm\";\n\n// On a `<dialog>`: the hub calls showModal() when `lb-page-unknown` is true.\nexport const ATTR_URL_UNKNOWN = \"lb-url-unknown\";\n\n// --- Build time (docs/reference/custom-elements.md) ---------------------\n// Marks the element in an element file whose children receive the rest of\n// the custom element's content. An attribute rather than an element because\n// HTML content models discard foreign elements inside <select> and <table>.\nexport const ATTR_EXP_SLOT = \"lb-exp-slot\";\n\n// One name in two positions. In an element file it marks a destination; on a\n// `<template>` in the custom element's content it names the destination\n// that template is for, and the template's content moves into it.\nexport const ATTR_EXP_TEMPLATE = \"lb-exp-template\";\n\n// A page ships as <template lb-page=\"<stub>\">.\nexport const ATTR_PAGE = \"lb-page\";\n\n// Stamped by the builder beside ATTR_PAGE: the text content of the page\n// file's `<title>`, which the builder removes.\nexport const ATTR_PAGE_TITLE = \"lb-page-title\";\n\n// The attributes a developer writes. The builder refuses any other `lb-`\n// attribute in markup: the rest are stamps, written by the hub or the\n// builder and never by hand or by script.\nexport const DEVELOPER_ATTRIBUTES = [\n ATTR_QUERY,\n ATTR_COLUMN,\n ATTR_SHOW,\n ATTR_GROUP,\n ...AGGREGATES,\n ATTR_ORDER,\n ATTR_FILTER,\n ATTR_MANUAL,\n ATTR_REQUEST,\n ATTR_SELECT,\n ATTR_URL_LINK,\n ATTR_URL_PUSH,\n ATTR_URL_PARM,\n ATTR_URL_UNKNOWN,\n] as const;\n\n// The hub's own tag. It is exempt from the rule every other LB-* tag\n// follows: expansion does not require it to have a definition (build/expand.ts),\n// and the client build does not require it to have a script of its own\n// (build/elements.ts) — it is the framework's live element, always present,\n// registered once by the package's main entry point, not a widget an\n// application discovers or declares.\nexport const HUB_TAG_NAME = \"lb-hub\";\n\n// --- Wire --------------------------------------------------------------\n// One path, one method: everything the hub asks of the server is a POST\n// below this path. The page's stub follows it, and the query string the\n// browser is showing rides after that verbatim, so `/accounts?acct=23` asks\n// as `POST /lb/accounts?acct=23` and the server always knows what URL the\n// browser is showing. Navigation is therefore the only GET an application\n// serves, which is what leaves the page name space unrestricted.\nexport const LB_ENDPOINT = \"/lb\";\n\n// A client-side deadline for one round trip. fetch() has no deadline of its\n// own; past this the request is aborted and treated as a failure.\nexport const LB_REQUEST_TIMEOUT_MS = 10_000;\n"]}
@@ -80,7 +80,11 @@ export interface HubRequest {
80
80
  * for a request that names no one row. Never sent beside `key`.
81
81
  */
82
82
  keys?: string[];
83
- values?: Record<string, string>;
83
+ /**
84
+ * The gathered controls' values, by column. A column of `lb-url` may hold
85
+ * several, as a URL repeats a parm; every other column holds one.
86
+ */
87
+ values?: Record<string, ParmValue>;
84
88
  /**
85
89
  * The rows of the queries nested in a form, by query name, each with the
86
90
  * values of its own controls: a set of rows gathered beside the form's
@@ -93,6 +97,16 @@ export interface GatheredRow {
93
97
  key: string;
94
98
  values: Record<string, string>;
95
99
  }
100
+ /**
101
+ * What a control gathers: one value, or several from a control that holds
102
+ * several, which only a column of `lb-url` takes.
103
+ */
104
+ export type ParmValue = string | string[];
105
+ /**
106
+ * The query parms of a URL as a row of `lb-url`: a parm the URL carries
107
+ * once is a string, and one it repeats is every value it carries, in order.
108
+ */
109
+ export declare function parmsRow(parms: URLSearchParams): Row;
96
110
  /**
97
111
  * The detail of the `lb-request-done` event: the request as the hub
98
112
  * completed and sent it, and what came of it. `items` is every response
@@ -116,7 +130,9 @@ export interface HubRefusal {
116
130
  columns?: Record<string, string>;
117
131
  }
118
132
  /** The fields a handler receives: the request, less its name. */
119
- export type RequestFields = Omit<HubRequest, "name">;
133
+ export type RequestFields = Omit<HubRequest, "name" | "values"> & {
134
+ values?: Record<string, string>;
135
+ };
120
136
  /** Whether a name is one of the requests Loadbare provides. */
121
137
  export declare function isRowRequest(name: string): boolean;
122
138
  /**
@@ -129,7 +145,7 @@ export declare function isRowRequest(name: string): boolean;
129
145
  * returned `lb-url`. The two must agree, or what the page shows would differ
130
146
  * from what the address bar says.
131
147
  */
132
- export declare function withQueryParms(search: URLSearchParams, parms: Record<string, string>): URLSearchParams;
148
+ export declare function withQueryParms(search: URLSearchParams, parms: Record<string, ParmValue>): URLSearchParams;
133
149
  /**
134
150
  * A path names a page by its stub, and nothing finer. The bare path resolves
135
151
  * to `index`, the same convention a static file server follows.
@@ -1 +1 @@
1
- {"version":3,"file":"lb-types.d.ts","sourceRoot":"","sources":["../../core/lb-types.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,SAAS,EAKV,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,CAAC,EAAE,GAAG,EAAE,CA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AAC,CAAC;AAE/D,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAOD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAStD;AAkBD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,UAAU,EACrC,IAAI,CAAC,EAAE,UAAU,GAChB,OAAO,CA2BT;AAED,8DAA8D;AAC9D,wBAAgB,MAAM,CACpB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,UAAU,EAAE,EACnB,IAAI,CAAC,EAAE,UAAU,GAChB,OAAO,CAET;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,GAAG,GACP;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAgB1D;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,UAAU,CAAC,IAAI,IAAI,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,IAAI,IAAI,CAAC;IACtB;;;;OAIG;IACH,aAAa,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9D,0DAA0D;IAC1D,UAAU,CAAC,IAAI,IAAI,CAAC;CACrB"}
@@ -4,6 +4,18 @@ import { FILTER_OPERATORS, LB_RESERVED_PREFIX, LB_ROW_REQUESTS, ORDER_DESCENDING
4
4
  export function isPatch(result) {
5
5
  return !Array.isArray(result);
6
6
  }
7
+ /**
8
+ * The query parms of a URL as a row of `lb-url`: a parm the URL carries
9
+ * once is a string, and one it repeats is every value it carries, in order.
10
+ */
11
+ export function parmsRow(parms) {
12
+ const row = {};
13
+ for (const name of new Set(parms.keys())) {
14
+ const all = parms.getAll(name);
15
+ row[name] = all.length === 1 ? all[0] : all;
16
+ }
17
+ return row;
18
+ }
7
19
  /** Whether a name is one of the requests Loadbare provides. */
8
20
  export function isRowRequest(name) {
9
21
  return LB_ROW_REQUESTS.includes(name);
@@ -21,10 +33,27 @@ export function isRowRequest(name) {
21
33
  export function withQueryParms(search, parms) {
22
34
  const next = new URLSearchParams(search);
23
35
  for (const [name, value] of Object.entries(parms)) {
24
- if (value === "")
25
- next.delete(name);
26
- else
27
- next.set(name, value);
36
+ if (!Array.isArray(value)) {
37
+ if (value === "")
38
+ next.delete(name);
39
+ else
40
+ next.set(name, value);
41
+ continue;
42
+ }
43
+ // Several values repeat the parm, as an HTML form sends them. Values
44
+ // already there are left where they stand, so the URL is unchanged.
45
+ const kept = value.filter((v) => v !== "");
46
+ const had = next.getAll(name);
47
+ if (kept.length === had.length && kept.every((v, i) => v === had[i])) {
48
+ continue;
49
+ }
50
+ if (kept.length === 1) {
51
+ next.set(name, kept[0]);
52
+ continue;
53
+ }
54
+ next.delete(name);
55
+ for (const v of kept)
56
+ next.append(name, v);
28
57
  }
29
58
  return next;
30
59
  }
@@ -224,10 +253,11 @@ export function passes(value, terms, type) {
224
253
  */
225
254
  export function nextLocation(page, parms, row) {
226
255
  const named = {};
256
+ const text = (value) => value === null || value === undefined ? "" : String(value);
227
257
  for (const [name, value] of Object.entries(row)) {
228
258
  if (name.startsWith(LB_RESERVED_PREFIX))
229
259
  continue;
230
- named[name] = value === null || value === undefined ? "" : String(value);
260
+ named[name] = Array.isArray(value) ? value.map(text) : text(value);
231
261
  }
232
262
  const path = row[URL_COLUMN_PATH];
233
263
  const next = typeof path === "string" ? pageNameFor(path) : page;
@@ -1 +1 @@
1
- {"version":3,"file":"lb-types.js","sourceRoot":"","sources":["../../core/lb-types.ts"],"names":[],"mappings":"AAAA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AM,CACpB,KAAc,EACd,KAAmB,EACnB,IAAiB;IAEjB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAY,EACZ,KAAsB,EACtB,GAAQ;IAER,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAChD,IAAI,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;YAAE,SAAS;QAClD,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3E,CAAC;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACjE,MAAM,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5B,OAAO;QACL,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC;QACnE,KAAK;KACN,CAAC;AACJ,CAAC","sourcesContent":["/// <reference lib=\"dom\" />\n\n// The wire vocabulary. Shared by browser and server.\n\nimport {\n COLUMN_TYPES,\n KIND_ROW,\n FILTER_OPERATORS,\n KIND_ROWS,\n LB_RESERVED_PREFIX,\n LB_ROW_REQUESTS,\n ORDER_DESCENDING,\n URL_COLUMN_PATH,\n} from \"./lb-constants.js\";\n\n/**\n * One row: its columns, by name.\n *\n * A value is whatever the server serialized. The hub knows nothing about its\n * type and enforces nothing: it hands each value to the browser untouched,\n * and the browser renders it as it sees fit. What a number, a date or a null\n * should look like is the application's decision, made in the query.\n */\nexport type Row = Record<string, unknown>;\n\n/**\n * Part of a `rows` query's answer — see docs/reference/server.md, \"Queries\".\n *\n * Rows named here are added or updated, keys in `drop` are removed, and\n * anything unnamed is left alone. The hub places what it names by the\n * query's order. Add and remove are one result rather than two because the\n * interesting cases are both at once — a row whose sort key changed has to\n * move, a swap is one out and one in — and two messages would paint the\n * intermediate state.\n */\nexport interface Patch {\n rows?: Row[];\n drop?: unknown[];\n}\n\n/** A type a `rows` query may declare for a column — see COLUMN_TYPES. */\nexport type ColumnType = (typeof COLUMN_TYPES)[number];\n\n/** The types a `rows` query declares for its columns, by column. */\nexport type ColumnTypes = Record<string, ColumnType>;\n\n/** A query's kind, declared by the server and carried by every answer. */\nexport type Kind = typeof KIND_ROW | typeof KIND_ROWS;\n\n/**\n * What a `rows` query answers with: all rows, or a patch. `Array.isArray`\n * tells the two apart. All rows arrive in the order the server chose, which\n * is the order they show in when the query declares none.\n */\nexport type RowsResult = Row[] | Patch;\n\nexport function isPatch(result: RowsResult): result is Patch {\n return !Array.isArray(result);\n}\n\n/**\n * What any one query answers with, as the application writes it. A `row`\n * query that finds no row answers `null`.\n */\nexport type HubResult = Row | RowsResult | null;\n\n/**\n * What application code hands the engine: answers by query name. The engine\n * turns each into a response item, adding the kind and key the query\n * declared.\n */\nexport type HubData = Record<string, HubResult>;\n\n/**\n * One query's answer on the wire: its name, its kind, its key's column name,\n * and exactly one of a row, all rows, or a patch. A patch answers a `rows`\n * query only.\n *\n * A `rows` query also carries the order and column types it declared, once,\n * on the answer that loads the page. The hub keeps them with the answer for\n * every answer after it.\n */\nexport interface ResponseItem {\n query: string;\n kind: Kind;\n key: string;\n row?: Row | null;\n rows?: Row[];\n patch?: Patch;\n order?: string;\n types?: ColumnTypes;\n}\n\n/** Every response the server sends: a page load and a request alike. */\nexport type HubResponse = ResponseItem[];\n\n/**\n * Every request has one shape. The name picks the handler; the rest is\n * present when the hub found it.\n */\nexport interface HubRequest {\n name: string;\n query?: string;\n key?: string;\n /**\n * The rows a request acts on together, by key: those the user selected,\n * for a request that names no one row. Never sent beside `key`.\n */\n keys?: string[];\n values?: Record<string, string>;\n /**\n * The rows of the queries nested in a form, by query name, each with the\n * values of its own controls: a set of rows gathered beside the form's\n * own values.\n */\n rows?: Record<string, GatheredRow[]>;\n}\n\n/** One nested row a form gathered: its key, and its controls' values. */\nexport interface GatheredRow {\n key: string;\n values: Record<string, string>;\n}\n\n/**\n * The detail of the `lb-request-done` event: the request as the hub\n * completed and sent it, and what came of it. `items` is every response\n * item that landed because of it, in the order it landed. `error` is set\n * when the request's own round trip failed, and then nothing landed.\n */\nexport interface HubRequestDone {\n request: HubRequest;\n items: ResponseItem[];\n error?: Error;\n /** Set beside `error` when the handler refused the request. */\n refusal?: HubRefusal;\n}\n\n/**\n * Why a handler refused a request, in words written for the user: a\n * message for the request as a whole, a message per column the request\n * gathered, or both. Sent with status 422; any other failure sends nothing.\n */\nexport interface HubRefusal {\n message?: string;\n columns?: Record<string, string>;\n}\n\n/** The fields a handler receives: the request, less its name. */\nexport type RequestFields = Omit<HubRequest, \"name\">;\n\n/** Whether a name is one of the requests Loadbare provides. */\nexport function isRowRequest(name: string): boolean {\n return (LB_ROW_REQUESTS as readonly string[]).includes(name);\n}\n\n/**\n * A query string with some parms set, and the rest as they were. An empty\n * value takes its parm out, since empty is every parm's default and a\n * default is left out of the URL.\n *\n * One rule on both sides of the wire: the hub applies it to the address bar,\n * and the server to the query string it loads the page at after a request\n * returned `lb-url`. The two must agree, or what the page shows would differ\n * from what the address bar says.\n */\nexport function withQueryParms(\n search: URLSearchParams,\n parms: Record<string, string>,\n): URLSearchParams {\n const next = new URLSearchParams(search);\n for (const [name, value] of Object.entries(parms)) {\n if (value === \"\") next.delete(name);\n else next.set(name, value);\n }\n return next;\n}\n\n/**\n * A path names a page by its stub, and nothing finer. The bare path resolves\n * to `index`, the same convention a static file server follows.\n */\nexport function pageNameFor(path: string): string {\n const name = path.replace(/^\\/+|\\/+$/g, \"\");\n return name === \"\" ? \"index\" : name;\n}\n\n/** One term of an order: a column, and whether it sorts descending. */\nexport interface OrderTerm {\n column: string;\n descending: boolean;\n}\n\n/**\n * An order's terms, from its text: columns separated by commas, each\n * descending when it begins with `-`. Throws on a term that names no column.\n * An empty text is no order.\n */\nexport function parseOrder(text: string): OrderTerm[] {\n if (text.trim() === \"\") return [];\n return text.split(\",\").map((raw) => {\n const term = raw.trim();\n const descending = term.startsWith(ORDER_DESCENDING);\n const column = descending ? term.slice(ORDER_DESCENDING.length) : term;\n if (column === \"\" || column.startsWith(ORDER_DESCENDING)) {\n throw new Error(`the order '${text}' has a term naming no column`);\n }\n return { column, descending };\n });\n}\n\n/** Strings compare as the user's language orders them. */\nconst collator = new Intl.Collator();\n\n/** How a value sorts among values of other types: by its JSON type. */\nfunction rank(value: unknown): number {\n switch (typeof value) {\n case \"boolean\":\n return 0;\n case \"number\":\n return 1;\n case \"string\":\n return 2;\n default:\n return 3;\n }\n}\n\n/**\n * Compare two column values, ascending.\n *\n * A value compares by its JSON type, and nothing is guessed: numbers\n * numerically, booleans false before true, strings as the user's language\n * orders them. A number that arrives as a string sorts as a string, so a\n * numeric sort column is sent as a JSON number. Null and a missing value\n * sort after everything, as Postgres sorts them ascending, and so first\n * descending.\n */\nexport function compareValues(a: unknown, b: unknown): number {\n const missingA = a === null || a === undefined;\n const missingB = b === null || b === undefined;\n if (missingA || missingB) return missingA === missingB ? 0 : missingA ? 1 : -1;\n const ra = rank(a);\n const rb = rank(b);\n if (ra !== rb) return ra - rb;\n if (typeof a === \"number\") return a - (b as number);\n if (typeof a === \"boolean\") return Number(a) - Number(b);\n if (typeof a === \"string\") return collator.compare(a, b as string);\n return collator.compare(JSON.stringify(a), JSON.stringify(b));\n}\n\n/**\n * A value read as a declared column type: a number for `number`, a boolean\n * for `boolean`, text for `text`. A value that is no value of its type reads\n * as missing, and compares as a null does. A column with no declared type\n * reads as it arrived.\n */\nexport function readAs(value: unknown, type: ColumnType | undefined): unknown {\n if (type === undefined || value === null || value === undefined) return value;\n switch (type) {\n case \"number\": {\n if (typeof value === \"number\") return value;\n if (typeof value !== \"string\" || value.trim() === \"\") return undefined;\n const n = Number(value);\n return Number.isNaN(n) ? undefined : n;\n }\n case \"boolean\":\n if (typeof value === \"boolean\") return value;\n return value === \"true\" ? true : value === \"false\" ? false : undefined;\n default:\n return typeof value === \"object\" ? JSON.stringify(value) : String(value);\n }\n}\n\n/** Compare two rows by an order's terms, each column read as its type. */\nexport function compareRows(\n a: Row,\n b: Row,\n terms: OrderTerm[],\n types: ColumnTypes = {},\n): number {\n for (const { column, descending } of terms) {\n const c = compareValues(\n readAs(a[column], types[column]),\n readAs(b[column], types[column]),\n );\n if (c !== 0) return descending ? -c : c;\n }\n return 0;\n}\n\n/** A filter's operator — see FILTER_OPERATORS. */\nexport type FilterOperator = (typeof FILTER_OPERATORS)[number];\n\n/** One term of a filter: an operator, and the value it compares with. */\nexport interface FilterTerm {\n operator: FilterOperator;\n value: string;\n}\n\n/** Where a filter's next term begins: whitespace before an operator. */\nconst NEXT_TERM = new RegExp(\n `\\\\s+(?=${FILTER_OPERATORS.map((op) => op.replace(/[$^*]/g, \"\\\\$&\")).join(\"|\")})`,\n);\n\n/**\n * A filter's terms, from its text: each an operator and the value after it,\n * a new term beginning wherever whitespace comes before an operator, so a\n * value may hold spaces. Text with no operator before it is `*=`. A term\n * with no value is not yet a term, and is left out, so a filter being typed\n * filters nothing until it says something. Nothing is evaluated.\n */\nexport function parseFilter(text: string): FilterTerm[] {\n const terms: FilterTerm[] = [];\n for (const raw of text.trim().split(NEXT_TERM)) {\n const operator =\n FILTER_OPERATORS.find((op) => raw.startsWith(op)) ?? \"*=\";\n const value = raw.slice(raw.startsWith(operator) ? operator.length : 0);\n if (value.trim() !== \"\") terms.push({ operator, value: value.trim() });\n }\n return terms;\n}\n\n/**\n * The filter's value as the column's own type, so a comparison is the one\n * the order makes: a number for a number, a boolean for a boolean, text for\n * anything else. Undefined when the text is no value of that type.\n */\nfunction asTypeOf(text: string, like: unknown): unknown {\n if (typeof like === \"number\") {\n const n = Number(text);\n return text.trim() === \"\" || Number.isNaN(n) ? undefined : n;\n }\n if (typeof like === \"boolean\") {\n return text === \"true\" ? true : text === \"false\" ? false : undefined;\n }\n return text;\n}\n\n/**\n * Whether a column's value passes one term.\n *\n * `^=`, `$=` and `*=` read the value as text, ignoring case: it begins with,\n * ends with or contains the term's value. The rest compare as the order\n * compares, with the column read as its declared type, if it has one, and\n * the term's value read as the column's type. A missing value, and one that\n * is no value of its declared type, passes only `!=`.\n */\nexport function passesTerm(\n value: unknown,\n { operator, value: text }: FilterTerm,\n type?: ColumnType,\n): boolean {\n if (value === null || value === undefined) return operator === \"!=\";\n if (operator === \"^=\" || operator === \"$=\" || operator === \"*=\") {\n const have = String(value).toLocaleLowerCase();\n const want = text.toLocaleLowerCase();\n if (operator === \"^=\") return have.startsWith(want);\n if (operator === \"$=\") return have.endsWith(want);\n return have.includes(want);\n }\n const read = readAs(value, type);\n const typed = read === undefined ? undefined : asTypeOf(text, read);\n if (typed === undefined) return operator === \"!=\";\n const c = compareValues(read, typed);\n switch (operator) {\n case \"=\":\n return c === 0;\n case \"!=\":\n return c !== 0;\n case \"<\":\n return c < 0;\n case \"<=\":\n return c <= 0;\n case \">\":\n return c > 0;\n default:\n return c >= 0;\n }\n}\n\n/** Whether a column's value passes every term of a filter. */\nexport function passes(\n value: unknown,\n terms: FilterTerm[],\n type?: ColumnType,\n): boolean {\n return terms.every((term) => passesTerm(value, term, type));\n}\n\n/**\n * Where a row for `lb-url` leads, from a page and its query parms.\n *\n * A column whose name begins with `lb-` is Loadbare's, and never a query\n * parm; every other column is one. An `lb-path` naming another page enters\n * it with only the parms the row names. Otherwise the named parms are set,\n * or taken out when empty, and the rest are kept.\n *\n * One rule on both sides of the wire: the server loads the page it names,\n * and the hub writes the URL it names. The two must agree, or what the page\n * shows would differ from what the address bar says.\n */\nexport function nextLocation(\n page: string,\n parms: URLSearchParams,\n row: Row,\n): { page: string; parms: URLSearchParams; moved: boolean } {\n const named: Record<string, string> = {};\n for (const [name, value] of Object.entries(row)) {\n if (name.startsWith(LB_RESERVED_PREFIX)) continue;\n named[name] = value === null || value === undefined ? \"\" : String(value);\n }\n const path = row[URL_COLUMN_PATH];\n const next = typeof path === \"string\" ? pageNameFor(path) : page;\n const moved = next !== page;\n return {\n page: next,\n parms: withQueryParms(moved ? new URLSearchParams() : parms, named),\n moved,\n };\n}\n\n/**\n * What the hub tells a custom element it did, in its own terms rather than\n * the browser's: a custom element implements any of these in place of\n * `connectedCallback` and its kin, which the builder refuses.\n *\n * Each is a method on an element the hub does not own, so it carries the\n * `lb` prefix Loadbare reserves for exactly that — see\n * docs/reference/custom-elements.md.\n */\nexport interface HubLifecycle {\n /**\n * Called once, after the hub has placed the element and every column has\n * landed on it. An element under an `lb-show` that is off is placed inside\n * its template, so it may not be rendered.\n */\n lbAttached?(): void;\n /**\n * Called once after a result has landed on an element holding rows, with\n * every row in place and every stamp set. The hub reconciles and places\n * every row itself, by the query's order, so a custom element reacts to\n * rows and never places them.\n */\n lbRowsLanded?(): void;\n /**\n * Called once a request committed by this element, or by one inside it,\n * has finished, innermost first and before `lb-request-done` is\n * dispatched. `origin` is the element that committed.\n */\n lbRequestDone?(detail: HubRequestDone, origin: Element): void;\n /** Called once, after the hub has removed the element. */\n lbDetached?(): void;\n}\n"]}
1
+ {"version":3,"file":"lb-types.js","sourceRoot":"","sources":["../../core/lb-types.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,qDAAqD;AAErD,OAAO,EAGL,gBAAgB,EAEhB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AA2C3B,MAAM,UA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_ROW_REQUESTS,\n ORDER_DESCENDING,\n URL_COLUMN_PATH,\n} from \"./lb-constants.js\";\n\n/**\n * One row: its columns, by name.\n *\n * A value is whatever the server serialized. The hub knows nothing about its\n * type and enforces nothing: it hands each value to the browser untouched,\n * and the browser renders it as it sees fit. What a number, a date or a null\n * should look like is the application's decision, made in the query.\n */\nexport type Row = Record<string, unknown>;\n\n/**\n * Part of a `rows` query's answer — see docs/reference/server.md, \"Queries\".\n *\n * Rows named here are added or updated, keys in `drop` are removed, and\n * anything unnamed is left alone. The hub places what it names by the\n * query's order. Add and remove are one result rather than two because the\n * interesting cases are both at once — a row whose sort key changed has to\n * move, a swap is one out and one in — and two messages would paint the\n * intermediate state.\n */\nexport interface Patch {\n rows?: Row[];\n drop?: unknown[];\n}\n\n/** A type a `rows` query may declare for a column — see COLUMN_TYPES. */\nexport type ColumnType = (typeof COLUMN_TYPES)[number];\n\n/** The types a `rows` query declares for its columns, by column. */\nexport type ColumnTypes = Record<string, ColumnType>;\n\n/** A query's kind, declared by the server and carried by every answer. */\nexport type Kind = typeof KIND_ROW | typeof KIND_ROWS;\n\n/**\n * What a `rows` query answers with: all rows, or a patch. `Array.isArray`\n * tells the two apart. All rows arrive in the order the server chose, which\n * is the order they show in when the query declares none.\n */\nexport type RowsResult = Row[] | Patch;\n\nexport function isPatch(result: RowsResult): result is Patch {\n return !Array.isArray(result);\n}\n\n/**\n * What any one query answers with, as the application writes it. A `row`\n * query that finds no row answers `null`.\n */\nexport type HubResult = Row | RowsResult | null;\n\n/**\n * What application code hands the engine: answers by query name. The engine\n * turns each into a response item, adding the kind and key the query\n * declared.\n */\nexport type HubData = Record<string, HubResult>;\n\n/**\n * One query's answer on the wire: its name, its kind, its key's column name,\n * and exactly one of a row, all rows, or a patch. A patch answers a `rows`\n * query only.\n *\n * A `rows` query also carries the order and column types it declared, once,\n * on the answer that loads the page. The hub keeps them with the answer for\n * every answer after it.\n */\nexport interface ResponseItem {\n query: string;\n kind: Kind;\n key: string;\n row?: Row | null;\n rows?: Row[];\n patch?: Patch;\n order?: string;\n types?: ColumnTypes;\n}\n\n/** Every response the server sends: a page load and a request alike. */\nexport type HubResponse = ResponseItem[];\n\n/**\n * Every request has one shape. The name picks the handler; the rest is\n * present when the hub found it.\n */\nexport interface HubRequest {\n name: string;\n query?: string;\n key?: string;\n /**\n * The rows a request acts on together, by key: those the user selected,\n * for a request that names no one row. Never sent beside `key`.\n */\n keys?: string[];\n /**\n * The gathered controls' values, by column. A column of `lb-url` may hold\n * several, as a URL repeats a parm; every other column holds one.\n */\n values?: Record<string, ParmValue>;\n /**\n * The rows of the queries nested in a form, by query name, each with the\n * values of its own controls: a set of rows gathered beside the form's\n * own values.\n */\n rows?: Record<string, GatheredRow[]>;\n}\n\n/** One nested row a form gathered: its key, and its controls' values. */\nexport interface GatheredRow {\n key: string;\n values: Record<string, string>;\n}\n\n/**\n * What a control gathers: one value, or several from a control that holds\n * several, which only a column of `lb-url` takes.\n */\nexport type ParmValue = string | string[];\n\n/**\n * The query parms of a URL as a row of `lb-url`: a parm the URL carries\n * once is a string, and one it repeats is every value it carries, in order.\n */\nexport function parmsRow(parms: URLSearchParams): Row {\n const row: Row = {};\n for (const name of new Set(parms.keys())) {\n const all = parms.getAll(name);\n row[name] = all.length === 1 ? all[0] : all;\n }\n return row;\n}\n\n/**\n * The detail of the `lb-request-done` event: the request as the hub\n * completed and sent it, and what came of it. `items` is every response\n * item that landed because of it, in the order it landed. `error` is set\n * when the request's own round trip failed, and then nothing landed.\n */\nexport interface HubRequestDone {\n request: HubRequest;\n items: ResponseItem[];\n error?: Error;\n /** Set beside `error` when the handler refused the request. */\n refusal?: HubRefusal;\n}\n\n/**\n * Why a handler refused a request, in words written for the user: a\n * message for the request as a whole, a message per column the request\n * gathered, or both. Sent with status 422; any other failure sends nothing.\n */\nexport interface HubRefusal {\n message?: string;\n columns?: Record<string, string>;\n}\n\n/** The fields a handler receives: the request, less its name. */\nexport type RequestFields = Omit<HubRequest, \"name\" | \"values\"> & {\n values?: Record<string, string>;\n};\n\n/** Whether a name is one of the requests Loadbare provides. */\nexport function isRowRequest(name: string): boolean {\n return (LB_ROW_REQUESTS as readonly string[]).includes(name);\n}\n\n/**\n * A query string with some parms set, and the rest as they were. An empty\n * value takes its parm out, since empty is every parm's default and a\n * default is left out of the URL.\n *\n * One rule on both sides of the wire: the hub applies it to the address bar,\n * and the server to the query string it loads the page at after a request\n * returned `lb-url`. The two must agree, or what the page shows would differ\n * from what the address bar says.\n */\nexport function withQueryParms(\n search: URLSearchParams,\n parms: Record<string, ParmValue>,\n): URLSearchParams {\n const next = new URLSearchParams(search);\n for (const [name, value] of Object.entries(parms)) {\n if (!Array.isArray(value)) {\n if (value === \"\") next.delete(name);\n else next.set(name, value);\n continue;\n }\n // Several values repeat the parm, as an HTML form sends them. Values\n // already there are left where they stand, so the URL is unchanged.\n const kept = value.filter((v) => v !== \"\");\n const had = next.getAll(name);\n if (kept.length === had.length && kept.every((v, i) => v === had[i])) {\n continue;\n }\n if (kept.length === 1) {\n next.set(name, kept[0]!);\n continue;\n }\n next.delete(name);\n for (const v of kept) next.append(name, v);\n }\n return next;\n}\n\n/**\n * A path names a page by its stub, and nothing finer. The bare path resolves\n * to `index`, the same convention a static file server follows.\n */\nexport function pageNameFor(path: string): string {\n const name = path.replace(/^\\/+|\\/+$/g, \"\");\n return name === \"\" ? \"index\" : name;\n}\n\n/** One term of an order: a column, and whether it sorts descending. */\nexport interface OrderTerm {\n column: string;\n descending: boolean;\n}\n\n/**\n * An order's terms, from its text: columns separated by commas, each\n * descending when it begins with `-`. Throws on a term that names no column.\n * An empty text is no order.\n */\nexport function parseOrder(text: string): OrderTerm[] {\n if (text.trim() === \"\") return [];\n return text.split(\",\").map((raw) => {\n const term = raw.trim();\n const descending = term.startsWith(ORDER_DESCENDING);\n const column = descending ? term.slice(ORDER_DESCENDING.length) : term;\n if (column === \"\" || column.startsWith(ORDER_DESCENDING)) {\n throw new Error(`the order '${text}' has a term naming no column`);\n }\n return { column, descending };\n });\n}\n\n/** Strings compare as the user's language orders them. */\nconst collator = new Intl.Collator();\n\n/** How a value sorts among values of other types: by its JSON type. */\nfunction rank(value: unknown): number {\n switch (typeof value) {\n case \"boolean\":\n return 0;\n case \"number\":\n return 1;\n case \"string\":\n return 2;\n default:\n return 3;\n }\n}\n\n/**\n * Compare two column values, ascending.\n *\n * A value compares by its JSON type, and nothing is guessed: numbers\n * numerically, booleans false before true, strings as the user's language\n * orders them. A number that arrives as a string sorts as a string, so a\n * numeric sort column is sent as a JSON number. Null and a missing value\n * sort after everything, as Postgres sorts them ascending, and so first\n * descending.\n */\nexport function compareValues(a: unknown, b: unknown): number {\n const missingA = a === null || a === undefined;\n const missingB = b === null || b === undefined;\n if (missingA || missingB) return missingA === missingB ? 0 : missingA ? 1 : -1;\n const ra = rank(a);\n const rb = rank(b);\n if (ra !== rb) return ra - rb;\n if (typeof a === \"number\") return a - (b as number);\n if (typeof a === \"boolean\") return Number(a) - Number(b);\n if (typeof a === \"string\") return collator.compare(a, b as string);\n return collator.compare(JSON.stringify(a), JSON.stringify(b));\n}\n\n/**\n * A value read as a declared column type: a number for `number`, a boolean\n * for `boolean`, text for `text`. A value that is no value of its type reads\n * as missing, and compares as a null does. A column with no declared type\n * reads as it arrived.\n */\nexport function readAs(value: unknown, type: ColumnType | undefined): unknown {\n if (type === undefined || value === null || value === undefined) return value;\n switch (type) {\n case \"number\": {\n if (typeof value === \"number\") return value;\n if (typeof value !== \"string\" || value.trim() === \"\") return undefined;\n const n = Number(value);\n return Number.isNaN(n) ? undefined : n;\n }\n case \"boolean\":\n if (typeof value === \"boolean\") return value;\n return value === \"true\" ? true : value === \"false\" ? false : undefined;\n default:\n return typeof value === \"object\" ? JSON.stringify(value) : String(value);\n }\n}\n\n/** Compare two rows by an order's terms, each column read as its type. */\nexport function compareRows(\n a: Row,\n b: Row,\n terms: OrderTerm[],\n types: ColumnTypes = {},\n): number {\n for (const { column, descending } of terms) {\n const c = compareValues(\n readAs(a[column], types[column]),\n readAs(b[column], types[column]),\n );\n if (c !== 0) return descending ? -c : c;\n }\n return 0;\n}\n\n/** A filter's operator — see FILTER_OPERATORS. */\nexport type FilterOperator = (typeof FILTER_OPERATORS)[number];\n\n/** One term of a filter: an operator, and the value it compares with. */\nexport interface FilterTerm {\n operator: FilterOperator;\n value: string;\n}\n\n/** Where a filter's next term begins: whitespace before an operator. */\nconst NEXT_TERM = new RegExp(\n `\\\\s+(?=${FILTER_OPERATORS.map((op) => op.replace(/[$^*]/g, \"\\\\$&\")).join(\"|\")})`,\n);\n\n/**\n * A filter's terms, from its text: each an operator and the value after it,\n * a new term beginning wherever whitespace comes before an operator, so a\n * value may hold spaces. Text with no operator before it is `*=`. A term\n * with no value is not yet a term, and is left out, so a filter being typed\n * filters nothing until it says something. Nothing is evaluated.\n */\nexport function parseFilter(text: string): FilterTerm[] {\n const terms: FilterTerm[] = [];\n for (const raw of text.trim().split(NEXT_TERM)) {\n const operator =\n FILTER_OPERATORS.find((op) => raw.startsWith(op)) ?? \"*=\";\n const value = raw.slice(raw.startsWith(operator) ? operator.length : 0);\n if (value.trim() !== \"\") terms.push({ operator, value: value.trim() });\n }\n return terms;\n}\n\n/**\n * The filter's value as the column's own type, so a comparison is the one\n * the order makes: a number for a number, a boolean for a boolean, text for\n * anything else. Undefined when the text is no value of that type.\n */\nfunction asTypeOf(text: string, like: unknown): unknown {\n if (typeof like === \"number\") {\n const n = Number(text);\n return text.trim() === \"\" || Number.isNaN(n) ? undefined : n;\n }\n if (typeof like === \"boolean\") {\n return text === \"true\" ? true : text === \"false\" ? false : undefined;\n }\n return text;\n}\n\n/**\n * Whether a column's value passes one term.\n *\n * `^=`, `$=` and `*=` read the value as text, ignoring case: it begins with,\n * ends with or contains the term's value. The rest compare as the order\n * compares, with the column read as its declared type, if it has one, and\n * the term's value read as the column's type. A missing value, and one that\n * is no value of its declared type, passes only `!=`.\n */\nexport function passesTerm(\n value: unknown,\n { operator, value: text }: FilterTerm,\n type?: ColumnType,\n): boolean {\n if (value === null || value === undefined) return operator === \"!=\";\n if (operator === \"^=\" || operator === \"$=\" || operator === \"*=\") {\n const have = String(value).toLocaleLowerCase();\n const want = text.toLocaleLowerCase();\n if (operator === \"^=\") return have.startsWith(want);\n if (operator === \"$=\") return have.endsWith(want);\n return have.includes(want);\n }\n const read = readAs(value, type);\n const typed = read === undefined ? undefined : asTypeOf(text, read);\n if (typed === undefined) return operator === \"!=\";\n const c = compareValues(read, typed);\n switch (operator) {\n case \"=\":\n return c === 0;\n case \"!=\":\n return c !== 0;\n case \"<\":\n return c < 0;\n case \"<=\":\n return c <= 0;\n case \">\":\n return c > 0;\n default:\n return c >= 0;\n }\n}\n\n/** Whether a column's value passes every term of a filter. */\nexport function passes(\n value: unknown,\n terms: FilterTerm[],\n type?: ColumnType,\n): boolean {\n return terms.every((term) => passesTerm(value, term, type));\n}\n\n/**\n * Where a row for `lb-url` leads, from a page and its query parms.\n *\n * A column whose name begins with `lb-` is Loadbare's, and never a query\n * parm; every other column is one. An `lb-path` naming another page enters\n * it with only the parms the row names. Otherwise the named parms are set,\n * or taken out when empty, and the rest are kept.\n *\n * One rule on both sides of the wire: the server loads the page it names,\n * and the hub writes the URL it names. The two must agree, or what the page\n * shows would differ from what the address bar says.\n */\nexport function nextLocation(\n page: string,\n parms: URLSearchParams,\n row: Row,\n): { page: string; parms: URLSearchParams; moved: boolean } {\n const named: Record<string, ParmValue> = {};\n const text = (value: unknown): string =>\n value === null || value === undefined ? \"\" : String(value);\n for (const [name, value] of Object.entries(row)) {\n if (name.startsWith(LB_RESERVED_PREFIX)) continue;\n named[name] = Array.isArray(value) ? value.map(text) : text(value);\n }\n const path = row[URL_COLUMN_PATH];\n const next = typeof path === \"string\" ? pageNameFor(path) : page;\n const moved = next !== page;\n return {\n page: next,\n parms: withQueryParms(moved ? new URLSearchParams() : parms, named),\n moved,\n };\n}\n\n/**\n * What the hub tells a custom element it did, in its own terms rather than\n * the browser's: a custom element implements any of these in place of\n * `connectedCallback` and its kin, which the builder refuses.\n *\n * Each is a method on an element the hub does not own, so it carries the\n * `lb` prefix Loadbare reserves for exactly that — see\n * docs/reference/custom-elements.md.\n */\nexport interface HubLifecycle {\n /**\n * Called once, after the hub has placed the element and every column has\n * landed on it. An element under an `lb-show` that is off is placed inside\n * its template, so it may not be rendered.\n */\n lbAttached?(): void;\n /**\n * Called once after a result has landed on an element holding rows, with\n * every row in place and every stamp set. The hub reconciles and places\n * every row itself, by the query's order, so a custom element reacts to\n * rows and never places them.\n */\n lbRowsLanded?(): void;\n /**\n * Called once a request committed by this element, or by one inside it,\n * has finished, innermost first and before `lb-request-done` is\n * dispatched. `origin` is the element that committed.\n */\n lbRequestDone?(detail: HubRequestDone, origin: Element): void;\n /** Called once, after the hub has removed the element. */\n lbDetached?(): void;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { type ColumnTypes, type ResponseItem, type Row, type RowsResult } from "../core/lb-types.js";
1
+ import { type ColumnTypes, type ParmValue, type ResponseItem, type Row, type RowsResult } from "../core/lb-types.js";
2
2
  /** A control's value, whether it is native or a custom element. */
3
3
  export interface Control extends Element {
4
4
  value: string;
@@ -25,9 +25,10 @@ export declare function isControl(el: Element): el is Control;
25
25
  /**
26
26
  * Gather a control into `values` under its column. Of the radio buttons
27
27
  * naming one column, the one checked gives the value, and `""` stands when
28
- * none is.
28
+ * none is. Of the checkboxes in a set naming one column, the checked ones
29
+ * give their values, and none checked gives none.
29
30
  */
30
- export declare function gatherInto(values: Record<string, string>, column: string, el: Control): void;
31
+ export declare function gatherInto(values: Record<string, ParmValue>, column: string, el: Control): void;
31
32
  /**
32
33
  * Root if it matches, then every descendant in root's query that does.
33
34
  * Gathering finds columns through here. It does not reach into an absent
@@ -80,13 +81,11 @@ export interface RowsOptions {
80
81
  types?: ColumnTypes;
81
82
  /** The user's choices: the row of `lb-choices`. */
82
83
  choices?: Row;
83
- /** The landing answers a request from this page. */
84
- requested?: boolean;
85
84
  /**
86
- * The request it answers was sent from inside this list, where the user
87
- * is working, so the rows already showing stay where they stand.
85
+ * The landing answers a request from this page, so a side the list
86
+ * places by hand leaves its rows where they stand.
88
87
  */
89
- held?: boolean;
88
+ requested?: boolean;
90
89
  /**
91
90
  * Fill every row, changed or not: the element has not been filled for
92
91
  * real before, so what its rows show cannot be trusted.
@@ -118,10 +117,12 @@ export interface RowsOptions {
118
117
  * the same rows again moves nothing. A row a filter the user chose does not
119
118
  * pass is `hidden`.
120
119
  *
121
- * A landing `held` for the user working in the list moves nothing already
122
- * showing, whole or a patch. A row it changed or created that the order
123
- * would put elsewhere, or that the filter would hide, stays and is stamped
124
- * unsorted until the rows are next placed by the order.
120
+ * A landing that answers a request leaves alone each side `lb-manual` names
121
+ * on the element, whole or a patch. Under `order`, nothing already showing
122
+ * moves, and a new row goes last in its group. Under `filter`, a row the
123
+ * answer changed or created stays showing. A row left where the order or
124
+ * the filter would not leave it is stamped unplaced until the rows are next
125
+ * placed.
125
126
  */
126
127
  export declare function applyRows(el: Element, template: HTMLTemplateElement, keyColumn: string, result: RowsResult, options?: RowsOptions): void;
127
128
  /** The answer kept for a query, as all of its rows. */
@@ -142,12 +143,6 @@ export interface LandOptions {
142
143
  quiet?: readonly string[];
143
144
  /** The items answer a request from this page. */
144
145
  requested?: boolean;
145
- /**
146
- * The element that sent the request, or the live row a form that sent it
147
- * is pointed at. The list it was sent from inside keeps its rows where
148
- * they stand.
149
- */
150
- origin?: Element;
151
146
  }
152
147
  /**
153
148
  * Land response items. Every answer arrives through here, and is kept for
@@ -158,9 +153,10 @@ export interface LandOptions {
158
153
  */
159
154
  export declare function applyResponse(root: ParentNode, items: ResponseItem[], options?: LandOptions): void;
160
155
  /**
161
- * Place an element's rows by the order again, from the answer kept for its
162
- * query, with no round trip: what the user asks for once an edit has left
163
- * rows out of order. False when the element shows no rows the hub holds.
156
+ * Place an element's rows by the order and the filter again, from the answer
157
+ * kept for its query, with no round trip: what the user asks for once an
158
+ * answer has left rows out of place. False when the element shows no rows
159
+ * the hub holds.
164
160
  */
165
- export declare function resort(root: ParentNode, el: Element): boolean;
161
+ export declare function placeAgain(root: ParentNode, el: Element): boolean;
166
162
  //# sourceMappingURL=lb-apply.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lb-apply.d.ts","sourceRoot":"","sources":["../../hub/lb-apply.ts"],"names":[],"mappings":"AAoFA,OAAO,EASL,KAAK,WAAW,EAKhB,KAAK,YAAY,EACjB,KAAK,GAAG,EACR,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AA0B7B,mEAAmE;AACnE,MAAM,WAAW,OAAQ,SAAQ,OAAO;IACtC,KAAK,EAAE,MAAM,CAAC;CACf;AA4BD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAE5C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAGrD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,OAAO,CAIpD;AAUD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,OAAO,GACV,IAAI,CAMN;AA0FD;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,EAAE,CAMjE;AA0CD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CAGtD;AAsMD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,GAAG,EACR,IAAI,UAAQ,EACZ,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAIN;AAqED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,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