Update tags and embedded version to v4 alpha8
This commit is contained in:
1 parent
de75672bb3
commit
0b4e52389d
9 files changed
+17
-19
No files matched your search
@@ -3,7 +3,7 @@
|
||||
module Giraffe.Htmx.Common
|
||||
|
||||
/// <summary>The version of htmx embedded in the package</summary>
|
||||
let HtmxVersion = "4.0.0-alpha6"
|
||||
let HtmxVersion = "4.0.0-alpha8"
|
||||
|
||||
/// <summary>The path for the provided htmx script</summary>
|
||||
let internal htmxLocalScript = $"/_content/Giraffe.Htmx.Common/htmx.min.js?ver={HtmxVersion}"
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
This package contains common code shared between [`Giraffe.Htmx`](https://www.nuget.org/packages/Giraffe.Htmx) and [`Giraffe.ViewEngine.Htmx`](https://www.nuget.org/packages/Giraffe.ViewEngine.Htmx), and will be automatically installed when you install either one. It also contains htmx as a static web asset, allowing it to be loaded from your local (or published) project.
|
||||
|
||||
**htmx version: 4.0.0-alpha6**
|
||||
**htmx version: 4.0.0-alpha8**
|
||||
|
||||
_**NOTE:** Pay special attention to breaking changes highlighted in the packages listed above._
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
var htmx=(()=>{class e{#e=null;#t=[];issue(e,t){return e.queueStrategy=t,this.#e?"replace"===t||"abort"!==t&&"abort"===this.#e.queueStrategy?(this.#t.map(e=>e.status="dropped"),this.#t=[],this.#e.request.abort(),this.#e=e,!0):("queue all"===t?(this.#t.push(e),e.status="queued"):"drop"===t?e.status="dropped":"queue last"===t?(this.#t.map(e=>e.status="dropped"),this.#t=[e],e.status="queued"):0===this.#t.length&&"abort"!==t?(this.#t.push(e),e.status="queued"):e.status="dropped",!1):(this.#e=e,!0)}finish(){this.#e=null}next(){return this.#t.shift()}abort(){this.#e?.abort?.()}more(){return this.#t?.length}}return new class{#r=new Map;#i="";#s=new Set;#n;#a;#o="a,form";#l=["get","post","put","patch","delete"];#h;#c;#u;constructor(){this.#d(),this.#f(),this.#a=`[${this.#m("hx-action")}],[${this.#m("hx-get")}],[${this.#m("hx-post")}],[${this.#m("hx-put")}],[${this.#m("hx-patch")}],[${this.#m("hx-delete")}]`,this.#h=(new XPathEvaluator).createExpression(`.//*[@*[ starts-with(name(), "${this.#m("hx-on")}")]]`),this.#n={attributeValue:this.#p.bind(this),parseTriggerSpecs:this.#g.bind(this),determineMethodAndAction:this.#x.bind(this),createRequestContext:this.#b.bind(this),collectFormData:this.#y.bind(this),handleHxVals:this.#v.bind(this),insertContent:this.#S.bind(this),morph:this.#E.bind(this)},document.addEventListener("DOMContentLoaded",()=>{this.#w(),this.process(document.body)})}#d(){this.config={version:"4.0.0-alpha6",logAll:!1,prefix:"",transitions:!1,history:!0,mode:"same-origin",defaultSwap:"innerHTML",indicatorClass:"htmx-indicator",requestClass:"htmx-request",includeIndicatorCSS:!0,defaultTimeout:6e4,extensions:"",sse:{reconnect:!1,reconnectDelay:500,reconnectMaxDelay:6e4,reconnectMaxAttempts:10,reconnectJitter:.3,pauseInBackground:!1},morphIgnore:["data-htmx-powered"],morphScanLimit:10,noSwap:[204,304],implicitInheritance:!1};let e=document.querySelector('meta[name="htmx-config"]');e&&this.#C(e.content,this.config),this.#i=this.config.extensions}#f(){if(!1!==this.config.includeIndicatorCSS){let e="";this.config.inlineStyleNonce&&(e=` nonce="${this.config.inlineStyleNonce}"`);let t=this.config.indicatorClass,r=this.config.requestClass;document.head.insertAdjacentHTML("beforeend",`<style${e}>.${t}{opacity:0;visibility: hidden} .${r} .${t}, .${r}.${t}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}</style>`)}}registerExtension(e,t){return!(this.#i&&!this.#i.split(/,\s*/).includes(e))&&(!this.#s.has(e)&&(this.#s.add(e),t.init&&t.init(this.#n),void Object.entries(t).forEach(([e,t])=>{this.#r.get(e)?.push(t)||this.#r.set(e,[t])})))}#q(e){return!e.closest||null!=e.closest(`[${this.#m("hx-ignore")}]`)}#m(e){return this.config.prefix?e.replace("hx-",this.config.prefix):e}#A(e,t){let r=[...e.querySelectorAll(t)];return e.matches?.(t)&&r.unshift(e),r}#T(e){return"before"===e?"beforebegin":"after"===e?"afterend":"prepend"===e?"afterbegin":"append"===e?"beforeend":e}#M(e,t){let r=[];return this.#p(e,t,void 0,(e,t)=>{e?.split(/\s*,\s*/).includes("this")&&r.push(t)}),r}#p(e,t,r,i){let s=(t=this.#m(t))+this.#N(":append"),n=t+(this.config.implicitInheritance?"":this.#N(":inherited")),a=t+this.#N(":inherited:append");if(e.hasAttribute(t)){let r=e.getAttribute(t);return i?i(r,e):r}if(e.hasAttribute(n)){let t=e.getAttribute(n);return i?i(t,e):t}if(e.hasAttribute(s)||e.hasAttribute(a)){let r=e.getAttribute(s)||e.getAttribute(a),o=e.parentNode?.closest?.(`[${CSS.escape(n)}],[${CSS.escape(a)}]`);if(i&&i(r,e),o){let e=this.#p(o,t,void 0,i);return e?(e+","+r).replace(/[{}]/g,""):r}return r}let o=e.parentNode?.closest?.(`[${CSS.escape(n)}],[${CSS.escape(a)}]`);if(o){let r=this.#p(o,t,void 0,i);return!i&&r&&this.config.implicitInheritance&&this.#I(e,"htmx:after:implicitInheritance",{elt:e,name:t,parent:o}),r}return r}#H(e){if("{"===e[0])return JSON.parse(e);return[...e.matchAll(/(?:"([^"]+)"|([^\s,:]+))(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|<([^>]+)\/>|([^\s,]+)))?(?=\s|,|$)/g)].reduce((e,t)=>{let r=(t[1]??t[2]).split("."),i=(t[3]??t[4]??t[5]??t[6]??"true").trim();return"true"===i?i=!0:"false"===i?i=!1:/^\d+$/.test(i)&&(i=parseInt(i)),r.slice(0,-1).reduce((e,t)=>e[t]??={},e)[r.at(-1)]=i,e},{})}#C(e,t){let r=this.#H(e);for(let e in r){let i=r[e];i&&"object"==typeof i&&!Array.isArray(i)&&t[e]?Object.assign(t[e],i):t[e]=i}return t}#g(e){return e.split(",").map(e=>{let t=e.match(/^\s*(\S+\[[^\]]*\]|\S+)\s*(.*?)\s*$/);if(!t||!t[1])return null;if(t[1].includes("[")&&!t[1].includes("]"))throw"unterminated:"+t[1];let r=t[2]?this.#H(t[2]):{};return r.name=t[1],r}).filter(e=>e)}#x(e,t){if(this.#O(e))return this.#L(e,t);{let t=this.#p(e,"hx-method")||"GET",r=this.#p(e,"hx-action");if(!r)for(let i of this.#l){let s=this.#p(e,"hx-"+i);if(s){r=s,t=i;break}}return t=t.toUpperCase(),{action:r,method:t}}}#L(e,t){if(e.matches("a"))return{action:e.getAttribute("href"),method:"GET"};return{action:t.submitter?.getAttribute?.("formAction")||e.getAttribute("action"),method:t.submitter?.getAttribute?.("formMethod")||e.getAttribute("method")||"GLine truncated
|
||||
var htmx=(()=>{class e{#e=null;#t=[];issue(e,t){return e.queueStrategy=t,this.#e?"replace"===t||"abort"!==t&&"abort"===this.#e.queueStrategy?(this.#t.forEach(e=>e.status="dropped"),this.#t=[],this.#e.request?.abort?.(),this.#e=e,!0):("queue all"===t?(this.#t.push(e),e.status="queued"):"drop"===t?e.status="dropped":"queue last"===t?(this.#t.forEach(e=>e.status="dropped"),this.#t=[e],e.status="queued"):0===this.#t.length&&"abort"!==t?(this.#t.push(e),e.status="queued"):e.status="dropped",!1):(this.#e=e,!0)}finish(){this.#e=null}next(){return this.#t.shift()}abort(){this.#e?.request?.abort?.()}more(){return this.#t?.length}}return new class{#r=new Map;#i="";#s=new Set;#n;#a;#o="a,form";#l=["get","post","put","patch","delete"];#h;#u;#c;#d;constructor(){this.#f(),this.#m(),this.#a=`[${this.#p("hx-action")}],[${this.#p("hx-get")}],[${this.#p("hx-post")}],[${this.#p("hx-put")}],[${this.#p("hx-patch")}],[${this.#p("hx-delete")}]`,this.#h=(new XPathEvaluator).createExpression(`.//*[@*[ starts-with(name(), "${this.#p("hx-on")}")]]`),this.#n={attributeValue:this.#g.bind(this),parseTriggerSpecs:this.#b.bind(this),determineMethodAndAction:this.#x.bind(this),createRequestContext:this.#y.bind(this),collectFormData:this.#v.bind(this),getAttributeObject:this.#S.bind(this),insertContent:this.#E.bind(this),morph:this.#w.bind(this),isSoftMatch:this.#C.bind(this),onTrigger:this.#A.bind(this),htmxProp:this.#q.bind(this),triggerHtmxEvent:this.#T.bind(this)};let e=()=>{this.#M(),this.process(document.body)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):setTimeout(e)}#f(){this.version="4.0.0-alpha8",this.config={logAll:!1,prefix:"",transitions:!1,history:!0,mode:"same-origin",defaultSwap:"innerHTML",defaultFocusScroll:!1,indicatorClass:"htmx-indicator",requestClass:"htmx-request",includeIndicatorCSS:!0,defaultTimeout:6e4,extensions:"",morphIgnore:["data-htmx-powered"],morphScanLimit:10,noSwap:[204,304],implicitInheritance:!1,defaultSettleDelay:1};let e=document.querySelector('meta[name="htmx-config"]');e&&this.#N(e.content,this.config),this.#i=this.config.extensions}#m(){if(!1!==this.config.includeIndicatorCSS){let e="";this.config.inlineStyleNonce&&(e=` nonce="${this.config.inlineStyleNonce}"`);let t=this.config.indicatorClass,r=this.config.requestClass;document.head.insertAdjacentHTML("beforeend",`<style${e}>.${t}{opacity:0;visibility: hidden} .${r} .${t}, .${r}.${t}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}</style>`)}}registerExtension(e,t){return!(this.#i&&!this.#i.split(/,\s*/).includes(e))&&(!this.#s.has(e)&&(this.#s.add(e),t.init&&t.init(this.#n),void Object.entries(t).forEach(([e,t])=>{this.#r.get(e)?.push(t)||this.#r.set(e,[t])})))}#H(e){return!e.closest||null!=e.closest(`[${this.#p("hx-ignore")}]`)}#p(e){return this.config.prefix?e.replace("hx-",this.config.prefix):e}#I(e,t){let r=[...e.querySelectorAll?.(t)??[]];return e.matches?.(t)&&r.unshift(e),r}#O(e){return"before"===e?"beforebegin":"after"===e?"afterend":"prepend"===e?"afterbegin":"append"===e?"beforeend":e}#L(e,t){let r=[];return this.#g(e,t,void 0,(e,t)=>{e?.split(/\s*,\s*/).includes("this")&&r.push(t)}),r}#g(e,t,r,i){let s=t,n=(t=this.#k(this.#p(t)))+this.#k(":append"),a=t+(this.config.implicitInheritance?"":this.#k(":inherited")),o=t+this.#k(":inherited:append");if(e.hasAttribute(t)){let r=e.getAttribute(t);return i?i(r,e):r}if(e.hasAttribute(a)){let t=e.getAttribute(a);return i?i(t,e):t}if(e.hasAttribute(n)||e.hasAttribute(o)){let t=e.getAttribute(n)||e.getAttribute(o),r=e.parentNode?.closest?.(`[${CSS.escape(a)}],[${CSS.escape(o)}]`);if(i&&i(t,e),r){let e=this.#g(r,s,void 0,i);return e?(e+","+t).replace(/[{}]/g,""):t}return t}let l=e.parentNode?.closest?.(`[${CSS.escape(a)}],[${CSS.escape(o)}]`);if(l){let r=this.#g(l,s,void 0,i);return!i&&r&&this.config.implicitInheritance&&this.#R(e,"htmx:after:implicitInheritance",{elt:e,name:t,parent:l}),r}return r}#j(e){if(!e)return{};if("{"===e[0])return JSON.parse(e);return[...e.matchAll(/(?:"([^"]+)"|([^\s,:]+))(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|<([^>]+)\/>|([^\s,]+)))?(?=\s|,|$)/g)].reduce((e,t)=>{let r=(t[1]??t[2]).split("."),i=(t[3]??t[4]??t[5]??t[6]??"true").trim();return"true"===i?i=!0:"false"===i?i=!1:/^\d+$/.test(i)&&(i=parseInt(i)),r.some(e=>this.#V(e))||(r.slice(0,-1).reduce((e,t)=>e[t]??={},e)[r.at(-1)]=i),e},{})}#V(e){return"#proto#"===e||"constructor"===e||"prototype"===e}#N(e,t){let r=this.#j(e);for(let e in r){if(this.#V(e))continue;let i=r[e];i&&"object"==typeof i&&!Array.isArray(i)&&t[e]?Object.assign(t[e],i):t[e]=i}return t}#b(e){return e.split(",").map(e=>{let t=e.match(/^\s*(\S+\[[^\]]*\]|\S+)\s*(.*?)\s*$/);if(!t||!t[1])return null;if(t[1].includes("[")&&!t[1].includes("]"))throw"unterminated:"+t[1];let r=t[2]?this.#j(t[2]):{};return r.name=t[1],r}).filter(e=>e)}#x(e,t){if(this.#P(e))return this.#B(e,t);{let t=this.#g(e,"hx-method")||"GET",r=this.#g(e,"hx-action");if(!r)for(let i of this.#l){let s=this.#g(e,"hx-"+i);if(null!=s){r=s,t=i;break}}reLine truncated
|
||||
Reference in new issue
Block a user