@ea-lab/reactive-json-docs 2.8.0 → 2.10.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 (34) hide show
  1. package/package.json +2 -2
  2. package/public/rjbuild/docs/core/element/form/CheckBoxField.md +142 -18
  3. package/public/rjbuild/docs/core/element/form/CheckBoxField.yaml +132 -7
  4. package/public/rjbuild/docs/core/element/form/SelectField.md +36 -10
  5. package/public/rjbuild/docs/core/element/form/SelectField.yaml +37 -3
  6. package/public/rjbuild/docs/core/element/form/formElementsCommon.md +32 -0
  7. package/public/rjbuild/docs/core/element/html/Html.yaml +47 -0
  8. package/public/rjbuild/docs/core/element/html/LabelFromValue.md +159 -0
  9. package/public/rjbuild/docs/core/element/html/LabelFromValue.yaml +163 -10
  10. package/public/rjbuild/docs/core/example/native-html-forms.md +19 -2
  11. package/public/rjbuild/docs/core/reaction/collectField.md +51 -0
  12. package/public/rjbuild/docs/core/reaction/collectField.yaml +81 -0
  13. package/public/rjbuild/docs/core/reaction/fetchData.md +21 -1
  14. package/public/rjbuild/docs/core/reaction/fetchData.yaml +2 -2
  15. package/public/rjbuild/docs/core/reaction/index.md +5 -0
  16. package/public/rjbuild/docs/core/reaction/index.yaml +5 -0
  17. package/public/rjbuild/docs/core/reaction/joinData.md +51 -0
  18. package/public/rjbuild/docs/core/reaction/joinData.yaml +87 -0
  19. package/public/rjbuild/docs/core/reaction/printPage.md +22 -0
  20. package/public/rjbuild/docs/core/reaction/printPage.yaml +29 -0
  21. package/public/rjbuild/docs/core/reaction/redirectNow.md +20 -2
  22. package/public/rjbuild/docs/core/reaction/redirectNow.yaml +24 -3
  23. package/public/rjbuild/docs/core/reaction/setClipboardData.md +35 -6
  24. package/public/rjbuild/docs/core/reaction/setClipboardData.yaml +18 -6
  25. package/public/rjbuild/docs/core/reaction/stringifyData.md +45 -0
  26. package/public/rjbuild/docs/core/reaction/stringifyData.yaml +58 -0
  27. package/public/rjbuild/docs/core/reaction/submitData.md +1 -1
  28. package/public/rjbuild/docs/core/reaction/submitData.yaml +4 -2
  29. package/public/rjbuild/docs/core/reaction/toggleData.md +72 -0
  30. package/public/rjbuild/docs/core/reaction/toggleData.yaml +77 -0
  31. package/public/rjbuild/docs/getting-started/reactions.md +5 -0
  32. package/public/rjbuild/docs/getting-started/reactions.yaml +5 -0
  33. package/public/rjbuild/docs/getting-started/rjbuild-structure.md +19 -1
  34. package/public/rjbuild/docs/getting-started/rjbuild-structure.yaml +21 -1
@@ -71,6 +71,10 @@ Reactive-JSON provides several built-in reactions:
71
71
  - **addData**: Adds new data to the specified path.
72
72
  - **removeData**: Removes data from the specified path.
73
73
  - **moveData**: Moves data from one path to another.
74
+ - **toggleData**: Adds a value to an array when absent, removes it when present.
75
+ - **collectField**: Writes the values of a field of every item of a collection as an array.
76
+ - **joinData**: Writes a string built from several parts.
77
+ - **stringifyData**: Writes the JSON representation of a value.
74
78
 
75
79
  ### Network Operations
76
80
  - **fetchData**: Fetches data from a URL using GET requests.
@@ -81,6 +85,7 @@ Reactive-JSON provides several built-in reactions:
81
85
  - **redirectNow**: Performs an immediate redirect.
82
86
  - **triggerEvent**: Triggers a custom event.
83
87
  - **postMessage**: Sends a message to another window/frame.
88
+ - **printPage**: Opens the print dialog of the browser.
84
89
 
85
90
  For detailed documentation of each reaction, including properties and examples, see their respective documentation pages.
86
91
 
@@ -96,6 +96,10 @@ renderView:
96
96
  - **[addData](../core/reaction/addData)**: Adds new data to the specified path.
97
97
  - **[removeData](../core/reaction/removeData)**: Removes data from the specified path.
98
98
  - **[moveData](../core/reaction/moveData)**: Moves data from one path to another.
99
+ - **[toggleData](../core/reaction/toggleData)**: Adds a value to an array when absent, removes it when present.
100
+ - **[collectField](../core/reaction/collectField)**: Writes the values of a field of every item of a collection as an array.
101
+ - **[joinData](../core/reaction/joinData)**: Writes a string built from several parts.
102
+ - **[stringifyData](../core/reaction/stringifyData)**: Writes the JSON representation of a value.
99
103
 
100
104
  ### Network Operations
101
105
  - **[fetchData](../core/reaction/fetchData)**: Fetches data from a URL using GET requests.
@@ -106,6 +110,7 @@ renderView:
106
110
  - **[redirectNow](../core/reaction/redirectNow)**: Performs an immediate redirect.
107
111
  - **[triggerEvent](../core/reaction/triggerEvent)**: Triggers a custom event.
108
112
  - **[postMessage](../core/reaction/postMessage)**: Sends a message to another window/frame.
113
+ - **[printPage](../core/reaction/printPage)**: Opens the print dialog of the browser.
109
114
 
110
115
  For detailed documentation of each reaction, including properties and examples, see their respective documentation pages.
111
116
 
@@ -355,7 +355,7 @@ additionalDataSource:
355
355
 
356
356
  #### Mixing all three types
357
357
 
358
- Path parts (plain strings, `~~.`/`~.` strings, and `segment` objects) are concatenated in order. All `param` objects are collected and appended as a query string after the path.
358
+ Path parts (plain strings, `~~.`/`~.` strings, and `segment` objects) are concatenated in order. All `param` objects are collected and appended as a query string after the path. When the path already holds a query string (`/api/items?sort=asc`), the parameters continue it with `&`.
359
359
 
360
360
  ```yaml
361
361
  additionalDataSource:
@@ -400,6 +400,24 @@ data:
400
400
  timeLogs: []
401
401
  ```
402
402
 
403
+ #### The same format elsewhere
404
+
405
+ The segments format is also accepted by:
406
+
407
+ - `url` of the [fetchData](../core/reaction/fetchData.md) and [submitData](../core/reaction/submitData.md) reactions: no request is sent when a required segment is empty;
408
+ - `to` of the [redirectNow](../core/reaction/redirectNow.md) reaction: no navigation when a required segment is empty;
409
+ - the URL attributes (`href`, `src`, `action`, `formAction`, `poster`) of any element: the attribute is omitted when a required segment is empty;
410
+ - `parts` of the [joinData](../core/reaction/joinData.md) reaction, which writes the composed string in the data.
411
+
412
+ There, the references are evaluated in the current template context: `~.slug` reads the current template data (e.g. the current `Switch` item), `~~.` the global data, `~>key` an ancestor. In `additionalDataSource.src`, both `~.` and `~~.` read the root data.
413
+
414
+ ```yaml
415
+ - type: a
416
+ attributes:
417
+ href: ["/article/", ~.year, "/", { segment: ~.slug, required: true }]
418
+ content: ~.title
419
+ ```
420
+
403
421
  ### Fallback Sources
404
422
 
405
423
  The `fallbackDataSource` property defines an alternate source that is tried automatically when the primary source cannot be used. It accepts the same structure as a regular `additionalDataSource` item, including its own `fallbackDataSource` for chaining.
@@ -379,7 +379,7 @@ renderView:
379
379
 
380
380
  #### Mixing all three types
381
381
 
382
- Path parts (plain strings, `~~.`/`~.` strings, and `segment` objects) are concatenated in order. All `param` objects are collected and appended as a query string after the path.
382
+ Path parts (plain strings, `~~.`/`~.` strings, and `segment` objects) are concatenated in order. All `param` objects are collected and appended as a query string after the path. When the path already holds a query string (`/api/items?sort=asc`), the parameters continue it with `&`.
383
383
 
384
384
  - type: TabbedSerializer
385
385
  yamlSerializedContent: |
@@ -428,6 +428,26 @@ renderView:
428
428
  taskId: "" # Will be overridden by dataOverride
429
429
  timeLogs: []
430
430
 
431
+ - type: Markdown
432
+ content: |
433
+ #### The same format elsewhere
434
+
435
+ The segments format is also accepted by:
436
+
437
+ - `url` of the [fetchData](../core/reaction/fetchData) and [submitData](../core/reaction/submitData) reactions: no request is sent when a required segment is empty;
438
+ - `to` of the [redirectNow](../core/reaction/redirectNow) reaction: no navigation when a required segment is empty;
439
+ - the URL attributes (`href`, `src`, `action`, `formAction`, `poster`) of any element: the attribute is omitted when a required segment is empty;
440
+ - `parts` of the [joinData](../core/reaction/joinData) reaction, which writes the composed string in the data.
441
+
442
+ There, the references are evaluated in the current template context: `~.slug` reads the current template data (e.g. the current `Switch` item), `~~.` the global data, `~>key` an ancestor. In `additionalDataSource.src`, both `~.` and `~~.` read the root data.
443
+
444
+ ```yaml
445
+ - type: a
446
+ attributes:
447
+ href: ["/article/", ~.year, "/", { segment: ~.slug, required: true }]
448
+ content: ~.title
449
+ ```
450
+
431
451
  - type: Markdown
432
452
  content: |
433
453