@ramstack/alpinegear-format 1.2.4 → 1.3.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.
package/README.md CHANGED
@@ -197,6 +197,11 @@ Provides the `x-hotkey` directive, which allows you to easily handle keyboard sh
197
197
  **[@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>
198
198
  Provides the `x-router` and `x-route` directives, which enable client-side navigation and routing functionality within your Alpine.js application.
199
199
 
200
+ **[@ramstack/alpinegear-dialog](https://www.npmjs.com/package/@ramstack/alpinegear-dialog)** ([README](https://github.com/rameel/ramstack.alpinegear.js/tree/main/src/plugins/dialog))<br>
201
+ Provides a headless dialog directive for Alpine.js based on the native HTML `<dialog>` element.
202
+ It supports declarative composition, value-based close semantics, and both modal and non-modal dialogs,
203
+ with optional Promise-based imperative control.
204
+
200
205
 
201
206
  ## Contributions
202
207
  Bug reports and contributions are welcome.
@@ -38,19 +38,19 @@ function plugin({ directive, evaluateLater, mutateDom }) {
38
38
 
39
39
  case Node.ELEMENT_NODE:
40
40
  if (node !== el) {
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
41
+ //
42
+ // When we encounter an element with the "x-data" attribute, its properties
43
+ // are not yet initialized, and the Alpine context is unavailable.
44
+ // Attempting to use these properties will result in
45
+ // an "Alpine Expression Error: [expression] is not defined".
46
+ //
47
+ // Workaround:
48
+ // To avoid this, we manually add our "x-format" directive to the element.
49
+ // Alpine evaluates "x-format" directive once the context is initialized.
50
+ // In the current loop, we skip these elements to defer their processing.
51
+ //
52
+ // This also handles cases where the user manually adds the "x-format" attribute.
53
+ //
54
54
  if (node.hasAttribute("x-data") && !has_format_attr(node)) {
55
55
  node.setAttribute("x-format", "");
56
56
  }
@@ -109,4 +109,4 @@ function plugin({ directive, evaluateLater, mutateDom }) {
109
109
  });
110
110
  }
111
111
 
112
- export { plugin as format };
112
+ export { plugin as format };
@@ -41,19 +41,19 @@
41
41
 
42
42
  case Node.ELEMENT_NODE:
43
43
  if (node !== el) {
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
44
+ //
45
+ // When we encounter an element with the "x-data" attribute, its properties
46
+ // are not yet initialized, and the Alpine context is unavailable.
47
+ // Attempting to use these properties will result in
48
+ // an "Alpine Expression Error: [expression] is not defined".
49
+ //
50
+ // Workaround:
51
+ // To avoid this, we manually add our "x-format" directive to the element.
52
+ // Alpine evaluates "x-format" directive once the context is initialized.
53
+ // In the current loop, we skip these elements to defer their processing.
54
+ //
55
+ // This also handles cases where the user manually adds the "x-format" attribute.
56
+ //
57
57
  if (node.hasAttribute("x-data") && !has_format_attr(node)) {
58
58
  node.setAttribute("x-format", "");
59
59
  }
@@ -114,4 +114,4 @@
114
114
 
115
115
  document.addEventListener("alpine:init", () => { Alpine.plugin(plugin); });
116
116
 
117
- })();
117
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramstack/alpinegear-format",
3
- "version": "1.2.4",
3
+ "version": "1.3.0",
4
4
  "description": "@ramstack/alpinegear-format provides 'x-format' Alpine.js directive, which allows you to easily interpolate text using a template syntax similar to what's available in Vue.js.",
5
5
  "author": "Rameel Burhan",
6
6
  "license": "MIT",