pict-section-form 1.0.198 → 1.0.200

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 (72) hide show
  1. package/README.md +42 -42
  2. package/docs/Comprehensions.md +17 -17
  3. package/docs/Comprehensions_Advanced.md +20 -20
  4. package/docs/Layouts.md +10 -10
  5. package/docs/Pict_Section_Form_Architecture.md +19 -53
  6. package/docs/README.md +5 -12
  7. package/docs/Solvers.md +4 -4
  8. package/docs/Templates.md +2 -29
  9. package/docs/_cover.md +12 -1
  10. package/docs/_playground.json +47 -0
  11. package/docs/_sidebar.md +13 -9
  12. package/docs/_version.json +3 -3
  13. package/docs/diagrams/template-hierarchy-2.excalidraw +3677 -0
  14. package/docs/diagrams/template-hierarchy-2.mmd +19 -0
  15. package/docs/diagrams/template-hierarchy-2.svg +2 -0
  16. package/docs/diagrams/template-hierarchy.excalidraw +2389 -0
  17. package/docs/diagrams/template-hierarchy.mmd +12 -0
  18. package/docs/diagrams/template-hierarchy.svg +2 -0
  19. package/docs/diagrams/views.excalidraw +405 -0
  20. package/docs/diagrams/views.mmd +4 -0
  21. package/docs/diagrams/views.svg +2 -0
  22. package/docs/examples/README.md +32 -41
  23. package/docs/examples/change_tracking/README.md +191 -0
  24. package/docs/examples/change_tracking/change_tracking.js +6685 -0
  25. package/docs/examples/change_tracking/index.html +65 -0
  26. package/docs/examples/dynamic_analysis/README.md +205 -0
  27. package/docs/examples/dynamic_analysis/chart.umd.js +14 -0
  28. package/docs/examples/dynamic_analysis/dynamic_analysis_application.js +5738 -0
  29. package/docs/examples/dynamic_analysis/index.html +128 -0
  30. package/docs/examples/gradebook/README.md +46 -41
  31. package/docs/examples/gradebook/gradebook_application.min.js +1 -0
  32. package/docs/examples/gradebook/index.html +95 -0
  33. package/docs/examples/ndt_field_test/README.md +212 -0
  34. package/docs/examples/ndt_field_test/chart.umd.js +14 -0
  35. package/docs/examples/ndt_field_test/index.html +436 -0
  36. package/docs/examples/ndt_field_test/ndt_field_test.js +6725 -0
  37. package/docs/examples/scope_mathematics/README.md +171 -0
  38. package/docs/examples/scope_mathematics/index.html +65 -0
  39. package/docs/examples/scope_mathematics/scope_mathematics.js +6685 -0
  40. package/docs/examples/simple_table/README.md +174 -99
  41. package/docs/examples/simple_table/index.html +65 -0
  42. package/docs/examples/simple_table/simple_tabular_application.min.js +1 -0
  43. package/docs/index.html +2 -2
  44. package/docs/input_providers/009-chart.md +2 -2
  45. package/docs/playground/app.json +4 -0
  46. package/docs/playground/appdata.json +9 -0
  47. package/docs/playground/application.js +58 -0
  48. package/docs/playground/manifest.json +53 -0
  49. package/docs/playground/pict.json +4 -0
  50. package/docs/playground/runtime/pict-application.min.js +2 -0
  51. package/docs/playground/runtime/pict-section-form.min.js +2 -0
  52. package/docs/playground/runtime/pict-section-modal.min.js +2 -0
  53. package/docs/playground/runtime/pict.min.js +12 -0
  54. package/docs/playground.md +93 -0
  55. package/docs/retold-catalog.json +244 -355
  56. package/docs/retold-keyword-index.json +23294 -9088
  57. package/example_applications/change_tracking/package.json +9 -1
  58. package/example_applications/dynamic_analysis/package.json +8 -0
  59. package/example_applications/gradebook/package.json +9 -1
  60. package/example_applications/ndt_field_test/package.json +8 -0
  61. package/example_applications/scope_mathematics/package.json +9 -1
  62. package/example_applications/simple_table/package.json +9 -1
  63. package/package.json +7 -7
  64. package/source/providers/Pict-Provider-DynamicTabularData.js +186 -0
  65. package/source/providers/layouts/Pict-Layout-Tabular.js +24 -0
  66. package/source/services/ManifestFactory.js +13 -4
  67. package/test/PictSectionForm-Tabular-Features_tests.js +176 -0
  68. package/docs/examples/complex_table/README.md +0 -163
  69. package/docs/examples/complex_tuigrid/README.md +0 -202
  70. package/docs/examples/manyfest_editor/README.md +0 -200
  71. package/docs/examples/simple_distill/README.md +0 -176
  72. package/docs/examples/simple_form/README.md +0 -143
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # PICT Forms Section
2
2
 
3
+ > **[Read the Pict-Section-Form Documentation](https://fable-retold.github.io/pict-section-form/)** - an interactive guide with live, runnable examples and the full API reference.
4
+
3
5
  A Form Section with programmatically definable content. Simple, extensible
4
6
  function APIs for adding groups, rows, entry elements and documentation or
5
7
  user workflow guidance.
@@ -262,40 +264,38 @@ Each section is represented within a manyfest. You could have one manyfest for
262
264
  }
263
265
  ```
264
266
 
265
- This [manyfest](https://github.com/stevenvelozo/manyfest) file describes a list
267
+ This [manyfest](https://github.com/fable-retold/manyfest) file describes a list
266
268
  of application state elements. And intersects these data elements with how
267
269
  they should be presented to the user in a form. This can work for any layout
268
270
  of data in your application.
269
271
 
270
272
  ## Documentation
271
273
 
272
- Comprehensive documentation is available in the [docs](docs/) folder:
274
+ The complete documentation - an interactive guide with live examples - is hosted at **[stevenvelozo.github.io/pict-section-form](https://fable-retold.github.io/pict-section-form/)**:
273
275
 
274
276
  | Document | Description |
275
277
  |----------|-------------|
276
- | [Getting Started](docs/Getting_Started.md) | Quick start guide for new users |
277
- | [Architecture](docs/Pict_Section_Form_Architecture.md) | System architecture and design |
278
- | [Configuration](docs/Configuration.md) | Complete configuration reference |
279
- | [Input Types](docs/Input_Types.md) | Available input types |
280
- | [Templates](docs/Templates.md) | Template customization and macros |
281
- | [Solvers](docs/Solvers.md) | Expression solver system |
282
- | [Providers](docs/Providers.md) | Provider reference |
283
- | [Layouts](docs/Layouts.md) | Layout types and customization |
278
+ | [Getting Started](https://fable-retold.github.io/pict-section-form/#/page/Getting_Started) | Quick start guide for new users |
279
+ | [Architecture](https://fable-retold.github.io/pict-section-form/#/page/Pict_Section_Form_Architecture) | System architecture and design |
280
+ | [Configuration](https://fable-retold.github.io/pict-section-form/#/page/Configuration) | Complete configuration reference |
281
+ | [Input Types](https://fable-retold.github.io/pict-section-form/#/page/Input_Types) | Available input types |
282
+ | [Templates](https://fable-retold.github.io/pict-section-form/#/page/Templates) | Template customization and macros |
283
+ | [Solvers](https://fable-retold.github.io/pict-section-form/#/page/Solvers) | Expression solver system |
284
+ | [Providers](https://fable-retold.github.io/pict-section-form/#/page/Providers) | Provider reference |
285
+ | [Layouts](https://fable-retold.github.io/pict-section-form/#/page/Layouts) | Layout types and customization |
284
286
 
285
287
  ### Example Applications
286
288
 
287
- Working examples demonstrating various features:
289
+ Live, runnable example applications - click to open one in your browser:
288
290
 
289
291
  | Example | Description |
290
292
  |---------|-------------|
291
- | [simple_form](docs/examples/simple_form/) | Basic form with solvers and visibility control |
292
- | [simple_table](docs/examples/simple_table/) | Minimal tabular layout example |
293
- | [simple_distill](docs/examples/simple_distill/) | Entity bundles and trigger groups |
294
- | [gradebook](docs/examples/gradebook/) | Multi-table app with localStorage |
295
- | [postcard_example](docs/examples/postcard_example/) | Theme switching and navigation |
296
- | [complex_table](docs/examples/complex_table/) | Full-featured with charts and entity bundles |
297
- | [complex_tuigrid](docs/examples/complex_tuigrid/) | TuiGrid with aggregations |
298
- | [manyfest_editor](docs/examples/manyfest_editor/) | Meta-configuration editor |
293
+ | [Simple Table](https://fable-retold.github.io/pict-section-form/examples/simple_table/) | Tabular layout, reference manifests, and dot-notation access into nested data |
294
+ | [Gradebook](https://fable-retold.github.io/pict-section-form/examples/gradebook/) | Stacked headers, row labels, dynamic columns, row/column selection, and sorting |
295
+ | [Scope Mathematics](https://fable-retold.github.io/pict-section-form/examples/scope_mathematics/) | Solvers that reach across sections and the global form scope |
296
+ | [Change Tracking](https://fable-retold.github.io/pict-section-form/examples/change_tracking/) | A change-detecting solver state machine with bidirectional recompute |
297
+ | [NDT Field Test](https://fable-retold.github.io/pict-section-form/examples/ndt_field_test/) | Offline persistence, pick lists, pass/fail row solvers, and charts |
298
+ | [Dynamic Analysis](https://fable-retold.github.io/pict-section-form/examples/dynamic_analysis/) | Runtime section injection, solver rewriting, and solver-driven charts |
299
299
 
300
300
  ### Input Providers
301
301
 
@@ -303,19 +303,19 @@ Specialized input handlers for different data types:
303
303
 
304
304
  | Provider | Description |
305
305
  |----------|-------------|
306
- | [Select](docs/input_providers/001-select.md) | Dropdown lists with static/dynamic options |
307
- | [DateTime](docs/input_providers/002-datetime.md) | Date and time picker |
308
- | [Markdown](docs/input_providers/003-markdown.md) | Markdown content display |
309
- | [HTML](docs/input_providers/004-html.md) | Raw HTML content display |
310
- | [PreciseNumber](docs/input_providers/005-precise-number.md) | Formatted numbers with precision |
311
- | [Link](docs/input_providers/006-link.md) | Hyperlink inputs |
312
- | [Templated](docs/input_providers/007-templated.md) | Dynamic template rendering |
313
- | [TemplatedEntityLookup](docs/input_providers/008-templated-entity-lookup.md) | Entity fetch with template display |
314
- | [Chart](docs/input_providers/009-chart.md) | Chart.js visualizations |
315
- | [EntityBundleRequest](docs/input_providers/010-entity-bundle-request.md) | Cascading entity fetches |
316
- | [AutofillTriggerGroup](docs/input_providers/011-autofill-trigger-group.md) | Trigger-based autofill |
317
- | [TabGroupSelector](docs/input_providers/012-tab-group-selector.md) | Tab navigation for groups |
318
- | [TabSectionSelector](docs/input_providers/013-tab-section-selector.md) | Tab navigation for sections |
306
+ | [Select](https://fable-retold.github.io/pict-section-form/#/page/input_providers/001-select) | Dropdown lists with static/dynamic options |
307
+ | [DateTime](https://fable-retold.github.io/pict-section-form/#/page/input_providers/002-datetime) | Date and time picker |
308
+ | [Markdown](https://fable-retold.github.io/pict-section-form/#/page/input_providers/003-markdown) | Markdown content display |
309
+ | [HTML](https://fable-retold.github.io/pict-section-form/#/page/input_providers/004-html) | Raw HTML content display |
310
+ | [PreciseNumber](https://fable-retold.github.io/pict-section-form/#/page/input_providers/005-precise-number) | Formatted numbers with precision |
311
+ | [Link](https://fable-retold.github.io/pict-section-form/#/page/input_providers/006-link) | Hyperlink inputs |
312
+ | [Templated](https://fable-retold.github.io/pict-section-form/#/page/input_providers/007-templated) | Dynamic template rendering |
313
+ | [TemplatedEntityLookup](https://fable-retold.github.io/pict-section-form/#/page/input_providers/008-templated-entity-lookup) | Entity fetch with template display |
314
+ | [Chart](https://fable-retold.github.io/pict-section-form/#/page/input_providers/009-chart) | Chart.js visualizations |
315
+ | [EntityBundleRequest](https://fable-retold.github.io/pict-section-form/#/page/input_providers/010-entity-bundle-request) | Cascading entity fetches |
316
+ | [AutofillTriggerGroup](https://fable-retold.github.io/pict-section-form/#/page/input_providers/011-autofill-trigger-group) | Trigger-based autofill |
317
+ | [TabGroupSelector](https://fable-retold.github.io/pict-section-form/#/page/input_providers/012-tab-group-selector) | Tab navigation for groups |
318
+ | [TabSectionSelector](https://fable-retold.github.io/pict-section-form/#/page/input_providers/013-tab-section-selector) | Tab navigation for sections |
319
319
 
320
320
  ## Installation
321
321
 
@@ -345,19 +345,19 @@ formApp.pict.views.PictFormMetacontroller.render();
345
345
 
346
346
  Pict Section Form is part of the Pict ecosystem:
347
347
 
348
- - [pict](https://github.com/stevenvelozo/pict) - Core application framework
349
- - [pict-view](https://github.com/stevenvelozo/pict-view) - View base class
350
- - [pict-provider](https://github.com/stevenvelozo/pict-provider) - Provider base class
351
- - [manyfest](https://github.com/stevenvelozo/manyfest) - Schema definitions
352
- - [fable](https://github.com/stevenvelozo/fable) - Service infrastructure
348
+ - [pict](https://github.com/fable-retold/pict) - Core application framework
349
+ - [pict-view](https://github.com/fable-retold/pict-view) - View base class
350
+ - [pict-provider](https://github.com/fable-retold/pict-provider) - Provider base class
351
+ - [manyfest](https://github.com/fable-retold/manyfest) - Schema definitions
352
+ - [fable](https://github.com/fable-retold/fable) - Service infrastructure
353
353
 
354
354
  ## Related Packages
355
355
 
356
- - [pict](https://github.com/stevenvelozo/pict) - MVC application framework
357
- - [pict-view](https://github.com/stevenvelozo/pict-view) - View base class
358
- - [pict-provider](https://github.com/stevenvelozo/pict-provider) - Data provider base class
359
- - [pict-template](https://github.com/stevenvelozo/pict-template) - Template engine
360
- - [manyfest](https://github.com/stevenvelozo/manyfest) - Schema-driven object navigation
356
+ - [pict](https://github.com/fable-retold/pict) - MVC application framework
357
+ - [pict-view](https://github.com/fable-retold/pict-view) - View base class
358
+ - [pict-provider](https://github.com/fable-retold/pict-provider) - Data provider base class
359
+ - [pict-template](https://github.com/fable-retold/pict-template) - Template engine
360
+ - [manyfest](https://github.com/fable-retold/manyfest) - Schema-driven object navigation
361
361
 
362
362
  ## License
363
363
 
@@ -1,9 +1,9 @@
1
1
  # Comprehensions
2
2
 
3
3
  The `addComprehensionEntity` solver function builds **multi-context, multi-entity
4
- comprehensions** from form data a JSON shape that can be inspected, diffed,
4
+ comprehensions** from form data - a JSON shape that can be inspected, diffed,
5
5
  and pushed to a Meadow REST API via
6
- [`meadow-integration load_comprehension`](https://github.com/stevenvelozo/meadow-integration).
6
+ [`meadow-integration load_comprehension`](https://fable-retold.github.io/meadow-integration/).
7
7
 
8
8
  Think of it as the "save side" of a form: a single function call lays down one
9
9
  property of one record under one workflow context, and many calls compose into a
@@ -17,8 +17,8 @@ addComprehensionEntity(Context, Entity, GUID, Property, Value)
17
17
 
18
18
  | Parameter | Type | Meaning |
19
19
  |---|---|---|
20
- | `Context` | string (manyfest address) | Workflow bucket `"OnSave"`, `"OnApprovalAction.Approve"`, etc. Dots create nested branches. |
21
- | `Entity` | string | The entity name `"Book"`, `"Recipe"`, `"Fruit"`. Opaque key (not parsed). |
20
+ | `Context` | string (manyfest address) | Workflow bucket - `"OnSave"`, `"OnApprovalAction.Approve"`, etc. Dots create nested branches. |
21
+ | `Entity` | string | The entity name - `"Book"`, `"Recipe"`, `"Fruit"`. Opaque key (not parsed). |
22
22
  | `GUID` | string | External GUID for the record. Opaque key (dots are NOT interpreted). |
23
23
  | `Property` | string | The field to set on the record. Opaque key. |
24
24
  | `Value` | any | The value to write. Strings, numbers, booleans, objects, arrays. |
@@ -42,7 +42,7 @@ Given these solvers on a Book form:
42
42
  ]
43
43
  ```
44
44
 
45
- the destination ends up looking like:
45
+ ...the destination ends up looking like:
46
46
 
47
47
  ```json
48
48
  {
@@ -70,8 +70,8 @@ Given these solvers on a Book form:
70
70
  }
71
71
  ```
72
72
 
73
- Every leaf in this tree is a Meadow-shaped record keyed by external GUID the
74
- exact format [`load_comprehension`](https://github.com/stevenvelozo/meadow-integration)
73
+ Every leaf in this tree is a Meadow-shaped record keyed by external GUID - the
74
+ exact format [`load_comprehension`](https://fable-retold.github.io/meadow-integration/)
75
75
  expects.
76
76
 
77
77
  ## Where the result lands
@@ -88,7 +88,7 @@ metacontroller:
88
88
  this.pict.views.PictFormMetacontroller.comprehensionDestinationAddress = 'AppData.MyWorkflowComprehensions';
89
89
  ```
90
90
 
91
- or pass it in the metacontroller view options if you're constructing the
91
+ ...or pass it in the metacontroller view options if you're constructing the
92
92
  metacontroller manually:
93
93
 
94
94
  ```js
@@ -100,7 +100,7 @@ If the address resolves to nothing, the function materializes an object there on
100
100
  the first write. If it resolves to a non-object scalar, the call logs a warning
101
101
  and bails (it won't overwrite a number with an object).
102
102
 
103
- ## Basic example flat OnSave context
103
+ ## Basic example - flat OnSave context
104
104
 
105
105
  ```js
106
106
  "Sections":
@@ -125,15 +125,15 @@ the three properties.
125
125
  1. **Empty GUIDs bail.** If any of `Context`, `Entity`, `GUID`, or `Property`
126
126
  resolves to `null`, `undefined`, or the empty string, the call logs a warning
127
127
  and returns `undefined`. Recipes with an empty `RecipeName` will not silently
128
- create a `""` bucket they just no-op until the user fills the name in.
128
+ create a `""` bucket - they just no-op until the user fills the name in.
129
129
  2. **Solver ordinals.** Solvers run in ascending ordinal order. Put your
130
130
  `addComprehensionEntity` calls *after* any solvers they depend on (e.g. after
131
131
  the `TotalCalories = SUM(...)` aggregate they read from). The complex_table
132
- example uses ordinals 200220 to keep them after the default-ordinal compute
132
+ example uses ordinals 200-220 to keep them after the default-ordinal compute
133
133
  solvers.
134
134
  3. **Re-solves overwrite.** Each solve re-runs every solver, so each
135
135
  `addComprehensionEntity` call overwrites the property it wrote last time
136
- with the current value. This is what you want the comprehension always
136
+ with the current value. This is what you want - the comprehension always
137
137
  reflects the current form state.
138
138
  4. **The destination is *not* cleared between solves.** If your form removes a
139
139
  record (e.g. deletes a row from a grid), the previous comprehension for that
@@ -165,17 +165,17 @@ Or write to a file and push from a CLI:
165
165
  npx meadow-integration load_comprehension out.json --prefix MYAPP
166
166
  ```
167
167
 
168
- See [meadow-integration: Comprehensions](https://github.com/stevenvelozo/meadow-integration/blob/main/docs/comprehensions.md)
169
- for the full push semantics GUID marshaling, foreign-key resolution, batch
168
+ See [meadow-integration: Comprehensions](https://github.com/fable-retold/meadow-integration/blob/main/docs/comprehensions.md)
169
+ for the full push semantics - GUID marshaling, foreign-key resolution, batch
170
170
  upserts, idempotency.
171
171
 
172
172
  ## See also
173
173
 
174
- - [Advanced patterns](Comprehensions_Advanced.md) mixing hashes and direct
174
+ - [Advanced patterns](Comprehensions_Advanced.md) - mixing hashes and direct
175
175
  addresses, computed contexts, per-row `MAP VAR` generation, customized
176
176
  destinations.
177
- - [Solvers](Solvers.md) full solver function reference.
178
- - The [Complex Table example](../example_applications/complex_table/Complex-Tabular-Application.js)
177
+ - [Solvers](Solvers.md) - full solver function reference.
178
+ - The Complex Table example (`example_applications/complex_table/Complex-Tabular-Application.js`)
179
179
  builds a complete `RecipeWorkflowComprehensions` tree with `OnSave` and
180
180
  `OnApprovalAction.{Submit,Approve}` contexts off the Recipe section and the
181
181
  FruitGrid recordset.
@@ -1,11 +1,11 @@
1
- # Comprehensions Advanced patterns
1
+ # Comprehensions - Advanced patterns
2
2
 
3
3
  This document goes deeper than [Comprehensions](Comprehensions.md):
4
4
 
5
- - **Hash vs. address arguments** when to write `BookGUID` (bare symbol),
5
+ - **Hash vs. address arguments** - when to write `BookGUID` (bare symbol),
6
6
  `"AppData.Bundle.BookGUID"` (string address), `getvalue("...")` (explicit
7
7
  lookup), and when to mix them.
8
- - **Computed contexts** `IF`/ternary results as the `Context` argument so a
8
+ - **Computed contexts** - `IF`/ternary results as the `Context` argument so a
9
9
  single solver routes between `OnApprovalAction.Submit` and
10
10
  `OnApprovalAction.Approve`.
11
11
  - **Per-row generation** with `MAP VAR` over a recordset.
@@ -13,22 +13,22 @@ This document goes deeper than [Comprehensions](Comprehensions.md):
13
13
  - **Resetting between solves**.
14
14
 
15
15
  The complete worked example for everything here lives at
16
- [`example_applications/complex_table/Complex-Tabular-Application.js`](../example_applications/complex_table/Complex-Tabular-Application.js)
17
- if you only read one thing, read that file. This page explains the *why* behind
16
+ `example_applications/complex_table/Complex-Tabular-Application.js`
17
+ - if you only read one thing, read that file. This page explains the *why* behind
18
18
  the patterns it uses.
19
19
 
20
- ## Argument resolution hashes, addresses, and quoted strings
20
+ ## Argument resolution - hashes, addresses, and quoted strings
21
21
 
22
22
  The solver expression parser treats each argument to `addComprehensionEntity`
23
23
  the same way it would treat any other function argument:
24
24
 
25
25
  | Argument form | What happens |
26
26
  |---|---|
27
- | `BookGUID` | **Bare symbol** resolved from the form's manifest. Looked up first by descriptor hash, then by address against the marshal destination. |
28
- | `Record.GUID` / `AppData.Bundle.X` | **Dotted symbol** resolved as an address (the parser does NOT need quotes around addresses). |
29
- | `"OnSave"` / `"Book"` | **Quoted string** taken literally, no resolution. |
30
- | `getvalue("AppData.X.Y")` | **Explicit lookup** useful when you want to force address-resolution semantics on a value built up from other solvers. |
31
- | `IF(...)` / `CONCAT(...)` | **Nested function call** the inner function's return value becomes the argument. |
27
+ | `BookGUID` | **Bare symbol** - resolved from the form's manifest. Looked up first by descriptor hash, then by address against the marshal destination. |
28
+ | `Record.GUID` / `AppData.Bundle.X` | **Dotted symbol** - resolved as an address (the parser does NOT need quotes around addresses). |
29
+ | `"OnSave"` / `"Book"` | **Quoted string** - taken literally, no resolution. |
30
+ | `getvalue("AppData.X.Y")` | **Explicit lookup** - useful when you want to force address-resolution semantics on a value built up from other solvers. |
31
+ | `IF(...)` / `CONCAT(...)` | **Nested function call** - the inner function's return value becomes the argument. |
32
32
 
33
33
  In practice you mix freely:
34
34
 
@@ -60,10 +60,10 @@ the parser to look the symbol up. The first three arguments are almost always
60
60
  literal strings (Context, Entity name) plus one resolved value (GUID); the
61
61
  fourth is almost always a literal Property; the fifth is almost always resolved.
62
62
 
63
- ## Computed contexts routing with `IF`
63
+ ## Computed contexts - routing with `IF`
64
64
 
65
65
  The `Context` argument is a manyfest address. It's also just a string that the
66
- function uses to walk a nested object which means a *computed* string works
66
+ function uses to walk a nested object - which means a *computed* string works
67
67
  fine. The complex_table example routes between `OnApprovalAction.Submit` and
68
68
  `OnApprovalAction.Approve` based on a `Proprietary` boolean:
69
69
 
@@ -83,7 +83,7 @@ Both `Submit` and `Approve` branches sit under `OnApprovalAction`, which lets
83
83
  downstream code key off `Object.keys(comprehension.OnApprovalAction)` to discover
84
84
  which actions fired this solve.
85
85
 
86
- The same trick scales to richer routing e.g. context-per-environment:
86
+ The same trick scales to richer routing - e.g. context-per-environment:
87
87
 
88
88
  ```js
89
89
  `addComprehensionEntity(
@@ -111,7 +111,7 @@ the row bound to a name you choose (`row` is the convention). Combined with
111
111
  { Ordinal: 210, Expression: `MAP VAR row FROM FruitData.FruityVice : addComprehensionEntity("OnSave", "Fruit", row.name, "Calories", row.nutritions.calories)` }
112
112
  ```
113
113
 
114
- Inside the body, `row.X.Y` resolves against each row in turn so you get
114
+ Inside the body, `row.X.Y` resolves against each row in turn - so you get
115
115
  deep-property access without writing per-row solvers.
116
116
 
117
117
  After the solve runs against the bundled FruityVice data, the comprehension at
@@ -141,13 +141,13 @@ row, you have two reasonable options:
141
141
 
142
142
  ## Customizing the destination
143
143
 
144
- Each metacontroller has a `comprehensionDestinationAddress` property
145
- mirroring the existing `viewMarshalDestination` knob that controls where
144
+ Each metacontroller has a `comprehensionDestinationAddress` property -
145
+ mirroring the existing `viewMarshalDestination` knob - that controls where
146
146
  `addComprehensionEntity` writes. The default is `AppData.FormEntityComprehensions`.
147
147
 
148
148
  ### Option 1: in the application constructor
149
149
 
150
- This is what the [complex_table example](../example_applications/complex_table/Complex-Tabular-Application.js)
150
+ This is what the complex_table example (`example_applications/complex_table/Complex-Tabular-Application.js`)
151
151
  does. After `super()` (which registers the metacontroller view via
152
152
  `PictFormApplication`), set the destination directly:
153
153
 
@@ -240,7 +240,7 @@ missing-or-emptied destination by re-materializing it on the next write.
240
240
 
241
241
  ## Full reference: the complex_table sample config
242
242
 
243
- The [complex_table example](../example_applications/complex_table/Complex-Tabular-Application.js)
243
+ The complex_table example (`example_applications/complex_table/Complex-Tabular-Application.js`)
244
244
  exercises every pattern on this page in one application. The relevant pieces:
245
245
 
246
246
  ```js
@@ -290,6 +290,6 @@ comprehensions -- reach for the meadow-integration toolchain directly:
290
290
  - `meadow-integration comprehensionintersect` to merge two comprehensions.
291
291
  - The `Comprehension` object's `Object.assign` semantics for in-code merges.
292
292
 
293
- See [meadow-integration: Comprehensions](https://github.com/stevenvelozo/meadow-integration/blob/main/docs/comprehensions.md)
293
+ See [meadow-integration: Comprehensions](https://github.com/fable-retold/meadow-integration/blob/main/docs/comprehensions.md)
294
294
  for those tools. The solver helper is purpose-built for "as I edit this form,
295
295
  build the comprehension that will save it."
package/docs/Layouts.md CHANGED
@@ -170,7 +170,7 @@ an array of cells.
170
170
  | Cell property | Type | Description |
171
171
  |---------------|------|-------------|
172
172
  | `Label` | string | Header text |
173
- | `ColumnSpan` | number | Number of data columns this cell spans (default 1) this is how you "cluster" |
173
+ | `ColumnSpan` | number | Number of data columns this cell spans (default 1) - this is how you "cluster" |
174
174
  | `CSSClass` | string | Optional class applied to the `<th>` |
175
175
 
176
176
  ```json
@@ -201,7 +201,7 @@ of the table (before the data columns). Each entry describes one label column.
201
201
  | Property | Type | Description |
202
202
  |----------|------|-------------|
203
203
  | `Name` | string | Header text for the label column |
204
- | `Template` | string | A Pict template resolved per row the row record is at `Record.Value`, the row index at `Record.Key` |
204
+ | `Template` | string | A Pict template resolved per row - the row record is at `Record.Value`, the row index at `Record.Key` |
205
205
  | `RowNumber` | boolean | When `true`, the label is the 1-based row number |
206
206
  | `SourceAddress` | string | An app-data address of a pre-slotted array; element `[rowIndex]` is the label |
207
207
  | `Cluster` | boolean | When `true`, consecutive equal labels collapse into one cell with `rowspan` |
@@ -217,14 +217,14 @@ Provide exactly one of `Template`, `RowNumber`, or `SourceAddress` per entry.
217
217
  ]
218
218
  ```
219
219
 
220
- `Cluster: true` is what produces the "merged cell" look a column of repeated
220
+ `Cluster: true` is what produces the "merged cell" look - a column of repeated
221
221
  values (e.g. a class section) renders as a single tall cell spanning its run
222
222
  of rows. Any label column may be clustered; there is no "prime" label column.
223
223
 
224
224
  ### Dynamic Columns
225
225
 
226
226
  `DynamicColumns` generates table columns at runtime from **another array** in
227
- the form data for example, one grade column per assignment. Each entry is a
227
+ the form data - for example, one grade column per assignment. Each entry is a
228
228
  generator:
229
229
 
230
230
  | Property | Type | Description |
@@ -233,7 +233,7 @@ generator:
233
233
  | `HashTemplate` | string | Template producing each column's unique descriptor hash |
234
234
  | `NameTemplate` | string | Template producing each column's header text |
235
235
  | `InformaryDataAddressTemplate` | string | Template producing the per-row data address the cell binds to |
236
- | `HeaderGroupTemplate` | string | Optional template producing a cluster label; auto-adds a clustered super-header row |
236
+ | `HeaderGroupTemplate` | string | Optional - template producing a cluster label; auto-adds a clustered super-header row |
237
237
  | `DataType` | string | Data type for the generated descriptors |
238
238
  | `PictForm` | object | `PictForm` block merged onto each generated descriptor (e.g. `InputType`) |
239
239
  | `InsertAt` | string/object | `"End"` (default), `"Start"`, or `{ "After": "<hash>" }` |
@@ -256,7 +256,7 @@ Inside each template the **source row** is the record (`Record.Field`).
256
256
 
257
257
  Dynamic columns are **non-destructive**: when a source row is removed the
258
258
  generated column disappears, but the underlying row data at the
259
- `InformaryDataAddress` is left untouched re-adding the source row brings the
259
+ `InformaryDataAddress` is left untouched - re-adding the source row brings the
260
260
  column back with its data intact. The columns re-resolve automatically as the
261
261
  source array changes; no manual refresh call is needed.
262
262
 
@@ -272,7 +272,7 @@ controls where:
272
272
 
273
273
  | Value | Behavior |
274
274
  |-------|----------|
275
- | `"right"` | Default controls in a trailing column |
275
+ | `"right"` | Default - controls in a trailing column |
276
276
  | `"left"` | Controls in a leading column, before the data columns |
277
277
  | `"hidden"` | No editing controls (read-only style table) |
278
278
 
@@ -283,7 +283,7 @@ controls where:
283
283
  ### Suppressing the Default Header Row
284
284
 
285
285
  Set `SuppressDefaultColumnHeaderRow: true` to omit the prime column-name row
286
- entirely useful when custom `Headers` rows fully describe the columns.
286
+ entirely - useful when custom `Headers` rows fully describe the columns.
287
287
 
288
288
  ### Selectable Rows & Columns
289
289
 
@@ -315,8 +315,8 @@ array lives in the marshalled form data it round-trips with save / load.
315
315
 
316
316
  ### Column Sorting
317
317
 
318
- `ColumnSorting: true` (off by default) injects a clickable sort control a
319
- `<span>` carrying a sort SVG glyph from Pict's icon registry into every
318
+ `ColumnSorting: true` (off by default) injects a clickable sort control - a
319
+ `<span>` carrying a sort SVG glyph from Pict's icon registry - into every
320
320
  prime header cell.
321
321
 
322
322
  ```json
@@ -32,25 +32,8 @@ The framework follows several key principles:
32
32
 
33
33
  The view layer consists of two primary classes:
34
34
 
35
- ```
36
- ┌─────────────────────────────────────────────────────────────────┐
37
- │ PictFormMetacontroller │
38
- │ - Manages multiple form sections │
39
- │ - Orchestrates data marshaling │
40
- │ - Controls solver execution │
41
- │ - Handles initial bundle loading │
42
- └─────────────────────────────────────────────────────────────────┘
43
-
44
- │ manages
45
-
46
- ┌─────────────────────────────────────────────────────────────────┐
47
- │ PictViewDynamicForm │
48
- │ - Represents a single form section │
49
- │ - Maintains section manifest instance │
50
- │ - Handles input provider lifecycle │
51
- │ - Manages group and row structures │
52
- └─────────────────────────────────────────────────────────────────┘
53
- ```
35
+ <!-- bespoke diagram: edit diagrams/views.mmd or .hints.json, then: npx pict-renderer-graph build modules/pict/pict-section-form/docs -->
36
+ ![Views](diagrams/views.svg)
54
37
 
55
38
  **PictViewDynamicForm** extends `pict-view` and represents a single form section.
56
39
  It maintains:
@@ -95,29 +78,24 @@ for export and editing.
95
78
 
96
79
  ### Rendering Flow
97
80
 
98
- ```
99
- 1. Application instantiates PictFormMetacontroller
100
- 2. For each Section in manifest:
101
- a. PictViewDynamicForm is created
102
- b. ManifestFactory parses descriptors into groups and rows
103
- c. MetatemplateGenerator creates layout templates
104
- 3. Forms are rendered to DOM using template hierarchy
105
- 4. Solvers are executed (expressions resolve values)
106
- 5. Input providers initialize UI controls
107
- 6. Event handlers attach for changes
108
- ```
81
+ 1. The application instantiates the `PictFormMetacontroller`.
82
+ 2. For each section in the manifest, a `PictViewDynamicForm` is created,
83
+ `ManifestFactory` parses its descriptors into groups and rows, and
84
+ `MetatemplateGenerator` builds the layout templates.
85
+ 3. The forms render to the DOM through the template hierarchy.
86
+ 4. Solvers execute - expressions resolve their values.
87
+ 5. Input providers initialize the UI controls.
88
+ 6. Event handlers attach for change detection.
109
89
 
110
90
  ### Data Change Flow
111
91
 
112
- ```
113
- 1. User modifies input value
114
- 2. dataChanged() called on PictViewDynamicForm
115
- 3. Informary marshals specific input from DOM to AppData
116
- 4. Input providers run onDataChange hooks
117
- 5. Application.solve() executes all solvers
118
- 6. Metacontroller marshals all sections back to view
119
- 7. Input providers run onDataMarshalToForm hooks
120
- ```
92
+ 1. The user modifies an input value.
93
+ 2. `dataChanged()` is called on the `PictViewDynamicForm`.
94
+ 3. Informary marshals that input from the DOM into `AppData`.
95
+ 4. Input providers run their `onDataChange` hooks.
96
+ 5. `Application.solve()` executes all solvers.
97
+ 6. The metacontroller marshals every section back to the view.
98
+ 7. Input providers run their `onDataMarshalToForm` hooks.
121
99
 
122
100
  ### Marshal Operations
123
101
 
@@ -131,20 +109,8 @@ to map form elements to their corresponding data addresses.
131
109
 
132
110
  Templates are rendered in a strict hierarchy:
133
111
 
134
- ```
135
- Form Container
136
- └── Section (for each)
137
- ├── Section Prefix
138
- └── Group (for each)
139
- ├── Group Prefix
140
- └── Row (for each)
141
- ├── Row Prefix
142
- ├── Input (for each)
143
- │ └── Input Template (by InputType or DataType)
144
- └── Row Postfix
145
- └── Group Postfix
146
- └── Section Postfix
147
- ```
112
+ <!-- bespoke diagram: edit diagrams/template-hierarchy.mmd or .hints.json, then: npx pict-renderer-graph build modules/pict/pict-section-form/docs -->
113
+ ![Template Hierarchy](diagrams/template-hierarchy.svg)
148
114
 
149
115
  Templates support three levels of customization:
150
116
  1. **View-specific** - Templates specific to a single view instance
package/docs/README.md CHANGED
@@ -73,17 +73,10 @@ npm install pict-section-form
73
73
  - [Providers](Providers.md) - Provider reference
74
74
  - [Layouts](Layouts.md) - Layout types and customization
75
75
 
76
- ## Example Applications
77
-
78
- - [simple_form](examples/simple_form/) - Basic form with solvers and visibility control
79
- - [simple_table](examples/simple_table/) - Minimal tabular layout example
80
- - [gradebook](examples/gradebook/) - Advanced tabular recordsets: stacked headers, row labels, dynamic columns, selection, sorting
81
- - [complex_table](examples/complex_table/) - Full-featured with charts and entity bundles
82
-
83
76
  ## Related Packages
84
77
 
85
- - [pict](https://github.com/stevenvelozo/pict) - Core application framework
86
- - [pict-view](https://github.com/stevenvelozo/pict-view) - View base class
87
- - [pict-provider](https://github.com/stevenvelozo/pict-provider) - Provider base class
88
- - [manyfest](https://github.com/stevenvelozo/manyfest) - Schema definitions
89
- - [fable](https://github.com/stevenvelozo/fable) - Service infrastructure
78
+ - [pict](https://fable-retold.github.io/pict/) - Core application framework
79
+ - [pict-view](https://fable-retold.github.io/pict-view/) - View base class
80
+ - [pict-provider](https://fable-retold.github.io/pict-provider/) - Provider base class
81
+ - [manyfest](https://fable-retold.github.io/manyfest/) - Schema definitions
82
+ - [fable](https://fable-retold.github.io/fable/) - Service infrastructure
package/docs/Solvers.md CHANGED
@@ -213,10 +213,10 @@ aggregate values from arrays:
213
213
 
214
214
  ### Tabular Row & Column Styling
215
215
 
216
- These functions style a whole row or whole column of a tabular group every
216
+ These functions style a whole row or whole column of a tabular group - every
217
217
  cell across or down. The highlight pair toggles a CSS class on a `1` / `0`
218
218
  flag; the color pair sets (`1`) or clears (`0`) an inline background color.
219
- None of them touch form data they are purely presentational and re-applied
219
+ None of them touch form data - they are purely presentational and re-applied
220
220
  on each solve.
221
221
 
222
222
  | Function | Description |
@@ -265,7 +265,7 @@ presentation.
265
265
  The `Context` argument is treated as a manyfest address, so dotted contexts
266
266
  like `"OnApprovalAction.Approve"` produce nested context branches. Successive
267
267
  calls accumulate properties on the same record. See [Comprehensions](Comprehensions.md)
268
- for the basic walkthrough and [Comprehensions Advanced](Comprehensions_Advanced.md)
268
+ for the basic walkthrough and [Comprehensions - Advanced](Comprehensions_Advanced.md)
269
269
  for computed contexts, `MAP VAR` patterns, and customized destinations.
270
270
 
271
271
  #### Comprehension Example
@@ -422,4 +422,4 @@ Use in solvers:
422
422
  - [Architecture](Pict_Section_Form_Architecture.md) - Solver system internals
423
423
  - [Input Types](Input_Types.md) - Input visibility control
424
424
  - [Comprehensions](Comprehensions.md) - `addComprehensionEntity` basics
425
- - [Comprehensions Advanced](Comprehensions_Advanced.md) - Computed contexts, `MAP VAR`, customized destinations
425
+ - [Comprehensions - Advanced](Comprehensions_Advanced.md) - Computed contexts, `MAP VAR`, customized destinations
package/docs/Templates.md CHANGED
@@ -7,35 +7,8 @@ Templates can be customized at multiple levels to achieve any desired appearance
7
7
 
8
8
  Templates are rendered in a strict hierarchical order:
9
9
 
10
- ```
11
- Form Level
12
- ├── -Template-Form-Container-Header
13
- ├── -Template-Form-Container-Wrap-Prefix
14
-
15
- └── For each Section:
16
- ├── -Template-Form-Container
17
-
18
- └── -Template-Wrap-Prefix
19
- ├── -Template-Section-Prefix
20
-
21
- └── For each Group:
22
- ├── -Template-Group-Prefix
23
-
24
- └── For each Row:
25
- ├── -Template-Row-Prefix
26
- │ ├── For each Input:
27
- │ │ └── -Template-Input-InputType-{type}
28
- │ │ OR -Template-Input-DataType-{type}
29
- │ │ OR -TabularTemplate-*
30
- │ └── -Template-Row-Postfix
31
-
32
- └── -Template-Group-Postfix
33
-
34
- └── -Template-Section-Postfix
35
- └── -Template-Wrap-Postfix
36
-
37
- └── -Template-Form-Container-Wrap-Postfix
38
- ```
10
+ <!-- bespoke diagram: edit diagrams/template-hierarchy-2.mmd or .hints.json, then: npx pict-renderer-graph build modules/pict/pict-section-form/docs -->
11
+ ![Template Hierarchy](diagrams/template-hierarchy-2.svg)
39
12
 
40
13
  ## Template Resolution
41
14
 
package/docs/_cover.md CHANGED
@@ -7,5 +7,16 @@
7
7
  - Expression solvers for calculated fields and conditional logic
8
8
  - Extensible input types and flexible templates
9
9
 
10
- [GitHub](https://github.com/stevenvelozo/pict-section-form)
10
+ [GitHub](https://github.com/fable-retold/pict-section-form)
11
11
  [Get Started](#pict-section-form)
12
+
13
+ <!-- docuserve:examples:start -->
14
+ | Example | Complexity | Launch |
15
+ |---------|------------|--------|
16
+ | [Change Tracking](examples/change%5Ftracking/README.md) | Intermediate | [Launch](examples/change%5Ftracking/index.html) |
17
+ | [Dynamic Analysis](examples/dynamic%5Fanalysis/README.md) | Advanced | [Launch](examples/dynamic%5Fanalysis/index.html) |
18
+ | [Gradebook](examples/gradebook/README.md) | Intermediate | [Launch](examples/gradebook/index.html) |
19
+ | [NDT Field Test](examples/ndt%5Ffield%5Ftest/README.md) | Advanced | [Launch](examples/ndt%5Ffield%5Ftest/index.html) |
20
+ | [Scope Mathematics](examples/scope%5Fmathematics/README.md) | Intermediate | [Launch](examples/scope%5Fmathematics/index.html) |
21
+ | [Simple Table](examples/simple%5Ftable/README.md) | Basic | [Launch](examples/simple%5Ftable/index.html) |
22
+ <!-- docuserve:examples:end -->