@loadbare/widgets 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,6 +12,7 @@ Inventory:
12
12
  | [`lb-options`](docs/lb-options.md) | a `<select>` whose options come from a query |
13
13
  | [`lb-picker`](docs/lb-picker.md) | `lb-options` with the row template built in |
14
14
  | [`lb-table`](docs/lb-table.md) | a `<table>` supplying its own scaffolding |
15
+ | [`lb-unknown-page`](docs/lb-unknown-page.md) | the chrome's dialog for a URL that names no page |
15
16
 
16
17
  ## Installing
17
18
 
@@ -0,0 +1,10 @@
1
+ <dialog lb-unknown-page lb-query="lb-navigation">
2
+ <p>This page is not in the app.</p>
3
+ <dl>
4
+ <dt>Page</dt>
5
+ <dd lb-cell="page-label"></dd>
6
+ <dt>URL</dt>
7
+ <dd lb-cell="page-uri"></dd>
8
+ </dl>
9
+ <form method="dialog"><button>{{button-text | OK}}</button></form>
10
+ </dialog>
@@ -0,0 +1,45 @@
1
+ # `lb-unknown-page`
2
+
3
+ > Status: a barebones starter. Iterative use will drive improvements.
4
+
5
+ The chrome's dialog for a URL that names no page. Write it once, inside
6
+ `<lb-hub>`, and the hub opens it whenever a path resolves to no page host.
7
+
8
+ ```html
9
+ <lb-hub>
10
+ <nav>
11
+ <a href="/" lb-nav-link>Home</a>
12
+ <a href="/about" lb-nav-link>About</a>
13
+ </nav>
14
+ <main></main>
15
+ <lb-unknown-page></lb-unknown-page>
16
+ </lb-hub>
17
+ ```
18
+
19
+ ## Parameters
20
+
21
+ | Parameter | Fills |
22
+ |-------------------|---------------------------------------|
23
+ | `exp-button-text` | the text of the button that closes it |
24
+
25
+ Leaving `exp-button-text` off labels the button `OK`.
26
+
27
+ ## Binding
28
+
29
+ The definition supplies its own binding: a `<dialog lb-unknown-page>` scoped
30
+ to the hub's `lb-navigation` query, which the hub lands on every navigation.
31
+
32
+ | Cell | Holds |
33
+ |--------------|-----------------------------------------------------------|
34
+ | `page-label` | the text of the nav anchor for the path, or empty if none |
35
+ | `page-uri` | the path as the browser has it |
36
+
37
+ The widget shows both. It does not yet choose between "the page *Members*
38
+ is not in this app" and "the URL */members* is not in this app"; that is the
39
+ improvement iterative use is expected to drive.
40
+
41
+ ## Inside the hub
42
+
43
+ The hub finds the dialog inside its own subtree and nowhere else, so the tag
44
+ goes inside `<lb-hub>`. See [`chrome.html`](../../app/docs/reference/chrome.md)
45
+ for the same dialog written by hand.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loadbare/widgets",
3
- "description": "The basic widget set for @loadbare/app: input, select, list, options, picker, table",
4
- "version": "0.2.2",
3
+ "description": "The basic widget set for @loadbare/app: input, select, list, options, picker, table, unknown-page",
4
+ "version": "0.2.3",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",