@loadbare/app 0.7.3 → 0.8.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.
- package/dist/build/assemble.d.ts.map +1 -1
- package/dist/build/assemble.js +67 -6
- package/dist/build/assemble.js.map +1 -1
- package/dist/core/lb-constants.d.ts +2 -2
- package/dist/core/lb-constants.d.ts.map +1 -1
- package/dist/core/lb-constants.js +28 -14
- package/dist/core/lb-constants.js.map +1 -1
- package/dist/core/lb-types.d.ts +4 -10
- package/dist/core/lb-types.d.ts.map +1 -1
- package/dist/core/lb-types.js.map +1 -1
- package/dist/hub/lb-apply.d.ts +2 -2
- package/dist/hub/lb-apply.d.ts.map +1 -1
- package/dist/hub/lb-apply.js +98 -8
- package/dist/hub/lb-apply.js.map +1 -1
- package/dist/hub/lb-hub.browser.d.ts.map +1 -1
- package/dist/hub/lb-hub.browser.js +61 -26
- package/dist/hub/lb-hub.browser.js.map +1 -1
- package/dist/server/lb-express.d.ts.map +1 -1
- package/dist/server/lb-express.js +2 -7
- package/dist/server/lb-express.js.map +1 -1
- package/dist/server/lb-server.d.ts +8 -15
- package/dist/server/lb-server.d.ts.map +1 -1
- package/dist/server/lb-server.js +0 -3
- package/dist/server/lb-server.js.map +1 -1
- package/docs/TECHREF-1.0.md +141 -100
- package/docs/analysis-closed-set.md +210 -0
- package/docs/comparison.md +1124 -0
- package/docs/prior-art.md +216 -0
- package/docs/reference/custom-elements.md +21 -6
- package/docs/reference/data-binding.md +120 -40
- package/docs/reference/page-files.md +13 -9
- package/docs/reference/widgets.md +2 -2
- package/docs/roadmap.md +1 -1
- package/docs/testing.md +7 -1
- package/docs/theory.md +737 -408
- package/docs/tutorials/080-widget-requests.md +9 -28
- package/package.json +1 -1
package/docs/TECHREF-1.0.md
CHANGED
|
@@ -10,8 +10,8 @@ to be true, then revise the code, docs, and tests to ensure it is true.
|
|
|
10
10
|
We cannot declare 1.0 until we determine if these blockers can be
|
|
11
11
|
added later w/o breaking changes. If we are reasonably confident
|
|
12
12
|
that they can be decided later w/o breaking changes, then we rename
|
|
13
|
-
them to "Out of Scope". Otherwise,
|
|
14
|
-
we declare 1.0.
|
|
13
|
+
them to "Out of Scope" or move them to the roadmap. Otherwise,
|
|
14
|
+
they must be resolved before we declare 1.0.
|
|
15
15
|
|
|
16
16
|
### Data types
|
|
17
17
|
|
|
@@ -59,6 +59,15 @@ That decision is firm; what the set contains is not.
|
|
|
59
59
|
|
|
60
60
|
### Lists
|
|
61
61
|
|
|
62
|
+
Imagine we have an HTML `<select>` that displays a fixed list for all
|
|
63
|
+
rows in a table, such as `customer_type` for a table of customers. When
|
|
64
|
+
all customers can be any customer type, our system as written today
|
|
65
|
+
is fine, because all HTML `<select>` elements get the same list.
|
|
66
|
+
|
|
67
|
+
But it may be that the list of allowed values is dependent on other values
|
|
68
|
+
in the row.
|
|
69
|
+
|
|
70
|
+
|
|
62
71
|
- **Decide how a new row fills a nested list.** A row added to the outer
|
|
63
72
|
list starts with an empty nested list, which fills only when the nested
|
|
64
73
|
list's name lands again. See [Master-detail](#master-detail) for what a
|
|
@@ -210,7 +219,7 @@ the whole of `--src` is one flat namespace, as stated in
|
|
|
210
219
|
Three kinds of file hold HTML.
|
|
211
220
|
|
|
212
221
|
| File | Holds | Found in |
|
|
213
|
-
|
|
222
|
+
| ------------------ | ------------------------------------ | ------------ |
|
|
214
223
|
| `chrome.html` | The one HTML document | `--src` |
|
|
215
224
|
| `<stub>.page.html` | One page's markup, as a fragment | `--src` |
|
|
216
225
|
| `<tag-name>.html` | One widget definition, as a fragment | Every origin |
|
|
@@ -277,13 +286,13 @@ A definition states a default with `{{name|default}}`, as in
|
|
|
277
286
|
`{{button-label|OK}}`. Whitespace around the name and around the default is
|
|
278
287
|
discarded. The default is a literal.
|
|
279
288
|
|
|
280
|
-
| The attribute is assigned | Expansion defines
|
|
281
|
-
|
|
282
|
-
| `exp-name="text"` | `{{name}}`
|
|
283
|
-
| `exp-name=""` | `{{name}}`
|
|
284
|
-
| Nothing | `{{name
|
|
285
|
-
| Nothing | `{{name}}`
|
|
286
|
-
| `exp-name` | No `{{name}}`
|
|
289
|
+
| The attribute is assigned | Expansion defines | Result |
|
|
290
|
+
| ------------------------- | ------------------- | -------------------------------- |
|
|
291
|
+
| `exp-name="text"` | `{{name}}` | `text` |
|
|
292
|
+
| `exp-name=""` | `{{name}}` | An empty string |
|
|
293
|
+
| Nothing | `{{name\|default}}` | `default` |
|
|
294
|
+
| Nothing | `{{name}}` | Nothing, and the attribute drops |
|
|
295
|
+
| `exp-name` | No `{{name}}` | A build error |
|
|
287
296
|
|
|
288
297
|
Attributes without the `exp-` prefix are ignored during expansion.
|
|
289
298
|
|
|
@@ -370,20 +379,19 @@ These are build errors:
|
|
|
370
379
|
|
|
371
380
|
### Binding
|
|
372
381
|
|
|
373
|
-
---- UNEDITED ----
|
|
374
|
-
|
|
375
382
|
Binding attributes determine how the hub updates the DOM, either by
|
|
376
383
|
directly updating a plain HTML element or instructing
|
|
377
384
|
custom widgets to update themselves.
|
|
378
385
|
|
|
379
386
|
|
|
380
|
-
| Attribute | Assigned By | Behavior
|
|
381
|
-
|
|
382
|
-
| lb-list | Developer | Scopes DOM children to a named set of rows; a nested lb-list or lb-row begins a new scope
|
|
383
|
-
| lb-row | Developer | Scopes DOM children to one named row; a nested lb-list or lb-row begins a new scope
|
|
384
|
-
| lb-cell | Developer | This DOM node displays this column of the row in scope
|
|
385
|
-
| lb-
|
|
386
|
-
| lb-key
|
|
387
|
+
| Attribute | Assigned By | Behavior |
|
|
388
|
+
| ------------ | ----------- | ----------------------------------------------------------------------------------------------- |
|
|
389
|
+
| lb-list | Developer | Scopes DOM children to a named set of rows; a nested lb-list or lb-row begins a new scope |
|
|
390
|
+
| lb-row | Developer | Scopes DOM children to one named row; a nested lb-list or lb-row begins a new scope |
|
|
391
|
+
| lb-cell | Developer | This DOM node displays this column of the row in scope |
|
|
392
|
+
| lb-show | Developer | This DOM node is present when this column of the row in scope is neither null nor false |
|
|
393
|
+
| lb-key | Developer | Names the column that identifies a row, on the row template inside an lb-list |
|
|
394
|
+
| lb-key-value | Hub | Stamped on a live row: that row's value of `lb-key` |
|
|
387
395
|
| lb-value | Hub | The value that landed on a cell; a widget updates itself from it and a stylesheet selects on it |
|
|
388
396
|
|
|
389
397
|
#### How a value lands
|
|
@@ -391,11 +399,11 @@ custom widgets to update themselves.
|
|
|
391
399
|
A cell lands one of three ways, and the element decides which. Every cell
|
|
392
400
|
that receives a value also carries it as `lb-value`.
|
|
393
401
|
|
|
394
|
-
| Element
|
|
395
|
-
|
|
396
|
-
| A custom element, tag hyphenated
|
|
397
|
-
| `<select>`, `<textarea>`, or `<input>`
|
|
398
|
-
| Any other native element
|
|
402
|
+
| Element | Receives the value as |
|
|
403
|
+
| -------------------------------------- | --------------------------------- |
|
|
404
|
+
| A custom element, tag hyphenated | Its `lb-value` attribute |
|
|
405
|
+
| `<select>`, `<textarea>`, or `<input>` | Its `value`, and `lb-value` |
|
|
406
|
+
| Any other native element | Its `textContent`, and `lb-value` |
|
|
399
407
|
|
|
400
408
|
A widget owns whatever control it wraps, so it is handed the value and
|
|
401
409
|
renders it itself. A form control shows its state as its `value`, so a
|
|
@@ -433,30 +441,44 @@ A widget sees `attributeChangedCallback` for an `lb-value` already present
|
|
|
433
441
|
when it upgrades, so a widget cannot tell a first landing from a refresh,
|
|
434
442
|
and does not need to.
|
|
435
443
|
|
|
436
|
-
#### Displaying by
|
|
444
|
+
#### Displaying by condition
|
|
437
445
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
446
|
+
`lb-show` names the column that decides whether an element is present.
|
|
447
|
+
`null` and `false` are off, and every other value is on. No string is read,
|
|
448
|
+
so `"false"` is on, and a query spells a condition as a boolean or a null.
|
|
441
449
|
|
|
442
450
|
```html
|
|
443
451
|
<template lb-key="id">
|
|
444
452
|
<tr>
|
|
445
453
|
<td lb-cell="name"></td>
|
|
446
|
-
<td lb-
|
|
447
|
-
<td><button lb-action="lb-row-delete">Remove</button></td>
|
|
454
|
+
<td><button lb-action="lb-row-delete" lb-show="removable">Remove</button></td>
|
|
448
455
|
</tr>
|
|
449
456
|
</template>
|
|
450
457
|
```
|
|
451
458
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
459
|
+
It binds as `lb-cell` does, to the row on the nearest scoped ancestor, and on
|
|
460
|
+
an element that is itself a scope the column belongs to the row around it. A row
|
|
461
|
+
that does not carry the column leaves the element as it is.
|
|
455
462
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
463
|
+
An element that is off is moved into a `<template lb-show="column">` standing
|
|
464
|
+
where it stood, and moved back out when the column turns on. It is not
|
|
465
|
+
rendered, focused, clicked, announced or gathered. It is moved and never
|
|
466
|
+
rebuilt, so a widget keeps its instance. Landing reaches into that template,
|
|
467
|
+
and nothing else does, so the element and every cell and scope inside it
|
|
468
|
+
return current. A custom element sees `disconnectedCallback` then
|
|
469
|
+
`adoptedCallback` going in, and `adoptedCallback` then `connectedCallback`
|
|
470
|
+
coming out, and still receives `lb-value` while it is away.
|
|
471
|
+
|
|
472
|
+
The builder ships every `lb-show` element already inside its template, so
|
|
473
|
+
nothing conditional shows until its row lands. An absent element's template
|
|
474
|
+
keeps its place among its siblings, and a position selector counts it.
|
|
475
|
+
|
|
476
|
+
These are build errors: `lb-show` on a row template's root, with no row
|
|
477
|
+
around it (outside every scope, on a scope with none around it, or in a list
|
|
478
|
+
scope outside its row template), or on a `<template>`.
|
|
479
|
+
|
|
480
|
+
Hiding is presentation, and the server still refuses what a request may not
|
|
481
|
+
do.
|
|
460
482
|
|
|
461
483
|
#### Master-detail
|
|
462
484
|
|
|
@@ -504,11 +526,10 @@ name, the same test that decides how a value lands — see
|
|
|
504
526
|
[How a value lands](#how-a-value-lands).
|
|
505
527
|
|
|
506
528
|
| lb-action | Written on |
|
|
507
|
-
|
|
529
|
+
| -------------- | ------------------------------------------------- |
|
|
508
530
|
| lb-row-insert | a `<form>`, or a button in a `<tr>`, in a list |
|
|
509
531
|
| lb-row-delete | anything inside a live row |
|
|
510
|
-
| lb-row-update | a `<form>`,
|
|
511
|
-
| lb-cell-change | a widget wrapping one control |
|
|
532
|
+
| lb-row-update | a `<form>`, a button in a live row, or a widget cell |
|
|
512
533
|
| anything else | must be a named routine in the page's server code |
|
|
513
534
|
|
|
514
535
|
The wire format is not visible to the user, but uses the same lb-*
|
|
@@ -520,13 +541,12 @@ dispatched it. It reads the scope from the dispatching element before any
|
|
|
520
541
|
ancestor sees the event, and never overwrites a field the request already
|
|
521
542
|
carries.
|
|
522
543
|
|
|
523
|
-
| `action` | Filled from scope | Required
|
|
524
|
-
|
|
525
|
-
| a declared name | `list` or `row`, `key`, `cell` | nothing
|
|
526
|
-
| `lb-
|
|
527
|
-
| `lb-row-
|
|
528
|
-
| `lb-row-
|
|
529
|
-
| `lb-row-update` | `list`, `key` | both, and `values` |
|
|
544
|
+
| `action` | Filled from scope | Required |
|
|
545
|
+
| ---------------- | ------------------------------ | ---------------------- |
|
|
546
|
+
| a declared name | `list` or `row`, `key`, `cell` | nothing |
|
|
547
|
+
| `lb-row-insert` | `list` | `list`, and `values` |
|
|
548
|
+
| `lb-row-delete` | `list`, `key` | both |
|
|
549
|
+
| `lb-row-update` | `list`, `key` | both, and `values` |
|
|
530
550
|
|
|
531
551
|
An element's own `lb-list` or `lb-row` names what it displays, never where
|
|
532
552
|
its request goes. A request belongs to the scope around the element, the
|
|
@@ -534,7 +554,13 @@ way a control belongs to the form around it. `list` or `row` comes from the
|
|
|
534
554
|
nearest ancestor scope, `key` from the nearest live row inside that scope,
|
|
535
555
|
and `cell` from the dispatching element's own `lb-cell`.
|
|
536
556
|
A request missing a required field is not sent. The hub never fills
|
|
537
|
-
`value`. An `lb-row-insert` or `lb-row-update`
|
|
557
|
+
`value`. An `lb-row-insert` or `lb-row-update` from an element carrying
|
|
558
|
+
`lb-cell` is a record of one cell, the way a control has a value and a form
|
|
559
|
+
has values: `values` holds that cell alone, taken from the `value` the widget
|
|
560
|
+
sent or else read from the control it is or wraps, and `value` is not sent
|
|
561
|
+
beside it. A widget that sends a `value` from an element carrying no
|
|
562
|
+
`lb-cell` is refused, since nothing names the column. Any other
|
|
563
|
+
`lb-row-insert` or `lb-row-update` gathers the row it belongs
|
|
538
564
|
to: `values` holds every `lb-cell` with a control to read in the nearest
|
|
539
565
|
`<form>`, `<tr>` or live row around the dispatching element, itself
|
|
540
566
|
included, inside its scope. The cells are found the way a row lands, so a
|
|
@@ -547,10 +573,11 @@ own form; a live row counts because it is the row the key names. The scope
|
|
|
547
573
|
itself is never the row, since its cells belong to other rows. A request
|
|
548
574
|
from an element in no form or row is not sent, and the hub reports that its
|
|
549
575
|
cells belong in a `<form>`. A request that already carries `values` keeps
|
|
550
|
-
them, and one whose row has no cell to read is not sent. A click
|
|
551
|
-
native element that carries either operation and
|
|
552
|
-
holds cells
|
|
553
|
-
would send the row: put the action on a form or on a
|
|
576
|
+
them, and one whose row has no cell to read is not sent. A click on a
|
|
577
|
+
native element that carries either operation and is a cell or
|
|
578
|
+
holds cells is not sent, since clicking into one of its controls
|
|
579
|
+
would send the row: put the action on a form, on a button, or on a widget
|
|
580
|
+
that decides when its cell has changed.
|
|
554
581
|
|
|
555
582
|
A widget dispatches the action and, where it wraps a control, that control's
|
|
556
583
|
value.
|
|
@@ -559,7 +586,7 @@ value.
|
|
|
559
586
|
{ action: "lb-row-insert", list: "rosterList", values: {...} }
|
|
560
587
|
{ action: "lb-row-delete", list: "rosterList", key: "42" }
|
|
561
588
|
{ action: "lb-row-update", list: "rosterList", key: "42", values: {...} }
|
|
562
|
-
{ action: "lb-
|
|
589
|
+
{ action: "lb-row-update", list: "rosterList", key: "42", values: { name: "Ann" } }
|
|
563
590
|
{ action: "selectTab", row: "prefs", cell: "active_tab", value: "two" }
|
|
564
591
|
```
|
|
565
592
|
|
|
@@ -624,7 +651,7 @@ other link, so leaving the application is the default and staying in it is
|
|
|
624
651
|
the opt-in.
|
|
625
652
|
|
|
626
653
|
| Attribute | Assigned By | Behavior |
|
|
627
|
-
|
|
654
|
+
| ----------- | ----------- | --------------------------------------------------------------------------------------- |
|
|
628
655
|
| lb-nav-link | Developer | On an `<a>`: the hub shows the page the anchor's path names, without loading a document |
|
|
629
656
|
|
|
630
657
|
The attribute takes no value. The hub looks for the nearest ancestor
|
|
@@ -677,7 +704,7 @@ Current page, published by the hub as a row. Can be bound anywhere just
|
|
|
677
704
|
like a server-produced result.
|
|
678
705
|
|
|
679
706
|
| Cell | Holds |
|
|
680
|
-
|
|
707
|
+
| ------------ | ------------------------------------------------------------------- |
|
|
681
708
|
| `page-label` | The text of the link to the current page, empty if no link names it |
|
|
682
709
|
| `page-uri` | The path as the browser has it, such as `/members` |
|
|
683
710
|
|
|
@@ -799,7 +826,7 @@ client script, the stylesheet, the hub's data channel, and the one HTML
|
|
|
799
826
|
document.
|
|
800
827
|
|
|
801
828
|
| Handle | With |
|
|
802
|
-
|
|
829
|
+
| ---------------------------- | ------------------- |
|
|
803
830
|
| `/client.js` | `dist/client.js` |
|
|
804
831
|
| `/app.css` | `dist/app.css` |
|
|
805
832
|
| `hubRoutes(hub, contextFor)` | The hub's own route |
|
|
@@ -888,9 +915,9 @@ as explained in the next section.
|
|
|
888
915
|
It has three optional keys.
|
|
889
916
|
|
|
890
917
|
| Key | Keyed by | Answers |
|
|
891
|
-
|
|
918
|
+
| ------------- | --------------------- | -------------------------------------------------- |
|
|
892
919
|
| `actions` | The `lb-action` value | Anything the page chooses to declare |
|
|
893
|
-
| `crud` | A query name | The
|
|
920
|
+
| `crud` | A query name | The three reserved `lb-action` values |
|
|
894
921
|
| `onPageEnter` | Nothing | Runs once on entering the page, before its queries |
|
|
895
922
|
|
|
896
923
|
|
|
@@ -941,16 +968,19 @@ export const requests: Requests = {
|
|
|
941
968
|
|
|
942
969
|
Each key under a `crud` entry is a reserved `lb-action` value with its prefix
|
|
943
970
|
stripped and the rest camel-cased, so the attribute, the wire and this key
|
|
944
|
-
are one vocabulary. All
|
|
971
|
+
are one vocabulary. All three operate on a list, because each needs a key and
|
|
945
972
|
a key exists only on a live row.
|
|
946
973
|
|
|
947
974
|
| `lb-action` | Key under `crud` | `where` carries |
|
|
948
|
-
|
|
949
|
-
| `lb-cell-change` | `cellChange` | `key`, `cell`, `value` |
|
|
975
|
+
| ---------------- | ---------------- | ---------------------- |
|
|
950
976
|
| `lb-row-delete` | `rowDelete` | `key` |
|
|
951
977
|
| `lb-row-insert` | `rowInsert` | `values` |
|
|
952
978
|
| `lb-row-update` | `rowUpdate` | `key`, `values` |
|
|
953
979
|
|
|
980
|
+
A `rowUpdate` sets the columns `values` names and leaves the rest as they
|
|
981
|
+
are, as an SQL `UPDATE` does. A form sends the cells it holds and a widget
|
|
982
|
+
cell sends itself, so one handler answers both.
|
|
983
|
+
|
|
954
984
|
## Widgets
|
|
955
985
|
|
|
956
986
|
---- UNEDITED ----
|
|
@@ -988,21 +1018,31 @@ The hub stamps these on the element that dispatched a request, which is the
|
|
|
988
1018
|
widget itself when a widget fired it. A widget observes them and reacts; it
|
|
989
1019
|
must name them in `observedAttributes` to see them change.
|
|
990
1020
|
|
|
991
|
-
| Attribute | Written on | Holds
|
|
992
|
-
|
|
993
|
-
| `lb-pending` | The dispatching element | The round trip is in flight
|
|
1021
|
+
| Attribute | Written on | Holds |
|
|
1022
|
+
| -------------- | ----------------------- | --------------------------------------------------------------------------------------- |
|
|
1023
|
+
| `lb-pending` | The dispatching element | The round trip is in flight |
|
|
994
1024
|
| `lb-error` | The dispatching element | The last round trip failed, cleared on the next — see [The round trip](#the-round-trip) |
|
|
995
|
-
| `lb-row-count` | A list scope | How many rows the scope is showing
|
|
1025
|
+
| `lb-row-count` | A list scope | How many rows the scope is showing |
|
|
1026
|
+
|
|
1027
|
+
They are also stamped on plain HTML, where a stylesheet is the only
|
|
1028
|
+
consumer: dim a pending button, mark a failed one, and style an empty list
|
|
1029
|
+
against `lb-row-count` rather than carrying an empty-state element.
|
|
1030
|
+
|
|
1031
|
+
The hub reads one of them. A native `lb-action` element, a button or a
|
|
1032
|
+
form, that is performed again while it carries `lb-pending` is ignored: the
|
|
1033
|
+
click or submit is cancelled and nothing is sent. A pending native action is
|
|
1034
|
+
therefore disabled in fact, and a stylesheet only has to show it. A widget is
|
|
1035
|
+
not held back this way, because a widget that sends on change must have its
|
|
1036
|
+
latest value sent rather than dropped.
|
|
996
1037
|
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
carrying an empty-state element.
|
|
1038
|
+
Alongside `lb-pending` the hub sets `aria-busy="true"` on the same element and
|
|
1039
|
+
removes it when the round trip settles, so assistive technology hears the
|
|
1040
|
+
state a stylesheet shows.
|
|
1001
1041
|
|
|
1002
1042
|
#### Row hooks
|
|
1003
1043
|
|
|
1004
1044
|
| Name | Implemented By | Behavior |
|
|
1005
|
-
|
|
1045
|
+
| ------------------------------- | -------------- | ----------------------------------------------------------- |
|
|
1006
1046
|
| `applyRow(root, row)` | Loadbare | Fills one scope from one row |
|
|
1007
1047
|
| `lbPlaceRow(el, row, template)` | Developer | Optional on a list scope: where a row goes |
|
|
1008
1048
|
| `lbRowsLanded()` | Developer | Optional on a list scope: scaffolding derived from the rows |
|
|
@@ -1027,7 +1067,7 @@ that defines it. The definition lives there and only there.
|
|
|
1027
1067
|
Loadbare/app owns every flag in this table.
|
|
1028
1068
|
|
|
1029
1069
|
| Flag | Default | Names | Defined in |
|
|
1030
|
-
|
|
1070
|
+
| ---------- | ------- | ----------------------------------------- | ------------------------------------------------- |
|
|
1031
1071
|
| `--src` | `src` | The application's own tree, scanned whole | [What the builder scans](#what-the-builder-scans) |
|
|
1032
1072
|
| `--out` | `dist` | Where the builder writes | [Running the builder](#running-the-builder) |
|
|
1033
1073
|
| `--watch` | off | Rebuild on change under `--src` | [Running the builder](#running-the-builder) |
|
|
@@ -1040,7 +1080,7 @@ named carries its meaning wherever it sits in the `--src` tree, so an
|
|
|
1040
1080
|
application must not use one of these names for anything else.
|
|
1041
1081
|
|
|
1042
1082
|
| File | How many | Holds | Defined in |
|
|
1043
|
-
|
|
1083
|
+
| ----------------------- | ---------------------- | -------------------------------------------------------- | ------------------------------------------------------- |
|
|
1044
1084
|
| `chrome.html` | Exactly one | The application's one HTML document | [Chrome](#chrome) |
|
|
1045
1085
|
| `imports.ts` | Zero or one | Default-exports an array of widget library package names | [Imported widget libraries](#imported-widget-libraries) |
|
|
1046
1086
|
| `<stub>.page.html` | One per page | One page's markup, as a fragment | [Pages](#pages) |
|
|
@@ -1058,7 +1098,7 @@ only when some origin has a stylesheet, `pages.ts` only when some page has a
|
|
|
1058
1098
|
`.queries.ts` or a `.requests.ts`.
|
|
1059
1099
|
|
|
1060
1100
|
| Path | Written | Holds | Read by | Defined in |
|
|
1061
|
-
|
|
1101
|
+
| ------------------ | ----------------- | ------------------------------------------------------------------ | ---------- | ------------------------------------------- |
|
|
1062
1102
|
| `/app.html` | Always | The chrome, built | The server | [Chrome](#chrome) |
|
|
1063
1103
|
| `/client.js` | Always | `<lb-hub>` and every widget the application uses | The chrome | [Chrome](#chrome) |
|
|
1064
1104
|
| `/client-entry.ts` | Always | The generated entry `client.js` is bundled from | Nothing | [Running the builder](#running-the-builder) |
|
|
@@ -1071,7 +1111,7 @@ Loadbare/app owns every key in this table. A widget library declares them.
|
|
|
1071
1111
|
An application never does.
|
|
1072
1112
|
|
|
1073
1113
|
| Key | Value | Means | Defined in |
|
|
1074
|
-
|
|
1114
|
+
| ------------------ | ------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------- |
|
|
1075
1115
|
| `loadbare.widgets` | A path inside the package | Where this package's widgets are. Absent means the whole installed directory | [Imported widget libraries](#imported-widget-libraries) |
|
|
1076
1116
|
|
|
1077
1117
|
### Reserved namespaces
|
|
@@ -1079,11 +1119,11 @@ An application never does.
|
|
|
1079
1119
|
Loadbare/app owns every namespace in this table. Ownership of a name and
|
|
1080
1120
|
ownership of its behavior are stated separately, because they differ.
|
|
1081
1121
|
|
|
1082
|
-
| Namespace | Applies to | Loadbare owns | Defined in
|
|
1083
|
-
|
|
1084
|
-
| `lb-*` | HTML attributes | The names and their behavior | [The lb-* namespace](#the-lb--namespace)
|
|
1085
|
-
| `exp-*` | HTML attributes | The behavior; widget authors pick the values | [Build time parameters](#build-time-parameters)
|
|
1086
|
-
| `lb*` | Methods on custom elements | The names and their behavior | [Row hooks](#row-hooks)
|
|
1122
|
+
| Namespace | Applies to | Loadbare owns | Defined in |
|
|
1123
|
+
| --------- | -------------------------- | -------------------------------------------- | ----------------------------------------------- |
|
|
1124
|
+
| `lb-*` | HTML attributes | The names and their behavior | [The lb-* namespace](#the-lb--namespace) |
|
|
1125
|
+
| `exp-*` | HTML attributes | The behavior; widget authors pick the values | [Build time parameters](#build-time-parameters) |
|
|
1126
|
+
| `lb*` | Methods on custom elements | The names and their behavior | [Row hooks](#row-hooks) |
|
|
1087
1127
|
|
|
1088
1128
|
#### The lb-* namespace
|
|
1089
1129
|
|
|
@@ -1092,28 +1132,29 @@ application writes the ones this table names and invents none of its own,
|
|
|
1092
1132
|
because a name Loadbare has not defined today it may define tomorrow.
|
|
1093
1133
|
|
|
1094
1134
|
The prefix reaches past HTML. A query name cannot begin with `lb-` either,
|
|
1095
|
-
which is what keeps the
|
|
1135
|
+
which is what keeps the three operations apart from an application's own
|
|
1096
1136
|
actions on the wire — see [Page Queries](#page-queries).
|
|
1097
1137
|
|
|
1098
1138
|
Each attribute is defined in one section, and this table says which.
|
|
1099
1139
|
|
|
1100
|
-
| Attribute
|
|
1101
|
-
|
|
1102
|
-
| `lb-list`
|
|
1103
|
-
| `lb-row`
|
|
1104
|
-
| `lb-cell`
|
|
1105
|
-
| `lb-
|
|
1106
|
-
| `lb-key
|
|
1107
|
-
| `lb-value`
|
|
1108
|
-
| `lb-
|
|
1109
|
-
| `lb-
|
|
1110
|
-
| `lb-
|
|
1111
|
-
| `lb-
|
|
1112
|
-
| `lb-
|
|
1113
|
-
| `lb-
|
|
1114
|
-
| `lb-
|
|
1115
|
-
| `lb-
|
|
1116
|
-
| `lb-
|
|
1140
|
+
| Attribute | Written by | Defined in |
|
|
1141
|
+
| ----------------- | ------------- | --------------------------------------------------- |
|
|
1142
|
+
| `lb-list` | Developer | [Binding](#binding) |
|
|
1143
|
+
| `lb-row` | Developer | [Binding](#binding) |
|
|
1144
|
+
| `lb-cell` | Developer | [Binding](#binding) |
|
|
1145
|
+
| `lb-show` | Developer | [Displaying by condition](#displaying-by-condition) |
|
|
1146
|
+
| `lb-key` | Developer | [Binding](#binding) |
|
|
1147
|
+
| `lb-key-value` | Hub | [Binding](#binding) |
|
|
1148
|
+
| `lb-value` | Hub | [How a value lands](#how-a-value-lands) |
|
|
1149
|
+
| `lb-action` | Developer | [Requests](#requests) |
|
|
1150
|
+
| `lb-nav-link` | Developer | [Links](#links) |
|
|
1151
|
+
| `lb-pending` | Hub | [Request state](#request-state) |
|
|
1152
|
+
| `lb-error` | Hub | [Request state](#request-state) |
|
|
1153
|
+
| `lb-row-count` | Hub | [Request state](#request-state) |
|
|
1154
|
+
| `lb-unknown-page` | Developer | [Chrome](#chrome) |
|
|
1155
|
+
| `lb-slot` | Widget author | [Slots and templates](#slots-and-templates) |
|
|
1156
|
+
| `lb-template` | Widget author | [Slots and templates](#slots-and-templates) |
|
|
1157
|
+
| `lb-page` | Builder | [Pages](#pages) |
|
|
1117
1158
|
|
|
1118
1159
|
An attribute the builder does not recognize is left alone today. Refusing
|
|
1119
1160
|
one is on the list of validations still to land — see
|
|
@@ -1125,7 +1166,7 @@ Loadbare/app owns every tag in this table. An application writes them and
|
|
|
1125
1166
|
never defines them.
|
|
1126
1167
|
|
|
1127
1168
|
| Tag | Written in | Means | Defined in |
|
|
1128
|
-
|
|
1169
|
+
| ---------- | ---------- | ------------------------------ | ----------------- |
|
|
1129
1170
|
| `<lb-hub>` | The chrome | The application's live element | [Chrome](#chrome) |
|
|
1130
1171
|
|
|
1131
1172
|
### Reserved events
|
|
@@ -1134,7 +1175,7 @@ Loadbare/app owns every DOM event in this table, both the name and what its
|
|
|
1134
1175
|
`detail` carries.
|
|
1135
1176
|
|
|
1136
1177
|
| Event | Dispatched from | Bubbles | Cancelable | Defined in |
|
|
1137
|
-
|
|
1178
|
+
| ------------ | ---------------------- | ------- | ---------- | --------------------------------------- |
|
|
1138
1179
|
| `lb-request` | The element that acted | Yes | No | [The request event](#the-request-event) |
|
|
1139
1180
|
|
|
1140
1181
|
### Reserved attributes
|
|
@@ -1143,6 +1184,6 @@ Loadbare/app owns every attribute in this table, both the name and its
|
|
|
1143
1184
|
behavior.
|
|
1144
1185
|
|
|
1145
1186
|
| Attribute | Written on | Takes a value | Defined in |
|
|
1146
|
-
|
|
1187
|
+
| ----------------- | ----------------------------------- | ------------- | ----------------- |
|
|
1147
1188
|
| `lb-unknown-page` | A `<dialog>` in chrome | No | [Chrome](#chrome) |
|
|
1148
1189
|
| `lb-page` | A `<template>`, by the builder only | Yes | [Pages](#pages) |
|