@atpassport/client 0.1.9 → 0.1.10
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/dist/core.mjs +1 -1
- package/dist/index.d.mts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +0 -1
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-HQWY5EUQ.mjs +0 -1
- package/dist/chunk-LGB4WCG6.mjs +0 -1
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var d=class{baseUrl;callbackUrl;lang;constructor(t){this.baseUrl=(t.baseUrl||"https://atpassport.net").replace(/\/$/,""),this.callbackUrl=t.callbackUrl,this.lang=t.lang}generateAuthUrl(t){let a=crypto.randomUUID(),e=this.lang?`${this.lang}/authentication`:"authentication",s=new URL(`${this.baseUrl}/${e}`),r=new URL(this.callbackUrl);if(t)for(let[i,n]of Object.entries(t))r.searchParams.set(i,n);return s.searchParams.set("callback",r.toString()),s.searchParams.set("atpstate",a),{url:s.toString(),atpstate:a}}parseCallback(t,a){let e=new URL(t),s=e.searchParams.get("handle"),r=e.searchParams.get("did"),i=e.searchParams.get("pdsurl"),n=e.searchParams.get("atpstate");if(a&&n!==a)throw new Error("Invalid atpstate: CSRF validation failed.");let l={};return e.searchParams.forEach((c,o)=>{["handle","did","pdsurl","atpstate"].includes(o)||(l[o]=c)}),{handle:s,did:r,pdsUrl:i,atpstate:n,customParams:l}}async pick(){return new Promise(t=>{let s=window.screenX+(window.outerWidth-400)/2,r=window.screenY+(window.outerHeight-500)/2,i=this.lang?`${this.lang}/picker`:"picker",n=`${this.baseUrl}/${i}`,l=window.open(n,"atpassport:picker",`width=400,height=500,left=${s},top=${r}`),c=h=>{h.origin===new URL(this.baseUrl).origin&&h.data?.type==="atpassport:pick"&&(window.removeEventListener("message",c),t(h.data.handle))};window.addEventListener("message",c);let o=setInterval(()=>{l?.closed&&clearInterval(o)},1e3)})}decorate(t){t.addEventListener("focus",async()=>{if(t.value)return;let a=await this.pick();a&&(t.value=a,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))})}};export{d as AtPassport};
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var t=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(o,e,x,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of b(e))!c.call(o,p)&&p!==x&&t(o,p,{get:()=>e[p],enumerable:!(r=a(e,p))||r.enumerable});return o};var f=o=>d(t({},"__esModule",{value:!0}),o);var g={};module.exports=f(g);
|
package/dist/index.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-HQWY5EUQ.mjs";import{a as r,b as e}from"./chunk-LGB4WCG6.mjs";export{o as AtPassport,r as AtPassportIcon,e as AtPassportUI};
|
package/dist/ui.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{jsx as r,jsxs as a}from"react/jsx-runtime";var o="M0 0 C1 0.5 2 1 3 1.5 C9.5 4.7 15.9 8.1 22.1 11.8 C25.2 13.2 27.3 13.3 30.7 12.9 C33.3 11.9 33.3 11.9 35.8 10.5 C44.4 5.8 54.9 5.7 64.5 7.5 C67.3 8.4 69.5 9.8 71.8 11.7 C73.2 15.3 72.9 17.3 71.7 20.9 C64.5 26.2 56.2 29.7 48.1 33.6 C46.6 34.3 45.2 35 43.7 35.7 C40 37.5 36.3 39.2 32.7 41 C29.9 42.3 27 43.7 24.2 45 C20.5 46.8 16.8 48.6 13.2 50.3 C9.2 52.2 5.3 54.1 1.3 56 C0.3 56.5 -0.8 57 -1.8 57.6 C-3.9 58.5 -5.9 59.5 -7.9 60.5 C-8.8 60.9 -9.7 61.4 -10.6 61.8 C-11.4 62.2 -12.2 62.6 -13 63 C-18.7 65.3 -24.9 66.1 -30.8 64.1 C-36.8 61.3 -41 57.8 -45.3 52.9 C-46 52.2 -46.6 51.6 -47.3 50.9 C-52.6 45 -52.6 45 -53.3 40.9 C-52 40.1 -50.7 39.3 -49.4 38.5 C-48.7 38 -48 37.6 -47.3 37.1 C-43.7 34.9 -41.5 34.6 -37.3 34.9 C-34.4 36.3 -31.8 38 -29.1 39.7 C-25.5 41.3 -24.1 41.1 -20.3 39.9 C-16.9 38.4 -13.7 36.7 -10.4 34.9 C-9.1 34.2 -9.1 34.2 -7.8 33.4 C-5.6 32.3 -3.5 31.1 -1.3 29.9 C-3.6 26.9 -5.9 24.2 -8.8 21.8 C-13 18.3 -17 14.6 -21 10.8 C-24 8.1 -27.1 5.5 -30.3 2.9 C-30.3 0.6 -30.3 0.6 -29.3 -2.1 C-18.8 -7.6 -10.1 -5.2 0 0 Z",s="M0 0 C1 -0 2.1 -0 3.2 -0 C4.3 -0 5.5 -0 6.7 -0 C7.9 -0 9.1 -0 10.3 -0 C13.6 -0 17 -0 20.3 -0 C23.8 -0 27.2 -0 30.7 -0 C36.5 -0 42.4 -0 48.2 -0 C54.9 0 61.7 0 68.4 -0 C74.2 -0 80 -0 85.8 -0 C89.2 -0 92.7 -0 96.1 -0 C100 -0 103.8 -0 107.7 -0 C109.4 -0 109.4 -0 111.2 -0 C112.8 -0 112.8 -0 114.4 0 C115.3 0 116.2 0 117.1 0 C119.2 0.1 119.2 0.1 120.2 1.1 C120.3 3.1 120.3 5.1 120.3 7.1 C120.3 8.8 120.3 8.8 120.3 10.4 C120.2 13.1 120.2 13.1 119.2 14.1 C117.6 14.2 116 14.3 114.4 14.3 C113.3 14.3 112.3 14.3 111.2 14.3 C110 14.3 108.9 14.3 107.7 14.3 C106.5 14.3 105.3 14.3 104 14.3 C100.7 14.3 97.4 14.3 94.1 14.3 C90.6 14.3 87.1 14.3 83.7 14.3 C77.8 14.3 72 14.3 66.2 14.3 C59.4 14.3 52.7 14.3 45.9 14.3 C40.2 14.3 34.4 14.3 28.6 14.3 C25.1 14.3 21.7 14.3 18.2 14.3 C14.4 14.3 10.5 14.3 6.7 14.3 C4.9 14.3 4.9 14.3 3.2 14.3 C1.6 14.3 1.6 14.3 0 14.3 C-0.9 14.3 -1.8 14.3 -2.8 14.3 C-4.8 14.1 -4.8 14.1 -5.8 13.1 C-5.9 11.1 -6 9.1 -5.9 7.1 C-5.9 6 -6 4.9 -6 3.8 C-5.7 -0.7 -4.1 0 0 0 Z",t=(C=128)=>`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="${C}" height="${C}" viewBox="0 0 128 128"><path d="${o}" fill="currentColor" transform="translate(54.3,21.1)"/><path d="${s}" fill="currentColor" transform="translate(6.8,97.9)"/></svg>`,e=({size:C=24,...n})=>a("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:C,height:C,viewBox:"0 0 128 128",fill:"currentColor",...n,children:[r("path",{d:o,transform:"translate(54.3,21.1)"}),r("path",{d:s,transform:"translate(6.8,97.9)"})]}),p={ja:{title:"@passport\u3067\u30ED\u30B0\u30A4\u30F3",description:"@passport\u306F\u3001\u5404atproto\u30A2\u30D7\u30EA\u3067\u30CF\u30F3\u30C9\u30EB\u3092\u90FD\u5EA6\u5165\u529B\u3059\u308B\u624B\u9593\u304C\u7701\u3051\u308B\u5171\u901A\u30CF\u30F3\u30C9\u30EB\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC\u3067\u3059\u3002"},en:{title:"Login with @passport",description:"@passport is a universal handle manager that saves you from typing your handle repeatedly across atproto apps."},iconSvg:t(128),getIconSvg:t};export{e as AtPassportIcon,p as AtPassportUI};
|
package/package.json
CHANGED
package/dist/chunk-HQWY5EUQ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=class{baseUrl;callbackUrl;lang;constructor(t){this.baseUrl=(t.baseUrl||"https://atpassport.net").replace(/\/$/,""),this.callbackUrl=t.callbackUrl,this.lang=t.lang}generateAuthUrl(t){let a=crypto.randomUUID(),e=this.lang?`${this.lang}/authentication`:"authentication",s=new URL(`${this.baseUrl}/${e}`),r=new URL(this.callbackUrl);if(t)for(let[i,n]of Object.entries(t))r.searchParams.set(i,n);return s.searchParams.set("callback",r.toString()),s.searchParams.set("atpstate",a),{url:s.toString(),atpstate:a}}parseCallback(t,a){let e=new URL(t),s=e.searchParams.get("handle"),r=e.searchParams.get("did"),i=e.searchParams.get("pdsurl"),n=e.searchParams.get("atpstate");if(a&&n!==a)throw new Error("Invalid atpstate: CSRF validation failed.");let l={};return e.searchParams.forEach((c,o)=>{["handle","did","pdsurl","atpstate"].includes(o)||(l[o]=c)}),{handle:s,did:r,pdsUrl:i,atpstate:n,customParams:l}}async pick(){return new Promise(t=>{let s=window.screenX+(window.outerWidth-400)/2,r=window.screenY+(window.outerHeight-500)/2,i=this.lang?`${this.lang}/picker`:"picker",n=`${this.baseUrl}/${i}`,l=window.open(n,"atpassport:picker",`width=400,height=500,left=${s},top=${r}`),c=h=>{h.origin===new URL(this.baseUrl).origin&&h.data?.type==="atpassport:pick"&&(window.removeEventListener("message",c),t(h.data.handle))};window.addEventListener("message",c);let o=setInterval(()=>{l?.closed&&clearInterval(o)},1e3)})}decorate(t){t.addEventListener("focus",async()=>{if(t.value)return;let a=await this.pick();a&&(t.value=a,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))})}};export{d as a};
|
package/dist/chunk-LGB4WCG6.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r,jsxs as a}from"react/jsx-runtime";var o="M0 0 C1 0.5 2 1 3 1.5 C9.5 4.7 15.9 8.1 22.1 11.8 C25.2 13.2 27.3 13.3 30.7 12.9 C33.3 11.9 33.3 11.9 35.8 10.5 C44.4 5.8 54.9 5.7 64.5 7.5 C67.3 8.4 69.5 9.8 71.8 11.7 C73.2 15.3 72.9 17.3 71.7 20.9 C64.5 26.2 56.2 29.7 48.1 33.6 C46.6 34.3 45.2 35 43.7 35.7 C40 37.5 36.3 39.2 32.7 41 C29.9 42.3 27 43.7 24.2 45 C20.5 46.8 16.8 48.6 13.2 50.3 C9.2 52.2 5.3 54.1 1.3 56 C0.3 56.5 -0.8 57 -1.8 57.6 C-3.9 58.5 -5.9 59.5 -7.9 60.5 C-8.8 60.9 -9.7 61.4 -10.6 61.8 C-11.4 62.2 -12.2 62.6 -13 63 C-18.7 65.3 -24.9 66.1 -30.8 64.1 C-36.8 61.3 -41 57.8 -45.3 52.9 C-46 52.2 -46.6 51.6 -47.3 50.9 C-52.6 45 -52.6 45 -53.3 40.9 C-52 40.1 -50.7 39.3 -49.4 38.5 C-48.7 38 -48 37.6 -47.3 37.1 C-43.7 34.9 -41.5 34.6 -37.3 34.9 C-34.4 36.3 -31.8 38 -29.1 39.7 C-25.5 41.3 -24.1 41.1 -20.3 39.9 C-16.9 38.4 -13.7 36.7 -10.4 34.9 C-9.1 34.2 -9.1 34.2 -7.8 33.4 C-5.6 32.3 -3.5 31.1 -1.3 29.9 C-3.6 26.9 -5.9 24.2 -8.8 21.8 C-13 18.3 -17 14.6 -21 10.8 C-24 8.1 -27.1 5.5 -30.3 2.9 C-30.3 0.6 -30.3 0.6 -29.3 -2.1 C-18.8 -7.6 -10.1 -5.2 0 0 Z",s="M0 0 C1 -0 2.1 -0 3.2 -0 C4.3 -0 5.5 -0 6.7 -0 C7.9 -0 9.1 -0 10.3 -0 C13.6 -0 17 -0 20.3 -0 C23.8 -0 27.2 -0 30.7 -0 C36.5 -0 42.4 -0 48.2 -0 C54.9 0 61.7 0 68.4 -0 C74.2 -0 80 -0 85.8 -0 C89.2 -0 92.7 -0 96.1 -0 C100 -0 103.8 -0 107.7 -0 C109.4 -0 109.4 -0 111.2 -0 C112.8 -0 112.8 -0 114.4 0 C115.3 0 116.2 0 117.1 0 C119.2 0.1 119.2 0.1 120.2 1.1 C120.3 3.1 120.3 5.1 120.3 7.1 C120.3 8.8 120.3 8.8 120.3 10.4 C120.2 13.1 120.2 13.1 119.2 14.1 C117.6 14.2 116 14.3 114.4 14.3 C113.3 14.3 112.3 14.3 111.2 14.3 C110 14.3 108.9 14.3 107.7 14.3 C106.5 14.3 105.3 14.3 104 14.3 C100.7 14.3 97.4 14.3 94.1 14.3 C90.6 14.3 87.1 14.3 83.7 14.3 C77.8 14.3 72 14.3 66.2 14.3 C59.4 14.3 52.7 14.3 45.9 14.3 C40.2 14.3 34.4 14.3 28.6 14.3 C25.1 14.3 21.7 14.3 18.2 14.3 C14.4 14.3 10.5 14.3 6.7 14.3 C4.9 14.3 4.9 14.3 3.2 14.3 C1.6 14.3 1.6 14.3 0 14.3 C-0.9 14.3 -1.8 14.3 -2.8 14.3 C-4.8 14.1 -4.8 14.1 -5.8 13.1 C-5.9 11.1 -6 9.1 -5.9 7.1 C-5.9 6 -6 4.9 -6 3.8 C-5.7 -0.7 -4.1 0 0 0 Z",t=(C=128)=>`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="${C}" height="${C}" viewBox="0 0 128 128"><path d="${o}" fill="currentColor" transform="translate(54.3,21.1)"/><path d="${s}" fill="currentColor" transform="translate(6.8,97.9)"/></svg>`,e=({size:C=24,...n})=>a("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:C,height:C,viewBox:"0 0 128 128",fill:"currentColor",...n,children:[r("path",{d:o,transform:"translate(54.3,21.1)"}),r("path",{d:s,transform:"translate(6.8,97.9)"})]}),p={ja:{title:"@passport\u3067\u30ED\u30B0\u30A4\u30F3",description:"@passport\u306F\u3001\u5404atproto\u30A2\u30D7\u30EA\u3067\u30CF\u30F3\u30C9\u30EB\u3092\u90FD\u5EA6\u5165\u529B\u3059\u308B\u624B\u9593\u304C\u7701\u3051\u308B\u5171\u901A\u30CF\u30F3\u30C9\u30EB\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC\u3067\u3059\u3002"},en:{title:"Login with @passport",description:"@passport is a universal handle manager that saves you from typing your handle repeatedly across atproto apps."},iconSvg:t(128),getIconSvg:t};export{e as a,p as b};
|