@ramstack/alpinegear-format 1.1.0 → 1.1.1

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.
@@ -1 +1 @@
1
- function e(e,...t){const n=e(...t);return()=>{let e;return n((t=>e=t)),t=e,"function"==typeof t?.get?e.get():e;var t}}function t({directive:t,evaluateLater:n,mutateDom:o}){t("format",((t,{modifiers:c},{effect:a})=>{const r=/{{(?<expr>.+?)}}/g,f=(e=>e.includes("once"))(c);function i(e){f?o((()=>e())):a((()=>o((()=>e()))))}!function t(c){switch(c.nodeType){case Node.TEXT_NODE:!function(t){const c=t.textContent.split(r);if(c.length>1){const a=new DocumentFragment;for(let o=0;c.length>o;o++)if(o%2==0)a.appendChild(document.createTextNode(c[o]));else{const r=e(n,t.parentNode,c[o]),f=document.createTextNode("");a.append(f),i((()=>f.textContent=r()))}o((()=>t.parentElement.replaceChild(a,t)))}}(c);break;case Node.ELEMENT_NODE:!function(e){for(let n of e.childNodes)t(n)}(c),function(t){for(let o of t.attributes)if([...o.value.matchAll(r)].length){const c=o.value;i((()=>o.value=c.replace(r,((o,c)=>e(n,t,c)()))))}}(c)}}(t)}))}export{t as format};
1
+ function e(e,...t){const n=e(...t);return()=>{let e;return n(t=>e=t),t=e,"function"==typeof t?.get?e.get():e;var t}}function t({directive:t,evaluateLater:n,mutateDom:o}){t("format",(t,{modifiers:c},{effect:a})=>{const r=/{{(?<expr>.+?)}}/g,f=(e=>e.includes("once"))(c);function i(e){f?o(()=>e()):a(()=>o(()=>e()))}!function t(c){switch(c.nodeType){case Node.TEXT_NODE:!function(t){const c=t.textContent.split(r);if(c.length>1){const a=new DocumentFragment;for(let o=0;c.length>o;o++)if(o%2==0)a.appendChild(document.createTextNode(c[o]));else{const r=e(n,t.parentNode,c[o]),f=document.createTextNode("");a.append(f),i(()=>f.textContent=r())}o(()=>t.parentElement.replaceChild(a,t))}}(c);break;case Node.ELEMENT_NODE:!function(e){for(let n of e.childNodes)t(n)}(c),function(t){for(let o of t.attributes)if([...o.value.matchAll(r)].length){const c=o.value;i(()=>o.value=c.replace(r,(o,c)=>e(n,t,c)()))}}(c)}}(t)})}export{t as format};
@@ -1 +1 @@
1
- !function(){"use strict";function e(e,...t){const n=e(...t);return()=>{let e;return n((t=>e=t)),t=e,"function"==typeof t?.get?e.get():e;var t}}function t({directive:t,evaluateLater:n,mutateDom:o}){t("format",((t,{modifiers:c},{effect:i})=>{const a=/{{(?<expr>.+?)}}/g,l=(e=>e.includes("once"))(c);function r(e){l?o((()=>e())):i((()=>o((()=>e()))))}!function t(c){switch(c.nodeType){case Node.TEXT_NODE:!function(t){const c=t.textContent.split(a);if(c.length>1){const i=new DocumentFragment;for(let o=0;c.length>o;o++)if(o%2==0)i.appendChild(document.createTextNode(c[o]));else{const a=e(n,t.parentNode,c[o]),l=document.createTextNode("");i.append(l),r((()=>l.textContent=a()))}o((()=>t.parentElement.replaceChild(i,t)))}}(c);break;case Node.ELEMENT_NODE:!function(e){for(let n of e.childNodes)t(n)}(c),function(t){for(let o of t.attributes)if([...o.value.matchAll(a)].length){const c=o.value;r((()=>o.value=c.replace(a,((o,c)=>e(n,t,c)()))))}}(c)}}(t)}))}document.addEventListener("alpine:init",(()=>{Alpine.plugin(t)}))}();
1
+ !function(){"use strict";function e(e,...t){const n=e(...t);return()=>{let e;return n(t=>e=t),t=e,"function"==typeof t?.get?e.get():e;var t}}function t({directive:t,evaluateLater:n,mutateDom:o}){t("format",(t,{modifiers:c},{effect:i})=>{const a=/{{(?<expr>.+?)}}/g,l=(e=>e.includes("once"))(c);function r(e){l?o(()=>e()):i(()=>o(()=>e()))}!function t(c){switch(c.nodeType){case Node.TEXT_NODE:!function(t){const c=t.textContent.split(a);if(c.length>1){const i=new DocumentFragment;for(let o=0;c.length>o;o++)if(o%2==0)i.appendChild(document.createTextNode(c[o]));else{const a=e(n,t.parentNode,c[o]),l=document.createTextNode("");i.append(l),r(()=>l.textContent=a())}o(()=>t.parentElement.replaceChild(i,t))}}(c);break;case Node.ELEMENT_NODE:!function(e){for(let n of e.childNodes)t(n)}(c),function(t){for(let o of t.attributes)if([...o.value.matchAll(a)].length){const c=o.value;r(()=>o.value=c.replace(a,(o,c)=>e(n,t,c)()))}}(c)}}(t)})}document.addEventListener("alpine:init",()=>{Alpine.plugin(t)})}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramstack/alpinegear-format",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
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",