@siteping/widget 0.10.4 → 0.10.5

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
@@ -81,7 +81,7 @@ All configuration options for `initSiteping()`:
81
81
  | `identity` | `{ name: string; email: string }` | — | Pre-fill author identity from the host (SSO). When set, the widget skips the identity modal |
82
82
  | `deepLink` | `boolean \| { param?: string }` | `false` | On initial load, focus the annotation referenced by `?siteping=<id>` (or a custom query key). SPA navigations are ignored — use `focusFeedback()` for route-change focus |
83
83
  | `watchNavigation` | `boolean` | `true` | Auto re-fetch feedbacks on client-side (SPA) navigation. The widget patches the History API + listens for `popstate`/`hashchange`, so the panel list and markers follow route changes even when the widget is mounted once in a persistent layout (e.g. Next.js App Router). Re-fetches data only — it never re-scrolls. Set `false` to opt out and drive updates via `refresh()` |
84
- | `enableRightClickComment` | `boolean` | `false` | Right-click anywhere on the page to instantly open the comment composer at the cursor. Modifier-key right-clicks (Shift/Ctrl/Alt/Meta) fall through to the native context menu. Right-clicks on SitePing's own UI are ignored. Note: on Android, `contextmenu` fires on long-press — relevant for ≥768 px tablets where the widget loads |
84
+ | `enableRightClickComment` | `boolean` | `false` | Right-click anywhere on the page to instantly open the comment composer at the cursor. Keyboard-triggered context menus (≣ Menu key, Shift+F10) always get the native menu; only mouse right-click and touch/pen long-press open the composer. Modifier-key right-clicks (Shift/Ctrl/Alt/Meta) fall through to the native context menu. Right-clicks on SitePing's own UI are ignored. |
85
85
 
86
86
  > **Custom translations** — Use `registerLocale(code, translations)` to add your own locale at runtime.
87
87
 
@@ -1792,5 +1792,5 @@ function c(t){let n=document.createRange().createContextualFragment(t).firstElem
1792
1792
  transition-duration: 0.01ms !important;
1793
1793
  }
1794
1794
  }
1795
- `,Ue='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',ae=class{constructor(e,s,n){this.t=n;this.keyMap=new Map([["j",()=>s.onNavigate("down")],["k",()=>s.onNavigate("up")],["r",()=>s.onResolve()],["d",()=>s.onDelete()],["f",()=>s.onFocusSearch()],["/",()=>s.onFocusSearch()],["x",()=>s.onToggleSelect()],["?",()=>this.toggleHelp()]]),this.helpOverlay=this.buildOverlay(),this.hintButton=this.buildHintButton(),this.boundHandler=r=>this.handleKeydown(r);}t;helpOverlay;hintButton;keyMap;boundHandler;shadowRoot=null;enabled=false;helpVisible=false;destroyed=false;enable(e){if(this.destroyed||this.enabled)return;e&&(this.shadowRoot=e),(this.shadowRoot??document).addEventListener("keydown",this.boundHandler),this.enabled=true;}disable(){if(!this.enabled)return;(this.shadowRoot??document).removeEventListener("keydown",this.boundHandler),this.enabled=false,this.helpVisible&&this.hideHelp();}toggleHelp(){this.helpVisible?this.hideHelp():this.showHelp();}destroy(){this.destroyed||(this.disable(),this.helpOverlay.remove(),this.hintButton.remove(),this.destroyed=true);}handleKeydown(e){if(e.key==="Escape"){this.helpVisible&&(e.preventDefault(),e.stopPropagation(),this.hideHelp());return}if(this.helpVisible)return;let s=e.composedPath()[0];if(s){let r=s.tagName?.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||s.isContentEditable)return}if(e.ctrlKey||e.altKey||e.metaKey)return;let n=this.keyMap.get(e.key);n&&(e.preventDefault(),e.stopPropagation(),n());}showHelp(){this.helpVisible=true,this.helpOverlay.classList.add("sp-shortcuts-overlay--visible"),this.helpOverlay.querySelector(".sp-shortcuts-close")?.focus();}hideHelp(){this.helpVisible=false,this.helpOverlay.classList.remove("sp-shortcuts-overlay--visible");}buildOverlay(){let e=o("div",{class:"sp-shortcuts-overlay"});e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",this.t("shortcuts.title")),e.addEventListener("click",d=>{d.target===e&&this.hideHelp();});let s=o("div",{class:"sp-shortcuts-card"}),n=o("div",{class:"sp-shortcuts-title"});n.appendChild(c(Ke));let r=o("span");a(r,this.t("shortcuts.title")),n.appendChild(r),s.appendChild(n);let i=document.createElement("button");i.className="sp-shortcuts-close",i.setAttribute("aria-label",this.t("shortcuts.close")),i.appendChild(c(Ue)),i.addEventListener("click",()=>this.hideHelp()),s.appendChild(i);let l=o("div",{class:"sp-shortcuts-grid"});for(let d of ze){let p=o("div",{class:"sp-shortcuts-row"}),h=o("div",{class:"sp-shortcuts-keys"});d.keys.forEach((v,m)=>{if(m>0){let g=o("span",{class:"sp-shortcuts-separator"});a(g,"/"),h.appendChild(g);}let f=o("span",{class:"sp-kbd"});a(f,v),h.appendChild(f);});let u=o("span",{class:"sp-shortcuts-desc"});a(u,this.t(d.label)),p.appendChild(h),p.appendChild(u),l.appendChild(p);}return s.appendChild(l),e.appendChild(s),e}buildHintButton(){let e=document.createElement("button");return e.className="sp-shortcuts-hint",e.setAttribute("aria-label",this.t("shortcuts.hint")),a(e,"?"),e.addEventListener("click",s=>{s.stopPropagation(),this.toggleHelp();}),e}};export{ie as $,$ as A,gt as B,E as C,O as D,N as E,D as F,ge as G,be as H,z as I,C as J,xe as K,Pt as L,Ot as M,Nt as N,G as O,It as P,X as Q,$t as R,J as S,Gt as T,se as U,Qt as V,Jt as W,Zt as X,re as Y,es as Z,rs as _,c as a,as as aa,o as b,ls as ba,a as c,ps as ca,F as d,ae as da,Ve as e,Ge as f,qe as g,We as h,Xe as i,Qe as j,Je as k,Ze as l,et as m,tt as n,st as o,nt as p,rt as q,ot as r,it as s,at as t,lt as u,pt as v,ct as w,M as x,ut as y,ht as z};//# sourceMappingURL=chunk-33HB3HZI.js.map
1796
- //# sourceMappingURL=chunk-33HB3HZI.js.map
1795
+ `,Ue='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',ae=class{constructor(e,s,n){this.t=n;this.keyMap=new Map([["j",()=>s.onNavigate("down")],["k",()=>s.onNavigate("up")],["r",()=>s.onResolve()],["d",()=>s.onDelete()],["f",()=>s.onFocusSearch()],["/",()=>s.onFocusSearch()],["x",()=>s.onToggleSelect()],["?",()=>this.toggleHelp()]]),this.helpOverlay=this.buildOverlay(),this.hintButton=this.buildHintButton(),this.boundHandler=r=>this.handleKeydown(r);}t;helpOverlay;hintButton;keyMap;boundHandler;shadowRoot=null;enabled=false;helpVisible=false;destroyed=false;enable(e){if(this.destroyed||this.enabled)return;e&&(this.shadowRoot=e),(this.shadowRoot??document).addEventListener("keydown",this.boundHandler),this.enabled=true;}disable(){if(!this.enabled)return;(this.shadowRoot??document).removeEventListener("keydown",this.boundHandler),this.enabled=false,this.helpVisible&&this.hideHelp();}toggleHelp(){this.helpVisible?this.hideHelp():this.showHelp();}destroy(){this.destroyed||(this.disable(),this.helpOverlay.remove(),this.hintButton.remove(),this.destroyed=true);}handleKeydown(e){if(e.key==="Escape"){this.helpVisible&&(e.preventDefault(),e.stopPropagation(),this.hideHelp());return}if(this.helpVisible)return;let s=e.composedPath()[0];if(s){let r=s.tagName?.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||s.isContentEditable)return}if(e.ctrlKey||e.altKey||e.metaKey)return;let n=this.keyMap.get(e.key);n&&(e.preventDefault(),e.stopPropagation(),n());}showHelp(){this.helpVisible=true,this.helpOverlay.classList.add("sp-shortcuts-overlay--visible"),this.helpOverlay.querySelector(".sp-shortcuts-close")?.focus();}hideHelp(){this.helpVisible=false,this.helpOverlay.classList.remove("sp-shortcuts-overlay--visible");}buildOverlay(){let e=o("div",{class:"sp-shortcuts-overlay"});e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",this.t("shortcuts.title")),e.addEventListener("click",d=>{d.target===e&&this.hideHelp();});let s=o("div",{class:"sp-shortcuts-card"}),n=o("div",{class:"sp-shortcuts-title"});n.appendChild(c(Ke));let r=o("span");a(r,this.t("shortcuts.title")),n.appendChild(r),s.appendChild(n);let i=document.createElement("button");i.className="sp-shortcuts-close",i.setAttribute("aria-label",this.t("shortcuts.close")),i.appendChild(c(Ue)),i.addEventListener("click",()=>this.hideHelp()),s.appendChild(i);let l=o("div",{class:"sp-shortcuts-grid"});for(let d of ze){let p=o("div",{class:"sp-shortcuts-row"}),h=o("div",{class:"sp-shortcuts-keys"});d.keys.forEach((v,m)=>{if(m>0){let g=o("span",{class:"sp-shortcuts-separator"});a(g,"/"),h.appendChild(g);}let f=o("span",{class:"sp-kbd"});a(f,v),h.appendChild(f);});let u=o("span",{class:"sp-shortcuts-desc"});a(u,this.t(d.label)),p.appendChild(h),p.appendChild(u),l.appendChild(p);}return s.appendChild(l),e.appendChild(s),e}buildHintButton(){let e=document.createElement("button");return e.className="sp-shortcuts-hint",e.setAttribute("aria-label",this.t("shortcuts.hint")),a(e,"?"),e.addEventListener("click",s=>{s.stopPropagation(),this.toggleHelp();}),e}};export{ie as $,$ as A,gt as B,E as C,O as D,N as E,D as F,ge as G,be as H,z as I,C as J,xe as K,Pt as L,Ot as M,Nt as N,G as O,It as P,X as Q,$t as R,J as S,Gt as T,se as U,Qt as V,Jt as W,Zt as X,re as Y,es as Z,rs as _,c as a,as as aa,o as b,ls as ba,a as c,ps as ca,F as d,ae as da,Ve as e,Ge as f,qe as g,We as h,Xe as i,Qe as j,Je as k,Ze as l,et as m,tt as n,st as o,nt as p,rt as q,ot as r,it as s,at as t,lt as u,pt as v,ct as w,M as x,ut as y,ht as z};//# sourceMappingURL=chunk-D2AVRF24.js.map
1796
+ //# sourceMappingURL=chunk-D2AVRF24.js.map