@ramstack/alpinegear-hotkey 1.2.2 → 1.2.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 +52 -14
  2. package/package.json +8 -2
package/README.md CHANGED
@@ -18,7 +18,7 @@ To include the CDN version of this plugin, add the following `<script>` tag befo
18
18
  <script src="https://cdn.jsdelivr.net/npm/@ramstack/alpinegear-hotkey@1/alpinegear-hotkey.min.js" defer></script>
19
19
 
20
20
  <!-- alpine.js -->
21
- <script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
21
+ <script src="https://cdn.jsdelivr.net/npm/alpinejs@3/dist/cdn.min.js" defer></script>
22
22
  ```
23
23
 
24
24
  ### Using NPM
@@ -46,7 +46,7 @@ Here's a simple example:
46
46
 
47
47
  ```html
48
48
  <div x-data x-hotkey.shift+f.window="console.log($event.hotkey)">
49
- Hello, World!
49
+ Hello, World!
50
50
  </div>
51
51
  ```
52
52
 
@@ -72,9 +72,9 @@ Also, the `x-hotkey` automatically passes the event object as the first argument
72
72
  <div x-data x-hotkey.shift+f.window="handle"></div>
73
73
 
74
74
  <script>
75
- function handle(e) {
76
- console.log(e);
77
- }
75
+ function handle(e) {
76
+ console.log(e);
77
+ }
78
78
  </script>
79
79
  ```
80
80
 
@@ -115,7 +115,7 @@ This property contains the string representation of the hotkey.
115
115
 
116
116
  ```html
117
117
  <div x-data x-hotkey.ctrl+shift+f.alt+u.window="console.log($event.hotkey)">
118
- Hello, World!
118
+ Hello, World!
119
119
  </div>
120
120
  ```
121
121
 
@@ -133,9 +133,9 @@ If you want to prevent hotkey handling from being triggered by specific elements
133
133
 
134
134
  ```html
135
135
  <div x-hotkey.shift+k="...">
136
- ...
137
- <!-- Ignoring hotkeys from the input element -->
138
- <input type="text" data-hotkey-ignore>
136
+ ...
137
+ <!-- Ignoring hotkeys from the input element -->
138
+ <input type="text" data-hotkey-ignore>
139
139
  </div>
140
140
  ```
141
141
 
@@ -143,12 +143,12 @@ You can also exclude a group of elements by applying the attribute to their pare
143
143
 
144
144
  ```html
145
145
  <div x-hotkey.shift+k="...">
146
- ...
146
+ ...
147
147
 
148
- <!-- Ignoring hotkeys from all elements within the form -->
149
- <form data-hotkey-ignore>
150
- ...
151
- </form>
148
+ <!-- Ignoring hotkeys from all elements within the form -->
149
+ <form data-hotkey-ignore>
150
+ ...
151
+ </form>
152
152
  </div>
153
153
  ```
154
154
 
@@ -157,6 +157,44 @@ You can find the source code for this plugin on GitHub:
157
157
 
158
158
  https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/hotkey
159
159
 
160
+
161
+ ## Related projects
162
+
163
+ **[@ramstack/alpinegear-main](https://www.npmjs.com/package/@ramstack/alpinegear-main)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/main))<br>
164
+ Provides a combined plugin that includes several useful directives.
165
+ This package aggregates multiple individual plugins, offering a convenient all-in-one bundle.
166
+ Included directives: `x-bound`, `x-format`, `x-fragment`, `x-match`, `x-template`, and `x-when`.
167
+
168
+ **[@ramstack/alpinegear-bound](https://www.npmjs.com/package/@ramstack/alpinegear-bound)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/bound))<br>
169
+ Provides the `x-bound` directive, which allows for two-way binding of input elements and their associated data properties.
170
+ It works similarly to the binding provided by [Svelte](https://svelte.dev/docs/element-directives#bind-property)
171
+ and also supports synchronizing values between two `Alpine.js` data properties.
172
+
173
+ **[@ramstack/alpinegear-format](https://www.npmjs.com/package/@ramstack/alpinegear-format)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/format))<br>
174
+ Provides the `x-format` directive, which allows you to easily interpolate text using a template syntax similar to what's available in `Vue.js`.
175
+
176
+ **[@ramstack/alpinegear-template](https://www.npmjs.com/package/@ramstack/alpinegear-template)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/template))<br>
177
+ Provides the `x-template` directive, which allows you to define a template once anywhere in the DOM and reference it by its ID.
178
+
179
+ **[@ramstack/alpinegear-fragment](https://www.npmjs.com/package/@ramstack/alpinegear-fragment)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/fragment))<br>
180
+ Provides the `x-fragment` directive, which allows for fragment-like behavior similar to what's available in frameworks
181
+ like `Vue.js` or `React`, where multiple root elements can be grouped together.
182
+
183
+ **[@ramstack/alpinegear-match](https://www.npmjs.com/package/@ramstack/alpinegear-match)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/match))<br>
184
+ Provides the `x-match` directive, which functions similarly to the `switch` statement in many programming languages,
185
+ allowing you to conditionally render elements based on matching cases.
186
+
187
+ **[@ramstack/alpinegear-when](https://www.npmjs.com/package/@ramstack/alpinegear-when)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/when))<br>
188
+ Provides the `x-when` directive, which allows for conditional rendering of elements similar to `x-if`, but supports multiple root elements.
189
+
190
+ **[@ramstack/alpinegear-destroy](https://www.npmjs.com/package/@ramstack/alpinegear-destroy)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/destroy))<br>
191
+ Provides the `x-destroy` directive, which is the opposite of `x-init` and allows you to hook into the cleanup phase
192
+ of any element, running a callback when the element is removed from the DOM.
193
+
194
+ **[@ramstack/alpinegear-router](https://www.npmjs.com/package/@ramstack/alpinegear-router)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/router))<br>
195
+ Provides the `x-router` and `x-route` directives, which enable client-side navigation and routing functionality within your Alpine.js application.
196
+
197
+
160
198
  ## Contributions
161
199
  Bug reports and contributions are welcome.
162
200
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramstack/alpinegear-hotkey",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "@ramstack/alpinegear-hotkey provides 'x-hotkey' Alpine.js directive, allowing easily handle keyboard shortcuts.",
5
5
  "author": "Rameel Burhan",
6
6
  "license": "MIT",
@@ -11,7 +11,13 @@
11
11
  },
12
12
  "keywords": [
13
13
  "alpine.js",
14
- "alpinejs"
14
+ "alpinejs",
15
+ "hotkey",
16
+ "shortcut",
17
+ "alpinejs-hotkey",
18
+ "alpinejs-shortcut",
19
+ "alpinejs-directive",
20
+ "alpinejs-plugin"
15
21
  ],
16
22
  "main": "alpinegear-hotkey.js",
17
23
  "module": "alpinegear-hotkey.esm.js"