@muscara/htmx-jsonata 0.0.7 → 0.0.9

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 (2) hide show
  1. package/README.md +37 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ```html
6
6
  <!-- ... include jsonata -->
7
7
  <!-- ... include htmx -->
8
- <script src="https://unpkg.com/@muscara/htmx-jsonata@0.0.6/htmx-jsonata.min.js"></script>
8
+ <script src="https://unpkg.com/@muscara/htmx-jsonata@latest/htmx-jsonata.min.js"></script>
9
9
  ```
10
10
 
11
11
  > [!TIP]
@@ -18,6 +18,41 @@
18
18
  - `jn-path`: specifies a path to nested data (supports dot notation).
19
19
  - `jn-each`: marks an element as a template to be cloned for each item in an array response.
20
20
 
21
- ## try it
21
+ ## example
22
+
23
+ ```html
24
+ <div
25
+ jn-url="https://status.powerschool.com/api/v2/summary.json"
26
+ jn-query="
27
+ components.(
28
+ $ConvertDate := function($date) {
29
+ $toMillis($date) ~> $fromMillis('[M]/[D]/[Y]')
30
+ };
31
+
32
+ {
33
+ 'name': name,
34
+ 'status': 'status',
35
+ 'updated': $ConvertDate(updated_at)
36
+ }
37
+ )
38
+ "
39
+ >
40
+ <ul>
41
+ <li jn-each>
42
+ <p>
43
+ <span jn-path="name"></span>
44
+ <strong jn-path="status"></strong>
45
+ <small>
46
+ <em>
47
+ (last updated: <span jn-path="updated"></span>)
48
+ </em>
49
+ </small>
50
+ </p>
51
+ </li>
52
+ </ul>
53
+ </div>
54
+ ```
55
+
56
+ ## playground
22
57
 
23
58
  for live examples, use the [playground](https://htmx-jsonata.kevinmuscara.deno.net/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muscara/htmx-jsonata",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "htmx extension that provides jsonata query functionality for htmx elements",
5
5
  "main": "htmx-jsonata.min.js",
6
6
  "scripts": {