@paroicms/zoom-plugin 0.2.0 → 0.2.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
|
-
|
|
1
|
+
.PaZoomable{cursor:pointer}.PaZoomable:hover,.PaZoomable:focus{outline:1px solid var(--paInteractiveColor)}.PaZoomContent-img{display:block;height:100%;object-fit:contain;width:100%}.PaZoomContent-spinner{animation:spin 1s linear infinite;border:4px solid rgba(255,255,255,.3);border-radius:50%;border-top:4px solid white;height:40px;width:40px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ot from"https://esm.sh/@paroicms/tiny-modal@0.7.
|
|
1
|
+
import ot from"https://esm.sh/@paroicms/tiny-modal@0.7.2";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
@@ -13,12 +13,12 @@ import ot from"https://esm.sh/@paroicms/tiny-modal@0.7.0";
|
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
-
*/const L=globalThis,O=L.trustedTypes,W=O?O.createPolicy("lit-html",{createHTML:o=>o}):void 0,tt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,et="?"+_,ft=`<${et}>`,A=document,b=()=>A.createComment(""),
|
|
16
|
+
*/const L=globalThis,O=L.trustedTypes,W=O?O.createPolicy("lit-html",{createHTML:o=>o}):void 0,tt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,et="?"+_,ft=`<${et}>`,A=document,b=()=>A.createComment(""),C=o=>o===null||typeof o!="object"&&typeof o!="function",I=Array.isArray,mt=o=>I(o)||typeof o?.[Symbol.iterator]=="function",N=`[ \t\n\f\r]`,E=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,F=/>/g,f=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),J=/'/g,K=/"/g,st=/^(?:script|style|textarea|title)$/i,At=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),G=At(1),y=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Q=new WeakMap,m=A.createTreeWalker(A,129);function it(o,t){if(!I(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return W!==void 0?W.createHTML(t):t}const gt=(o,t)=>{const e=o.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",r=E;for(let l=0;l<e;l++){const h=o[l];let c,p,a=-1,u=0;for(;u<h.length&&(r.lastIndex=u,p=r.exec(h),p!==null);)u=r.lastIndex,r===E?p[1]==="!--"?r=q:p[1]!==void 0?r=F:p[2]!==void 0?(st.test(p[2])&&(i=RegExp("</"+p[2],"g")),r=f):p[3]!==void 0&&(r=f):r===f?p[0]===">"?(r=i??E,a=-1):p[1]===void 0?a=-2:(a=r.lastIndex-p[2].length,c=p[1],r=p[3]===void 0?f:p[3]==='"'?K:J):r===K||r===J?r=f:r===q||r===F?r=E:(r=f,i=void 0);const $=r===f&&o[l+1].startsWith("/>")?" ":"";n+=r===E?h+ft:a>=0?(s.push(c),h.slice(0,a)+tt+h.slice(a)+_+$):h+_+(a===-2?l:$)}return[it(o,n+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class w{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0;const l=t.length-1,h=this.parts,[c,p]=gt(t,e);if(this.el=w.createElement(c,s),m.currentNode=this.el.content,e===2||e===3){const a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const a of i.getAttributeNames())if(a.endsWith(tt)){const u=p[r++],$=i.getAttribute(a).split(_),x=/([.?@])?(.*)/.exec(u);h.push({type:1,index:n,name:x[2],strings:$,ctor:x[1]==="."?vt:x[1]==="?"?Et:x[1]==="@"?St:T}),i.removeAttribute(a)}else a.startsWith(_)&&(h.push({type:6,index:n}),i.removeAttribute(a));if(st.test(i.tagName)){const a=i.textContent.split(_),u=a.length-1;if(u>0){i.textContent=O?O.emptyScript:"";for(let $=0;$<u;$++)i.append(a[$],b()),m.nextNode(),h.push({type:2,index:++n});i.append(a[u],b())}}}else if(i.nodeType===8)if(i.data===et)h.push({type:2,index:n});else{let a=-1;for(;(a=i.data.indexOf(_,a+1))!==-1;)h.push({type:7,index:n}),a+=_.length-1}n++}}static createElement(t,e){const s=A.createElement("template");return s.innerHTML=t,s}}function v(o,t,e=o,s){if(t===y)return t;let i=s!==void 0?e._$Co?.[s]:e._$Cl;const n=C(t)?void 0:t._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(o),i._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=i:e._$Cl=i),i!==void 0&&(t=v(o,i._$AS(o,t.values),i,s)),t}class yt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??A).importNode(e,!0);m.currentNode=i;let n=m.nextNode(),r=0,l=0,h=s[0];for(;h!==void 0;){if(r===h.index){let c;h.type===2?c=new P(n,n.nextSibling,this,t):h.type===1?c=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(c=new bt(n,this,t)),this._$AV.push(c),h=s[++l]}r!==h?.index&&(n=m.nextNode(),r++)}return m.currentNode=A,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class P{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=v(this,t,e),C(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==y&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):mt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=w.createElement(it(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const n=new yt(i,this),r=n.u(this.options);n.p(e),this.T(r),this._$AH=n}}_$AC(t){let e=Q.get(t.strings);return e===void 0&&Q.set(t.strings,e=new w(t)),e}k(t){I(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new P(this.O(b()),this.O(b()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class T{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(n===void 0)t=v(this,t,e,0),r=!C(t)||t!==this._$AH&&t!==y,r&&(this._$AH=t);else{const l=t;let h,c;for(t=n[0],h=0;h<n.length-1;h++)c=v(this,l[s+h],e,h),c===y&&(c=this._$AH[h]),r||=!C(c)||c!==this._$AH[h],c===d?t=d:t!==d&&(t+=(c??"")+n[h+1]),this._$AH[h]=c}r&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class vt extends T{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Et extends T{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class St extends T{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=v(this,t,e,0)??d)===y)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class bt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){v(this,t)}}const Ct=L.litHtmlPolyfillSupport;Ct?.(w,P),(L.litHtmlVersions??=[]).push("3.3.1");const z=(o,t,e)=>{const s=e?.renderBefore??t;let i=s._$litPart$;if(i===void 0){const n=e?.renderBefore??null;s._$litPart$=i=new P(t.insertBefore(b(),n),n,void 0,e??{})}return i._$AI(o),i};
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
|
19
19
|
* Copyright 2017 Google LLC
|
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
-
*/const D=globalThis;class H extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=z(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return y}}H._$litElement$=!0,H.finalized=!0,D.litElementHydrateSupport?.({LitElement:H});const
|
|
21
|
+
*/const D=globalThis;class H extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=z(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return y}}H._$litElement$=!0,H.finalized=!0,D.litElementHydrateSupport?.({LitElement:H});const wt=D.litElementPolyfillSupport;wt?.({LitElement:H});(D.litElementVersions??=[]).push("4.2.1");const Pt="/api/plugin/zoom-plugin",xt=Pt;function Ut(){const o=document.querySelectorAll("[data-zoomable]");for(const t of o){if(!(t instanceof HTMLElement))continue;const e=t.dataset.zoomable?.trim();e&&Ht(t,{mediaId:e})}}function Ht(o,{mediaId:t}){o.classList.add("PaZoomable"),o.setAttribute("tabindex","0"),o.addEventListener("click",async e=>{e.preventDefault(),await Ot(t)})}async function Ot(o){const t=document.createElement("div"),e=ot({dialogContent:t,modalClass:"_paZoomViewer",loadCss:!0});e.open(),z(G`
|
|
22
22
|
<div class="PaZoomContent">
|
|
23
23
|
<div class="PaZoomContent-spinner"></div>
|
|
24
24
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/zoom-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Image zoom viewer plugin for ParoiCMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"clear": "rimraf backend/dist/* frontend/dist/*"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@paroicms/script-lib": "0.3.
|
|
29
|
+
"@paroicms/script-lib": "0.3.4",
|
|
30
30
|
"arktype": "~2.1.23"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@paroicms/public-server-lib": "0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@paroicms/public-anywhere-lib": "0.37.
|
|
38
|
-
"@paroicms/public-server-lib": "0.47.
|
|
37
|
+
"@paroicms/public-anywhere-lib": "0.37.2",
|
|
38
|
+
"@paroicms/public-server-lib": "0.47.3",
|
|
39
39
|
"@types/node": "~24.8.1",
|
|
40
40
|
"rimraf": "~6.0.1",
|
|
41
41
|
"typescript": "~5.9.3"
|