@loadbare/app 0.12.0 → 0.14.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 (56) hide show
  1. package/dist/build/assemble.d.ts.map +1 -1
  2. package/dist/build/assemble.js +87 -1
  3. package/dist/build/assemble.js.map +1 -1
  4. package/dist/build/cli.js +2 -1
  5. package/dist/build/cli.js.map +1 -1
  6. package/dist/build/elements.d.ts +9 -1
  7. package/dist/build/elements.d.ts.map +1 -1
  8. package/dist/build/elements.js +50 -0
  9. package/dist/build/elements.js.map +1 -1
  10. package/dist/build/origins.d.ts +2 -0
  11. package/dist/build/origins.d.ts.map +1 -1
  12. package/dist/build/origins.js +1 -1
  13. package/dist/build/origins.js.map +1 -1
  14. package/dist/core/lb-constants.d.ts +34 -1
  15. package/dist/core/lb-constants.d.ts.map +1 -1
  16. package/dist/core/lb-constants.js +105 -0
  17. package/dist/core/lb-constants.js.map +1 -1
  18. package/dist/core/lb-types.d.ts +74 -18
  19. package/dist/core/lb-types.d.ts.map +1 -1
  20. package/dist/core/lb-types.js +74 -11
  21. package/dist/core/lb-types.js.map +1 -1
  22. package/dist/hub/lb-apply.d.ts +57 -18
  23. package/dist/hub/lb-apply.d.ts.map +1 -1
  24. package/dist/hub/lb-apply.js +661 -63
  25. package/dist/hub/lb-apply.js.map +1 -1
  26. package/dist/hub/lb-hub.browser.d.ts.map +1 -1
  27. package/dist/hub/lb-hub.browser.js +400 -33
  28. package/dist/hub/lb-hub.browser.js.map +1 -1
  29. package/dist/server/lb-express.d.ts +19 -7
  30. package/dist/server/lb-express.d.ts.map +1 -1
  31. package/dist/server/lb-express.js +62 -26
  32. package/dist/server/lb-express.js.map +1 -1
  33. package/dist/server/lb-server.d.ts +80 -11
  34. package/dist/server/lb-server.d.ts.map +1 -1
  35. package/dist/server/lb-server.js +185 -33
  36. package/dist/server/lb-server.js.map +1 -1
  37. package/docs/TECHREF-1.0.md +584 -111
  38. package/docs/comparison.md +17 -13
  39. package/docs/possible-ideas.md +308 -0
  40. package/docs/reference/chrome.md +7 -1
  41. package/docs/reference/custom-elements.md +134 -39
  42. package/docs/reference/data-binding.md +405 -17
  43. package/docs/reference/page-files.md +101 -19
  44. package/docs/reference/server.md +24 -0
  45. package/docs/reference/widgets.md +118 -25
  46. package/docs/roadmap.md +17 -6
  47. package/docs/testing.md +21 -10
  48. package/package.json +2 -3
  49. package/skills/loadbare-app/SKILL.md +92 -30
  50. package/skills/loadbare-app/references/TECHREF-1.0.md +584 -111
  51. package/skills/loadbare-app/references/chrome.md +7 -1
  52. package/skills/loadbare-app/references/custom-elements.md +134 -39
  53. package/skills/loadbare-app/references/data-binding.md +405 -17
  54. package/skills/loadbare-app/references/page-files.md +101 -19
  55. package/skills/loadbare-app/references/server.md +24 -0
  56. package/skills/loadbare-app/references/widgets.md +118 -25
@@ -9,11 +9,17 @@ export interface Control extends Element {
9
9
  */
10
10
  export declare function isFormAssociated(el: Element): boolean;
11
11
  /**
12
- * A control: an `<input>`, `<select>` or `<textarea>`, or a form-associated
13
- * custom element with a `value` property. Landing and gathering draw the
14
- * same line, so a value read back is the one that landed there.
12
+ * A control: an `<input>`, `<select>` or `<textarea>`, a checkbox, or a
13
+ * form-associated custom element with a `value` property. Landing and
14
+ * gathering draw the same line, so a value read back is the one that landed
15
+ * there.
15
16
  */
16
17
  export declare function isControl(el: Element): el is Control;
18
+ /**
19
+ * What a control gathers: a checkbox `"true"` or `"false"`, so unchecked
20
+ * still says so, and any other control its `value`.
21
+ */
22
+ export declare function controlValue(el: Control): string;
17
23
  /**
18
24
  * Root if it matches, then every descendant in root's query that does.
19
25
  * Gathering finds columns through here. It does not reach into an absent
@@ -21,6 +27,11 @@ export declare function isControl(el: Element): el is Control;
21
27
  * showing.
22
28
  */
23
29
  export declare function within(root: Element, selector: string): Element[];
30
+ /**
31
+ * Tick or clear an `lb-select` checkbox, and stamp the live row it selects
32
+ * to match.
33
+ */
34
+ export declare function select(box: Element, on: boolean): void;
24
35
  /**
25
36
  * Fill from one row: every `lb-column` and `lb-show` in root's query.
26
37
  *
@@ -30,7 +41,13 @@ export declare function within(root: Element, selector: string): Element[];
30
41
  * ancestor, so its own `lb-column` reads from the row around it and is left
31
42
  * alone here.
32
43
  */
33
- export declare function applyRow(root: Element, row: Row, liveRow?: boolean): void;
44
+ export declare function applyRow(root: Element, row: Row, liveRow?: boolean, stop?: string): void;
45
+ /**
46
+ * A row naming every column root's query shows, each null: what landing it
47
+ * leaves is root as it stands with no row. Absent branches are counted, so a
48
+ * column only an absent element names is cleared too.
49
+ */
50
+ export declare function blankRow(root: Element): Row;
34
51
  /**
35
52
  * The row template: the first `<template>` among the element's descendants,
36
53
  * outside any nested `lb-query`. A template holding an absent branch is not a
@@ -38,32 +55,54 @@ export declare function applyRow(root: Element, row: Row, liveRow?: boolean): vo
38
55
  * live row comes first in document order.
39
56
  */
40
57
  export declare function templateIn(el: Element): HTMLTemplateElement | null;
58
+ /** How a list of rows lands: in what order, and whether a request asked. */
59
+ export interface RowsOptions {
60
+ /** The order to place rows by, as an order's text. */
61
+ order?: string;
62
+ /** The landing answers a request from this page. */
63
+ requested?: boolean;
64
+ }
41
65
  /**
42
66
  * Land rows through a row template.
43
67
  *
44
- * All rows decide membership and order: every row is placed in the order
45
- * given, and a row whose key did not arrive is gone. A patch disturbs only
46
- * what it names — a row it did not mention keeps its contents and its
47
- * position.
68
+ * All rows decide membership: a row whose key did not arrive leaves. A patch
69
+ * disturbs only what it names — a row it did not mention keeps its contents,
70
+ * and keeps its place unless a row the patch named now sorts around it.
48
71
  *
49
- * A custom element that carries `lbPlaceRow` decides where a row goes,
50
- * because only it knows whether it sorts or groups. Without it a row lands
51
- * immediately before the template, so rows accumulate in the order they
52
- * arrive and the template stays put as the insertion marker.
72
+ * Every live row is placed by the order. With none, all rows show in the
73
+ * order they arrived, and a patch's new rows go last. A row moves only when
74
+ * the order put it somewhere else, so landing the same rows again moves
75
+ * nothing.
53
76
  */
54
- export declare function applyRows(el: Element, template: HTMLTemplateElement, keyColumn: string, result: RowsResult): void;
77
+ export declare function applyRows(el: Element, template: HTMLTemplateElement, keyColumn: string, result: RowsResult, options?: RowsOptions): void;
78
+ /** The answer kept for a query, as all of its rows. */
79
+ export declare function keptAnswer(root: ParentNode, query: string): ResponseItem | undefined;
55
80
  /**
56
81
  * Drop what landing kept for a root. The hub calls it when it replaces the
57
82
  * page, since another page's query of the same name is another query.
58
83
  */
59
84
  export declare function forget(root: ParentNode): void;
85
+ /** How response items land. */
86
+ export interface LandOptions {
87
+ /**
88
+ * Queries that may have nowhere to land without a warning: the hub's own
89
+ * `lb-url` lands wherever a chrome or page names it, and nowhere otherwise.
90
+ */
91
+ quiet?: readonly string[];
92
+ /** The user's order for a query, which replaces the server's. */
93
+ orderFor?: (query: string) => string | undefined;
94
+ /** The items answer a request from this page. */
95
+ requested?: boolean;
96
+ }
60
97
  /**
61
98
  * Land response items. Every answer arrives through here, and is kept for
62
99
  * `root`, so that what arrives after it is filled from it — see forget().
63
- *
64
- * `quiet` names queries that may have nowhere to land without a warning: the
65
- * hub's own `lb-url` lands wherever a chrome or page names it, and nowhere
66
- * otherwise.
67
100
  */
68
- export declare function applyResponse(root: ParentNode, items: ResponseItem[], quiet?: readonly string[]): void;
101
+ export declare function applyResponse(root: ParentNode, items: ResponseItem[], options?: LandOptions): void;
102
+ /**
103
+ * Land a query's kept answer again, as all of its rows: what the hub does
104
+ * when the user's order for it changes and the rows themselves have not.
105
+ * False when no answer is kept.
106
+ */
107
+ export declare function reland(root: ParentNode, query: string): boolean;
69
108
  //# sourceMappingURL=lb-apply.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lb-apply.d.ts","sourceRoot":"","sources":["../../hub/lb-apply.ts"],"names":[],"mappings":"AA6CA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,GAAG,EAER,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAW7B,mEAAmE;AACnE,MAAM,WAAW,OAAQ,SAAQ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