@muscara/htmx-jsonata 0.0.2 → 0.0.4

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 +13 -15
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,32 +2,30 @@
2
2
 
3
3
  [htmx extension](https://htmx.org/extensions) that provides [jsonata](https://jsonata.org) query functionality for htmx elements
4
4
 
5
- add the following to your project to begin.
5
+ add the following to your project to begin. **make sure you import after htmx and jsonata**
6
6
  ```html
7
- <script src="https://unpkg.com/@muscara/htmx-jsonata@0.0.2/htmx-jsonata.min.js"></script>
8
- <!-- ... include htmx -->
9
7
  <!-- ... include jsonata -->
8
+ <!-- ... include htmx -->
9
+ <script src="https://unpkg.com/@muscara/htmx-jsonata/htmx-jsonata.min.js"></script>
10
10
  ```
11
11
 
12
12
  > only GET request method is supported
13
13
 
14
14
  ## usage
15
15
 
16
- ```html
17
- <script src="https://unpkg.com/@muscara/htmx-jsonata@0.0.1/htmx-jsonata.min.js"></script>
18
- <script src="https://unpkg.com/htmx.org@1.9.10"></script>
19
- <script src="https://cdn.jsdelivr.net/npm/jsonata@2.0.3/jsonata.min.js"></script>
16
+ attributes:
17
+
18
+ - `jsonata-url` (required): the JSON API URL to fetch data from.
19
+
20
+ - `jsonata`: jsonata expression to filter, transform, or query the JSON response.
21
+
22
+ - `jsonata-property`: specifies which property from the parsed result to display in the element.
20
23
 
24
+ example use:
25
+
26
+ ```html
21
27
  <div jsonata-url="https://jsonplaceholder.typicode.com/users" jsonata="$[name='Leanne Graham']">
22
28
  <h1 jsonata-property="name"></h1>
23
29
  <p jsonata-property="phone"></p>
24
30
  </div>
25
31
  ```
26
-
27
- ### attributes
28
-
29
- `jsonata-url` (required): the JSON API URL to fetch data from.
30
-
31
- `jsonata`: jsonata expression to filter, transform, or query the JSON response.
32
-
33
- `jsonata-property`: specifies which property from the parsed result to display in the element.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@muscara/htmx-jsonata",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "htmx extension that provides jsonata query functionality for htmx elements",
5
- "main": "htmx-jsonata.js",
5
+ "main": "htmx-jsonata.min.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },