@iyulab/lowline-form 0.0.0-stage → 0.1.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/README.md CHANGED
@@ -1,3 +1,40 @@
1
- # Temporary Holding Version
1
+ # `<lowline-form>`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A formdown form whose decided fields are suggested from the records people confirmed, talking to a Lowline host's
4
+ routes (`MapLowline` in .NET).
5
+
6
+ ```html
7
+ <lowline-form src="/lowline" form="intake" record="r-17"></lowline-form>
8
+ <script type="module">
9
+ const form = document.querySelector('lowline-form')
10
+ form.content = '@customer: [text]\n@owner: [select options="kim,lee"]'
11
+ // later: await form.save() · await form.fill('customer Beta, owner lee')
12
+ </script>
13
+ ```
14
+
15
+ | Property | |
16
+ |---|---|
17
+ | `src` | Where the host's routes are (`/lowline`). |
18
+ | `form` | The form, by the name the host defined it under. |
19
+ | `record` | The record being written; a record opened again keeps its id, so it is not evidence for itself. |
20
+ | `content` | The form's formdown text. |
21
+ | `data` | The record's values when it was opened. |
22
+ | `rate` | How often a field's answer is held back to check it, from 0 to 1 (one in twenty by default). |
23
+ | `strings` | The words the form shows, in the host's language. |
24
+
25
+ `save()` sends the values with the account of what was shown, taken and turned down, and fires `lowline-saved`;
26
+ `fill(text)` offers the host model's values in their fields. A field the records cannot answer yet is judged by the
27
+ host's model when it has one (`judge`): asked once for the values it reads, shown in the field while the person writes
28
+ on, never put in on its own. When the routes do not answer, `lowline-unavailable` fires and the form is filled in by
29
+ hand. Nothing is counted in the browser: the host's engine counts what it is sent.
30
+
31
+ `Draft`, `Session` and `LowlineClient` are exported for a host that draws its own form.
32
+
33
+ The package is `@iyulab/lowline-form`, with Lit and formdown as dependencies. A page with no build step takes the one
34
+ file in it that carries both: `dist/bundle/lowline-form.bundle.js`.
35
+
36
+ ```sh
37
+ npm ci
38
+ npm test
39
+ npm run bundle # one file with Lit and formdown inside, in dist/bundle
40
+ ```